February 18th, 2004, 07:44 PM
converting asm(hex) into a char array '\xXX'
I am writing some shellcode to exploit a service running on my machine. My goal is to spawn a shell, with system privlieges, and start a telnet service via commandline.
I have the C++/ASM code to acomplish this, my question is how to take the pertianit ASM code and convert it into a char array in C++.
0e 05 0a ff....blah blah blah
My ASM code comes from MSVC++'s debugger...
char payload = "\x0e\x05\x0a\xff";
Thanks for any input
February 19th, 2004, 09:34 AM
You are writing shellcode and you don't know how to convert a bunch of bytes to a char array?
How come you know how to write something as complex as shellcode but have no idea how to do this?
Experience is something you don't get until just after you need it.
February 20th, 2004, 08:39 PM
sorry for my unclear question. I know how to convert hex bytes into a char array, i was just wanting to hear other peoples ideas
char *hexArray = new char;
char *outputArray = new char[3*strlen(hexArray)];
long int iPos = 0;
for(int i = 0; i < strlen(hexArray);i++)
outputArray[iPos] = '\\';
outputArray[iPos] = 'x';
outputArray[iPos] = hexArray[i]l
February 21st, 2004, 04:49 AM
come cool shell coding tute,
it converts decimal to asm to hex so um i think gdb can convert back, if i find out a shell code ot do it ill post it for u,
right now i just reading have **** to do but ill work on a asm to hex and asm to decimal convertor maybe even a hex to dic :P