1
0
mirror of https://github.com/bitdefender/bddisasm.git synced 2024-11-22 07:28:07 +00:00

Only call ND_SIGN_EX when instruction has displacement

This commit is contained in:
Turo Lamminen 2024-08-26 17:28:32 +03:00
parent f967327ca4
commit 8bc44ae145

View File

@ -1298,7 +1298,7 @@ NdParseMemoryOperand16(
// Store the displacement. // Store the displacement.
Operand->Info.Memory.HasDisp = !!Instrux->HasDisp; Operand->Info.Memory.HasDisp = !!Instrux->HasDisp;
Operand->Info.Memory.DispSize = Instrux->DispLength; Operand->Info.Memory.DispSize = Instrux->DispLength;
Operand->Info.Memory.Disp = ND_SIGN_EX(Instrux->DispLength, Instrux->Displacement); Operand->Info.Memory.Disp = Instrux->HasDisp ? ND_SIGN_EX(Instrux->DispLength, Instrux->Displacement) : 0;
return ND_STATUS_SUCCESS; return ND_STATUS_SUCCESS;
} }
@ -1416,7 +1416,7 @@ NdParseMemoryOperand3264(
Operand->Info.Memory.HasDisp = Instrux->HasDisp; Operand->Info.Memory.HasDisp = Instrux->HasDisp;
Operand->Info.Memory.DispSize = Instrux->DispLength; Operand->Info.Memory.DispSize = Instrux->DispLength;
Operand->Info.Memory.Disp = ND_SIGN_EX(Instrux->DispLength, Instrux->Displacement); Operand->Info.Memory.Disp = Instrux->HasDisp ? ND_SIGN_EX(Instrux->DispLength, Instrux->Displacement) : 0;
return ND_STATUS_SUCCESS; return ND_STATUS_SUCCESS;
} }