1
0
Fork 0

GUI: ArchValue FS/GS for unusual highlighting of FS/GS

This commit is contained in:
mrexodia 2017-01-28 21:18:24 +01:00
parent 34948aacb2
commit 3a9e74bfdf
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 4 additions and 10 deletions

View File

@ -475,7 +475,7 @@ bool CapstoneTokenizer::tokenizeRegOperand(const cs_x86_op & op)
registerType = TokenType::YmmRegister; registerType = TokenType::YmmRegister;
else if(reg >= X86_REG_ZMM0 && reg <= X86_REG_ZMM31) else if(reg >= X86_REG_ZMM0 && reg <= X86_REG_ZMM31)
registerType = TokenType::ZmmRegister; registerType = TokenType::ZmmRegister;
else if(reg == X86_REG_FS || reg == X86_REG_GS) else if(reg == ArchValue(X86_REG_FS, X86_REG_GS))
registerType = TokenType::MnemonicUnusual; registerType = TokenType::MnemonicUnusual;
addToken(registerType, _cp.RegName(x86_reg(reg))); addToken(registerType, _cp.RegName(x86_reg(reg)));
return true; return true;
@ -522,7 +522,7 @@ bool CapstoneTokenizer::tokenizeMemOperand(const cs_x86_op & op)
break; break;
} }
} }
auto segmentType = op.reg == X86_REG_FS || op.reg == X86_REG_GS ? TokenType::MnemonicUnusual : TokenType::MemorySegment; auto segmentType = op.reg == ArchValue(X86_REG_FS, X86_REG_GS) ? TokenType::MnemonicUnusual : TokenType::MemorySegment;
addToken(segmentType, segmentText); addToken(segmentType, segmentText);
addToken(TokenType::Uncategorized, ":"); addToken(TokenType::Uncategorized, ":");

View File

@ -107,17 +107,11 @@ inline QDate GetCompileDate()
return QLocale("en_US").toDate(QString(__DATE__).simplified(), "MMM d yyyy"); return QLocale("en_US").toDate(QString(__DATE__).simplified(), "MMM d yyyy");
} }
template<typename T>
inline T & ArchValue(T & x32value, T & x64value)
{
#ifdef _WIN64 #ifdef _WIN64
Q_UNUSED(x32value); #define ArchValue(x32value, x64value) x64value
return x64value;
#else #else
Q_UNUSED(x64value); #define ArchValue(x32value, x64value) x32value
return x32value;
#endif //_WIN64 #endif //_WIN64
}
// Format : d:hh:mm:ss.1234567 // Format : d:hh:mm:ss.1234567
inline QString FILETIMEToTime(const FILETIME & time) inline QString FILETIMEToTime(const FILETIME & time)