So if I want to read some information at the offset 开发者_C百科00A2E63C (e.g.)... and I need to have it as a DWORD,
how can I convert the "00A2E63C" String to a proper DWORD?
help is appreciated
unsigned long x = strtoul("00A2E63C", NULL, 16);
This would convert the string "00A2E63C" into unsigned long.
std::stringstream hai;
// insert string into hai here
DWORD d;
hai >> d;
void* ptr = (void*)d;
// INVOKE HIDEOUSLY UNSAFE AND UNDEFINED BEHAVIOUR HERE
I don't actually remember if it's undefined. But it's almost certainly hideously unsafe.
精彩评论