I have the following char*:
char*Problem = "\x8B\x15\x00\x00\x00\x00\x8B\x7C\x24\x14\x85\xC9\x74\x16\x8B\x03\x89\x01\x8B\x2D\x00\x00\x00\x00\x8B\x15\x00\x00\x00\x00\x8B\x0D\x00\x00\x00\x00\x83\xC1\x04"
I am trying to get this:
unsigned char buf[] = {0x8B, 0x15, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x7C, 0x24, 0x14, 0x85, 0xC9, 0x74, 0x16, 0x8B, 0x03, 0x89, 0x01, 0x8B, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x15, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x83, 0xC1, 0x04};
But by runtime. I am reading the char* from a textbox.
I tried the following:
UnicodeString Maskstr = Edit2->Text; //My char*Problem above
const char *chr = AnsiString(Maskstr).c_str();
char* MaskConverted = const_cast<char*>( chr );
unsigned char NewArray[40];
strcpy( (char*) NewArray, MaskConverted );
I thought, my unsigned char would be NewArray now, but it´s not. So how to get the correct result?..
I am a bit stuck right now. Any ideas?
Thank you! :)
unsigned char buf[len];is not legal in C++;