We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b5ff07 commit aa9948eCopy full SHA for aa9948e
shellnoob.py
@@ -156,9 +156,9 @@ class ShellNoob():
156
157
int main() {
158
// make sure the memory is RWX to support self-modifying shellcode
159
- char *target = (char *) memalign(4096, sizeof(shellcode));
160
- mprotect(target, sizeof(shellcode), PROT_READ | PROT_WRITE | PROT_EXEC);
161
- memcpy(target, shellcode, sizeof(shellcode));
+ char *target = (char *) memalign(4096, 2048);
+ mprotect(target, 2048, PROT_READ | PROT_WRITE | PROT_EXEC);
+ memcpy(target, shellcode, 2048);
162
(*(void (*)()) target)();
163
return 0;
164
}
0 commit comments