开发者

Create a DWORD Pointer from Offset

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜