Fix a crash in _dbg_addrinfoget

Thanks to @JustasMasiulis for reporting!
This commit is contained in:
Duncan Ogilvie 2020-10-30 20:39:31 +01:00
parent 5ac31bfe96
commit d74095770c
2 changed files with 3 additions and 2 deletions

View File

@ -354,7 +354,8 @@ extern "C" DLL_EXPORT bool _dbg_addrinfoget(duint addr, SEGMENTREG segment, BRID
Zydis cp;
auto getregs = !bOnlyCipAutoComments || addr == lastContext.cip;
disasmget(cp, addr, &instr, getregs);
if(!cp.IsNop())
// Some nop variants have 'operands' that should be ignored
if(cp.Success() && !cp.IsNop())
{
//Ignore register values when not on CIP and OnlyCipAutoComments is enabled: https://github.com/x64dbg/x64dbg/issues/1383
if(!getregs)

View File

@ -399,7 +399,7 @@ bool Zydis::IsBranchType(std::underlying_type_t<BranchType> bt) const
ZydisMnemonic Zydis::GetId() const
{
if(!Success())
DebugBreak();
return ZYDIS_MNEMONIC_INVALID;
return mInstr.mnemonic;
}