This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Transform a binary file into a C header file. | |
The binary file is splitted into 16 char strings and rebuild at execution time. | |
The function buildsc() must be called in your main to rebuild the binary file into the sc C variable. | |
The length is set in the sc_length variable. | |
Be carefull, try to avoid compiler code optimization as it will remove all these modifications in the final binary. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Rust basic Process injection using OpenProcess, VirtualAllocEx, WriteProcessMemory and CreateRemoteThread | |
*/ | |
#[allow(non_camel_case_types)] | |
type HANDLE = *mut u64; | |
#[allow(non_camel_case_types)] | |
type LPVOID = *mut u64; | |
#[allow(non_camel_case_types)] | |
type DWORD = u32; | |
#[allow(non_camel_case_types)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Rust basic Process injection using OpenProcess, VirtualAllocEx, WriteProcessMemory and CreateRemoteThread | |
* API dynamic resolution and shellcode XOR encoded | |
*/ | |
#[allow(non_camel_case_types)] | |
type HANDLE = *mut u64; | |
#[allow(non_camel_case_types)] | |
type LPVOID = *mut u64; | |
#[allow(non_camel_case_types)] | |
type DWORD = u32; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned long hash_string(void* buffer, unsigned long size, char* extension){ | |
unsigned char current = 0; | |
unsigned long hash = 0; | |
unsigned char* currentChar = NULL; | |
hash = 1337; | |
currentChar = (void*)buffer; | |
hash++; | |
while(1){ | |
current = *currentChar; |