1
0
Fork 0

first basic avx support

This commit is contained in:
dreg_fr33project 2014-11-13 02:37:12 +01:00
parent c328ad157c
commit 899247356d
6 changed files with 80 additions and 0 deletions

View File

@ -835,6 +835,7 @@ __declspec(dllexport) bool TITCALL SetContextFPUDataEx(HANDLE hActiveThread, voi
__declspec(dllexport) bool TITCALL SetContextDataEx(HANDLE hActiveThread, DWORD IndexOfRegister, ULONG_PTR NewRegisterValue);
__declspec(dllexport) bool TITCALL SetContextData(DWORD IndexOfRegister, ULONG_PTR NewRegisterValue);
__declspec(dllexport) bool TITCALL GetAVXContext(HANDLE hActiveThread, TITAN_ENGINE_CONTEXT_t* titcontext);
__declspec(dllexport) bool TITCALL SetAVXContext(HANDLE hActiveThread, TITAN_ENGINE_CONTEXT_t* titcontext);
__declspec(dllexport) void TITCALL ClearExceptionNumber();
__declspec(dllexport) long TITCALL CurrentExceptionNumber();
__declspec(dllexport) bool TITCALL MatchPatternEx(HANDLE hProcess, void* MemoryToCheck, int SizeOfMemoryToCheck, void* PatternToMatch, int SizeOfPatternToMatch, PBYTE WildCard);

View File

@ -1557,6 +1557,7 @@ bool startsWith(const char* pre, const char* str)
#define x87TW_PRE_FIELD_STRING "x87TW_"
#define MMX_PRE_FIELD_STRING "MM"
#define XMM_PRE_FIELD_STRING "XMM"
#define YMM_PRE_FIELD_STRING "YMM"
#define x8780BITFPU_PRE_FIELD_STRING "x87r"
#define STRLEN_USING_SIZEOF(string) (sizeof(string) - 1)
@ -1861,6 +1862,84 @@ void fpustuff(const char* string, uint value)
if(found)
SetContextDataEx(hActiveThread, registerindex, value);
}
else if(startsWith(YMM_PRE_FIELD_STRING, string))
{
string += STRLEN_USING_SIZEOF(YMM_PRE_FIELD_STRING);
DWORD registerindex;
bool found = true;
switch(atoi(string))
{
case 0:
registerindex = UE_YMM0;
break;
case 1:
registerindex = UE_YMM1;
break;
case 2:
registerindex = UE_YMM2;
break;
case 3:
registerindex = UE_YMM3;
break;
case 4:
registerindex = UE_YMM4;
break;
case 5:
registerindex = UE_YMM5;
break;
case 6:
registerindex = UE_YMM6;
break;
case 7:
registerindex = UE_YMM7;
break;
case 8:
registerindex = UE_YMM8;
break;
case 9:
registerindex = UE_YMM9;
break;
case 10:
registerindex = UE_YMM10;
break;
case 11:
registerindex = UE_YMM11;
break;
case 12:
registerindex = UE_YMM12;
break;
case 13:
registerindex = UE_YMM13;
break;
case 14:
registerindex = UE_YMM14;
break;
case 15:
registerindex = UE_YMM15;
break;
default:
found = false;
break;
}
if(found)
SetContextDataEx(hActiveThread, registerindex, value);
}
}
bool valtostring(const char* string, uint* value, bool silent)