diff --git a/SMPDataFlowAnalysis.cpp b/SMPDataFlowAnalysis.cpp index b9be5af91f2f5f22f4addbebab446a7b04599dc7..f97526f3ffb02f6b7e13b94670b21e0396b88d5c 100644 --- a/SMPDataFlowAnalysis.cpp +++ b/SMPDataFlowAnalysis.cpp @@ -566,16 +566,16 @@ void SMPInstr::AnnotateStackConstants(bool UseFP, FILE *AnnotFile) { if (BaseReg == R_none) { msg("BaseReg of R_none at %x\n", this->address); } - if (BaseReg == R_sp) { // EBP cannot be BaseReg in SIB ?? + if (BaseReg == R_sp) { // ESP cannot be IndexReg // ESP-relative constant offset qfprintf(AnnotFile, - "%x %d PTRIMMEDESP STACK %d %s\n", + "%x %d PTRIMMEDESP STACK %d displ %s\n", SMPcmd.ea, SMPcmd.size, offset, disasm); } - else if (UseFP && ((IndexReg == R_bp) || (BaseReg == R_bp))) { // ESP cannot be IndexReg + else if (UseFP && ((IndexReg == R_bp) || (BaseReg == R_bp))) { // EBP-relative constant offset qfprintf(AnnotFile, - "%x %d PTRIMMEDEBP STACK %d %s\n", + "%x %d PTRIMMEDEBP STACK %d displ %s\n", SMPcmd.ea, SMPcmd.size, offset, disasm); } } @@ -584,13 +584,13 @@ void SMPInstr::AnnotateStackConstants(bool UseFP, FILE *AnnotFile) { if (BaseReg == R_sp) { // ESP-relative constant offset qfprintf(AnnotFile, - "%x %d PTRIMMEDESP STACK %d %s\n", + "%x %d PTRIMMEDESP STACK %d displ %s\n", SMPcmd.ea, SMPcmd.size, offset, disasm); } else if (UseFP && (BaseReg == R_bp)) { // EBP-relative constant offset qfprintf(AnnotFile, - "%x %d PTRIMMEDEBP STACK %d %s\n", + "%x %d PTRIMMEDEBP STACK %d displ %s\n", SMPcmd.ea, SMPcmd.size, offset, disasm); } } // end if (Opnd.hasSIB) ... else ... @@ -600,16 +600,16 @@ void SMPInstr::AnnotateStackConstants(bool UseFP, FILE *AnnotFile) { if (Opnd.hasSIB) { int BaseReg = sib_base(Opnd); short IndexReg = sib_index(Opnd); - if (BaseReg == R_sp) { // EBP cannot be BaseReg in SIB + if (BaseReg == R_sp) { // ESP cannot be IndexReg // ESP-relative constant offset qfprintf(AnnotFile, - "%x %d PTRIMMEDESP STACK %d %s\n", + "%x %d PTRIMMEDESP STACK %d displ %s\n", SMPcmd.ea, SMPcmd.size, offset, disasm); } - else if (UseFP && (IndexReg == R_bp)) { // ESP cannot be IndexReg + else if (UseFP && ((BaseReg == R_bp) || (IndexReg == R_bp))) { // EBP-relative constant offset qfprintf(AnnotFile, - "%x %d PTRIMMEDEBP STACK %d %s\n", + "%x %d PTRIMMEDEBP STACK %d displ %s\n", SMPcmd.ea, SMPcmd.size, offset, disasm); } } @@ -618,13 +618,13 @@ void SMPInstr::AnnotateStackConstants(bool UseFP, FILE *AnnotFile) { if (BaseReg == R_sp) { // ESP-relative constant offset qfprintf(AnnotFile, - "%x %d PTRIMMEDESP STACK %d %s\n", + "%x %d PTRIMMEDESP STACK %d displ %s\n", SMPcmd.ea, SMPcmd.size, offset, disasm); } else if (UseFP && (BaseReg == R_bp)) { // EBP-relative constant offset qfprintf(AnnotFile, - "%x %d PTRIMMEDEBP STACK %d %s\n", + "%x %d PTRIMMEDEBP STACK %d displ %s\n", SMPcmd.ea, SMPcmd.size, offset, disasm); } } // end if (Opnd.hasSIB) ... else ...