scrap shellcode

master
JoYo 7 years ago
parent 5aafac4365
commit 1faad74d59

@ -7,6 +7,9 @@
#include <sysexits.h>
#include <openssl/sha.h>
#pragma comment(lib, "openssl/sha.lib")
char *picProto(void *picAddr, size_t picSize, void *clonePtr) {
char *(*cloneFunc)(void *, size_t) = clonePtr;
return cloneFunc(picAddr, picSize);
@ -75,7 +78,7 @@ int main(int argc, const char **argv) {
goto MAIN_CLEANUP;
}
memset_s(&picBuffer, picBuffer_len, 0, picBuffer_len);
memset(&picBuffer, 0, picBuffer_len);
retVal = mprotect(picBuffer, picBuffer_len, PROT_EXEC);
if (0 == retVal) {
retVal = EX_SOFTWARE;

@ -2,11 +2,11 @@ import sys
def options(opt):
opt.load('asm compiler_c')
opt.load('nasm compiler_c')
def configure(conf):
conf.load('asm compiler_c')
conf.load('nasm compiler_c')
conf.check_cc(header_name='openssl/sha.h')
@ -14,8 +14,11 @@ def build(bld):
bld.program(
source='pic-linux.c',
target='pic-linux',
cflags='-g',
lib=['ssl', 'crypto'])
# bld(features='nasm',
# source='scrap.asm',
# target='scrap')
bld(features='asm',
source='scrap.asm',
target='scrap')
# gdb --args ./pic-linux scrap.asm.2.o

Loading…
Cancel
Save