DBG: added bswap expression function
This commit is contained in:
parent
e918b773e7
commit
34dbdf35d5
|
@ -59,6 +59,8 @@ void ExpressionFunctions::Init()
|
|||
|
||||
RegisterEasy("peb\1PEB", peb);
|
||||
RegisterEasy("teb\1TEB", teb);
|
||||
|
||||
RegisterEasy("bswap", bswap);
|
||||
}
|
||||
|
||||
bool ExpressionFunctions::Register(const String & name, int argc, CBEXPRESSIONFUNCTION cbFunction, void* userdata)
|
||||
|
|
|
@ -57,4 +57,12 @@ namespace Exprfunc
|
|||
{
|
||||
return duint(GetTEBLocation(hActiveThread));
|
||||
}
|
||||
|
||||
duint bswap(duint value)
|
||||
{
|
||||
duint result = 0;
|
||||
for(size_t i = 0; i < sizeof(value); i++)
|
||||
((unsigned char*)&result)[sizeof(value) - i - 1] = ((unsigned char*)&value)[i];
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,4 +15,6 @@ namespace Exprfunc
|
|||
|
||||
duint peb();
|
||||
duint teb();
|
||||
|
||||
duint bswap(duint value);
|
||||
}
|
Loading…
Reference in New Issue