Skip to content

Instantly share code, notes, and snippets.

@helloobaby
Created November 22, 2022 05:30
Show Gist options
  • Select an option

  • Save helloobaby/3f6a430d13c580a122f40ecdc99157e7 to your computer and use it in GitHub Desktop.

Select an option

Save helloobaby/3f6a430d13c580a122f40ecdc99157e7 to your computer and use it in GitHub Desktop.
zydis v4
ZydisDisassembledInstruction insn;
ZydisDisassembleIntel(ZYDIS_MACHINE_MODE_LONG_COMPAT_32, (ZyanU64)ip, ip,
15, &insn);
ZyanU64 ResultAddress;
if (insn.info.mnemonic == ZYDIS_MNEMONIC_CALL) {
ZydisCalcAbsoluteAddress(&insn.info, insn.operands, (ZyanU64)ip,
&ResultAddress);
TraceFile << hex << "ip : ResultAddress " << ip << "\t" << ResultAddress
<< endl;
if (ResultAddress > NtdllModule->start_ && ResultAddress < NtdllModule->end_) {
auto it = kSymbolInfo[NtdllModuleIndex].begin();
it = kSymbolInfo[NtdllModuleIndex].find(ResultAddress);
if (it != kSymbolInfo[NtdllModuleIndex].end()) {
TraceFile << "Call -> " << it->second << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment