From 2dc0451e3a807826a89fa1a423a022669700f0a6 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Fri, 30 Oct 2015 22:34:35 +0100 Subject: [PATCH] Remove trailing whitespace. --- COMPILE.TXT | 4 ++-- pkgconfig.mk | 2 +- samples/mem_apis.c | 4 ++-- samples/sample_x86.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/COMPILE.TXT b/COMPILE.TXT index c14facd8..a00fea53 100644 --- a/COMPILE.TXT +++ b/COMPILE.TXT @@ -201,7 +201,7 @@ Unicorn requires few dependent packages as follows. [5] Cross-compile for iOS from Mac OSX. - To cross-compile for iOS (iPhone/iPad/iPod), Mac OSX with XCode installed is required. + To cross-compile for iOS (iPhone/iPad/iPod), Mac OSX with XCode installed is required. - To cross-compile for ArmV7 (iPod 4, iPad 1/2/3, iPhone4, iPhone4S), run: $ ./make.sh ios_armv7 @@ -264,5 +264,5 @@ Unicorn requires few dependent packages as follows. Automated unit tests use the cmocka unit testing framework (https://cmocka.org/). It can be installed in most Linux distros using the package manager, e.g. `sudo yum install libcmocka libcmocka-devel`, or you can easily build and install it from source. - + You can run the tests by running `make test` in the project directory. diff --git a/pkgconfig.mk b/pkgconfig.mk index fb869b03..125322eb 100644 --- a/pkgconfig.mk +++ b/pkgconfig.mk @@ -1,7 +1,7 @@ # Package version of Unicorn for Makefile. # To be used to generate unicorn.pc for pkg-config -# version major & minor +# version major & minor PKG_MAJOR = 0 PKG_MINOR = 9 diff --git a/samples/mem_apis.c b/samples/mem_apis.c index db0240d8..8ec4c715 100644 --- a/samples/mem_apis.c +++ b/samples/mem_apis.c @@ -43,7 +43,7 @@ static void hook_code(uc_engine *uc, uint64_t addr, uint32_t size, void *user_da if (uc_emu_stop(uc) != UC_ERR_OK) { printf("not ok - uc_emu_stop fail during hook_code callback, addr: 0x%" PRIx64 "\n", addr); _exit(-1); - } + } } opcode = buf[0]; @@ -137,7 +137,7 @@ static void do_nx_demo(bool cause_fault) if (cause_fault) { // insert instruction to trigger U_PROT_EXEC change (see hook_code function) code_buf[0x1000] = 0x41; // inc ecx at page1 - } + } // write machine code to be emulated to memory if (uc_mem_write(uc, 0x100000, code_buf, sizeof(code_buf))) { diff --git a/samples/sample_x86.c b/samples/sample_x86.c index c285b31d..5f33833f 100644 --- a/samples/sample_x86.c +++ b/samples/sample_x86.c @@ -13,7 +13,7 @@ // code to be emulated #define X86_CODE32 "\x41\x4a" // INC ecx; DEC edx #define X86_CODE32_JUMP "\xeb\x02\x90\x90\x90\x90\x90\x90" // jmp 4; nop; nop; nop; nop; nop; nop -// #define X86_CODE32_SELF "\xeb\x1c\x5a\x89\xd6\x8b\x02\x66\x3d\xca\x7d\x75\x06\x66\x05\x03\x03\x89\x02\xfe\xc2\x3d\x41\x41\x41\x41\x75\xe9\xff\xe6\xe8\xdf\xff\xff\xff\x31\xd2\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xca\x7d\x41\x41\x41\x41" +// #define X86_CODE32_SELF "\xeb\x1c\x5a\x89\xd6\x8b\x02\x66\x3d\xca\x7d\x75\x06\x66\x05\x03\x03\x89\x02\xfe\xc2\x3d\x41\x41\x41\x41\x75\xe9\xff\xe6\xe8\xdf\xff\xff\xff\x31\xd2\x6a\x0b\x58\x99\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xca\x7d\x41\x41\x41\x41" //#define X86_CODE32 "\x51\x51\x51\x51" // PUSH ecx; #define X86_CODE32_LOOP "\x41\x4a\xeb\xfe" // INC ecx; DEC edx; JMP self-loop #define X86_CODE32_MEM_WRITE "\x89\x0D\xAA\xAA\xAA\xAA\x41\x4a" // mov [0xaaaaaaaa], ecx; INC ecx; DEC edx @@ -23,7 +23,7 @@ #define X86_CODE32_INOUT "\x41\xE4\x3F\x4a\xE6\x46\x43" // INC ecx; IN AL, 0x3f; DEC edx; OUT 0x46, AL; INC ebx //#define X86_CODE64 "\x41\xBC\x3B\xB0\x28\x2A \x49\x0F\xC9 \x90 \x4D\x0F\xAD\xCF\x49\x87\xFD\x90\x48\x81\xD2\x8A\xCE\x77\x35\x48\xF7\xD9" // <== still crash -//#define X86_CODE64 "\x41\xBC\x3B\xB0\x28\x2A\x49\x0F\xC9\x90\x4D\x0F\xAD\xCF\x49\x87\xFD\x90\x48\x81\xD2\x8A\xCE\x77\x35\x48\xF7\xD9" +//#define X86_CODE64 "\x41\xBC\x3B\xB0\x28\x2A\x49\x0F\xC9\x90\x4D\x0F\xAD\xCF\x49\x87\xFD\x90\x48\x81\xD2\x8A\xCE\x77\x35\x48\xF7\xD9" #define X86_CODE64 "\x41\xBC\x3B\xB0\x28\x2A\x49\x0F\xC9\x90\x4D\x0F\xAD\xCF\x49\x87\xFD\x90\x48\x81\xD2\x8A\xCE\x77\x35\x48\xF7\xD9\x4D\x29\xF4\x49\x81\xC9\xF6\x8A\xC6\x53\x4D\x87\xED\x48\x0F\xAD\xD2\x49\xF7\xD4\x48\xF7\xE1\x4D\x19\xC5\x4D\x89\xC5\x48\xF7\xD6\x41\xB8\x4F\x8D\x6B\x59\x4D\x87\xD0\x68\x6A\x1E\x09\x3C\x59" #define X86_CODE16 "\x00\x00" // add byte ptr [bx + si], al #define X86_CODE64_SYSCALL "\x0f\x05" // SYSCALL