From fe765137cd79a671dc3e6932bb867ef333611e73 Mon Sep 17 00:00:00 2001 From: spv Date: Wed, 11 May 2022 11:41:29 -0400 Subject: add WIP c shellcode compilation --- tools/build_native.sh | 12 +++++++++++- tools/shc/shellcode.c | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tools/shc/shellcode.c diff --git a/tools/build_native.sh b/tools/build_native.sh index 896562a..90ecb60 100755 --- a/tools/build_native.sh +++ b/tools/build_native.sh @@ -5,4 +5,14 @@ ldid -S bin/thread_shit rm bin/testlol gcc testlol.c -o bin/testlol --std=c99 -ldid -S bin/testlol \ No newline at end of file +ldid -S bin/testlol + +rm bin/935csbypass +gcc 935csbypass.c -o bin/935csbypass --std=c99 -marm +ldid -S bin/935csbypass + +rm shc/bin/shellcode +gcc shc/shellcode.c -o shc/bin/shellcode --std=c99 -marm -ffreestanding -c -fPIC +#ldid -S shc/bin/shellcode + +otool -t shc/bin/shellcode -X | cut -d " " -f 2- | tr -d "\n" | xxd -r -ps > shc/bin/shellcode.bin \ No newline at end of file diff --git a/tools/shc/shellcode.c b/tools/shc/shellcode.c new file mode 100644 index 0000000..e48b51d --- /dev/null +++ b/tools/shc/shellcode.c @@ -0,0 +1,10 @@ +/* + * native C shellcode + */ + +typedef unsigned int uint32_t; + +void shellcode(void) { + *(uint32_t*)0x41414141 = 0x42424242; +// __builtin_unreachable(); +} \ No newline at end of file -- cgit v1.2.3