Hi everyone,
i've been coding some shellcode in nasm and found really tedious the building steps asm->bin->shellcode->c->exe so i made a script to automate that stuff, nothing fancy, anyways, here it is:
to use it just pass the name of your asm (if its potatoe.asm, you should run "builder.bat potatoe")
NOTE: the bat and asm files must be in the same directory
@ECHO OFF
nasm -f bin -o %1.bin %1.asm
xxd -c 1 -p %1.bin %1.txt
if exist %1.c (del %1.c)
set /p "=char code[] = "^"<nul >%1.c
for /F %%i in (%1.txt) do set /p "=\x%%i"<nul >>%1.c
echo ^";>>%1.c
echo int main(int argc, char **argv)>>%1.c
echo {>>%1.c
echo int (*func)();>>%1.c
echo func = (int (*)()) code;>>%1.c
echo (int)(*func)();>>%1.c
echo }>>%1.c
gcc -o %1 %1.c
@ECHO ON
This is just my tiny contribution, thanks everyone for the support and advice!Hope ill be able to contribute with something more significant in the future