slyd0g / objcshellcodeloader Goto Github PK
View Code? Open in Web Editor NEWmacOS shellcode loader written in Objective-C
macOS shellcode loader written in Objective-C
❯ clang main.m
main.m:19:32: error: implicit declaration of function 'mach_vm_allocate' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
kern_return_t kernReturn = mach_vm_allocate(mach_task_self(), &address, shellcodeLength, VM_FLAGS_ANYWHERE);
^
main.m:19:32: note: did you mean 'mach_port_allocate'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h:131:15: note: 'mach_port_allocate' declared here
kern_return_t mach_port_allocate
^
main.m:23:42: warning: format specifies type 'void *' but the argument has type 'mach_vm_address_t' (aka 'unsigned long long') [-Wformat]
printf(" |-> Address: %p\n", address);
~~ ^~~~~~~
%llu
main.m:31:18: error: implicit declaration of function 'mach_vm_protect' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
kernReturn = mach_vm_protect(mach_task_self(), address, shellcodeLength, false, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE);
^
main.m:31:18: note: did you mean 'vm_protect'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h:119:15: note: 'vm_protect' declared here
kern_return_t vm_protect
^
main.m:42:18: error: implicit declaration of function 'mach_vm_write' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
kernReturn = mach_vm_write(mach_task_self(), address, shellcode, shellcodeLength);
^
main.m:42:18: note: did you mean 'mach_vm_wire'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h:315:15: note: 'mach_vm_wire' declared here
kern_return_t mach_vm_wire
^
1 warning and 3 errors generated.
===================================
❯ clang main.m -std=c89
main.m:19:32: error: implicit declaration of function 'mach_vm_allocate' [-Werror,-Wimplicit-function-declaration]
kern_return_t kernReturn = mach_vm_allocate(mach_task_self(), &address, shellcodeLength, VM_FLAGS_ANYWHERE);
^
main.m:19:32: note: did you mean 'mach_port_allocate'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h:131:15: note: 'mach_port_allocate' declared here
kern_return_t mach_port_allocate
^
main.m:23:42: warning: format specifies type 'void *' but the argument has type 'mach_vm_address_t' (aka 'unsigned long long') [-Wformat]
printf(" |-> Address: %p\n", address);
~~ ^~~~~~~
%llu
main.m:31:18: error: implicit declaration of function 'mach_vm_protect' [-Werror,-Wimplicit-function-declaration]
kernReturn = mach_vm_protect(mach_task_self(), address, shellcodeLength, false, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE);
^
main.m:31:18: note: did you mean 'vm_protect'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h:119:15: note: 'vm_protect' declared here
kern_return_t vm_protect
^
main.m:42:18: error: implicit declaration of function 'mach_vm_write' [-Werror,-Wimplicit-function-declaration]
kernReturn = mach_vm_write(mach_task_self(), address, shellcode, shellcodeLength);
^
main.m:42:18: note: did you mean 'mach_vm_wire'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h:315:15: note: 'mach_vm_wire' declared here
kern_return_t mach_vm_wire
^
1 warning and 3 errors generated.
======================================
so, how can i build it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.