LPCVOID Base = (void *) 0x210811989F0; LPCVOID Num = (void *) 0x2387C88; LPCVOID Result = reinterpret_cast<LPCVOID>(0x210811989F0 + 0x2387C88); // 0x21083520678
怎么才能通过 Base 跟 Num 得到 Result 的值?半路出家啃c++,基础还没学完,麻烦赐教
Base
Num
Result
c++
我没理解错的话你是想通过某个地址+偏移 获取内存中的某个值?
struct Foo { int bar; char str[20]; int baz; }; Foo foo; foo.baz = 100; const void* lpBase = (const void*)&foo; const int offset = sizeof(int) + 20; printf("%d", *(int*)((char*)lpBase + offset)); // 100
奇怪的需求,正常的业务代码很少遇到,倒是一些逆向的场景里经常有
548k questions
547k answers
4 comments
86.3k users