diff --git a/.gitignore b/.gitignore index 4a48ed0..418e99b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ Release tests/logging-test.* *.suo *.opendb +*.VC.db +.vs/* diff --git a/CAPE/CAPE.c b/CAPE/CAPE.c index abfa75b..d242730 100644 --- a/CAPE/CAPE.c +++ b/CAPE/CAPE.c @@ -21,9 +21,14 @@ along with this program.If not, see . #include #include #include +#include +#include +#include +#include #include "CAPE.h" #include "Debugger.h" +#include "..\alloc.h" #include "..\pipe.h" #include "..\config.h" @@ -31,18 +36,34 @@ along with this program.If not, see . #define BUFSIZE 1024 // For hashing #define MD5LEN 16 +#define DUMP_MAX 100 +#define CAPE_OUTPUT_FILE "CapeOutput.bin" + +static unsigned int DumpCount; + +extern uint32_t path_from_handle(HANDLE handle, wchar_t *path, uint32_t path_buffer_len); + +#define CAPE_OUTPUT_FILE "CapeOutput.bin" extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); extern void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); extern void CapeOutputFile(LPCTSTR lpOutputFile); +extern int IsPeImageVirtual(DWORD_PTR Buffer); extern int ScyllaDumpCurrentProcess(DWORD NewOEP); extern int ScyllaDumpProcess(HANDLE hProcess, DWORD_PTR modBase, DWORD NewOEP); extern int ScyllaDumpCurrentProcessFixImports(DWORD NewOEP); +extern int ScyllaDumpProcessFixImports(HANDLE hProcess, DWORD_PTR modBase, DWORD NewOEP); +extern void ExtractionClearAll(void); + +extern wchar_t *our_process_path; +extern ULONG_PTR base_of_dll_of_interest; static HMODULE s_hInst = NULL; static WCHAR s_wzDllPath[MAX_PATH]; CHAR s_szDllPath[MAX_PATH]; +BOOL ProcessDumped; + //************************************************************************************** void PrintHexBytes(__in char* TextBuffer, __in BYTE* HexBuffer, __in unsigned int Count) //************************************************************************************** @@ -60,6 +81,117 @@ void PrintHexBytes(__in char* TextBuffer, __in BYTE* HexBuffer, __in unsigned in return; } +//********************************************************************************************************************************* +BOOL TranslatePathFromDeviceToLetter(__in char *DeviceFilePath, __out char* DriveLetterFilePath, __inout LPDWORD lpdwBufferSize) +//********************************************************************************************************************************* +{ + char DriveStrings[BUFSIZE]; + DriveStrings[0] = '\0'; + + if (DriveLetterFilePath == NULL || *lpdwBufferSize < MAX_PATH) + { + *lpdwBufferSize = MAX_PATH; + return FALSE; + } + + if (GetLogicalDriveStrings(BUFSIZE-1, DriveStrings)) + { + char DeviceName[MAX_PATH]; + char szDrive[3] = " :"; + BOOL FoundDevice = FALSE; + char* p = DriveStrings; + + do + { + *szDrive = *p; + + if (QueryDosDevice(szDrive, DeviceName, MAX_PATH)) + { + size_t DeviceNameLength = strlen(DeviceName); + + if (DeviceNameLength < MAX_PATH) + { + FoundDevice = _strnicmp(DeviceFilePath, DeviceName, DeviceNameLength) == 0; + + if (FoundDevice && *(DeviceFilePath + DeviceNameLength) == ('\\')) + { + // Construct DriveLetterFilePath replacing device path with DOS path + char NewPath[MAX_PATH]; + StringCchPrintf(NewPath, MAX_PATH, TEXT("%s%s"), szDrive, DeviceFilePath+DeviceNameLength); + StringCchCopyN(DriveLetterFilePath, MAX_PATH, NewPath, strlen(NewPath)); + } + } + } + + // Go to the next NULL character. + while (*p++); + } + while (!FoundDevice && *p); // end of string + } + else + { + DoOutputErrorString("TranslatePathFromDeviceToLetter: GetLogicalDriveStrings failed"); + return FALSE; + } + + return TRUE; +} + +//************************************************************************************** +BOOL SetCapeMetaData(DWORD DumpType, DWORD TargetPid, HANDLE hTargetProcess, PVOID Address) +//************************************************************************************** +{ + if (DumpType == 0) + { + DoOutputDebugString("SetCapeMetaData: DumpType NULL.\n"); + return FALSE; + } + + CapeMetaData->DumpType = DumpType; + + if (DumpType == INJECTION_PE || DumpType == INJECTION_SHELLCODE) + { + if (!TargetPid) + { + DoOutputDebugString("SetCapeMetaData: Injection type with no PID - error.\n"); + return FALSE; + } + + if (!hTargetProcess) + { + DoOutputDebugString("SetCapeMetaData: Injection type with no process handle - error.\n"); + return FALSE; + } + + CapeMetaData->TargetPid = TargetPid; + + if (CapeMetaData->TargetProcess == NULL) + { + DoOutputDebugString("SetCapeMetaData: failed to allocate memory for target process string.\n"); + return FALSE; + } + + if (CapeMetaData->TargetProcess == NULL && !GetModuleFileNameEx(hTargetProcess, NULL, CapeMetaData->TargetProcess, MAX_PATH)) + { + CapeMetaData->TargetProcess = (char*)malloc(MAX_PATH); + DoOutputErrorString("SetCapeMetaData: GetModuleFileNameEx failed on target process, handle 0x%x", hTargetProcess); + return FALSE; + } + } + else if (DumpType == EXTRACTION_PE || DumpType == EXTRACTION_SHELLCODE) + { + if (!Address) + { + DoOutputDebugString("SetCapeMetaData: Extraction type with no PID - error.\n"); + return FALSE; + } + + CapeMetaData->Address = Address; + } + + return TRUE; +} + //************************************************************************************** BOOL MapFile(HANDLE hFile, unsigned char **Buffer, DWORD* FileSize) //************************************************************************************** @@ -69,7 +201,7 @@ BOOL MapFile(HANDLE hFile, unsigned char **Buffer, DWORD* FileSize) if (!GetFileSizeEx(hFile, &LargeFileSize)) { - DoOutputErrorString("Cannot get file size"); + DoOutputErrorString("MapFile: Cannot get file size"); return FALSE; } @@ -79,6 +211,12 @@ BOOL MapFile(HANDLE hFile, unsigned char **Buffer, DWORD* FileSize) return FALSE; } + if (LargeFileSize.LowPart == 0) + { + DoOutputDebugString("MapFile: File is zero in size."); + return FALSE; + } + *FileSize = LargeFileSize.LowPart; DoOutputDebugString("File size: 0x%x", *FileSize); @@ -106,7 +244,7 @@ BOOL MapFile(HANDLE hFile, unsigned char **Buffer, DWORD* FileSize) if (dwBytesRead > 0 && dwBytesRead < *FileSize) { - DoOutputErrorString("MapFile: Unexpected size read in."); + DoOutputErrorString("MapFile: Unexpected size read in"); free(Buffer); return FALSE; @@ -121,6 +259,353 @@ BOOL MapFile(HANDLE hFile, unsigned char **Buffer, DWORD* FileSize) return TRUE; } +//************************************************************************************** +PINJECTIONINFO GetInjectionInfo(DWORD ProcessId) +//************************************************************************************** +{ + DWORD CurrentProcessId; + + PINJECTIONINFO CurrentInjectionInfo = InjectionInfoList; + while (CurrentInjectionInfo) + { + CurrentProcessId = CurrentInjectionInfo->ProcessId; + + if (CurrentProcessId == ProcessId) + return CurrentInjectionInfo; + else + CurrentInjectionInfo = CurrentInjectionInfo->NextInjectionInfo; + } + + return NULL; +} + +//************************************************************************************** +PINJECTIONINFO CreateInjectionInfo(DWORD ProcessId) +//************************************************************************************** +{ + PINJECTIONINFO CurrentInjectionInfo, PreviousInjectionInfo; + + PreviousInjectionInfo = NULL; + + if (InjectionInfoList == NULL) + { + InjectionInfoList = ((struct InjectionInfo*)malloc(sizeof(struct InjectionInfo))); + + if (InjectionInfoList == NULL) + { + DoOutputDebugString("CreateInjectionInfo: failed to allocate memory for initial injection info list.\n"); + return NULL; + } + + memset(InjectionInfoList, 0, sizeof(struct InjectionInfo)); + + InjectionInfoList->ProcessId = ProcessId; + } + + CurrentInjectionInfo = InjectionInfoList; + + while (CurrentInjectionInfo) + { + if ((CurrentInjectionInfo->ProcessId) == ProcessId) + break; + + PreviousInjectionInfo = CurrentInjectionInfo; + CurrentInjectionInfo = CurrentInjectionInfo->NextInjectionInfo; + } + + if (!CurrentInjectionInfo) + { + // We haven't found it in the linked list, so create a new one + CurrentInjectionInfo = PreviousInjectionInfo; + + CurrentInjectionInfo->NextInjectionInfo = ((struct InjectionInfo*)malloc(sizeof(struct InjectionInfo))); + + if (CurrentInjectionInfo->NextInjectionInfo == NULL) + { + DoOutputDebugString("CreateInjectionInfo: Failed to allocate new thread breakpoints.\n"); + return NULL; + } + + memset(CurrentInjectionInfo->NextInjectionInfo, 0, sizeof(struct InjectionInfo)); + + CurrentInjectionInfo = CurrentInjectionInfo->NextInjectionInfo; + + CurrentInjectionInfo->ProcessId = ProcessId; + } + + return CurrentInjectionInfo; +} + +//************************************************************************************** +PINJECTIONSECTIONVIEW GetSectionView(HANDLE SectionHandle) +//************************************************************************************** +{ + PINJECTIONSECTIONVIEW CurrentSectionView = SectionViewList; + + //TODO remove debug + DoOutputDebugString("GetSectionView: Global section view list 0x%x, looking for handle 0x%x\n", CurrentSectionView, SectionHandle); + + while (CurrentSectionView) + { + //TODO remove debug + DoOutputDebugString("GetSectionView: looking at section handle 0x%x.\n", CurrentSectionView->SectionHandle); + if (CurrentSectionView->SectionHandle == SectionHandle) + { + DoOutputDebugString("GetSectionView: returning section view pointer 0x%x.\n", CurrentSectionView); + return CurrentSectionView; + } + + CurrentSectionView = CurrentSectionView->NextSectionView; + } + + return NULL; +} + +//************************************************************************************** +PINJECTIONSECTIONVIEW AddSectionView(HANDLE SectionHandle, PVOID LocalView, SIZE_T ViewSize) +//************************************************************************************** +{ + PINJECTIONSECTIONVIEW CurrentSectionView, PreviousSectionView; + + PreviousSectionView = NULL; + + if (SectionViewList == NULL) + { + SectionViewList = ((struct InjectionSectionView*)malloc(sizeof(struct InjectionSectionView))); + + if (SectionViewList == NULL) + { + DoOutputDebugString("AddSectionView: failed to allocate memory for initial section view list.\n"); + return NULL; + } + + memset(SectionViewList, 0, sizeof(struct InjectionSectionView)); + + SectionViewList->SectionHandle = SectionHandle; + SectionViewList->LocalView = LocalView; + SectionViewList->ViewSize = ViewSize; + } + + CurrentSectionView = SectionViewList; + + while (CurrentSectionView) + { + if ((CurrentSectionView->SectionHandle) == SectionHandle) + break; + + PreviousSectionView = CurrentSectionView; + CurrentSectionView = CurrentSectionView->NextSectionView; + } + + if (!CurrentSectionView) + { + // We haven't found it in the linked list, so create a new one + CurrentSectionView = PreviousSectionView; + + CurrentSectionView->NextSectionView = ((struct InjectionSectionView*)malloc(sizeof(struct InjectionSectionView))); + + if (CurrentSectionView->NextSectionView == NULL) + { + DoOutputDebugString("CreateSectionView: Failed to allocate new injection sectionview structure.\n"); + return NULL; + } + + memset(CurrentSectionView->NextSectionView, 0, sizeof(struct InjectionSectionView)); + + CurrentSectionView = CurrentSectionView->NextSectionView; + CurrentSectionView->SectionHandle = SectionHandle; + CurrentSectionView->LocalView = LocalView; + CurrentSectionView->ViewSize = ViewSize; + } + + return CurrentSectionView; +} + +//************************************************************************************** +BOOL DropSectionView(PINJECTIONSECTIONVIEW SectionView) +//************************************************************************************** +{ + PINJECTIONSECTIONVIEW CurrentSectionView, PreviousSectionView; + + PreviousSectionView = NULL; + + if (SectionViewList == NULL) + { + DoOutputDebugString("DropSectionView: failed to obtain initial section view list.\n"); + return FALSE; + } + + CurrentSectionView = SectionViewList; + + while (CurrentSectionView) + { + if (CurrentSectionView == SectionView) + { + // Unlink this from the list and free the memory + if (PreviousSectionView && CurrentSectionView->NextSectionView) + { + PreviousSectionView->NextSectionView = CurrentSectionView->NextSectionView; + DoOutputDebugString("DropSectionView: removed a view from section view list.\n"); + } + else if (PreviousSectionView && CurrentSectionView->NextSectionView == NULL) + { + PreviousSectionView->NextSectionView = NULL; + DoOutputDebugString("DropSectionView: removed the view from the end of the section view list.\n"); + } + else if (!PreviousSectionView) + { + SectionViewList = NULL; + DoOutputDebugString("DropSectionView: removed the head of the section view list.\n"); + } + + free(CurrentSectionView); + + return TRUE; + } + + PreviousSectionView = CurrentSectionView; + CurrentSectionView = CurrentSectionView->NextSectionView; + } + + return FALSE; +} + +//************************************************************************************** +void DumpSectionViewsForPid(DWORD Pid) +//************************************************************************************** +{ + struct InjectionInfo *CurrentInjectionInfo; + PINJECTIONSECTIONVIEW CurrentSectionView; + DWORD BufferSize = MAX_PATH; + LPVOID PEPointer = NULL; + BOOL Dumped = FALSE; + + CurrentInjectionInfo = GetInjectionInfo(Pid); + + if (CurrentInjectionInfo == NULL) + { + DoOutputDebugString("DumpSectionViewsForPid: No injection info for pid %d.\n", Pid); + return; + } + + CurrentSectionView = SectionViewList; + + while (CurrentSectionView) + { + if (CurrentSectionView->TargetProcessId == Pid) + { + DoOutputDebugString("DumpSectionViewsForPid: Shared section view found with pid %d.\n", Pid); + + if (CurrentSectionView->LocalView) + { + PEPointer = CurrentSectionView->LocalView; + + while (ScanForPE(PEPointer, CurrentSectionView->ViewSize - ((DWORD_PTR)PEPointer - (DWORD_PTR)CurrentSectionView->LocalView), &PEPointer)) + { + DoOutputDebugString("DumpSectionViewsForPid: Dumping PE image from shared section view, local address 0x%x.\n", PEPointer); + + CapeMetaData->DumpType = INJECTION_PE; + CapeMetaData->TargetPid = Pid; + CapeMetaData->Address = PEPointer; + + if (DumpImageInCurrentProcess((DWORD_PTR)PEPointer)) + { + DoOutputDebugString("DumpSectionViewsForPid: Dumped PE image from shared section view.\n"); + Dumped = TRUE; + } + else + DoOutputDebugString("DumpSectionViewsForPid: Failed to dump PE image from shared section view.\n"); + + ((BYTE*)PEPointer)++; + } + + if (Dumped == FALSE) + { + DoOutputDebugString("DumpSectionViewsForPid: no PE file found in shared section view, attempting raw dump.\n"); + + CapeMetaData->DumpType = INJECTION_SHELLCODE; + + CapeMetaData->TargetPid = Pid; + + if (DumpMemory(CurrentSectionView->LocalView, CurrentSectionView->ViewSize)) + { + DoOutputDebugString("DumpSectionViewsForPid: Dumped shared section view."); + Dumped = TRUE; + } + else + DoOutputDebugString("DumpSectionViewsForPid: Failed to dump shared section view."); + } + } + } + + //DropSectionView(CurrentSectionView); + + CurrentSectionView = CurrentSectionView->NextSectionView; + } + + if (Dumped == FALSE) + DoOutputDebugString("DumpSectionViewsForPid: no shared section views found for pid %d.\n", Pid); + + return; +} + +//************************************************************************************** +char* GetName() +//************************************************************************************** +{ + char *OutputFilename, *FullPathName; + SYSTEMTIME Time; + DWORD RetVal; + + FullPathName = (char*) malloc(MAX_PATH); + + if (FullPathName == NULL) + { + DoOutputErrorString("GetName: Error allocating memory for full path string"); + return 0; + } + + OutputFilename = (char*)malloc(MAX_PATH); + + if (OutputFilename == NULL) + { + DoOutputErrorString("GetName: failed to allocate memory for file name string"); + return 0; + } + + GetSystemTime(&Time); + sprintf_s(OutputFilename, MAX_PATH*sizeof(char), "%d_%d%d%d%d%d%d%d%d", GetCurrentProcessId(), Time.wMilliseconds, Time.wSecond, Time.wMinute, Time.wHour, Time.wDay, Time.wDayOfWeek, Time.wMonth, Time.wYear); + + // We want to dump CAPE output to the 'analyzer' directory + memset(FullPathName, 0, MAX_PATH); + + strncpy_s(FullPathName, MAX_PATH, g_config.analyzer, strlen(g_config.analyzer)+1); + + if (strlen(FullPathName) + strlen("\\CAPE\\") + strlen(OutputFilename) >= MAX_PATH) + { + DoOutputDebugString("GetName: Error, CAPE destination path too long."); + free(OutputFilename); + free(FullPathName); + return 0; + } + + PathAppend(FullPathName, "CAPE"); + + RetVal = CreateDirectory(FullPathName, NULL); + + if (RetVal == 0 && GetLastError() != ERROR_ALREADY_EXISTS) + { + DoOutputDebugString("GetName: Error creating output directory"); + free(OutputFilename); + free(FullPathName); + return 0; + } + + PathAppend(FullPathName, OutputFilename); + + return FullPathName; +} + //************************************************************************************** BOOL GetHash(unsigned char* Buffer, unsigned int Size, char* OutputFilenameBuffer) //************************************************************************************** @@ -183,7 +668,7 @@ char* GetHashFromHandle(HANDLE hFile) if (!MapFile(hFile, &Buffer, &FileSize)) { - DoOutputErrorString("MapFile error - check path!"); + DoOutputErrorString("MapFile error - check the path is valid and the file has size."); return 0; } @@ -191,11 +676,15 @@ char* GetHashFromHandle(HANDLE hFile) if (OutputFilenameBuffer == NULL) { - DoOutputErrorString("Error allocating memory for hash string."); + DoOutputErrorString("Error allocating memory for hash string"); return 0; } - GetHash(Buffer, FileSize, (char*)OutputFilenameBuffer); + if (!GetHash(Buffer, FileSize, (char*)OutputFilenameBuffer)) + { + DoOutputErrorString("GetHashFromHandle: GetHash function failed"); + return 0; + } DoOutputDebugString("GetHash returned: %s", OutputFilenameBuffer); @@ -286,7 +775,7 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) if (DecryptedBuffer == NULL) { - DoOutputErrorString(TEXT("Error allocating memory for decrypted PE binary.")); + DoOutputErrorString("Error allocating memory for decrypted PE binary"); return FALSE; } @@ -295,10 +784,11 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) for (k=0; kAddress = DecryptedBuffer; + DumpImageInCurrentProcess((DWORD_PTR)DecryptedBuffer); free(DecryptedBuffer); - return TRUE; + return i; } else { @@ -307,6 +797,7 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) } } } + #ifndef _WIN64 for (i=0; i<=0xffff; i++) { @@ -357,7 +848,7 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) if (DecryptedBuffer == NULL) { - DoOutputErrorString(TEXT("Error allocating memory for decrypted PE binary.")); + DoOutputErrorString("Error allocating memory for decrypted PE binary"); return FALSE; } @@ -366,7 +857,8 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) for (k=0; kAddress = DecryptedBuffer; + DumpImageInCurrentProcess((DWORD_PTR)DecryptedBuffer); free(DecryptedBuffer); return TRUE; @@ -401,7 +893,7 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) if (DecryptedBuffer == NULL) { - DoOutputErrorString(TEXT("Error allocating memory for decrypted PE binary.")); + DoOutputErrorString("Error allocating memory for decrypted PE binary"); return FALSE; } @@ -410,7 +902,8 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) for (k=0; kAddress = DecryptedBuffer; + DumpImageInCurrentProcess((DWORD_PTR)DecryptedBuffer); free(DecryptedBuffer); return TRUE; @@ -457,7 +950,7 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) if (DecryptedBuffer == NULL) { - DoOutputErrorString(TEXT("Error allocating memory for decrypted PE binary.")); + DoOutputErrorString("Error allocating memory for decrypted PE binary"); return FALSE; } @@ -466,7 +959,8 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) for (k=0; kAddress = DecryptedBuffer; + DumpImageInCurrentProcess((DWORD_PTR)DecryptedBuffer); free(DecryptedBuffer); return TRUE; @@ -474,6 +968,7 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) } } } + #endif // We free can free DecryptedBuffer as it's no longer needed free(DecryptedBuffer); @@ -482,95 +977,413 @@ int DumpXorPE(LPBYTE Buffer, unsigned int Size) } //************************************************************************************** -int DumpMemory(LPCVOID Buffer, unsigned int Size) +int ScanPageForNonZero(LPVOID Address) //************************************************************************************** { - char *OutputFilename, *FullPathName; - DWORD RetVal, dwBytesWritten; - HANDLE hOutputFile; + unsigned int p; + DWORD_PTR AddressOfPage; + + if (!SystemInfo.dwPageSize) + GetSystemInfo(&SystemInfo); + + if (!SystemInfo.dwPageSize) + { + DoOutputErrorString("Failed to obtain system page size.\n"); + return 0; + } + + AddressOfPage = ((DWORD_PTR)Address/SystemInfo.dwPageSize)*SystemInfo.dwPageSize; + + __try + { + for (p=0; pe_lfanew == 0) + { + // e_lfanew is zero + continue; + } + + if ((ULONG)pDosHeader->e_lfanew > Size-p) + { + // e_lfanew points beyond end of region + continue; + } + + pNtHeader = (PIMAGE_NT_HEADERS)((PCHAR)pDosHeader + (ULONG)pDosHeader->e_lfanew); + + if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) + { + // No 'PE' header + continue; + } + + if ((pNtHeader->FileHeader.Machine == 0) || (pNtHeader->FileHeader.SizeOfOptionalHeader == 0 || pNtHeader->OptionalHeader.SizeOfHeaders == 0)) + { + // Basic requirements + DoOutputDebugString("ScanForPE: Basic requirements failure.\n"); + continue; + } + + if (Offset) + { + *Offset = (LPVOID)((char*)Buffer+p); + } + + DoOutputDebugString("ScanForPE: PE image located at: 0x%x\n", (DWORD_PTR)((char*)Buffer+p)); + + return 1; + } + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputDebugString("ScanForPE: Exception occured reading memory address 0x%x\n", (DWORD_PTR)((char*)Buffer+p)); + return 0; + } + } - DoOutputDebugString("GetHash returned: %s", OutputFilename); + DoOutputDebugString("ScanForPE: No PE image located at 0x%x.\n", Buffer); + return 0; +} - sprintf_s((OutputFilename+2*MD5LEN), MAX_PATH*sizeof(char)-2*MD5LEN, ".bin"); +//************************************************************************************** +int ScanForDisguisedPE(LPVOID Buffer, unsigned int Size, LPVOID* Offset) +//************************************************************************************** +{ + unsigned int p; + PIMAGE_DOS_HEADER pDosHeader; + PIMAGE_NT_HEADERS pNtHeader; + + if (Size == 0) + { + DoOutputDebugString("ScanForDisguisedPE: Error, zero size given\n"); + return 0; + } + + for (p=0; p < Size - 0x41; p++) // we want to stop short of the look-ahead to e_lfanew + { + __try + { + pDosHeader = (PIMAGE_DOS_HEADER)((char*)Buffer+p); + + if (!pDosHeader->e_lfanew || (ULONG)pDosHeader->e_lfanew > Size-p || pDosHeader->e_lfanew > PE_HEADER_LIMIT) + { + continue; + } + + pNtHeader = (PIMAGE_NT_HEADERS)((PCHAR)pDosHeader + (ULONG)pDosHeader->e_lfanew); + + if ((pNtHeader->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC) && (pNtHeader->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC)) + { + continue; + } + + // Basic requirements + if + ( + pNtHeader->FileHeader.Machine == 0 || + pNtHeader->FileHeader.SizeOfOptionalHeader == 0 || + pNtHeader->OptionalHeader.SizeOfHeaders == 0 || + pNtHeader->OptionalHeader.FileAlignment == 0 + ) + { + DoOutputDebugString("ScanForDisguisedPE: Basic requirements failure.\n"); + continue; + } - // We want to dump CAPE output to the 'analyzer' directory - memset(FullPathName, 0, MAX_PATH); - - strncpy_s(FullPathName, MAX_PATH, g_config.analyzer, strlen(g_config.analyzer)+1); + if (!(pNtHeader->FileHeader.Characteristics & IMAGE_FILE_EXECUTABLE_IMAGE)) + { + DoOutputDebugString("ScanForDisguisedPE: Characteristics bad."); + //continue; + } - if (strlen(FullPathName) + strlen("\\CAPE\\") + strlen(OutputFilename) >= MAX_PATH) - { - DoOutputDebugString("Error, CAPE destination path too long."); - free(OutputFilename); free(FullPathName); - return 0; - } + if (pNtHeader->FileHeader.SizeOfOptionalHeader & (sizeof (ULONG_PTR) - 1)) + { + DoOutputDebugString("ScanForDisguisedPE: SizeOfOptionalHeader bad."); + continue; + } + + if (((pNtHeader->OptionalHeader.FileAlignment-1) & pNtHeader->OptionalHeader.FileAlignment) != 0) + { + DoOutputDebugString("ScanForDisguisedPE: FileAlignment invalid."); + continue; + } + + if (Offset) + { + *Offset = (LPVOID)((char*)Buffer+p); + } + + DoOutputDebugString("ScanForDisguisedPE: PE image located at: 0x%x\n", (DWORD_PTR)((char*)Buffer+p)); + + return 1; + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputDebugString("ScanForDisguisedPE: Exception occured reading memory address 0x%x\n", (DWORD_PTR)((char*)Buffer+p)); + return 0; + } + } + + DoOutputDebugString("ScanForDisguisedPE: No PE image located in range 0x%x-0x%x.\n", Buffer, (DWORD_PTR)Buffer + Size); + return 0; +} - PathAppend(FullPathName, "CAPE"); +//************************************************************************************** +int IsDisguisedPE(LPVOID Buffer, unsigned int Size) +//************************************************************************************** +{ + PIMAGE_DOS_HEADER pDosHeader; + PIMAGE_NT_HEADERS pNtHeader; + + if (Size == 0) + { + DoOutputDebugString("IsDisguisedPE: Error, zero size given.\n"); + return 0; + } + + __try + { + pDosHeader = (PIMAGE_DOS_HEADER)Buffer; - RetVal = CreateDirectory(FullPathName, NULL); + if (!pDosHeader->e_lfanew || pDosHeader->e_lfanew > PE_HEADER_LIMIT) + { + //DoOutputDebugString("IsDisguisedPE: e_lfanew bad."); + return 0; + } + + // more tests to establish it's PE + pNtHeader = (PIMAGE_NT_HEADERS)((PCHAR)pDosHeader + (ULONG)pDosHeader->e_lfanew); - if (RetVal == 0 && GetLastError() != ERROR_ALREADY_EXISTS) - { - DoOutputDebugString("Error creating output directory"); - free(OutputFilename); free(FullPathName); - return 0; - } + if ((pNtHeader->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC) && (pNtHeader->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC)) + { + DoOutputDebugString("IsDisguisedPE: OptionalHeader.Magic bad."); + return 0; + } + + if ((pNtHeader->FileHeader.Machine == 0) || (pNtHeader->FileHeader.SizeOfOptionalHeader == 0 || pNtHeader->OptionalHeader.SizeOfHeaders == 0)) + { + // Basic requirements + DoOutputDebugString("IsDisguisedPE: Basic requirements bad.\n"); + return 0; + } - PathAppend(FullPathName, OutputFilename); - - DoOutputDebugString("DEBUG: FullPathName = %s", FullPathName); + if (!(pNtHeader->FileHeader.Characteristics & IMAGE_FILE_EXECUTABLE_IMAGE)) + { + DoOutputDebugString("ScanForDisguisedPE: Characteristics bad."); + //return 0; + } + + if (pNtHeader->FileHeader.SizeOfOptionalHeader & (sizeof (ULONG_PTR) - 1)) + { + DoOutputDebugString("ScanForDisguisedPE: SizeOfOptionalHeader bad.\n"); + return 0; + } + + if (((pNtHeader->OptionalHeader.FileAlignment-1) & pNtHeader->OptionalHeader.FileAlignment) != 0) + { + DoOutputDebugString("ScanForDisguisedPE: FileAlignment invalid.\n"); + return 0; + } + + if (pNtHeader->OptionalHeader.SectionAlignment < pNtHeader->OptionalHeader.FileAlignment) + { + DoOutputDebugString("ScanForDisguisedPE: FileAlignment greater than SectionAlignment.\n"); + return 0; + } + + // To pass the above tests it should now be safe to assume it's a PE image + return 1; + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputDebugString("IsDisguisedPE: Exception occured reading region at 0x%x\n", (DWORD_PTR)(Buffer)); + return 0; + } - hOutputFile = CreateFile(FullPathName, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + DoOutputDebugString("IsDisguisedPE: No PE image located\n"); + return 0; +} + +//************************************************************************************** +BOOL DumpPEsInRange(LPVOID Buffer, SIZE_T Size) +//************************************************************************************** +{ + PBYTE PEImage; + PIMAGE_DOS_HEADER pDosHeader; + + BOOL RetVal = FALSE; + LPVOID PEPointer = Buffer; + + DoOutputDebugString("DumpPEsInRange: Scanning range 0x%x - 0x%x.\n", Buffer, (BYTE*)Buffer + Size); + + while (ScanForDisguisedPE(PEPointer, Size - ((DWORD_PTR)PEPointer - (DWORD_PTR)Buffer), &PEPointer)) + { + pDosHeader = (PIMAGE_DOS_HEADER)PEPointer; + if (*(WORD*)PEPointer != IMAGE_DOS_SIGNATURE || (*(DWORD*)((BYTE*)pDosHeader + pDosHeader->e_lfanew) != IMAGE_NT_SIGNATURE)) + { + DoOutputDebugString("DumpPEsInRange: Disguised PE image (bad MZ and/or PE headers) at 0x%x.\n", PEPointer); + + // We want to fix the PE header in the dump (for e.g. disassembly etc) + PEImage = (BYTE*)malloc(Size - ((DWORD_PTR)PEPointer - (DWORD_PTR)Buffer)); + memcpy(PEImage, PEPointer, Size - ((DWORD_PTR)PEPointer - (DWORD_PTR)Buffer)); + pDosHeader = (PIMAGE_DOS_HEADER)PEImage; + + *(WORD*)PEImage = IMAGE_DOS_SIGNATURE; + *(DWORD*)(PEImage + pDosHeader->e_lfanew) = IMAGE_NT_SIGNATURE; + + SetCapeMetaData(EXTRACTION_PE, 0, NULL, (PVOID)PEPointer); + + if (DumpImageInCurrentProcess((DWORD)PEImage)) + { + DoOutputDebugString("DumpPEsInRange: Dumped PE image from 0x%x.\n", PEPointer); + RetVal = TRUE; + } + else + DoOutputDebugString("DumpPEsInRange: Failed to dump PE image from 0x%x.\n", PEPointer); + } + else + { + SetCapeMetaData(EXTRACTION_PE, 0, NULL, (PVOID)PEPointer); + + if (DumpImageInCurrentProcess((DWORD)PEPointer)) + { + DoOutputDebugString("DumpPEsInRange: Dumped PE image from 0x%x.\n", PEPointer); + RetVal = TRUE; + } + else + DoOutputDebugString("DumpPEsInRange: Failed to dump PE image from 0x%x.\n", PEPointer); + } + + ((BYTE*)PEPointer)++; + } - DoOutputDebugString("CreateFile returned: 0x%x", hOutputFile); + return RetVal; +} + +//************************************************************************************** +int DumpMemory(LPVOID Buffer, unsigned int Size) +//************************************************************************************** +{ + char *FullPathName; + DWORD dwBytesWritten; + HANDLE hOutputFile; + LPVOID BufferCopy; + + FullPathName = GetName(); + + hOutputFile = CreateFile(FullPathName, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); if (hOutputFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_EXISTS) { - DoOutputDebugString("CAPE output filename exists already: %s", FullPathName); - free(OutputFilename); free(FullPathName); + DoOutputDebugString("DumpMemory: CAPE output filename exists already: %s", FullPathName); + free(FullPathName); return 0; } - DoOutputDebugString("Passed file_exists check"); - if (hOutputFile == INVALID_HANDLE_VALUE) { - DoOutputErrorString("Could not create CAPE output file"); - free(OutputFilename); free(FullPathName); + DoOutputErrorString("DumpMemory: Could not create CAPE output file"); + free(FullPathName); return 0; } - DoOutputDebugString("Passed invalid_handle check"); dwBytesWritten = 0; - DoOutputDebugString("CAPE output file succssfully created:%s", FullPathName); + DoOutputDebugString("DumpMemory: CAPE output file successfully created: %s", FullPathName); - if (FALSE == WriteFile(hOutputFile, Buffer, Size, &dwBytesWritten, NULL)) + BufferCopy = (LPVOID)((BYTE*)malloc(Size)); + + if (BufferCopy == NULL) + { + DoOutputDebugString("DumpMemory: Failed to allocate memory for buffer copy.\n"); + return FALSE; + } + + __try + { + memcpy(BufferCopy, Buffer, Size); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputDebugString("DumpMemory: Exception occured reading memory address 0x%x\n", Buffer); + return 0; + } + + if (FALSE == WriteFile(hOutputFile, BufferCopy, Size, &dwBytesWritten, NULL)) { - DoOutputDebugString("WriteFile error on CAPE output file"); - free(OutputFilename); free(FullPathName); + DoOutputErrorString("DumpMemory: WriteFile error on CAPE output file"); + free(FullPathName); + free(BufferCopy); return 0; } - DoOutputDebugString("CAPE output filename: %s", FullPathName); - CloseHandle(hOutputFile); + + CapeMetaData->Address = Buffer; + CapeMetaData->Size = Size; CapeOutputFile(FullPathName); // We can free the filename buffers - free(OutputFilename); free(FullPathName); + free(FullPathName); + free(BufferCopy); + + ExtractionClearAll(); return 1; } @@ -579,8 +1392,9 @@ int DumpMemory(LPCVOID Buffer, unsigned int Size) int DumpCurrentProcessFixImports(DWORD NewEP) //************************************************************************************** { - if (ScyllaDumpCurrentProcessFixImports(NewEP)) + if (DumpCount < DUMP_MAX && ScyllaDumpCurrentProcessFixImports(NewEP)) { + DumpCount++; return 1; } @@ -591,8 +1405,9 @@ int DumpCurrentProcessFixImports(DWORD NewEP) int DumpCurrentProcessNewEP(DWORD NewEP) //************************************************************************************** { - if (ScyllaDumpCurrentProcess(NewEP)) + if (DumpCount < DUMP_MAX && ScyllaDumpCurrentProcess(NewEP)) { + DumpCount++; return 1; } @@ -603,8 +1418,9 @@ int DumpCurrentProcessNewEP(DWORD NewEP) int DumpCurrentProcess() //************************************************************************************** { - if (ScyllaDumpCurrentProcess(0)) + if (DumpCount < DUMP_MAX && ScyllaDumpCurrentProcess(0)) { + DumpCount++; return 1; } @@ -612,11 +1428,15 @@ int DumpCurrentProcess() } //************************************************************************************** -int DumpProcess(HANDLE hProcess, DWORD_PTR ImageBase) +int DumpModuleInCurrentProcess(DWORD_PTR ModuleBase) //************************************************************************************** { - if (ScyllaDumpProcess(hProcess, ImageBase, 0)) + SetCapeMetaData(EXTRACTION_PE, 0, NULL, (PVOID)ModuleBase); + + if (DumpCount < DUMP_MAX && ScyllaDumpProcess(GetCurrentProcess(), ModuleBase, 0)) { + ExtractionClearAll(); + DumpCount++; return 1; } @@ -624,25 +1444,167 @@ int DumpProcess(HANDLE hProcess, DWORD_PTR ImageBase) } //************************************************************************************** -int DumpPE(LPCVOID Buffer) +int DumpImageInCurrentProcess(DWORD_PTR ImageBase) +//************************************************************************************** +{ + PIMAGE_DOS_HEADER pDosHeader; + PIMAGE_NT_HEADERS pNtHeader; + + pDosHeader = (PIMAGE_DOS_HEADER)ImageBase; + + if (DumpCount >= DUMP_MAX) + { + DoOutputDebugString("DumpImageInCurrentProcess: CAPE dump limit reached.\n"); + return 0; + } + + if (*(WORD*)ImageBase != IMAGE_DOS_SIGNATURE) + { + DoOutputDebugString("DumpImageInCurrentProcess: No DOS signature in header.\n"); + return 0; + } + + if (!pDosHeader->e_lfanew || pDosHeader->e_lfanew > PE_HEADER_LIMIT) + { + DoOutputDebugString("DumpImageInCurrentProcess: bad e_lfanew.\n"); + return 0; + } + + pNtHeader = (PIMAGE_NT_HEADERS)((PCHAR)pDosHeader + (ULONG)pDosHeader->e_lfanew); + + if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) + { + // No 'PE' header + DoOutputDebugString("DumpImageInCurrentProcess: Invalid PE signature in header.\n"); + return 0; + } + + if ((pNtHeader->FileHeader.Machine == 0) || (pNtHeader->FileHeader.SizeOfOptionalHeader == 0 || pNtHeader->OptionalHeader.SizeOfHeaders == 0)) + { + // Basic requirements + DoOutputDebugString("DumpImageInCurrentProcess: PE image invalid.\n"); + return 0; + } + + if (IsPeImageVirtual(ImageBase) == FALSE) + { + DoOutputDebugString("DumpImageInCurrentProcess: Attempting to dump 'raw' PE image.\n"); + + if (ScyllaDumpPE(ImageBase)) + { + DumpCount++; + return 1; + } + else + { + // failed to dump pe image + DoOutputDebugString("DumpImageInCurrentProcess: Failed to dump 'raw' PE image.\n"); + return 0; + } + } + + DoOutputDebugString("DumpImageInCurrentProcess: Attempting to dump virtual PE image.\n"); + + if (!ScyllaDumpProcess(GetCurrentProcess(), ImageBase, 0)) + { + DoOutputDebugString("DumpImageInCurrentProcess: Failed to dump PE as virtual image.\n"); + return 0; + } + + DumpCount++; + return 1; +} + +//************************************************************************************** +int DumpProcess(HANDLE hProcess, DWORD_PTR ImageBase) //************************************************************************************** { - if (ScyllaDumpPE((DWORD_PTR)Buffer)) + if (DumpCount < DUMP_MAX && ScyllaDumpProcess(hProcess, ImageBase, 0)) { + DumpCount++; return 1; } return 0; } +//************************************************************************************** +int DumpPE(LPVOID Buffer) +//************************************************************************************** +{ + SetCapeMetaData(EXTRACTION_PE, 0, NULL, (PVOID)Buffer); + + if (DumpCount < DUMP_MAX && ScyllaDumpPE((DWORD_PTR)Buffer)) + { + ExtractionClearAll(); + DumpCount++; + return 1; + } + + return 0; +} + +//************************************************************************************** +int RoutineProcessDump() +//************************************************************************************** +{ + if (g_config.procmemdump && ProcessDumped == FALSE) + { + ProcessDumped = TRUE; // this prevents a second call before the first is complete + if (g_config.import_reconstruction) + { + if (base_of_dll_of_interest) + ProcessDumped = ScyllaDumpProcessFixImports(GetCurrentProcess(), base_of_dll_of_interest, 0); + else + ProcessDumped = ScyllaDumpCurrentProcessFixImports(0); + } + else + { + if (base_of_dll_of_interest) + ProcessDumped = ScyllaDumpProcess(GetCurrentProcess(), base_of_dll_of_interest, 0); + else + ProcessDumped = ScyllaDumpCurrentProcess(0); + } + } + + return ProcessDumped; +} + void init_CAPE() { // Initialise CAPE global variables // +#ifndef STANDALONE + CapeMetaData = (PCAPEMETADATA)malloc(sizeof(CAPEMETADATA)); + CapeMetaData->Pid = GetCurrentProcessId(); + CapeMetaData->ProcessPath = (char*)malloc(MAX_PATH); + WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, (LPCWSTR)our_process_path, wcslen(our_process_path)+1, CapeMetaData->ProcessPath, MAX_PATH, NULL, NULL); + + // Specific to Extraction package: + CapeMetaData->DumpType = EXTRACTION_PE; + CapeMetaData->Address = NULL; -#ifndef _WIN64 - // Start the debugger thread if required - //launch_debugger(); + DumpCount = 0; + + // This flag controls whether a dump is automatically + // made at the end of a process' lifetime. + // It is normally only set in the base packages, + // or upon submission. (This overrides submission.) + // g_config.procmemdump = 0; + + // Cuckoo debug output level for development (0=none, 2=max) + // g_config.debug = 2; +#endif + + // Start the debugger thread + // if required by package + if (DEBUGGER_ENABLED) + launch_debugger(); + +#ifdef _WIN64 + DoOutputDebugString("CAPE initialised (64-bit).\n"); +#else + DoOutputDebugString("CAPE initialised (32-bit).\n"); #endif return; diff --git a/CAPE/CAPE.h b/CAPE/CAPE.h index 50d378b..f5dcf24 100644 --- a/CAPE/CAPE.h +++ b/CAPE/CAPE.h @@ -1,12 +1,41 @@ -extern HMODULE s_hInst; -extern WCHAR s_wzDllPath[MAX_PATH]; -extern CHAR s_szDllPath[MAX_PATH]; -extern int DumpCurrentProcessNewEP(DWORD NewEP); -extern int DumpCurrentProcess(); -extern int DumpProcess(HANDLE hProcess, DWORD_PTR ImageBase); -extern int DumpPE(LPCVOID Buffer); -extern int ScyllaDumpPE(DWORD_PTR Buffer); -unsigned int DumpSize; +//Global switch for debugger +#define DEBUGGER_ENABLED 1 +#define GUARD_PAGES_ENABLED 0 + +typedef struct InjectionSectionView +{ + HANDLE SectionHandle; + PVOID LocalView; + SIZE_T ViewSize; + int TargetProcessId; + struct InjectionSectionView *NextSectionView; +} INJECTIONSECTIONVIEW, *PINJECTIONSECTIONVIEW; + +PINJECTIONSECTIONVIEW AddSectionView(HANDLE SectionHandle, PVOID LocalView, SIZE_T ViewSize); +PINJECTIONSECTIONVIEW GetSectionView(HANDLE SectionHandle); +BOOL DropSectionView(PINJECTIONSECTIONVIEW SectionView); + +typedef struct InjectionInfo +{ + int ProcessId; + HANDLE ProcessHandle; + DWORD_PTR ImageBase; + DWORD_PTR EntryPoint; + BOOL WriteDetected; + BOOL ImageDumped; + LPVOID BufferBase; + unsigned int BufferSizeOfImage; + HANDLE SectionHandle; +// struct InjectionSectionView *SectionViewList; + struct InjectionInfo *NextInjectionInfo; +} INJECTIONINFO, *PINJECTIONINFO; + +struct InjectionInfo *InjectionInfoList; + +PINJECTIONINFO GetInjectionInfo(DWORD ProcessId); +PINJECTIONINFO CreateInjectionInfo(DWORD ProcessId); + +struct InjectionSectionView *SectionViewList; // // MessageId: STATUS_SUCCESS @@ -34,3 +63,65 @@ unsigned int DumpSize; #define DATA 0 #define EXECUTABLE 1 +#define DLL 2 + +#define PLUGX_SIGNATURE 0x5658 // 'XV' +#define PE_HEADER_LIMIT 0x200 // Range to look for PE header within candidate buffer + +typedef struct CapeMetadata +{ + char* ProcessPath; + char* ModulePath; + DWORD Pid; + DWORD DumpType; + char* TargetProcess; // For injection + DWORD TargetPid; // " + PVOID Address; // For shellcode/modules + SIZE_T Size; // " +} CAPEMETADATA, *PCAPEMETADATA; + +struct CapeMetadata *CapeMetaData; + +BOOL SetCapeMetaData(DWORD DumpType, DWORD TargetPid, HANDLE hTargetProcess, PVOID Address); + +enum { + PROCDUMP = 0, + + COMPRESSION = 1, + + INJECTION_PE = 3, + INJECTION_SHELLCODE = 4, + //INJECTION_RUNPE = 5, + + EXTRACTION_PE = 8, + EXTRACTION_SHELLCODE = 9, + + PLUGX_PAYLOAD = 0x10, + PLUGX_CONFIG = 0x11, + + EVILGRAB_PAYLOAD = 0x14, + EVILGRAB_DATA = 0x15 +}; + +extern HMODULE s_hInst; +extern WCHAR s_wzDllPath[MAX_PATH]; +extern CHAR s_szDllPath[MAX_PATH]; +BOOL TranslatePathFromDeviceToLetter(__in TCHAR *DeviceFilePath, __out TCHAR* DriveLetterFilePath, __inout LPDWORD lpdwBufferSize); +int DumpMemory(LPVOID Buffer, unsigned int Size); +BOOL DumpPEsInRange(LPVOID Buffer, SIZE_T Size); +int DumpCurrentProcessNewEP(DWORD NewEP); +int DumpCurrentProcess(); +int DumpProcess(HANDLE hProcess, DWORD_PTR ImageBase); +int DumpPE(LPVOID Buffer); +int ScyllaDumpPE(DWORD_PTR Buffer); +int ScanForNonZero(LPVOID Buffer, unsigned int Size); +int ScanPageForNonZero(LPVOID Address); +int ScanForPE(LPVOID Buffer, unsigned int Size, LPVOID* Offset); +int ScanForDisguisedPE(LPVOID Buffer, unsigned int Size, LPVOID* Offset); +int IsDisguisedPE(LPVOID Buffer, unsigned int Size); +int DumpImageInCurrentProcess(DWORD_PTR ImageBase); +void DumpSectionViewsForPid(DWORD Pid); +unsigned int DumpSize; +SYSTEM_INFO SystemInfo; + +HANDLE EvilGrabRegHandle; diff --git a/CAPE/CAPE_Extraction.c b/CAPE/CAPE_Extraction.c new file mode 100644 index 0000000..067f827 --- /dev/null +++ b/CAPE/CAPE_Extraction.c @@ -0,0 +1,1307 @@ +/* +CAPE - Config And Payload Extraction +Copyright(C) 2015, 2016 Context Information Security. (kevin.oreilly@contextis.com) + +This program is free software : you can redistribute it and / or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program.If not, see . +*/ +#include +#include "Debugger.h" +#include "CAPE.h" + +#define PE_HEADER_LIMIT 0x200 +#define ESTIMATED_LOOP_DELTA 0x50 + +extern ULONG_PTR g_our_dll_base; +extern DWORD g_our_dll_size; + +extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); +extern void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); + +extern unsigned int address_is_in_stack(DWORD Address); + +extern BOOL DumpPEsInRange(LPVOID Buffer, SIZE_T Size); +extern int DumpMemory(LPVOID Buffer, unsigned int Size); +extern int ScanForPE(LPVOID Buffer, unsigned int Size, LPVOID* Offset); +extern int ScanPageForNonZero(LPVOID Address); + +SIZE_T AllocationSize; +PVOID AllocationBase; + +PVOID *pAllocationBase; +PSIZE_T pRegionSize; + +PGUARDPAGES GuardedPagesToStep; + +BOOL AllocationWriteDetected; +BOOL PeImageDetected; +BOOL AllocationDumped; +BOOL AllocationBaseWriteBpSet; +BOOL AllocationBaseExecBpSet; +BOOL EntryPointExecBpSet; +static unsigned int EPBPRegister; + +static DWORD_PTR BasePointer, FirstEIP, LastEIP, CurrentEIP, LastDelta, TotalDelta, DeltaMax, LoopDeltaMax; + +BOOL MidPageExecCallback(PBREAKPOINTINFO pBreakpointInfo, struct _EXCEPTION_POINTERS* ExceptionInfo); +BOOL SetInitialWriteBreakpoint(PVOID *Address, SIZE_T RegionSize); +BOOL SetMidPageBreakpoint(PVOID *Address, SIZE_T Size); + +void ExtractionClearAll(void) +{ + if (AllocationBase && AllocationSize) + ClearBreakpointsInRange(GetCurrentThreadId(), AllocationBase, AllocationSize); + + AllocationSize = 0; + AllocationBase = NULL; + CapeMetaData->Address = NULL; + + + AllocationWriteDetected = FALSE; + PeImageDetected = FALSE; + AllocationBaseExecBpSet = FALSE; + EntryPointExecBpSet = FALSE; + + return; +} + +#ifndef _WIN64 +BOOL Trace(struct _EXCEPTION_POINTERS* ExceptionInfo) +{ + if (LastEIP) + { + CurrentEIP = ExceptionInfo->ContextRecord->Eip; + + if (CurrentEIP > LastEIP) + { + LastDelta = (unsigned int)(CurrentEIP - LastEIP); + } + else + { + LastDelta = (unsigned int)(LastEIP - CurrentEIP); + } + + if (CurrentEIP > FirstEIP) + { + TotalDelta = (unsigned int)(CurrentEIP - FirstEIP); + + if ((unsigned int)(CurrentEIP - FirstEIP) > DeltaMax) + DeltaMax = (unsigned int)(CurrentEIP - FirstEIP); + + if (LoopDeltaMax && DeltaMax > LoopDeltaMax && ExceptionInfo->ContextRecord->Ebp == BasePointer) + // attempt dump as writing may have ended + { + SetCapeMetaData(EXTRACTION_PE, 0, NULL, AllocationBase); + + if (!AllocationDumped && DumpPEsInRange(AllocationBase, AllocationSize)) + { + AllocationDumped = TRUE; + DoOutputDebugString("Trace: successfully dumped from loop end at 0x%x.\n", CurrentEIP); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + return TRUE; + } + else + { + DoOutputDebugString("Trace: failed to dump PE module from loop end at 0x%x (loop delta 0x%x).\n", CurrentEIP, (unsigned int)(CurrentEIP - FirstEIP)); + return FALSE; + } + } + } + else + { + TotalDelta = (unsigned int)(FirstEIP - CurrentEIP); + + if (DeltaMax && DeltaMax > LoopDeltaMax) + LoopDeltaMax = DeltaMax; + } + + // attempt dump as probably not in a loop, writing may have ended + if (TotalDelta > ESTIMATED_LOOP_DELTA && ExceptionInfo->ContextRecord->Ebp <= BasePointer) + { + SetCapeMetaData(EXTRACTION_PE, 0, NULL, AllocationBase); + + if (!AllocationDumped && DumpPEsInRange(AllocationBase, AllocationSize)) + { + AllocationDumped = TRUE; + DoOutputDebugString("Trace: successfully dumped module 0x%x bytes after last write, EIP: 0x%x\n", TotalDelta, CurrentEIP); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + return TRUE; + } + else + { + DoOutputDebugString("Trace: failed to dump PE module 0x%x bytes after last write, EIP: 0x%x", TotalDelta, CurrentEIP); + return FALSE; + } + } + else if (!LastDelta) + { + //DoOutputDebugString("Trace: repeating instruction at 0x%x.\n", CurrentEIP); + SetSingleStepMode(ExceptionInfo->ContextRecord, Trace); + } + else + { + LastEIP = CurrentEIP; + //DoOutputDebugString("Trace: next instruction at 0x%x.\n", CurrentEIP); + SetSingleStepMode(ExceptionInfo->ContextRecord, Trace); + } + + return TRUE; + } + else + { + LastEIP = ExceptionInfo->ContextRecord->Eip; + BasePointer = ExceptionInfo->ContextRecord->Ebp; + FirstEIP = LastEIP; + DeltaMax = 0; + LoopDeltaMax = 0; + + DoOutputDebugString("Entering single-step mode at 0x%x.\n", FirstEIP); + SetSingleStepMode(ExceptionInfo->ContextRecord, Trace); + return TRUE; + } +} +#endif + +//************************************************************************************** +void AllocationHandler(PVOID BaseAddress, SIZE_T RegionSize, ULONG AllocationType, ULONG Protect) +//************************************************************************************** +{ + MEMORY_BASIC_INFORMATION meminfo; + PGUARDPAGES CurrentGuardPages; + + if (!DebuggerInitialised) + return; + + if (RegionSize < EXTRACTION_MIN_SIZE) + return; + + // Whether we limit tracking to executable regions + if (!(Protect & EXECUTABLE_FLAGS)) + return; + + DoOutputDebugString("NtAllocateVirtualMemory hook, BaseAddress:0x%x, RegionSize: 0x%x.\n", BaseAddress, RegionSize); + + CurrentGuardPages = GuardPageList; + + while (CurrentGuardPages) + { + if (!CurrentGuardPages->PagesDumped && CurrentGuardPages->ReadDetected && CurrentGuardPages->WriteDetected) + CurrentGuardPages->PagesDumped = DumpPEsInRange(CurrentGuardPages->BaseAddress, CurrentGuardPages->RegionSize); + + if (CurrentGuardPages->PagesDumped) + { + DoOutputDebugString("NtAllocateVirtualMemory hook: PE image(s) within CAPE guarded pages detected and dumped.\n"); + ExtractionClearAll(); + } + + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + if (AllocationBase && AllocationSize && !AllocationDumped) + { + if (AllocationBaseWriteBpSet == FALSE && AllocationType & MEM_COMMIT && (BaseAddress == AllocationBase)) + { // if memory was previously reserved but not committed + SetInitialWriteBreakpoint(AllocationBase, AllocationSize); + } + else + { + DoOutputDebugString("NtAllocateVirtualMemory hook: attempting CAPE dump on previous region: 0x%x.\n", AllocationBase); + + memset(&meminfo, 0, sizeof(meminfo)); + + if (!VirtualQuery(AllocationBase, &meminfo, sizeof(meminfo))) + { + DoOutputErrorString("NtAllocateVirtualMemory hook: unable to query memory region 0x%x", AllocationBase); + } + else + { + AllocationDumped = DumpPEsInRange(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + { + DoOutputDebugString("NtAllocateVirtualMemory hook: PE image(s) detected and dumped.\n"); + ExtractionClearAll(); + } + else + { + SetCapeMetaData(EXTRACTION_SHELLCODE, 0, NULL, meminfo.AllocationBase); + + DoOutputDebugString("NtAllocateVirtualMemory hook: dumping memory range at 0x%x.\n", AllocationBase); + + if (ScanForNonZero(meminfo.AllocationBase, meminfo.RegionSize)) + AllocationDumped = DumpMemory(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + ExtractionClearAll(); + else + DoOutputDebugString("NtAllocateVirtualMemory hook: Failed to dump memory range at 0x%x.\n", AllocationBase); + } + + if (!AllocationDumped) + { + DoOutputDebugString("NtAllocateVirtualMemory hook: Previously marked memory range at: 0x%x is empty or inaccessible.\n", AllocationBase); + ExtractionClearAll(); + } + + // set breakpoints on new region + if (AllocationType & MEM_COMMIT) + // Allocation committed, we set an initial write bp + SetInitialWriteBreakpoint(BaseAddress, RegionSize); + else if (AllocationType & MEM_RESERVE) + { // Allocation not committed, so we can't set a bp yet + AllocationBaseWriteBpSet = FALSE; + AllocationBase = BaseAddress; + AllocationSize = RegionSize; + DoOutputDebugString("NtAllocateVirtualMemory hook: Memory reserved but not committed at 0x%x.\n", AllocationBase); + } + } + } + } + else if (AllocationType & MEM_COMMIT) + // Allocation committed, we set an initial write bp + SetInitialWriteBreakpoint(BaseAddress, RegionSize); + else if (AllocationType & MEM_RESERVE) + { // Allocation not committed, so we can't set a bp yet + AllocationBaseWriteBpSet = FALSE; + AllocationBase = BaseAddress; + AllocationSize = RegionSize; + DoOutputDebugString("NtAllocateVirtualMemory hook: Memory reserved but not committed at 0x%x.\n", AllocationBase); + } +} + +//************************************************************************************** +void ProtectionHandler(PVOID Address, SIZE_T RegionSize, ULONG Protect) +//************************************************************************************** +{ + MEMORY_BASIC_INFORMATION meminfo; + PGUARDPAGES CurrentGuardPages; + int Register; + BOOL GuardedPages = FALSE; + + if (!DebuggerInitialised) + return; + + if (RegionSize < EXTRACTION_MIN_SIZE) + return; + + if (!(Protect & EXECUTABLE_FLAGS)) + return; + + DoOutputDebugString("ProtectionHandler: Address: 0x%x, RegionSize: 0x%x\n", Address, RegionSize); + + if (!VirtualQuery(Address, &meminfo, sizeof(MEMORY_BASIC_INFORMATION))) + { + DoOutputErrorString("ProtectionHandler: unable to query memory region 0x%x", Address); + return; + } + + CurrentGuardPages = GuardPageList; + + while (CurrentGuardPages) + { + if (!CurrentGuardPages->PagesDumped && CurrentGuardPages->ReadDetected && CurrentGuardPages->WriteDetected) + CurrentGuardPages->PagesDumped = DumpPEsInRange(CurrentGuardPages->BaseAddress, CurrentGuardPages->RegionSize); + + if (CurrentGuardPages->PagesDumped) + { + DoOutputDebugString("ProtectionHandler: PE image(s) within CAPE guarded pages detected and dumped.\n"); + ExtractionClearAll(); + } + + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + if (AllocationBase == 0) + { + if (Address == meminfo.BaseAddress) + { + // we check if the buffer has already been written to + if (ScanForNonZero(meminfo.AllocationBase, RegionSize + (BYTE*)Address - (BYTE*)meminfo.AllocationBase)) + { + if (DumpPEsInRange(meminfo.AllocationBase, RegionSize + (BYTE*)Address - (BYTE*)meminfo.AllocationBase)) + { + DoOutputDebugString("ProtectionHandler: PE image(s) detected and dumped.\n"); + ExtractionClearAll(); + } + else if (SetNextAvailableBreakpoint(GetCurrentThreadId(), &Register, 0, (BYTE*)Address, BP_EXEC, MidPageExecCallback)) + { + AllocationBaseExecBpSet = TRUE; + AllocationBase = Address; + AllocationSize = RegionSize; + DoOutputDebugString("ProtectionHandler: Execution breakpoint %d set base address: 0x%x, AllocationBaseExecBpSet = %d\n", Register, Address, AllocationBaseExecBpSet); + } + else + { + DoOutputDebugString("ProtectionHandler: SetNextAvailableBreakpoint failed to set exec bp on allocation base.\n"); + return; + } + } + else // looks like it's still an empty buffer + { + DoOutputDebugString("ProtectionHandler: Setting initial write breakpoint on protection address: 0x%x\n", Address); + SetInitialWriteBreakpoint(Address, RegionSize); + } + } + else + { + DoOutputDebugString("ProtectionHandler: Setting mid-page exec breakpoint on protection address: 0x%x\n", Address); + SetMidPageBreakpoint(Address, RegionSize); + } + } + else if (AllocationWriteDetected && AllocationBase && AllocationSize && !AllocationDumped) + { + DoOutputDebugString("ProtectionHandler: attempting CAPE dump on region: 0x%x.\n", AllocationBase); + + AllocationDumped = DumpPEsInRange(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + { + DoOutputDebugString("ProtectionHandler: PE image(s) detected and dumped.\n"); + ExtractionClearAll(); + } + else + { + SetCapeMetaData(EXTRACTION_SHELLCODE, 0, NULL, meminfo.AllocationBase); + + AllocationDumped = DumpMemory(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + { + DoOutputDebugString("ProtectionHandler: successfully dumped memory range at 0x%x.\n", AllocationBase); + ExtractionClearAll(); + } + } + + if (!AllocationDumped) + { + DoOutputDebugString("ProtectionHandler: Previously marked memory range at: 0x%x is empty or inaccessible.\n", AllocationBase); + ExtractionClearAll(); + } + + if ((DWORD_PTR)Address < (DWORD_PTR)AllocationBase || (DWORD_PTR)Address >= ((DWORD_PTR)AllocationBase + AllocationSize)) + { + // we check if the buffer has already been written to + if (ScanForNonZero(Address, RegionSize)) + { + // We want to switch our 'Allocation' pointers to this region, + // so let's dump anything in the previous region + AllocationDumped = DumpPEsInRange(meminfo.AllocationBase, meminfo.RegionSize); + if (AllocationDumped) + { + DoOutputDebugString("ProtectionHandler: Found and dumped PE image(s).\n"); + ExtractionClearAll(); + } + + // Now we set up our new breakpoint + if (SetNextAvailableBreakpoint(GetCurrentThreadId(), &Register, 0, (BYTE*)Address, BP_EXEC, MidPageExecCallback)) + { + AllocationBaseExecBpSet = TRUE; + AllocationBase = Address; + AllocationSize = RegionSize; + DoOutputDebugString("ProtectionHandler: Execution breakpoint %d set base address: 0x%x, AllocationBaseExecBpSet = %d\n", Register, Address, AllocationBaseExecBpSet); + } + else + { + DoOutputDebugString("ProtectionHandler: SetNextAvailableBreakpoint failed to set exec bp on allocation base.\n"); + return; + } + } + else // looks like it's still an empty buffer + { + DoOutputDebugString("ProtectionHandler: Setting initial write breakpoint on protection address: 0x%x\n", Address); + + SetInitialWriteBreakpoint(Address, RegionSize); + } + } + } +} + +//************************************************************************************** +void FreeHandler(PVOID BaseAddress, SIZE_T RegionSize) +//************************************************************************************** +{ + if (BaseAddress == AllocationBase) + { + // we check if the buffer has been written to + if (RegionSize && ScanForNonZero(BaseAddress, RegionSize)) + { + // We want to switch our 'Allocation' pointers to this region, + // so let's dump anything in the previous region + AllocationDumped = DumpPEsInRange(BaseAddress, RegionSize); + + if (AllocationDumped) + { + DoOutputDebugString("FreeHandler: Found and dumped PE image(s).\n"); + ExtractionClearAll(); + } + else + { + SetCapeMetaData(EXTRACTION_SHELLCODE, 0, NULL, BaseAddress); + + AllocationDumped = DumpMemory(BaseAddress, RegionSize); + + if (AllocationDumped) + DoOutputDebugString("FreeHandler: dumped executable memory range at 0x%x prior to its freeing.\n", BaseAddress); + else + DoOutputDebugString("FreeHandler: failed to dump executable memory range at 0x%x prior to its freeing.\n", BaseAddress); + } + } + + DoOutputDebugString("FreeHandler: Clearing breakpoints in range 0x%x - 0x%x.\n", BaseAddress, (char*)BaseAddress + RegionSize); + ExtractionClearAll(); + } +} + +//************************************************************************************** +void TerminateHandler(void) +//************************************************************************************** +{ + MEMORY_BASIC_INFORMATION meminfo; + + if (AllocationBase && AllocationSize && !AllocationDumped) + { + memset(&meminfo, 0, sizeof(meminfo)); + + if (!VirtualQuery(AllocationBase, &meminfo, sizeof(meminfo))) + { + DoOutputErrorString("TerminateHandler: unable to query memory region 0x%x", AllocationBase); + } + else + { + AllocationDumped = DumpPEsInRange(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + { + DoOutputDebugString("TerminateHandler: PE image(s) detected and dumped.\n"); + ExtractionClearAll(); + } + else + { + SetCapeMetaData(EXTRACTION_SHELLCODE, 0, NULL, meminfo.AllocationBase); + + AllocationDumped = DumpMemory(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + { + DoOutputDebugString("TerminateHandler: successfully dumped memory range at 0x%x.\n", AllocationBase); + ExtractionClearAll(); + } + } + + if (!AllocationDumped) + { + DoOutputDebugString("TerminateHandler: Previously marked memory range at: 0x%x is empty or inaccessible.\n", AllocationBase); + ExtractionClearAll(); + } + } + } +} + +//************************************************************************************** +BOOL StepOverGuardPageFault(struct _EXCEPTION_POINTERS* ExceptionInfo) +//************************************************************************************** +{ + PGUARDPAGES CurrentGuardPages = GuardedPagesToStep; + + if (LastEIP) + { +#ifdef _WIN64 + CurrentEIP = ExceptionInfo->ContextRecord->Rip; +#else + CurrentEIP = ExceptionInfo->ContextRecord->Eip; +#endif + + if (CurrentEIP == LastEIP) + { + // We want to keep stepping until we're past the instruction + SetSingleStepMode(ExceptionInfo->ContextRecord, StepOverGuardPageFault); + return TRUE; + } + else + { + if (CurrentGuardPages == NULL) + { + DoOutputDebugString("StepOverGuardPageFault error: GuardedPagesToStep not set.\n"); + return FALSE; + } + + if (ReinstateGuardPages(CurrentGuardPages)) + { + //DoOutputDebugString("StepOverGuardPageFault: Reinstated page guard.\n"); + GuardedPagesToStep = NULL; + LastEIP = (DWORD_PTR)NULL; + CurrentEIP = (DWORD_PTR)NULL; + return TRUE; + } + + DoOutputDebugString("StepOverGuardPageFault: Failed to reinstate page guard.\n"); + return FALSE; + } + } + else + { +#ifdef _WIN64 + LastEIP = ExceptionInfo->ContextRecord->Rip; +#else + LastEIP = ExceptionInfo->ContextRecord->Eip; +#endif + + if (CurrentGuardPages->LastWriteAddress) + { + if (!SystemInfo.dwPageSize) + GetSystemInfo(&SystemInfo); + + // we want to flag writes that occur beyond the first page + if (ScanPageForNonZero(CurrentGuardPages->LastWriteAddress) && (DWORD_PTR)CurrentGuardPages->LastWriteAddress >= (DWORD_PTR)CurrentGuardPages->BaseAddress + SystemInfo.dwPageSize) + { + if (!CurrentGuardPages->WriteDetected) + { + DoOutputDebugString("StepOverGuardPageFault: DEBUG trigger write to 0x%x, base 0x%x, pagesize 0x%x.\n", CurrentGuardPages->LastWriteAddress, CurrentGuardPages->BaseAddress, SystemInfo.dwPageSize); + CurrentGuardPages->WriteDetected = TRUE; + + // we only care about reads that come after writes + CurrentGuardPages->ReadDetected = FALSE; + } + } + } + + SetSingleStepMode(ExceptionInfo->ContextRecord, StepOverGuardPageFault); + return TRUE; + } +} + +//************************************************************************************** +BOOL ExtractionGuardPageHandler(struct _EXCEPTION_POINTERS* ExceptionInfo) +//************************************************************************************** +{ + DWORD AccessType = (DWORD)ExceptionInfo->ExceptionRecord->ExceptionInformation[0]; + PVOID AccessAddress = (PVOID)ExceptionInfo->ExceptionRecord->ExceptionInformation[1]; + PVOID FaultingAddress = (PVOID)ExceptionInfo->ExceptionRecord->ExceptionAddress; + + PGUARDPAGES CurrentGuardPages = GetGuardPages(AccessAddress); + + if (CurrentGuardPages == NULL) + { + DoOutputDebugString("ExtractionGuardPageHandler error: address 0x%x not in guarded pages.\n", AccessAddress); + return FALSE; + } + + switch (AccessType) + { + case EXCEPTION_WRITE_FAULT: + + //DoOutputDebugString("ExtractionGuardPageHandler: Write detected at 0x%x by 0x%x\n", AccessAddress, FaultingAddress); + + CurrentGuardPages->LastWriteAddress = AccessAddress; + + GuardedPagesToStep = CurrentGuardPages; + + SetSingleStepMode(ExceptionInfo->ContextRecord, StepOverGuardPageFault); + + break; + + case EXCEPTION_READ_FAULT: + + if (CurrentGuardPages->WriteDetected) + { + if (!(CurrentGuardPages->Protect & (PAGE_EXECUTE_READWRITE || PAGE_EXECUTE_READ || PAGE_EXECUTE)) && !CurrentGuardPages->PagesDumped && !CurrentGuardPages->ReadDetected) + { + DoOutputDebugString("ExtractionGuardPageHandler: Read detected after previous write at 0x%x by 0x%x\n", AccessAddress, FaultingAddress); + + if (DisableGuardPages(CurrentGuardPages)) + { + CurrentGuardPages->PagesDumped = DumpPEsInRange(CurrentGuardPages->BaseAddress, CurrentGuardPages->RegionSize); + if (CurrentGuardPages->PagesDumped) + DoOutputDebugString("ExtractionGuardPageHandler: PE image(s) detected and dumped.\n"); + } + else + { + DoOutputDebugString("ExtractionGuardPageHandler: Failed to disable guard pages for dump.\n"); + } + + // if dumping failed (for example, because of an incomplete image) + // we want to re-enable guard pages so we can try again + //if (!CurrentGuardPages->PagesDumped) + //{ + // ReinstateGuardPages(CurrentGuardPages); + //} + } + } + + CurrentGuardPages->ReadDetected = TRUE; + CurrentGuardPages->LastReadBy = FaultingAddress; + + break; + + case EXCEPTION_EXECUTE_FAULT: + + DoOutputDebugString("ExtractionGuardPageHandler: Execution detected at 0x%x by 0x%x\n", AccessAddress, FaultingAddress); + + if (!(CurrentGuardPages->Protect & (PAGE_EXECUTE_READWRITE || PAGE_EXECUTE_READ || PAGE_EXECUTE))) + { + DoOutputDebugString("ExtractionGuardPageHandler: Anomaly detected - pages not marked with execute flag in guarded pages list.\n"); + } + + if (!CurrentGuardPages->PagesDumped) + { + DoOutputDebugString("ExtractionGuardPageHandler: Execution within guarded page detected, dumping.\n"); + + if (DisableGuardPages(CurrentGuardPages)) + { + CurrentGuardPages->PagesDumped = DumpPEsInRange(CurrentGuardPages->BaseAddress, CurrentGuardPages->RegionSize); + if (CurrentGuardPages->PagesDumped) + DoOutputDebugString("ExtractionGuardPageHandler: PE image(s) detected and dumped.\n"); + else + { + SetCapeMetaData(EXTRACTION_SHELLCODE, 0, NULL, CurrentGuardPages->BaseAddress); + + CurrentGuardPages->PagesDumped = DumpMemory(CurrentGuardPages->BaseAddress, CurrentGuardPages->RegionSize); + + if (CurrentGuardPages->PagesDumped) + DoOutputDebugString("ExtractionGuardPageHandler: shellcode detected and dumped.\n"); + else + DoOutputDebugString("ExtractionGuardPageHandler: failed to dump detected shellcode.\n"); + } + } + else + { + DoOutputDebugString("ExtractionGuardPageHandler: Failed to disable guard pages for dump.\n"); + } + } + + break; + + default: + DoOutputDebugString("ExtractionGuardPageHandler: Unknown access type: 0x%x - error.\n", AccessType); + return FALSE; + } + + return TRUE; +} + +BOOL EntryPointExecCallback(PBREAKPOINTINFO pBreakpointInfo, struct _EXCEPTION_POINTERS* ExceptionInfo) +{ + MEMORY_BASIC_INFORMATION meminfo; + + if (pBreakpointInfo == NULL) + { + DoOutputDebugString("EntryPointExecCallback executed with pBreakpointInfo NULL.\n"); + return FALSE; + } + + if (pBreakpointInfo->ThreadHandle == NULL) + { + DoOutputDebugString("EntryPointExecCallback executed with NULL thread handle.\n"); + return FALSE; + } + + DoOutputDebugString("EntryPointExecCallback: Breakpoint %i at Address 0x%x.\n", pBreakpointInfo->Register, pBreakpointInfo->Address); + + memset(&meminfo, 0, sizeof(meminfo)); + + if (!VirtualQuery(pBreakpointInfo->Address, &meminfo, sizeof(meminfo))) + { + DoOutputErrorString("EntryPointExecCallback: unable to query memory region 0x%x", pBreakpointInfo->Address); + return FALSE; + } + + SetCapeMetaData(EXTRACTION_PE, 0, NULL, meminfo.AllocationBase); + + if (AllocationDumped == TRUE) + { + DoOutputDebugString("EntryPointExecCallback: allocation already dumped, clearing breakpoint.\n"); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + } + else + { + AllocationDumped = DumpPEsInRange(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + { + DoOutputDebugString("EntryPointExecCallback hook: PE image(s) detected and dumped.\n"); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + } + else + { + DoOutputDebugString("EntryPointExecCallback: failed to dump PE module.\n"); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + return FALSE; + } + } + + return TRUE; +} + +BOOL EntryPointWriteCallback(PBREAKPOINTINFO pBreakpointInfo, struct _EXCEPTION_POINTERS* ExceptionInfo) +{ + if (pBreakpointInfo == NULL) + { + DoOutputDebugString("EntryPointWriteCallback executed with pBreakpointInfo NULL.\n"); + return FALSE; + } + + if (pBreakpointInfo->ThreadHandle == NULL) + { + DoOutputDebugString("EntryPointWriteCallback executed with NULL thread handle.\n"); + return FALSE; + } + + DoOutputDebugString("EntryPointWriteCallback: Breakpoint %i at Address 0x%x.\n", pBreakpointInfo->Register, pBreakpointInfo->Address); + + if ((DWORD_PTR)pBreakpointInfo->Address < (DWORD_PTR)AllocationBase || (DWORD_PTR)pBreakpointInfo->Address > (DWORD_PTR)AllocationBase + AllocationSize) + { + DoOutputDebugString("EntryPointWriteCallback: current AddressOfEntryPoint is not within allocated region. We assume it's only partially written and await further writes.\n"); + return TRUE; + } + + if (EntryPointExecBpSet == FALSE) + { + if (ContextSetNextAvailableBreakpoint(ExceptionInfo->ContextRecord, &EPBPRegister, 0, (BYTE*)AllocationBase+*(DWORD*)(pBreakpointInfo->Address), BP_EXEC, EntryPointExecCallback)) + { + EntryPointExecBpSet = TRUE; +#ifdef _WIN64 + DoOutputDebugString("EntryPointWriteCallback: Execution bp %d set on EntryPoint 0x%x (RIP = 0x%x).\n", EPBPRegister, (BYTE*)AllocationBase+*(DWORD*)(pBreakpointInfo->Address), ExceptionInfo->ContextRecord->Rip); +#else + DoOutputDebugString("EntryPointWriteCallback: Execution bp %d set on EntryPoint 0x%x (EIP = 0x%x).\n", EPBPRegister, (BYTE*)AllocationBase+*(DWORD*)(pBreakpointInfo->Address), ExceptionInfo->ContextRecord->Eip); +#endif + } + else + { + DoOutputDebugString("EntryPointWriteCallback: ContextSetNextAvailableBreakpoint on EntryPoint 0x%x failed\n", (BYTE*)AllocationBase+*(DWORD*)(pBreakpointInfo->Address)); + return FALSE; + } + } + else + { + if (ContextSetBreakpoint(ExceptionInfo->ContextRecord, EPBPRegister, 0, (BYTE*)AllocationBase+*(DWORD*)(pBreakpointInfo->Address), BP_EXEC, EntryPointExecCallback)) + { + EntryPointExecBpSet = TRUE; +#ifdef _WIN64 + DoOutputDebugString("EntryPointWriteCallback: Updated EntryPoint execution bp %d to 0x%x (RIP = 0x%x).\n", EPBPRegister, (BYTE*)AllocationBase+*(DWORD*)(pBreakpointInfo->Address), ExceptionInfo->ContextRecord->Rip); +#else + DoOutputDebugString("EntryPointWriteCallback: Updated EntryPoint execution bp %d to 0x%x (EIP = 0x%x).\n", EPBPRegister, (BYTE*)AllocationBase+*(DWORD*)(pBreakpointInfo->Address), ExceptionInfo->ContextRecord->Eip); +#endif + + // since it looks like the writing is happening at most a word at a time, let's try and catch the end of the write for another dump attempt + //SetSingleStepMode(ExceptionInfo->ContextRecord, Trace); + } + else + { + DoOutputDebugString("EntryPointWriteCallback: ContextSetBreakpoint on updated EntryPoint 0x%x failed\n", (BYTE*)AllocationBase+*(DWORD*)(pBreakpointInfo->Address)); + return FALSE; + } + } + + DoOutputDebugString("EntryPointWriteCallback executed successfully.\n"); + + return TRUE; +} + +BOOL PEHeaderWriteCallback(PBREAKPOINTINFO pBreakpointInfo, struct _EXCEPTION_POINTERS* ExceptionInfo) +{ +#ifdef _WIN64 + PIMAGE_NT_HEADERS64 pNtHeader; +#else + PIMAGE_NT_HEADERS32 pNtHeader; +#endif + if (pBreakpointInfo == NULL) + { + DoOutputDebugString("PEHeaderWriteCallback executed with pBreakpointInfo NULL.\n"); + return FALSE; + } + + if (pBreakpointInfo->ThreadHandle == NULL) + { + DoOutputDebugString("PEHeaderWriteCallback executed with NULL thread handle.\n"); + return FALSE; + } + + DoOutputDebugString("PEHeaderWriteCallback: Breakpoint %i at Address 0x%x.\n", pBreakpointInfo->Register, pBreakpointInfo->Address); + + pNtHeader = (PIMAGE_NT_HEADERS)pBreakpointInfo->Address; + + if (*(DWORD*)pNtHeader == IMAGE_NT_SIGNATURE) + { + PeImageDetected = TRUE; + + if (pNtHeader->OptionalHeader.AddressOfEntryPoint && pNtHeader->OptionalHeader.AddressOfEntryPoint < AllocationSize) + { + if (ContextUpdateCurrentBreakpoint(ExceptionInfo->ContextRecord, 0, (BYTE*)AllocationBase+pNtHeader->OptionalHeader.AddressOfEntryPoint, BP_EXEC, EntryPointExecCallback)) + { +#ifdef _WIN64 + DoOutputDebugString("PEHeaderWriteCallback: Execution bp set on EntryPoint 0x%x (RIP = 0x%x).\n", (DWORD_PTR)AllocationBase+pNtHeader->OptionalHeader.AddressOfEntryPoint, ExceptionInfo->ContextRecord->Rip); +#else + DoOutputDebugString("PEHeaderWriteCallback: Execution bp set on EntryPoint 0x%x (EIP = 0x%x).\n", (DWORD_PTR)AllocationBase+pNtHeader->OptionalHeader.AddressOfEntryPoint, ExceptionInfo->ContextRecord->Eip); +#endif + } + else + { + DoOutputDebugString("PEHeaderWriteCallback: ContextUpdateCurrentBreakpoint failed\n"); + ContextClearBreakpoint(ExceptionInfo->ContextRecord, pBreakpointInfo); + return FALSE; + } + } + else + { + if (ContextUpdateCurrentBreakpoint(ExceptionInfo->ContextRecord, sizeof(DWORD), (BYTE*)&(pNtHeader->OptionalHeader.AddressOfEntryPoint), BP_WRITE, EntryPointWriteCallback)) + { +#ifdef _WIN64 + DoOutputDebugString("PEHeaderWriteCallback: set write bp on AddressOfEntryPoint location (RIP = 0x%x).\n", ExceptionInfo->ContextRecord->Rip); +#else + DoOutputDebugString("PEHeaderWriteCallback: set write bp on AddressOfEntryPoint location (EIP = 0x%x).\n", ExceptionInfo->ContextRecord->Eip); +#endif + } + else + { + DoOutputDebugString("PEHeaderWriteCallback: ContextUpdateCurrentBreakpoint failed\n"); + ContextClearBreakpoint(ExceptionInfo->ContextRecord, pBreakpointInfo); + return FALSE; + } + } + } + else + { + DoOutputDebugString("PEHeaderWriteCallback: PE header has: 0x%x.\n", *(DWORD*)pNtHeader); + } + + DoOutputDebugString("PEHeaderWriteCallback executed successfully.\n"); + + return TRUE; +} + +BOOL PEPointerWriteCallback(PBREAKPOINTINFO pBreakpointInfo, struct _EXCEPTION_POINTERS* ExceptionInfo) +{ + long e_lfanew; + + DoOutputDebugString("PEPointerWriteCallback entry.\n"); + + if (pBreakpointInfo == NULL) + { + DoOutputDebugString("PEPointerWriteCallback executed with pBreakpointInfo NULL.\n"); + return FALSE; + } + + if (pBreakpointInfo->ThreadHandle == NULL) + { + DoOutputDebugString("PEPointerWriteCallback executed with NULL thread handle.\n"); + return FALSE; + } + + DoOutputDebugString("PEPointerWriteCallback: Breakpoint %i at Address 0x%x.\n", pBreakpointInfo->Register, pBreakpointInfo->Address); + + e_lfanew = *(long*)((pBreakpointInfo->Address)); + + if ((unsigned int)e_lfanew > PE_HEADER_LIMIT) + { + DoOutputDebugString("PEPointerWriteCallback: pointer to PE header too big: 0x%x (perhaps writing incomplete).\n", e_lfanew); + return FALSE; + } + + SetCapeMetaData(EXTRACTION_PE, 0, NULL, AllocationBase); + + if (e_lfanew && (*(DWORD*)((unsigned char*)AllocationBase+e_lfanew) == IMAGE_NT_SIGNATURE)) + { + if (DumpPEsInRange(AllocationBase, AllocationSize)) + { + AllocationDumped = TRUE; + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + DoOutputDebugString("PEPointerWriteCallback: successfully dumped module.\n"); + return TRUE; + } + else + { + DoOutputDebugString("PEPointerWriteCallback: failed to dump PE module.\n"); + } + } + + if (ContextUpdateCurrentBreakpoint(ExceptionInfo->ContextRecord, sizeof(DWORD), (BYTE*)AllocationBase+e_lfanew, BP_WRITE, PEHeaderWriteCallback)) + { +#ifdef _WIN64 + DoOutputDebugString("PEPointerWriteCallback: set write bp on e_lfanew write location 0x%x (RIP = 0x%x)\n", (BYTE*)AllocationBase + e_lfanew, ExceptionInfo->ContextRecord->Rip); +#else + DoOutputDebugString("PEPointerWriteCallback: set write bp on e_lfanew write location 0x%x (EIP = 0x%x)\n", (BYTE*)AllocationBase + e_lfanew, ExceptionInfo->ContextRecord->Eip); +#endif + } + else + { + DoOutputDebugString("PEPointerWriteCallback: ContextUpdateCurrentBreakpoint failed\n"); + return FALSE; + } + + DoOutputDebugString("PEPointerWriteCallback executed successfully.\n"); + + return TRUE; +} + +BOOL MidPageExecCallback(PBREAKPOINTINFO pBreakpointInfo, struct _EXCEPTION_POINTERS* ExceptionInfo) +{ + MEMORY_BASIC_INFORMATION meminfo; + SIZE_T Size; + + if (pBreakpointInfo == NULL) + { + DoOutputDebugString("MidPageExecCallback executed with pBreakpointInfo NULL.\n"); + return FALSE; + } + + if (pBreakpointInfo->ThreadHandle == NULL) + { + DoOutputDebugString("MidPageExecCallback executed with NULL thread handle.\n"); + return FALSE; + } + + DoOutputDebugString("MidPageExecCallback: Breakpoint %i at Address 0x%x.\n", pBreakpointInfo->Register, pBreakpointInfo->Address); + + memset(&meminfo, 0, sizeof(meminfo)); + + if (!VirtualQuery(pBreakpointInfo->Address, &meminfo, sizeof(meminfo))) + { + DoOutputErrorString("MidPageExecCallback: unable to query memory region 0x%x", pBreakpointInfo->Address); + return FALSE; + } + + SetCapeMetaData(EXTRACTION_PE, 0, NULL, meminfo.AllocationBase); + + if ((BYTE*)AllocationBase + AllocationSize > (BYTE*)meminfo.AllocationBase && meminfo.RegionSize) + { + Size = (BYTE*)AllocationBase + AllocationSize - (BYTE*)meminfo.AllocationBase; + } + else + { + Size = AllocationSize; + } + + if (!address_is_in_stack((DWORD_PTR)pBreakpointInfo->Address) && (DWORD_PTR)meminfo.BaseAddress > (DWORD_PTR)meminfo.AllocationBase) + { + DoOutputDebugString("MidPageExecCallback: Debug: About to scan region for a PE image (base 0x%x, size 0x%x).\n", meminfo.AllocationBase, Size); + AllocationDumped = DumpPEsInRange(meminfo.AllocationBase, Size); + } + else if (address_is_in_stack((DWORD_PTR)pBreakpointInfo->Address) || (DWORD_PTR)meminfo.BaseAddress == (DWORD_PTR)meminfo.AllocationBase) + { + DoOutputDebugString("MidPageExecCallback: Debug: About to scan region for a PE image (base 0x%x, size 0x%x).\n", meminfo.BaseAddress, meminfo.RegionSize); + AllocationDumped = DumpPEsInRange(meminfo.BaseAddress, meminfo.RegionSize); + } + + if (AllocationDumped) + { + DoOutputDebugString("MidPageExecCallback: PE image(s) detected and dumped.\n"); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + } + else + { + if (!address_is_in_stack((DWORD_PTR)pBreakpointInfo->Address) && (DWORD_PTR)meminfo.BaseAddress > (DWORD_PTR)meminfo.AllocationBase) + { + SetCapeMetaData(EXTRACTION_SHELLCODE, 0, NULL, meminfo.AllocationBase); + + AllocationDumped = DumpMemory(meminfo.AllocationBase, Size); + + if (AllocationDumped) + { + DoOutputDebugString("MidPageExecCallback: successfully dumped memory range at 0x%x.\n", meminfo.AllocationBase); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + } + } + else if (address_is_in_stack((DWORD_PTR)pBreakpointInfo->Address) || (DWORD_PTR)meminfo.BaseAddress == (DWORD_PTR)meminfo.AllocationBase) + { + SetCapeMetaData(EXTRACTION_SHELLCODE, 0, NULL, meminfo.BaseAddress); + + if (ScanForNonZero(meminfo.BaseAddress, Size)) + AllocationDumped = DumpMemory(meminfo.BaseAddress, meminfo.RegionSize); + else + DoOutputDebugString("MidPageExecCallback: memory range at 0x%x is empty.\n", meminfo.BaseAddress); + + if (AllocationDumped) + { + DoOutputDebugString("MidPageExecCallback: successfully dumped memory range at 0x%x.\n", meminfo.BaseAddress); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + } + } + } + + if (!AllocationDumped) + { + DoOutputDebugString("MidPageExecCallback: failed to dump memory range at 0x%x.\n", AllocationBase); + ExtractionClearAll(); + } + + DoOutputDebugString("MidPageExecCallback executed successfully.\n"); + + return TRUE; +} + +BOOL ShellcodeExecCallback(PBREAKPOINTINFO pBreakpointInfo, struct _EXCEPTION_POINTERS* ExceptionInfo) +{ + MEMORY_BASIC_INFORMATION meminfo; + //LPVOID PEPointer; + + if (pBreakpointInfo == NULL) + { + DoOutputDebugString("ShellcodeExecCallback executed with pBreakpointInfo NULL.\n"); + return FALSE; + } + + if (pBreakpointInfo->ThreadHandle == NULL) + { + DoOutputDebugString("ShellcodeExecCallback executed with NULL thread handle.\n"); + return FALSE; + } + + DoOutputDebugString("ShellcodeExecCallback: Breakpoint %i at Address 0x%x.\n", pBreakpointInfo->Register, pBreakpointInfo->Address); + + memset(&meminfo, 0, sizeof(meminfo)); + + if (!VirtualQuery(pBreakpointInfo->Address, &meminfo, sizeof(meminfo))) + { + DoOutputErrorString("ShellcodeExecCallback: unable to query memory region 0x%x", pBreakpointInfo->Address); + return FALSE; + } + + DoOutputDebugString("ShellcodeExecCallback: Debug: About to scan region for a PE image (base 0x%x, size 0x%x).\n", meminfo.AllocationBase, meminfo.RegionSize); + + SetCapeMetaData(EXTRACTION_PE, 0, NULL, meminfo.AllocationBase); + + AllocationDumped = DumpPEsInRange(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + { + DoOutputDebugString("ShellcodeExecCallback: PE image(s) detected and dumped.\n"); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + } + else + { + SetCapeMetaData(EXTRACTION_SHELLCODE, 0, NULL, meminfo.AllocationBase); + + AllocationDumped = DumpMemory(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + { + DoOutputDebugString("ShellcodeExecCallback: successfully dumped memory range at 0x%x.\n", AllocationBase); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + } + } + + if (!AllocationDumped) + { + DoOutputDebugString("ShellcodeExecCallback: failed to dump memory range at 0x%x.\n", AllocationBase); + ExtractionClearAll(); + } + + DoOutputDebugString("ShellcodeExecCallback executed successfully.\n"); + + return TRUE; +} + +BOOL BaseAddressWriteCallback(PBREAKPOINTINFO pBreakpointInfo, struct _EXCEPTION_POINTERS* ExceptionInfo) +{ + PIMAGE_DOS_HEADER pDosHeader; + unsigned int Register; + + if (pBreakpointInfo == NULL) + { + DoOutputDebugString("BaseAddressWriteCallback executed with pBreakpointInfo NULL.\n"); + return FALSE; + } + + if (pBreakpointInfo->ThreadHandle == NULL) + { + DoOutputDebugString("BaseAddressWriteCallback executed with NULL thread handle.\n"); + return FALSE; + } + + DoOutputDebugString("BaseAddressWriteCallback: Breakpoint %i at Address 0x%x.\n", pBreakpointInfo->Register, pBreakpointInfo->Address); + + AllocationWriteDetected = TRUE; + + if (*(WORD*)pBreakpointInfo->Address == IMAGE_DOS_SIGNATURE) + { + DoOutputDebugString("BaseAddressWriteCallback: MZ header found.\n"); + + pDosHeader = (PIMAGE_DOS_HEADER)pBreakpointInfo->Address; + + if (pDosHeader->e_lfanew && (unsigned int)pDosHeader->e_lfanew < PE_HEADER_LIMIT) + { + if (*(DWORD*)((unsigned char*)pDosHeader + pDosHeader->e_lfanew) == IMAGE_NT_SIGNATURE) + { + PeImageDetected = TRUE; + + SetCapeMetaData(EXTRACTION_PE, 0, NULL, AllocationBase); + + if (DumpPEsInRange(AllocationBase, AllocationSize)) + { + AllocationDumped = TRUE; + DoOutputDebugString("BaseAddressWriteCallback: successfully dumped module.\n"); + ContextClearAllBreakpoints(ExceptionInfo->ContextRecord); + return TRUE; + } + else + { + DoOutputDebugString("BaseAddressWriteCallback: failed to dump PE module.\n"); + } + } + else + { + // Deal with the situation where the breakpoint triggers after e_lfanew has already been written + if (ContextUpdateCurrentBreakpoint(ExceptionInfo->ContextRecord, sizeof(DWORD), (BYTE*)pDosHeader + pDosHeader->e_lfanew, BP_WRITE, PEHeaderWriteCallback)) + { +#ifdef _WIN64 + DoOutputDebugString("BaseAddressWriteCallback: set write bp on e_lfanew write location 0x%x (RIP = 0x%x)\n", (BYTE*)pDosHeader + pDosHeader->e_lfanew, ExceptionInfo->ContextRecord->Rip); +#else + DoOutputDebugString("BaseAddressWriteCallback: set write bp on e_lfanew write location 0x%x (EIP = 0x%x)\n", (BYTE*)pDosHeader + pDosHeader->e_lfanew, ExceptionInfo->ContextRecord->Eip); +#endif + } + else + { + DoOutputDebugString("BaseAddressWriteCallback: ContextUpdateCurrentBreakpoint failed\n"); + return FALSE; + } + } + } + //e_lfanew is a long, therefore dword in size + else if (ContextUpdateCurrentBreakpoint(ExceptionInfo->ContextRecord, sizeof(DWORD), (BYTE*)&pDosHeader->e_lfanew, BP_WRITE, PEPointerWriteCallback)) + { +#ifdef _WIN64 + DoOutputDebugString("BaseAddressWriteCallback: set write bp on e_lfanew write location: 0x%x (RIP = 0x%x)\n", (BYTE*)&pDosHeader->e_lfanew, ExceptionInfo->ContextRecord->Rip); +#else + DoOutputDebugString("BaseAddressWriteCallback: set write bp on e_lfanew write location: 0x%x (EIP = 0x%x)\n", (BYTE*)&pDosHeader->e_lfanew, ExceptionInfo->ContextRecord->Eip); +#endif + } + else + { + DoOutputDebugString("BaseAddressWriteCallback: ContextUpdateCurrentBreakpoint failed\n"); + return FALSE; + } + } + else if (*(BYTE*)pBreakpointInfo->Address == 'M') + { + // Cover the case where a PE file is being written a byte at a time + DoOutputDebugString("BaseAddressWriteCallback: M written to first byte, awaiting next byte.\n"); + + // We do nothing and hope that the 4D byte isn't code! + } + else + { + DoOutputDebugString("BaseAddressWriteCallback: byte written to 0x%x: 0x%x.\n", pBreakpointInfo->Address, *(BYTE*)pBreakpointInfo->Address); + + if (AllocationBaseExecBpSet == TRUE) + { + DoOutputDebugString("BaseAddressWriteCallback: allocation exec bp already set, doing nothing.\n"); + return TRUE; + } + + // we add an exec breakpoint on address 0 in case it's shellcode, but leave the write bp in case it's an encrypted PE + if (ContextSetNextAvailableBreakpoint(ExceptionInfo->ContextRecord, &Register, 0, (BYTE*)AllocationBase, BP_EXEC, MidPageExecCallback)) + { + AllocationBaseExecBpSet = TRUE; +#ifdef _WIN64 + DoOutputDebugString("BaseAddressWriteCallback: Execution breakpoint %d set base address: 0x%x, AllocationBaseExecBpSet = %d (RIP = 0x%x)\n", Register, AllocationBase, AllocationBaseExecBpSet, ExceptionInfo->ContextRecord->Rip); +#else + DoOutputDebugString("BaseAddressWriteCallback: Execution breakpoint %d set base address: 0x%x, AllocationBaseExecBpSet = %d (EIP = 0x%x)\n", Register, AllocationBase, AllocationBaseExecBpSet, ExceptionInfo->ContextRecord->Eip); +#endif + } + else + { + if (ContextUpdateCurrentBreakpoint(ExceptionInfo->ContextRecord, 0, (BYTE*)AllocationBase, BP_EXEC, MidPageExecCallback)) + { + AllocationBaseExecBpSet = TRUE; + DoOutputDebugString("BaseAddressWriteCallback: Unable to add additional breakpoint, replacing existing write bp with execution bp.\n"); + } + else + { + DoOutputDebugString("BaseAddressWriteCallback: Error: Failed to replace existing write bp with execution bp.\n"); + return FALSE; + } + } + } + + DoOutputDebugString("BaseAddressWriteCallback executed successfully.\n"); + + return TRUE; +} + +BOOL SetMidPageBreakpoint(PVOID *Address, SIZE_T Size) +{ + DWORD ThreadId; + unsigned int Register; + + ThreadId = GetCurrentThreadId(); + + AllocationSize = Size; + AllocationBase = Address; + CapeMetaData->Address = Address; + + AllocationWriteDetected = FALSE; + PeImageDetected = FALSE; + AllocationDumped = FALSE; + AllocationBaseExecBpSet = FALSE; + EntryPointExecBpSet = FALSE; + + DoOutputDebugString("SetMidPageBreakpoint: AllocationBase: 0x%x, AllocationSize: 0x%x, ThreadId: 0x%x\n", AllocationBase, AllocationSize, ThreadId); + + if (AllocationSize == 0 || AllocationBase == NULL || ThreadId == 0) + { + DoOutputDebugString("SetMidPageBreakpoint: Error, one of the following is NULL: 0x%x, AllocationSize: 0x%x, ThreadId: 0x%x\n", AllocationBase, AllocationSize, ThreadId); + return FALSE; + } + + if (!SetNextAvailableBreakpoint(ThreadId, &Register, 0, (BYTE*)Address, BP_EXEC, MidPageExecCallback)) + { + DoOutputDebugString("SetMidPageBreakpoint: SetNextAvailableBreakpoint failed to set exec bp on executable address 0x%x.\n", Address); + return FALSE; + } + else + { + DoOutputDebugString("SetMidPageBreakpoint: Set exec breakpoint on protected address: 0x%x\n", Address); + } + + return TRUE; +} + +BOOL SetInitialWriteBreakpoint(PVOID *Address, SIZE_T RegionSize) +{ + DWORD ThreadId; + unsigned int Register; + + ThreadId = GetCurrentThreadId(); + + AllocationSize = RegionSize; + AllocationBase = Address; + CapeMetaData->Address = Address; + + AllocationWriteDetected = FALSE; + PeImageDetected = FALSE; + AllocationDumped = FALSE; + AllocationBaseWriteBpSet = FALSE; + AllocationBaseExecBpSet = FALSE; + EntryPointExecBpSet = FALSE; + + DoOutputDebugString("SetInitialWriteBreakpoint: AllocationBase: 0x%x, AllocationSize: 0x%x, ThreadId: 0x%x\n", AllocationBase, AllocationSize, ThreadId); + + if (AllocationSize == 0 || AllocationBase == NULL || ThreadId == 0) + { + DoOutputDebugString("SetInitialWriteBreakpoint: Error, one of the following is NULL: 0x%x, AllocationSize: 0x%x, ThreadId: 0x%x\n", AllocationBase, AllocationSize, ThreadId); + return FALSE; + } + + if (SetNextAvailableBreakpoint(ThreadId, &Register, sizeof(WORD), (BYTE*)AllocationBase, BP_WRITE, BaseAddressWriteCallback)) + { + DoOutputDebugString("SetInitialWriteBreakpoint: Breakpoint %d set write on word at base address: 0x%x\n", Register, AllocationBase); + AllocationBaseWriteBpSet = TRUE; + } + else + { + DoOutputDebugString("SetInitialWriteBreakpoint: SetNextAvailableBreakpoint failed\n"); + return FALSE; + } + + return TRUE; +} \ No newline at end of file diff --git a/CAPE/Debugger.c b/CAPE/Debugger.c index 874fcd5..a426c72 100644 --- a/CAPE/Debugger.c +++ b/CAPE/Debugger.c @@ -15,13 +15,13 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.If not, see . */ -#ifndef _WIN64 #include #include #include #include #include #include "Debugger.h" +#include "..\alloc.h" #include "..\config.h" #include "..\pipe.h" @@ -49,7 +49,7 @@ typedef struct _DR7 DWORD PAD1 : 3; DWORD GD : 1; //General Detect Enable DWORD PAD2 : 1; - DWORD Pad3 : 1; + DWORD PAD3 : 1; DWORD RWE0 : 2; //Read/Write/Execute bp0 DWORD LEN0 : 2; //Length bp0 DWORD RWE1 : 2; //Read/Write/Execute bp1 @@ -65,17 +65,31 @@ typedef struct _DR7 #define DEBUG_REGISTER_DATA_SIZES {1, 2, 4} #define DEBUG_REGISTER_LENGTH_MASKS {0xFFFFFFFF, 0, 1, 0xFFFFFFFF, 3} +typedef struct _LSA_UNICODE_STRING { + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; +} LSA_UNICODE_STRING, *PLSA_UNICODE_STRING, UNICODE_STRING, *PUNICODE_STRING; + +typedef struct _INJECT_STRUCT { + ULONG_PTR LdrLoadDllAddress; + UNICODE_STRING DllName; + HANDLE OutHandle; +} INJECT_STRUCT, *PINJECT_STRUCT; + DWORD LengthMask[MAX_DEBUG_REGISTER_DATA_SIZE + 1] = DEBUG_REGISTER_LENGTH_MASKS; DWORD MainThreadId; struct ThreadBreakpoints *MainThreadBreakpointList; -LPTOP_LEVEL_EXCEPTION_FILTER OriginalExceptionHandler; -LONG WINAPI CAPEExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo); SINGLE_STEP_HANDLER SingleStepHandler; -DWORD WINAPI PipeThread(LPVOID lpParam); -DWORD RemoteFuncAddress; -HANDLE hParentPipe; +GUARD_PAGE_HANDLER GuardPageHandler; +HANDLE hCapePipe; + +extern ULONG_PTR g_our_dll_base; +extern DWORD g_our_dll_size; +extern LONG WINAPI cuckoomon_exception_handler(__in struct _EXCEPTION_POINTERS *ExceptionInfo); +extern BOOL ExtractionGuardPageHandler(struct _EXCEPTION_POINTERS* ExceptionInfo); extern unsigned int address_is_in_stack(DWORD Address); extern BOOL WoW64fix(void); extern BOOL WoW64PatchBreakpoint(unsigned int Register); @@ -85,14 +99,307 @@ extern DWORD MyGetThreadId(HANDLE hThread); extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); extern void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); -LPTOP_LEVEL_EXCEPTION_FILTER OriginalExceptionHandler; - -PVOID OEP; - void DebugOutputThreadBreakpoints(); -BOOL RestoreExecutionBreakpoint(PCONTEXT Context); +BOOL ResumeAfterExecutionBreakpoint(PCONTEXT Context); BOOL SetSingleStepMode(PCONTEXT Context, PVOID Handler); BOOL ClearSingleStepMode(PCONTEXT Context); +unsigned int TrapIndex; + +//************************************************************************************** +BOOL IsInGuardPages(PVOID Address) +//************************************************************************************** +{ + PGUARDPAGES CurrentGuardPages = GuardPageList; + + if (GuardPageList == NULL) + return FALSE; + + while (CurrentGuardPages) + { + if ((DWORD_PTR)Address >= (DWORD_PTR)CurrentGuardPages->BaseAddress && (DWORD_PTR)Address < ((DWORD_PTR)CurrentGuardPages->BaseAddress + (DWORD_PTR)CurrentGuardPages->RegionSize)) + return TRUE; + + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + return FALSE; +} + +//************************************************************************************** +PGUARDPAGES GetGuardPages(PVOID Address) +//************************************************************************************** +{ + PGUARDPAGES CurrentGuardPages = GuardPageList; + + if (Address == NULL) + { + DoOutputDebugString("GetGuardPages: NULL passed as argument - error.\n"); + return FALSE; + } + + if (GuardPageList == NULL) + { + DoOutputDebugString("GetGuardPages: failed to obtain initial guard page list.\n"); + return FALSE; + } + + while (CurrentGuardPages) + { + if ((DWORD_PTR)Address >= (DWORD_PTR)CurrentGuardPages->BaseAddress && (DWORD_PTR)Address < ((DWORD_PTR)CurrentGuardPages->BaseAddress + (DWORD_PTR)CurrentGuardPages->RegionSize)) + return CurrentGuardPages; + + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + DoOutputDebugString("GetGuardPages: failed to find guard pages in list.\n"); + + return NULL; +} + +//************************************************************************************** +BOOL DropGuardPages(PGUARDPAGES GuardPages) +//************************************************************************************** +{ + // DEBUG + DoOutputDebugString("DropGuardPages entry.\n"); + + PGUARDPAGES CurrentGuardPages, PreviousGuardPages; + + if (GuardPages == NULL) + { + DoOutputDebugString("DropGuardPages: NULL passed as argument - error.\n"); + return FALSE; + } + + PreviousGuardPages = NULL; + + if (GuardPageList == NULL) + { + DoOutputDebugString("DropGuardPages: failed to obtain initial guard page list.\n"); + return FALSE; + } + + CurrentGuardPages = GuardPageList; + + while (CurrentGuardPages) + { + DoOutputDebugString("DropGuardPages: CurrentGuardPages 0x%x.\n", CurrentGuardPages); + + if (CurrentGuardPages == GuardPages) + { + DoOutputDebugString("DropGuardPages: About to unlink.\n"); + // Unlink this from the list and free the memory + if (PreviousGuardPages && CurrentGuardPages->NextGuardPages) + { + DoOutputDebugString("DropGuardPages: removed pages 0x%x-0x%x from guard page list.\n", GuardPages->BaseAddress, (DWORD_PTR)GuardPages->BaseAddress + GuardPages->RegionSize); + PreviousGuardPages->NextGuardPages = CurrentGuardPages->NextGuardPages; + } + else if (PreviousGuardPages && CurrentGuardPages->NextGuardPages == NULL) + { + DoOutputDebugString("DropGuardPages: removed pages 0x%x-0x%x from the end of the guard page list.\n", GuardPages->BaseAddress, (DWORD_PTR)GuardPages->BaseAddress + GuardPages->RegionSize); + PreviousGuardPages->NextGuardPages = NULL; + } + else if (!PreviousGuardPages) + { + DoOutputDebugString("DropGuardPages: removed pages 0x%x-0x%x from the head of the guard page list.\n", GuardPages->BaseAddress, (DWORD_PTR)GuardPages->BaseAddress + GuardPages->RegionSize); + GuardPageList = NULL; + } + + DoOutputDebugString("DropGuardPages: about to free the memory!\n"); + free(CurrentGuardPages); + + return TRUE; + } + + PreviousGuardPages = CurrentGuardPages; + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + DoOutputDebugString("DropGuardPages: failed to find guard pages in list.\n"); + + return FALSE; +} + +//************************************************************************************** +BOOL ReinstateGuardPages(PGUARDPAGES GuardPages) +//************************************************************************************** +{ + DWORD OldProtect; + BOOL GuardPagesFound = FALSE; + PGUARDPAGES CurrentGuardPages = GuardPageList; + MEMORY_BASIC_INFORMATION MemInfo; + SIZE_T MatchingRegionSize; + + if (GuardPageList == NULL) + return FALSE; + + while (CurrentGuardPages) + { + if (GuardPages->BaseAddress == CurrentGuardPages->BaseAddress) + GuardPagesFound = TRUE; + + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + if (GuardPagesFound == FALSE) + { + DoOutputDebugString("ReinstateGuardPages: failed to locate guard page(s) in guard page list.\n"); + return FALSE; + } + + MatchingRegionSize = VirtualQuery(GuardPages->BaseAddress, &MemInfo, GuardPages->RegionSize); + + if (!MatchingRegionSize) + { + DoOutputErrorString("ReinstateGuardPages: failed to query guard page(s) status in region 0x%x-0x%x", GuardPages->BaseAddress, (DWORD_PTR)GuardPages->BaseAddress + GuardPages->RegionSize); + return FALSE; + } + + if (MatchingRegionSize == GuardPages->RegionSize && MemInfo.Protect & PAGE_GUARD) + { + DoOutputDebugString("ReinstateGuardPages: guard page(s) already set in region 0x%x-0x%x", GuardPages->BaseAddress, (DWORD_PTR)GuardPages->BaseAddress + GuardPages->RegionSize); + return FALSE; + } + + if (!VirtualProtect(GuardPages->BaseAddress, GuardPages->RegionSize, GuardPages->Protect | PAGE_GUARD, &OldProtect)) + { + DoOutputErrorString("ReinstateGuardPages: failed to reinstate guard page(s) on region 0x%x size 0x%x", GuardPages->BaseAddress, GuardPages->RegionSize); + return FALSE; + } + + // This is unreliable if some pages no longer have PAGE_GUARD, + // i.e. they have been touched, while others haven't + //if (OldProtect != GuardPages->Protect) + //{ + // DoOutputDebugString("ReinstateGuardPages error: inconsistency in protecton flags for region 0x%x-0x%x - OldProtect = 0x%x, GuardPages->Protect = 0x%x\n", GuardPages->BaseAddress, (DWORD_PTR)GuardPages->BaseAddress + GuardPages->RegionSize, OldProtect, GuardPages->Protect); + //} + + return TRUE; +} + +//************************************************************************************** +BOOL DisableGuardPages(PGUARDPAGES GuardPages) +//************************************************************************************** +{ + DWORD OldProtect; + BOOL GuardPagesFound = FALSE; + PGUARDPAGES CurrentGuardPages = GuardPageList; + MEMORY_BASIC_INFORMATION MemInfo; + SIZE_T MatchingRegionSize; + + if (GuardPageList == NULL) + return FALSE; + + while (CurrentGuardPages) + { + if (GuardPages->BaseAddress == CurrentGuardPages->BaseAddress) + GuardPagesFound = TRUE; + + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + if (GuardPagesFound == FALSE) + { + DoOutputDebugString("DisableGuardPages: failed to locate guard page(s) in guard page list.\n"); + return FALSE; + } + + MatchingRegionSize = VirtualQuery(GuardPages->BaseAddress, &MemInfo, GuardPages->RegionSize); + + if (!MatchingRegionSize) + { + DoOutputErrorString("DisableGuardPages: failed to query guard page(s) status in region 0x%x-0x%x", GuardPages->BaseAddress, (DWORD_PTR)GuardPages->BaseAddress + GuardPages->RegionSize); + return FALSE; + } + + if (MatchingRegionSize == GuardPages->RegionSize && !(MemInfo.Protect & PAGE_GUARD)) + { + DoOutputDebugString("DisableGuardPages: guard page(s) not set in region 0x%x-0x%x", GuardPages->BaseAddress, (DWORD_PTR)GuardPages->BaseAddress + GuardPages->RegionSize); + return FALSE; + } + + if (!VirtualProtect(GuardPages->BaseAddress, GuardPages->RegionSize, GuardPages->Protect, &OldProtect)) + { + DoOutputErrorString("DisableGuardPages: failed to disable guard page(s) on region 0x%x-0x%x", GuardPages->BaseAddress, (DWORD_PTR)GuardPages->BaseAddress + GuardPages->RegionSize); + return FALSE; + } + + //if (OldProtect != (GuardPages->Protect & PAGE_GUARD)) + //{ + // DoOutputDebugString("DisableGuardPages error: inconsistency in protecton flags for region 0x%x-0x%x - OldProtect = 0x%x, GuardPages->Protect = 0x%x\n", GuardPages->BaseAddress, (DWORD_PTR)GuardPages->BaseAddress + GuardPages->RegionSize, OldProtect, GuardPages->Protect); + //} + + return TRUE; +} + +//************************************************************************************** +PGUARDPAGES CreateGuardPages() +//************************************************************************************** +{ + if (GuardPageList == NULL) + { + GuardPageList = ((struct GuardPages*)malloc(sizeof(struct GuardPages))); + + if (GuardPageList == NULL) + { + DoOutputDebugString("CreateGuardPages: failed to allocate memory for initial thread breakpoint list.\n"); + return NULL; + } + memset(GuardPageList, 0, sizeof(struct GuardPages)); + } + + return GuardPageList; +} + +//************************************************************************************** +BOOL AddGuardPages(PVOID Address, SIZE_T RegionSize, ULONG Protect) +//************************************************************************************** +{ + BOOL PageAlreadyGuarded; + PGUARDPAGES CurrentGuardPages, PreviousGuardPages; + + PreviousGuardPages = NULL; + + if (GuardPageList == NULL) + CreateGuardPages(); + + CurrentGuardPages = GuardPageList; + + while (CurrentGuardPages) + { + if ((DWORD_PTR)Address >= (DWORD_PTR)CurrentGuardPages->BaseAddress && (DWORD_PTR)Address < ((DWORD_PTR)CurrentGuardPages->BaseAddress + (DWORD_PTR)CurrentGuardPages->RegionSize)) + PageAlreadyGuarded = TRUE; + else + PageAlreadyGuarded = FALSE; + + PreviousGuardPages = CurrentGuardPages; + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + if (PageAlreadyGuarded == FALSE) + { + // We haven't found it in the linked list, so create a new one + CurrentGuardPages = PreviousGuardPages; + + CurrentGuardPages->NextGuardPages = ((struct GuardPages*)malloc(sizeof(struct GuardPages))); + + if (CurrentGuardPages->NextGuardPages == NULL) + { + DoOutputDebugString("AddGuardPages: Failed to allocate new guard page struct.\n"); + return FALSE; + } + memset(CurrentGuardPages->NextGuardPages, 0, sizeof(struct GuardPages)); + + CurrentGuardPages->BaseAddress = Address; + CurrentGuardPages->RegionSize = RegionSize; + CurrentGuardPages->Protect = Protect; + CurrentGuardPages->WriteDetected = FALSE; + CurrentGuardPages->LastWriteAddress = NULL; + CurrentGuardPages->PagesDumped = FALSE; + } + + return TRUE; +} //************************************************************************************** PTHREADBREAKPOINTS GetThreadBreakpoints(DWORD ThreadId) @@ -196,6 +503,8 @@ PTHREADBREAKPOINTS CreateThreadBreakpoints(DWORD ThreadId) } } + CurrentThreadBreakpoint->ThreadId = ThreadId; + for (Register = 0; Register < NUMBER_OF_DEBUG_REGISTERS; Register++) { CurrentThreadBreakpoint->BreakpointInfo[Register].Register = Register; @@ -205,23 +514,93 @@ PTHREADBREAKPOINTS CreateThreadBreakpoints(DWORD ThreadId) return CurrentThreadBreakpoint; } +//************************************************************************************** +BOOL GetNextAvailableBreakpoint(DWORD ThreadId, unsigned int* Register) +//************************************************************************************** +{ + DWORD CurrentThreadId; + unsigned int i; + + PTHREADBREAKPOINTS CurrentThreadBreakpoint = MainThreadBreakpointList; + + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("GetNextAvailableBreakpoint: MainThreadBreakpointList NULL.\n"); + return FALSE; + } + + while (CurrentThreadBreakpoint) + { + CurrentThreadId = MyGetThreadId(CurrentThreadBreakpoint->ThreadHandle); + + if (CurrentThreadId == ThreadId) + { + for (i=0; i < NUMBER_OF_DEBUG_REGISTERS; i++) + { + if (CurrentThreadBreakpoint->BreakpointInfo[i].Address == NULL) + { + *Register = i; + return TRUE; + } + } + } + + CurrentThreadBreakpoint = CurrentThreadBreakpoint->NextThreadBreakpoints; + } + + return FALSE; +} + +//************************************************************************************** +BOOL ContextGetNextAvailableBreakpoint(PCONTEXT Context, unsigned int* Register) +//************************************************************************************** +{ + unsigned int i; + PTHREADBREAKPOINTS CurrentThreadBreakpoint; + + CurrentThreadBreakpoint = GetThreadBreakpoints(GetCurrentThreadId()); + + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("ContextGetNextAvailableBreakpoint: Creating new thread breakpoints for thread 0x%x.\n", GetCurrentThreadId()); + CurrentThreadBreakpoint = CreateThreadBreakpoints(GetCurrentThreadId()); + } + + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("ContextGetNextAvailableBreakpoint: Cannot create new thread breakpoints - FATAL.\n"); + return FALSE; + } + + for (i=0; i < NUMBER_OF_DEBUG_REGISTERS; i++) + { + if (CurrentThreadBreakpoint->BreakpointInfo[i].Address == NULL) + { + *Register = i; + return TRUE; + } + } + + return FALSE; +} + //************************************************************************************** void DebugOutputThreadBreakpoints() //************************************************************************************** { unsigned int Register; - PTHREADBREAKPOINTS CurrentThreadBreakpoints; + PTHREADBREAKPOINTS CurrentThreadBreakpoint; PBREAKPOINTINFO pBreakpointInfo; - CurrentThreadBreakpoints = GetThreadBreakpoints(GetCurrentThreadId()); + CurrentThreadBreakpoint = GetThreadBreakpoints(GetCurrentThreadId()); for (Register = 0; Register < NUMBER_OF_DEBUG_REGISTERS; Register++) { - pBreakpointInfo = &(CurrentThreadBreakpoints->BreakpointInfo[Register]); + pBreakpointInfo = &(CurrentThreadBreakpoint->BreakpointInfo[Register]); if (pBreakpointInfo == NULL) { - DoOutputDebugString("CAPEExceptionFilter: Can't get BreakpointInfo - FATAL.\n"); + DoOutputDebugString("DebugOutputThreadBreakpoints: Can't get BreakpointInfo - FATAL.\n"); } DoOutputDebugString("Callback = 0x%x, Address = 0x%x, Size = 0x%x, Register = %i, ThreadHandle = 0x%x, Type = 0x%x\n", @@ -234,6 +613,16 @@ void DebugOutputThreadBreakpoints() } } +//************************************************************************************** +void ShowStack(DWORD_PTR StackPointer, unsigned int NumberOfRecords) +//************************************************************************************** +{ + unsigned int i; + + for (i=0; iExceptionRecord->ExceptionAddress); - - CurrentThreadBreakpoints = GetThreadBreakpoints(GetCurrentThreadId()); - - if (CurrentThreadBreakpoints == NULL) - { - DoOutputDebugString("CAPEExceptionFilter: Can't get thread breakpoints - FATAL.\n"); - return EXCEPTION_CONTINUE_SEARCH; - } - // Test Dr6 to see if this is a breakpoint BreakpointFlag = FALSE; for (bp = 0; bp < NUMBER_OF_DEBUG_REGISTERS; bp++) { - if (ExceptionInfo->ContextRecord->Dr6 & (1 << bp)) + if (ExceptionInfo->ContextRecord->Dr6 & (DWORD_PTR)(1 << bp)) { BreakpointFlag = TRUE; } @@ -271,16 +650,38 @@ LONG WINAPI CAPEExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo) // If not it's a single-step if (BreakpointFlag == FALSE) { - //if (SingleStepHandler(ExceptionInfo)) - SingleStepHandler(ExceptionInfo); + if (SingleStepHandler) + SingleStepHandler(ExceptionInfo); + else if (TrapIndex) + // this is from StepOverExecutionBreakpoint + { + DoOutputDebugString("CAPEExceptionFilter: Stepping over execution breakpoint to: 0x%x\n", ExceptionInfo->ExceptionRecord->ExceptionAddress); + ResumeAfterExecutionBreakpoint(ExceptionInfo->ContextRecord); + } + else + { + DoOutputDebugString("CAPEExceptionFilter: Error, unhandled single-step exception at: 0x%x\n", ExceptionInfo->ExceptionRecord->ExceptionAddress); + return EXCEPTION_CONTINUE_SEARCH; + } + return EXCEPTION_CONTINUE_EXECUTION; } + DoOutputDebugString("Entering CAPEExceptionFilter: breakpoint hit: 0x%x\n", ExceptionInfo->ExceptionRecord->ExceptionAddress); + + CurrentThreadBreakpoint = GetThreadBreakpoints(GetCurrentThreadId()); + + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("CAPEExceptionFilter: Can't get thread breakpoints - FATAL.\n"); + return EXCEPTION_CONTINUE_SEARCH; + } + for (bp = 0; bp < NUMBER_OF_DEBUG_REGISTERS; bp++) { - if (ExceptionInfo->ContextRecord->Dr6 & (1 << bp)) + if (ExceptionInfo->ContextRecord->Dr6 & (DWORD_PTR)(1 << bp)) { - pBreakpointInfo = &(CurrentThreadBreakpoints->BreakpointInfo[bp]); + pBreakpointInfo = &(CurrentThreadBreakpoint->BreakpointInfo[bp]); if (pBreakpointInfo == NULL) { @@ -290,25 +691,25 @@ LONG WINAPI CAPEExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo) if (pBreakpointInfo->Register == bp) { - if (bp == 0 && ((DWORD)pBreakpointInfo->Address != ExceptionInfo->ContextRecord->Dr0)) + if (bp == 0 && ((DWORD_PTR)pBreakpointInfo->Address != ExceptionInfo->ContextRecord->Dr0)) DoOutputDebugString("CAPEExceptionFilter: Anomaly detected! bp0 address (0x%x) different to BreakpointInfo (0x%x)!\n", ExceptionInfo->ContextRecord->Dr0, pBreakpointInfo->Address); - if (bp == 1 && ((DWORD)pBreakpointInfo->Address != ExceptionInfo->ContextRecord->Dr1)) + if (bp == 1 && ((DWORD_PTR)pBreakpointInfo->Address != ExceptionInfo->ContextRecord->Dr1)) DoOutputDebugString("CAPEExceptionFilter: Anomaly detected! bp1 address (0x%x) different to BreakpointInfo (0x%x)!\n", ExceptionInfo->ContextRecord->Dr1, pBreakpointInfo->Address); - if (bp == 2 && ((DWORD)pBreakpointInfo->Address != ExceptionInfo->ContextRecord->Dr2)) + if (bp == 2 && ((DWORD_PTR)pBreakpointInfo->Address != ExceptionInfo->ContextRecord->Dr2)) DoOutputDebugString("CAPEExceptionFilter: Anomaly detected! bp2 address (0x%x) different to BreakpointInfo (0x%x)!\n", ExceptionInfo->ContextRecord->Dr2, pBreakpointInfo->Address); - if (bp == 3 && ((DWORD)pBreakpointInfo->Address != ExceptionInfo->ContextRecord->Dr3)) + if (bp == 3 && ((DWORD_PTR)pBreakpointInfo->Address != ExceptionInfo->ContextRecord->Dr3)) DoOutputDebugString("CAPEExceptionFilter: Anomaly detected! bp3 address (0x%x) different to BreakpointInfo (0x%x)!\n", ExceptionInfo->ContextRecord->Dr3, pBreakpointInfo->Address); - - if (bp == 0 && ((DWORD)pBreakpointInfo->Type != ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE0)) +#ifndef _WIN64 + if (bp == 0 && ((DWORD_PTR)pBreakpointInfo->Type != ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE0)) { - if (pBreakpointInfo->Type == BP_READWRITE && ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE0 == BP_WRITE && address_is_in_stack((DWORD)pBreakpointInfo->Address)) + if (pBreakpointInfo->Type == BP_READWRITE && ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE0 == BP_WRITE && address_is_in_stack((DWORD_PTR)pBreakpointInfo->Address)) { DoOutputDebugString("CAPEExceptionFilter: Reinstated BP_READWRITE on breakpoint %d (WoW64 workaround)\n", pBreakpointInfo->Register); - SetExceptionHardwareBreakpoint(ExceptionInfo->ContextRecord, pBreakpointInfo->Register, pBreakpointInfo->Size, (BYTE*)pBreakpointInfo->Address, pBreakpointInfo->Type, pBreakpointInfo->Callback); + ContextSetBreakpoint(ExceptionInfo->ContextRecord, pBreakpointInfo->Register, pBreakpointInfo->Size, (BYTE*)pBreakpointInfo->Address, pBreakpointInfo->Type, pBreakpointInfo->Callback); } else { @@ -318,11 +719,11 @@ LONG WINAPI CAPEExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo) } if (bp == 1 && ((DWORD)pBreakpointInfo->Type != ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE1)) { - if (pBreakpointInfo->Type == BP_READWRITE && ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE1 == BP_WRITE && address_is_in_stack((DWORD)pBreakpointInfo->Address)) + if (pBreakpointInfo->Type == BP_READWRITE && ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE1 == BP_WRITE && address_is_in_stack((DWORD_PTR)pBreakpointInfo->Address)) { DoOutputDebugString("CAPEExceptionFilter: Reinstated BP_READWRITE on breakpoint %d (WoW64 workaround)\n", pBreakpointInfo->Register); - SetExceptionHardwareBreakpoint(ExceptionInfo->ContextRecord, pBreakpointInfo->Register, pBreakpointInfo->Size, (BYTE*)pBreakpointInfo->Address, pBreakpointInfo->Type, pBreakpointInfo->Callback); + ContextSetBreakpoint(ExceptionInfo->ContextRecord, pBreakpointInfo->Register, pBreakpointInfo->Size, (BYTE*)pBreakpointInfo->Address, pBreakpointInfo->Type, pBreakpointInfo->Callback); } else { @@ -332,11 +733,11 @@ LONG WINAPI CAPEExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo) } if (bp == 2 && ((DWORD)pBreakpointInfo->Type != ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE2)) { - if (pBreakpointInfo->Type == BP_READWRITE && ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE2 == BP_WRITE && address_is_in_stack((DWORD)pBreakpointInfo->Address)) + if (pBreakpointInfo->Type == BP_READWRITE && ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE2 == BP_WRITE && address_is_in_stack((DWORD_PTR)pBreakpointInfo->Address)) { DoOutputDebugString("CAPEExceptionFilter: Reinstated BP_READWRITE on stack breakpoint %d (WoW64 workaround)\n", pBreakpointInfo->Register); - SetExceptionHardwareBreakpoint(ExceptionInfo->ContextRecord, pBreakpointInfo->Register, pBreakpointInfo->Size, (BYTE*)pBreakpointInfo->Address, pBreakpointInfo->Type, pBreakpointInfo->Callback); + ContextSetBreakpoint(ExceptionInfo->ContextRecord, pBreakpointInfo->Register, pBreakpointInfo->Size, (BYTE*)pBreakpointInfo->Address, pBreakpointInfo->Type, pBreakpointInfo->Callback); } else { @@ -346,11 +747,11 @@ LONG WINAPI CAPEExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo) } if (bp == 3 && ((DWORD)pBreakpointInfo->Type != ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE3)) { - if (pBreakpointInfo->Type == BP_READWRITE && ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE3 == BP_WRITE && address_is_in_stack((DWORD)pBreakpointInfo->Address)) + if (pBreakpointInfo->Type == BP_READWRITE && ((PDR7)&(ExceptionInfo->ContextRecord->Dr7))->RWE3 == BP_WRITE && address_is_in_stack((DWORD_PTR)pBreakpointInfo->Address)) { DoOutputDebugString("CAPEExceptionFilter: Reinstated BP_READWRITE on breakpoint %d (WoW64 workaround)\n", pBreakpointInfo->Register); - SetExceptionHardwareBreakpoint(ExceptionInfo->ContextRecord, pBreakpointInfo->Register, pBreakpointInfo->Size, (BYTE*)pBreakpointInfo->Address, pBreakpointInfo->Type, pBreakpointInfo->Callback); + ContextSetBreakpoint(ExceptionInfo->ContextRecord, pBreakpointInfo->Register, pBreakpointInfo->Size, (BYTE*)pBreakpointInfo->Address, pBreakpointInfo->Type, pBreakpointInfo->Callback); } else { @@ -358,6 +759,7 @@ LONG WINAPI CAPEExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo) CheckDebugRegisters(0, ExceptionInfo->ContextRecord); } } +#endif // !_WIN64 } } } @@ -375,13 +777,78 @@ LONG WINAPI CAPEExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo) return EXCEPTION_CONTINUE_EXECUTION; } - - // Some other exception occurred. Pass it to next handler + // Page guard violations generate STATUS_GUARD_PAGE_VIOLATION + else if (ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION) + { + if (ExceptionInfo->ExceptionRecord->NumberParameters < 2) + { + DoOutputDebugString("CAPEExceptionFilter: Guard page exception with missing parameters, passing.\n"); + return EXCEPTION_CONTINUE_SEARCH; + } + + //DoOutputDebugString("Entering CAPEExceptionFilter: guarded page access at 0x%x by 0x%x\n", ExceptionInfo->ExceptionRecord->ExceptionInformation[1], ExceptionInfo->ExceptionRecord->ExceptionAddress); + + if (IsInGuardPages((PVOID)ExceptionInfo->ExceptionRecord->ExceptionInformation[1])) + { + if (GuardPageHandler) + { + if (GuardPageHandler(ExceptionInfo)) + return EXCEPTION_CONTINUE_EXECUTION; + else + return EXCEPTION_CONTINUE_SEARCH; + } + else + { + DoOutputDebugString("CAPEExceptionFilter: Error, no page guard handler for CAPE guard page exception.\n"); + return EXCEPTION_CONTINUE_EXECUTION; + } + } + else + { + DoOutputDebugString("CAPEExceptionFilter: exception at 0x%x not within CAPE guarded page.\n", ExceptionInfo->ExceptionRecord->ExceptionInformation[1]); + return EXCEPTION_CONTINUE_SEARCH; + } + } + //else if (ExceptionInfo->ExceptionRecord->ExceptionCode == DBG_PRINTEXCEPTION_C) + //{ + // // This could be useful output + // // TODO: find string buffer(s) and send info to DoOutputDebugString + // return EXCEPTION_CONTINUE_SEARCH; + //} + else if (!VECTORED_HANDLER && OriginalExceptionHandler) + { + if ((ULONG_PTR)ExceptionInfo->ExceptionRecord->ExceptionAddress >= g_our_dll_base && (ULONG_PTR)ExceptionInfo->ExceptionRecord->ExceptionAddress < (g_our_dll_base + g_our_dll_size)) + { + // This is a CAPE (or Cuckoo) exception + return EXCEPTION_EXECUTE_HANDLER; + } + + // As it's not a bp, and the sample has registered its own handler + // we return EXCEPTION_EXECUTE_HANDLER + DoOutputDebugString("CAPEExceptionFilter: Non-breakpoint exception caught, passing to sample's handler.\n"); + SetUnhandledExceptionFilter(OriginalExceptionHandler); + return EXCEPTION_EXECUTE_HANDLER; + } + else if (VECTORED_HANDLER && SampleVectoredHandler) + { + // As it's not a bp and the sample has registered its own handler + DoOutputDebugString("CAPEExceptionFilter: Non-breakpoint exception caught, passing to sample's vectored handler.\n"); + SampleVectoredHandler(ExceptionInfo); + } + + if ((ULONG_PTR)ExceptionInfo->ExceptionRecord->ExceptionAddress >= g_our_dll_base && (ULONG_PTR)ExceptionInfo->ExceptionRecord->ExceptionAddress < (g_our_dll_base + g_our_dll_size)) + { + // This is a CAPE (or Cuckoo) exception + DoOutputDebugString("CAPEExceptionFilter: Exception in cuckoomon caught (expected in memory scans), passing to next handler.\n"); + return EXCEPTION_CONTINUE_SEARCH; + } + + // Some other exception occurred. Pass it to next handler. return EXCEPTION_CONTINUE_SEARCH; } //************************************************************************************** -BOOL SetExceptionDebugRegister +BOOL ContextSetDebugRegister //************************************************************************************** ( PCONTEXT Context, @@ -393,37 +860,37 @@ BOOL SetExceptionDebugRegister { DWORD Length; - PDWORD Dr0 = &(Context->Dr0); - PDWORD Dr1 = &(Context->Dr1); - PDWORD Dr2 = &(Context->Dr2); - PDWORD Dr3 = &(Context->Dr3); + PDWORD_PTR Dr0 = &(Context->Dr0); + PDWORD_PTR Dr1 = &(Context->Dr1); + PDWORD_PTR Dr2 = &(Context->Dr2); + PDWORD_PTR Dr3 = &(Context->Dr3); PDR7 Dr7 = (PDR7)&(Context->Dr7); if ((unsigned int)Type > 3) { - DoOutputDebugString("SetExceptionDebugRegister: %d is an invalid breakpoint type, must be 0-3.\n", Type); + DoOutputDebugString("ContextSetDebugRegister: %d is an invalid breakpoint type, must be 0-3.\n", Type); return FALSE; } if (Type == 2) { - DoOutputDebugString("SetExceptionDebugRegister: The value 2 is a 'reserved' breakpoint type, ultimately invalid.\n"); + DoOutputDebugString("ContextSetDebugRegister: The value 2 is a 'reserved' breakpoint type, ultimately invalid.\n"); return FALSE; } if (Register < 0 || Register > 3) { - DoOutputDebugString("SetExceptionDebugRegister: %d is an invalid register, must be 0-3.\n", Register); + DoOutputDebugString("ContextSetDebugRegister: %d is an invalid register, must be 0-3.\n", Register); return FALSE; } if (Size < 0 || Size > 8) { - DoOutputDebugString("SetExceptionDebugRegister: %d is an invalid Size, must be 1, 2, 4 or 8.\n", Size); + DoOutputDebugString("ContextSetDebugRegister: %d is an invalid Size, must be 1, 2, 4 or 8.\n", Size); return FALSE; } - DoOutputDebugString("Setting breakpoint %i within Context, Size=0x%x, Address=0x%x and Type=0x%x.\n", Register, Size, Address, Type); + DoOutputDebugString("ContextSetDebugRegister: Setting breakpoint %i within Context, Size=0x%x, Address=0x%x and Type=0x%x.\n", Register, Size, Address, Type); Length = LengthMask[Size]; @@ -431,33 +898,35 @@ BOOL SetExceptionDebugRegister if (Type == BP_EXEC) Length = 0; - if (Type == BP_READWRITE && address_is_in_stack((DWORD)Address)) +#ifndef _WIN64 + if (Type == BP_READWRITE && address_is_in_stack((DWORD_PTR)Address)) WoW64PatchBreakpoint(Register); +#endif if (Register == 0) { - *Dr0 = (DWORD)Address; + *Dr0 = (DWORD_PTR)Address; Dr7->LEN0 = Length; Dr7->RWE0 = Type; Dr7->L0 = 1; } else if (Register == 1) { - *Dr1 = (DWORD)Address; + *Dr1 = (DWORD_PTR)Address; Dr7->LEN1 = Length; Dr7->RWE1 = Type; Dr7->L1 = 1; } else if (Register == 2) { - *Dr2 = (DWORD)Address; + *Dr2 = (DWORD_PTR)Address; Dr7->LEN2 = Length; Dr7->RWE2 = Type; Dr7->L2 = 1; } else if (Register == 3) { - *Dr3 = (DWORD)Address; + *Dr3 = (DWORD_PTR)Address; Dr7->LEN3 = Length; Dr7->RWE3 = Type; Dr7->L3 = 1; @@ -483,10 +952,10 @@ BOOL SetDebugRegister DWORD Length; CONTEXT Context; - PDWORD Dr0 = &Context.Dr0; - PDWORD Dr1 = &Context.Dr1; - PDWORD Dr2 = &Context.Dr2; - PDWORD Dr3 = &Context.Dr3; + PDWORD_PTR Dr0 = &Context.Dr0; + PDWORD_PTR Dr1 = &Context.Dr1; + PDWORD_PTR Dr2 = &Context.Dr2; + PDWORD_PTR Dr3 = &Context.Dr3; PDR7 Dr7 = (PDR7)&(Context.Dr7); if ((unsigned int)Type > 3) @@ -513,12 +982,13 @@ BOOL SetDebugRegister return FALSE; } - DoOutputDebugString("Setting breakpoint %i hThread=0x%x, Size=0x%x, Address=0x%x and Type=0x%x.\n", Register, hThread, Size, Address, Type); + DoOutputDebugString("SetDebugRegister: Setting breakpoint %i hThread=0x%x, Size=0x%x, Address=0x%x and Type=0x%x.\n", Register, hThread, Size, Address, Type); Context.ContextFlags = CONTEXT_DEBUG_REGISTERS; if (!GetThreadContext(hThread, &Context)) { + DoOutputErrorString("SetDebugRegister: GetThreadContext failed"); return FALSE; } @@ -528,33 +998,35 @@ BOOL SetDebugRegister if (Type == BP_EXEC) Length = 0; - if (Type == BP_READWRITE && address_is_in_stack((DWORD)Address)) +#ifndef _WIN64 + if (Type == BP_READWRITE && address_is_in_stack((DWORD_PTR)Address)) WoW64PatchBreakpoint(Register); +#endif if (Register == 0) { - *Dr0 = (DWORD)Address; + *Dr0 = (DWORD_PTR)Address; Dr7->LEN0 = Length; Dr7->RWE0 = Type; Dr7->L0 = 1; } else if (Register == 1) { - *Dr1 = (DWORD)Address; + *Dr1 = (DWORD_PTR)Address; Dr7->LEN1 = Length; Dr7->RWE1 = Type; Dr7->L1 = 1; } else if (Register == 2) { - *Dr2 = (DWORD)Address; + *Dr2 = (DWORD_PTR)Address; Dr7->LEN2 = Length; Dr7->RWE2 = Type; Dr7->L2 = 1; } else if (Register == 3) { - *Dr3 = (DWORD)Address; + *Dr3 = (DWORD_PTR)Address; Dr7->LEN3 = Length; Dr7->RWE3 = Type; Dr7->L3 = 1; @@ -566,31 +1038,35 @@ BOOL SetDebugRegister Context.ContextFlags = CONTEXT_DEBUG_REGISTERS; if (!SetThreadContext(hThread, &Context)) - return FALSE; - + { + DoOutputErrorString("SetDebugRegister: SetThreadContext failed"); + return FALSE; + } + return TRUE; } //************************************************************************************** -BOOL ClearAllDebugRegisters(HANDLE hThread) +BOOL ContextCheckDebugRegisters(PCONTEXT Context) //************************************************************************************** -{ - CONTEXT Context; - Context.ContextFlags = CONTEXT_DEBUG_REGISTERS; - - if (!GetThreadContext(hThread, &Context)) - return FALSE; +{ + PDR7 Dr7; + + if (!Context) + { + DoOutputDebugString("CheckDebugRegisters - no context supplied.\n"); + return FALSE; + } + + Dr7 = (PDR7)&(Context->Dr7); + + DoOutputDebugString("Checking breakpoints\n"); + DoOutputDebugString("Dr0 0x%x, Dr7->LEN0 %i, Dr7->RWE0 %i, Dr7->L0 %i\n", Context->Dr0, Dr7->LEN0, Dr7->RWE0, Dr7->L0); + DoOutputDebugString("Dr1 0x%x, Dr7->LEN1 %i, Dr7->RWE1 %i, Dr7->L1 %i\n", Context->Dr1, Dr7->LEN1, Dr7->RWE1, Dr7->L1); + DoOutputDebugString("Dr2 0x%x, Dr7->LEN2 %i, Dr7->RWE2 %i, Dr7->L2 %i\n", Context->Dr2, Dr7->LEN2, Dr7->RWE2, Dr7->L2); + DoOutputDebugString("Dr3 0x%x, Dr7->LEN3 %i, Dr7->RWE3 %i, Dr7->L3 %i\n", Context->Dr3, Dr7->LEN3, Dr7->RWE3, Dr7->L3); + DoOutputDebugString("Dr6 0x%x\n", Context->Dr6); - Context.Dr0 = 0; - Context.Dr1 = 0; - Context.Dr2 = 0; - Context.Dr3 = 0; - Context.Dr6 = 0; - Context.Dr7 = 0; - - if (!SetThreadContext(hThread, &Context)) - return FALSE; - return TRUE; } @@ -599,15 +1075,15 @@ BOOL CheckDebugRegisters(HANDLE hThread, PCONTEXT pContext) //************************************************************************************** { CONTEXT Context; - PDWORD Dr0 = &Context.Dr0; - PDWORD Dr1 = &Context.Dr1; - PDWORD Dr2 = &Context.Dr2; - PDWORD Dr3 = &Context.Dr3; + PDWORD_PTR Dr0 = &Context.Dr0; + PDWORD_PTR Dr1 = &Context.Dr1; + PDWORD_PTR Dr2 = &Context.Dr2; + PDWORD_PTR Dr3 = &Context.Dr3; PDR7 Dr7 = (PDR7)&(Context.Dr7); if (!hThread && !pContext) { - DoOutputDebugString("CheckDebugRegisters - no arguments supplied.\n"); + DoOutputDebugString("CheckDebugRegisters - reqruied arguments missing.\n"); return FALSE; } @@ -636,10 +1112,100 @@ BOOL CheckDebugRegisters(HANDLE hThread, PCONTEXT pContext) } //************************************************************************************** -BOOL ClearExceptionHardwareBreakpoint(PCONTEXT Context, PBREAKPOINTINFO pBreakpointInfo) +BOOL ContextClearAllBreakpoints(PCONTEXT Context) +//************************************************************************************** +{ + unsigned int i; + PTHREADBREAKPOINTS CurrentThreadBreakpoint; + + CurrentThreadBreakpoint = GetThreadBreakpoints(GetCurrentThreadId()); + + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("ContextClearAllBreakpoints: No breakpoints found for current thread 0x%x.\n", GetCurrentThreadId()); + return FALSE; + } + + for (i=0; i < NUMBER_OF_DEBUG_REGISTERS; i++) + { + CurrentThreadBreakpoint->BreakpointInfo[i].Register = 0; + CurrentThreadBreakpoint->BreakpointInfo[i].Size = 0; + CurrentThreadBreakpoint->BreakpointInfo[i].Address = NULL; + CurrentThreadBreakpoint->BreakpointInfo[i].Type = 0; + CurrentThreadBreakpoint->BreakpointInfo[i].Callback = NULL; + } + + Context->Dr0 = 0; + Context->Dr1 = 0; + Context->Dr2 = 0; + Context->Dr3 = 0; + Context->Dr6 = 0; + Context->Dr7 = 0; + + return TRUE; +} + +//************************************************************************************** +BOOL ClearAllBreakpoints(DWORD ThreadId) //************************************************************************************** { - PDWORD Dr0, Dr1, Dr2, Dr3; + CONTEXT Context; + PTHREADBREAKPOINTS CurrentThreadBreakpoint; + unsigned int Register; + DWORD CurrentThreadId; + + CurrentThreadBreakpoint = MainThreadBreakpointList; + + while (CurrentThreadBreakpoint) + { + CurrentThreadId = MyGetThreadId(CurrentThreadBreakpoint->ThreadHandle); + + if (CurrentThreadId == ThreadId) + { + for (Register = 0; Register < NUMBER_OF_DEBUG_REGISTERS; Register++) + { + CurrentThreadBreakpoint->BreakpointInfo[Register].Register = 0; + CurrentThreadBreakpoint->BreakpointInfo[Register].Size = 0; + CurrentThreadBreakpoint->BreakpointInfo[Register].Address = NULL; + CurrentThreadBreakpoint->BreakpointInfo[Register].Type = 0; + CurrentThreadBreakpoint->BreakpointInfo[Register].Callback = NULL; + } + + Context.ContextFlags = CONTEXT_DEBUG_REGISTERS; + + if (!GetThreadContext(CurrentThreadBreakpoint->ThreadHandle, &Context)) + { + DoOutputDebugString("ClearAllBreakpoints: Error getting thread context (thread %d).\n", CurrentThreadId); + return FALSE; + } + + Context.Dr0 = 0; + Context.Dr1 = 0; + Context.Dr2 = 0; + Context.Dr3 = 0; + Context.Dr6 = 0; + Context.Dr7 = 0; + + if (!SetThreadContext(CurrentThreadBreakpoint->ThreadHandle, &Context)) + { + DoOutputDebugString("ClearAllBreakpoints: Error setting thread context (thread %d).\n", CurrentThreadId); + return FALSE; + } + + return TRUE; + } + else + CurrentThreadBreakpoint = CurrentThreadBreakpoint->NextThreadBreakpoints; + } + + return FALSE; +} + +//************************************************************************************** +BOOL ContextClearBreakpoint(PCONTEXT Context, PBREAKPOINTINFO pBreakpointInfo) +//************************************************************************************** +{ + PDWORD_PTR Dr0, Dr1, Dr2, Dr3; PDR7 Dr7; if (Context == NULL) @@ -651,7 +1217,7 @@ BOOL ClearExceptionHardwareBreakpoint(PCONTEXT Context, PBREAKPOINTINFO pBreakpo Dr3 = &(Context->Dr3); Dr7 = (PDR7)&(Context->Dr7); - DoOutputDebugString("Clearing Context breakpoint %i\n", pBreakpointInfo->Register); + DoOutputDebugString("ContextClearBreakpoint: Clearing Context breakpoint %i\n", pBreakpointInfo->Register); if (pBreakpointInfo->Register == 0) { @@ -682,8 +1248,10 @@ BOOL ClearExceptionHardwareBreakpoint(PCONTEXT Context, PBREAKPOINTINFO pBreakpo Dr7->L3 = 0; } - if (pBreakpointInfo->Type == BP_READWRITE && address_is_in_stack((DWORD)pBreakpointInfo->Address)) +#ifndef _WIN64 + if (pBreakpointInfo->Type == BP_READWRITE && address_is_in_stack((DWORD_PTR)pBreakpointInfo->Address)) WoW64UnpatchBreakpoint(pBreakpointInfo->Register); +#endif Context->Dr6 = 0; @@ -695,6 +1263,54 @@ BOOL ClearExceptionHardwareBreakpoint(PCONTEXT Context, PBREAKPOINTINFO pBreakpo return TRUE; } +//************************************************************************************** +BOOL ClearBreakpointsInRange(DWORD ThreadId, PVOID BaseAddress, SIZE_T Size) +//************************************************************************************** +{ + unsigned int Register; + DWORD CurrentThreadId; + + PTHREADBREAKPOINTS CurrentThreadBreakpoint = MainThreadBreakpointList; + + if (BaseAddress == NULL) + { + DoOutputDebugString("ClearBreakpointsInRange: No address supplied (may have already been cleared).\n"); + return FALSE; + } + + if (Size == 0) + { + DoOutputDebugString("ClearBreakpointsInRange: Size supplied is zero.\n"); + return FALSE; + } + + DoOutputDebugString("ClearBreakpointsInRange: Clearing breakpoints in range 0x%x - 0x%x.\n", BaseAddress, (BYTE*)BaseAddress + Size); + + while (CurrentThreadBreakpoint) + { + CurrentThreadId = MyGetThreadId(CurrentThreadBreakpoint->ThreadHandle); + + if (CurrentThreadId == ThreadId) + { + for (Register = 0; Register < NUMBER_OF_DEBUG_REGISTERS; Register++) + { + if ((DWORD_PTR)CurrentThreadBreakpoint->BreakpointInfo[Register].Address >= (DWORD_PTR)BaseAddress + && (DWORD_PTR)CurrentThreadBreakpoint->BreakpointInfo[Register].Address < (DWORD_PTR)((BYTE*)BaseAddress + Size)) + { + DoOutputDebugString("ClearBreakpointsInRange: Clearing breakpoint %d address 0x%x.\n", Register, CurrentThreadBreakpoint->BreakpointInfo[Register].Address); + ClearBreakpoint(CurrentThreadBreakpoint->ThreadId, Register); + } + } + + return TRUE; + } + else + CurrentThreadBreakpoint = CurrentThreadBreakpoint->NextThreadBreakpoints; + } + + return FALSE; +} + //************************************************************************************** BOOL SetResumeFlag(PCONTEXT Context) //************************************************************************************** @@ -737,6 +1353,82 @@ BOOL ClearSingleStepMode(PCONTEXT Context) return TRUE; } +//************************************************************************************** +BOOL StepOverExecutionBreakpoint(PCONTEXT Context, PBREAKPOINTINFO pBreakpointInfo) +//************************************************************************************** +// This function allows us to get past an execution breakpoint while leaving it set. It +// diaables the breakpoint, sets single-step mode to step over the instruction, whereupon +// the breakpoint is restored in ResumeAfterExecutionBreakpoint and execution resumed. +{ + PDR7 Dr7; + + if (Context == NULL) + return FALSE; + + Dr7 = (PDR7)&(Context->Dr7); + + switch(pBreakpointInfo->Register) + { + case 0: + Dr7->L0 = 0; + break; + case 1: + Dr7->L1 = 0; + break; + case 2: + Dr7->L2 = 0; + break; + case 3: + Dr7->L3 = 0; + break; + } + + // set the trap flag + Context->EFlags |= FL_TF; + + // set the 'trap index' so we know which 'register' we're skipping + // (off by one to allow 'set'/'unset' to be signified by !0/0) + TrapIndex = pBreakpointInfo->Register + 1; + + return TRUE; +} + +//************************************************************************************** +BOOL ResumeAfterExecutionBreakpoint(PCONTEXT Context) +//************************************************************************************** +{ + PDR7 Dr7; + + if (Context == NULL) + return FALSE; + + Dr7 = (PDR7)&(Context->Dr7); + + switch(TrapIndex-1) + { + case 0: + Dr7->L0 = 1; + break; + case 1: + Dr7->L1 = 1; + break; + case 2: + Dr7->L2 = 1; + break; + case 3: + Dr7->L3 = 1; + break; + } + + // Clear the trap flag + Context->EFlags &= ~FL_TF; + + // clear the 'trap index' + TrapIndex = 0; + + return TRUE; +} + //************************************************************************************** BOOL ClearDebugRegister //************************************************************************************** @@ -746,14 +1438,13 @@ BOOL ClearDebugRegister int Size, LPVOID Address, DWORD Type -) -{ +){ CONTEXT Context; BOOL DoCloseHandle = FALSE; - PDWORD Dr0 = &Context.Dr0; - PDWORD Dr1 = &Context.Dr1; - PDWORD Dr2 = &Context.Dr2; - PDWORD Dr3 = &Context.Dr3; + PDWORD_PTR Dr0 = &Context.Dr0; + PDWORD_PTR Dr1 = &Context.Dr1; + PDWORD_PTR Dr2 = &Context.Dr2; + PDWORD_PTR Dr3 = &Context.Dr3; PDR7 Dr7 = (PDR7)&(Context.Dr7); if ((unsigned int)Type > 3) @@ -774,8 +1465,6 @@ BOOL ClearDebugRegister return FALSE; } - DoOutputDebugString("Clearing breakpoint %i\n", Register); - Context.ContextFlags = CONTEXT_DEBUG_REGISTERS; if (!GetThreadContext(hThread, &Context)) @@ -813,8 +1502,10 @@ BOOL ClearDebugRegister Dr7->L3 = 0; } - if (Type == BP_READWRITE && address_is_in_stack((DWORD)Address)) +#ifndef _WIN64 + if (Type == BP_READWRITE && address_is_in_stack((DWORD_PTR)Address)) WoW64UnpatchBreakpoint(Register); +#endif Context.Dr6 = 0; @@ -827,20 +1518,20 @@ BOOL ClearDebugRegister } if (DoCloseHandle == TRUE) - CloseHandle(hThread); + CloseHandle(hThread); return TRUE; } //************************************************************************************** -int CheckExceptionDebugRegister(CONTEXT Context, int Register) +int ContextCheckDebugRegister(CONTEXT Context, int Register) //************************************************************************************** { PDR7 Dr7; if (Register < 0 || Register > 3) { - DoOutputDebugString("CheckExceptionDebugRegister: %d is an invalid register, must be 0-3.\n", Register); + DoOutputDebugString("ContextCheckDebugRegister: %d is an invalid register, must be 0-3.\n", Register); return FALSE; } @@ -896,7 +1587,7 @@ int CheckDebugRegister(HANDLE hThread, int Register) } //************************************************************************************** -BOOL SetExceptionHardwareBreakpoint +BOOL ContextSetBreakpoint //************************************************************************************** ( PCONTEXT Context, @@ -911,17 +1602,17 @@ BOOL SetExceptionHardwareBreakpoint if (Register > 3 || Register < 0) { - DoOutputDebugString("SetExceptionHardwareBreakpoint: Error - register value %d, can only have value 0-3.\n", Register); + DoOutputDebugString("ContextSetBreakpoint: Error - register value %d, can only have value 0-3.\n", Register); return FALSE; } - if (SetExceptionDebugRegister(Context, Register, Size, Address, Type) == FALSE) + if (ContextSetDebugRegister(Context, Register, Size, Address, Type) == FALSE) { - DoOutputDebugString("Call to SetExceptionDebugRegister failed.\n"); + DoOutputDebugString("ContextSetBreakpoint: Call to ContextSetDebugRegister failed.\n"); } else { - DoOutputDebugString("Call to SetExceptionDebugRegister succeeded.\n"); + DoOutputDebugString("ContextSetBreakpoint: Call to ContextSetDebugRegister succeeded.\n"); CurrentThreadBreakpoint = GetThreadBreakpoints(GetCurrentThreadId()); @@ -931,37 +1622,130 @@ BOOL SetExceptionHardwareBreakpoint return FALSE; } - CurrentThreadBreakpoint->BreakpointInfo[Register].Callback = Callback; - CurrentThreadBreakpoint->BreakpointInfo[Register].Address = Address; - CurrentThreadBreakpoint->BreakpointInfo[Register].Size = Size; - CurrentThreadBreakpoint->BreakpointInfo[Register].Type = Type; + CurrentThreadBreakpoint->BreakpointInfo[Register].ThreadHandle = CurrentThreadBreakpoint->ThreadHandle; + CurrentThreadBreakpoint->BreakpointInfo[Register].Register = Register; + CurrentThreadBreakpoint->BreakpointInfo[Register].Size = Size; + CurrentThreadBreakpoint->BreakpointInfo[Register].Address = Address; + CurrentThreadBreakpoint->BreakpointInfo[Register].Type = Type; + CurrentThreadBreakpoint->BreakpointInfo[Register].Callback = Callback; } - return 1; + return TRUE; +} + +//************************************************************************************** +BOOL ContextSetNextAvailableBreakpoint +//************************************************************************************** +( + PCONTEXT Context, + unsigned int* Register, + int Size, + LPVOID Address, + DWORD Type, + PVOID Callback +) +{ + if (ContextGetNextAvailableBreakpoint(Context, Register) == FALSE) + { + DoOutputDebugString("ContextSetNextAvailableBreakpoint: ContextGetNextAvailableBreakpoint failed\n"); + return FALSE; + } + + return ContextSetBreakpoint(Context, *Register, Size, Address, Type, Callback); +} + +//************************************************************************************** +BOOL ContextUpdateCurrentBreakpoint +//************************************************************************************** +( + PCONTEXT Context, + int Size, + LPVOID Address, + DWORD Type, + PVOID Callback +) +{ + PTHREADBREAKPOINTS CurrentThreadBreakpoint; + PBREAKPOINTINFO pBreakpointInfo; + unsigned int bp; + + CurrentThreadBreakpoint = GetThreadBreakpoints(GetCurrentThreadId()); + + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("ContextUpdateCurrentBreakpoint: Error - Failed to acquire thread breakpoints.\n"); + return FALSE; + } + + for (bp = 0; bp < NUMBER_OF_DEBUG_REGISTERS; bp++) + { + if (Context->Dr6 & (DWORD_PTR)(1 << bp)) + { + pBreakpointInfo = &(CurrentThreadBreakpoint->BreakpointInfo[bp]); + + if (pBreakpointInfo == NULL) + { + DoOutputDebugString("ContextUpdateCurrentBreakpoint: Can't get BreakpointInfo.\n"); + return FALSE; + } + + if (pBreakpointInfo->Register == bp) + { + if (bp == 0 && ((DWORD_PTR)pBreakpointInfo->Address == Context->Dr0) && ((DWORD)pBreakpointInfo->Type == ((PDR7)&(Context->Dr7))->RWE0)) + { + return ContextSetBreakpoint(Context, 0, Size, Address, Type, Callback); + } + + if (bp == 1 && ((DWORD_PTR)pBreakpointInfo->Address == Context->Dr1) && ((DWORD)pBreakpointInfo->Type == ((PDR7)&(Context->Dr7))->RWE1)) + { + return ContextSetBreakpoint(Context, 1, Size, Address, Type, Callback); + } + + if (bp == 2 && ((DWORD_PTR)pBreakpointInfo->Address == Context->Dr2) && ((DWORD)pBreakpointInfo->Type == ((PDR7)&(Context->Dr7))->RWE2)) + { + return ContextSetBreakpoint(Context, 2, Size, Address, Type, Callback); + } + + if (bp == 3 && ((DWORD_PTR)pBreakpointInfo->Address == Context->Dr3) && ((DWORD)pBreakpointInfo->Type == ((PDR7)&(Context->Dr7))->RWE3)) + { + return ContextSetBreakpoint(Context, 3, Size, Address, Type, Callback); + } + } + } + } + + return FALSE; } //************************************************************************************** DWORD WINAPI SetBreakpointThread(LPVOID lpParam) //************************************************************************************** { + DWORD RetVal; + PBREAKPOINTINFO pBreakpointInfo = (PBREAKPOINTINFO)lpParam; if (SuspendThread(pBreakpointInfo->ThreadHandle) == 0xFFFFFFFF) DoOutputErrorString("SetBreakpointThread: Call to SuspendThread failed"); - else - DoOutputDebugString("SetBreakpointThread: Current thread suspended.\n"); - - //debug - DoOutputDebugString("SetBreakpointThread: ABbout to call SetDebugRegister.\n"); if (SetDebugRegister(pBreakpointInfo->ThreadHandle, pBreakpointInfo->Register, pBreakpointInfo->Size, pBreakpointInfo->Address, pBreakpointInfo->Type) == FALSE) { - DoOutputErrorString("Call to SetDebugRegister failed"); + DoOutputErrorString("SetBreakpointThread: Call to SetDebugRegister failed"); } - DoOutputDebugString("SetBreakpointThread: Breakpoint set, about to resume thread.\n"); - - ResumeThread(pBreakpointInfo->ThreadHandle); + RetVal = ResumeThread(pBreakpointInfo->ThreadHandle); + if (RetVal == -1) + { + DoOutputErrorString("SetBreakpointThread: ResumeThread failed.\n"); + } + else if (RetVal == 0) + { + DoOutputDebugString("SetBreakpointThread: Error - Sample thread was not suspended.\n"); + } + else if (g_config.debug) + { + DoOutputDebugString("SetBreakpointThread: Sample thread was suspended, now resumed.\n"); + } return 1; } @@ -970,29 +1754,88 @@ DWORD WINAPI SetBreakpointThread(LPVOID lpParam) DWORD WINAPI ClearBreakpointThread(LPVOID lpParam) //************************************************************************************** { + DWORD RetVal; PBREAKPOINTINFO pBreakpointInfo = (PBREAKPOINTINFO)lpParam; - DoOutputDebugString("Inside ClearBreakpointThread.\n"); - if (SuspendThread(pBreakpointInfo->ThreadHandle) == 0xFFFFFFFF) DoOutputErrorString("ClearBreakpointThread: Call to SuspendThread failed"); - else - DoOutputDebugString("ClearBreakpointThread: Current thread suspended.\n"); if (ClearDebugRegister(pBreakpointInfo->ThreadHandle, pBreakpointInfo->Register, pBreakpointInfo->Size, pBreakpointInfo->Address, pBreakpointInfo->Type) == FALSE) { DoOutputDebugString("ClearBreakpointThread: Call to ClearDebugRegister failed.\n"); } - DoOutputDebugString("ClearBreakpointThread: Breakpoint cleared, about to resume thread.\n"); + RetVal = ResumeThread(pBreakpointInfo->ThreadHandle); + if (RetVal == -1) + { + DoOutputErrorString("ClearBreakpointThread: ResumeThread failed.\n"); + } + else if (RetVal == 0) + { + DoOutputDebugString("ClearBreakpointThread: Error - Sample thread was not suspended.\n"); + } + else if (g_config.debug) + { + DoOutputDebugString("ClearBreakpointThread: Sample thread was suspended, now resumed.\n"); + } + + DebugOutputThreadBreakpoints(); + + return TRUE; +} + +//************************************************************************************** +BOOL ClearBreakpointWithoutThread(DWORD ThreadId, int Register) +//************************************************************************************** +{ + PBREAKPOINTINFO pBreakpointInfo; + PTHREADBREAKPOINTS CurrentThreadBreakpoint; + + if (Register > 3 || Register < 0) + { + DoOutputDebugString("ClearBreakpointWithoutThread: Error - register value %d, can only have value 0-3.\n", Register); + return FALSE; + } + + CurrentThreadBreakpoint = GetThreadBreakpoints(ThreadId); + + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("ClearBreakpointWithoutThread: Creating new thread breakpoints for thread 0x%x.\n", ThreadId); + CurrentThreadBreakpoint = CreateThreadBreakpoints(ThreadId); + } + + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("ClearBreakpointWithoutThread: Cannot create new thread breakpoints - FATAL.\n"); + return FALSE; + } + + pBreakpointInfo = &CurrentThreadBreakpoint->BreakpointInfo[Register]; - ResumeThread(pBreakpointInfo->ThreadHandle); + if (CurrentThreadBreakpoint->ThreadHandle == NULL) + { + DoOutputDebugString("ClearBreakpointWithoutThread: There is no thread handle in the thread breakpoint - Error.\n"); + return FALSE; + } - return 1; + if (ClearDebugRegister(pBreakpointInfo->ThreadHandle, pBreakpointInfo->Register, pBreakpointInfo->Size, pBreakpointInfo->Address, pBreakpointInfo->Type) == FALSE) + { + DoOutputDebugString("ClearBreakpointWithoutThread: Call to ClearDebugRegister failed.\n"); + return FALSE; + } + + //pBreakpointInfo->Register = 0; + pBreakpointInfo->Size = 0; + pBreakpointInfo->Address = 0; + pBreakpointInfo->Type = 0; + pBreakpointInfo->Callback = NULL; + + return TRUE; } //************************************************************************************** -BOOL SetHardwareBreakpoint +BOOL SetBreakpointWithoutThread //************************************************************************************** ( DWORD ThreadId, @@ -1004,142 +1847,323 @@ BOOL SetHardwareBreakpoint ) { PBREAKPOINTINFO pBreakpointInfo; - PTHREADBREAKPOINTS CurrentThreadBreakpoints; - HANDLE hSetBreakpointThread; - + PTHREADBREAKPOINTS CurrentThreadBreakpoint; + BOOL RetVal; + if (Register > 3 || Register < 0) { - DoOutputDebugString("SetHardwareBreakpoint: Error - register value %d, can only have value 0-3.\n", Register); + DoOutputDebugString("SetBreakpointWithoutThread: Error - register value %d, can only have value 0-3.\n", Register); return FALSE; } - CurrentThreadBreakpoints = GetThreadBreakpoints(ThreadId); - - if (CurrentThreadBreakpoints == NULL) + CurrentThreadBreakpoint = GetThreadBreakpoints(ThreadId); + + if (CurrentThreadBreakpoint == NULL) { - DoOutputDebugString("Creating new thread breakpoints for thread 0x%x.\n", ThreadId); - CurrentThreadBreakpoints = CreateThreadBreakpoints(ThreadId); + DoOutputDebugString("SetBreakpointWithoutThread: Creating new thread breakpoints for thread 0x%x.\n", ThreadId); + CurrentThreadBreakpoint = CreateThreadBreakpoints(ThreadId); } - if (CurrentThreadBreakpoints == NULL) + if (CurrentThreadBreakpoint == NULL) { - DoOutputDebugString("Cannot create new thread breakpoints - FATAL.\n"); + DoOutputDebugString("SetBreakpointWithoutThread: Cannot create new thread breakpoints - FATAL.\n"); return FALSE; } - pBreakpointInfo = &CurrentThreadBreakpoints->BreakpointInfo[Register]; + pBreakpointInfo = &CurrentThreadBreakpoint->BreakpointInfo[Register]; - if (CurrentThreadBreakpoints->ThreadHandle == NULL) + if (CurrentThreadBreakpoint->ThreadHandle == NULL) { - DoOutputDebugString("SetHardwareBreakpoint: There is no thread handle in the threadbreakpoint!! FATAL ERROR.\n"); + DoOutputDebugString("SetBreakpointWithoutThread: There is no thread handle in the thread breakpoint - Error.\n"); return FALSE; } - - pBreakpointInfo->ThreadHandle = CurrentThreadBreakpoints->ThreadHandle; - pBreakpointInfo->Register = Register; - pBreakpointInfo->Size = Size; - pBreakpointInfo->Address = Address; - pBreakpointInfo->Type = Type; - pBreakpointInfo->Callback = Callback; - - OriginalExceptionHandler = SetUnhandledExceptionFilter(CAPEExceptionFilter); - //AddVectoredContinueHandler(1, CAPEExceptionFilter); + + pBreakpointInfo->ThreadHandle = CurrentThreadBreakpoint->ThreadHandle; + pBreakpointInfo->Register = Register; + pBreakpointInfo->Size = Size; + pBreakpointInfo->Address = Address; + pBreakpointInfo->Type = Type; + pBreakpointInfo->Callback = Callback; + + __try + { + RetVal = (SetDebugRegister(pBreakpointInfo->ThreadHandle, Register, Size, Address, Type)); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputErrorString("SetBreakpointWithoutThread: Exception calling SetDebugRegister"); + return FALSE; + } + + // Debug + DoOutputDebugString("SetBreakpointWithoutThread: bp set with register %d\n", Register); + + return TRUE; +} + +//************************************************************************************** +BOOL SetBreakpoint +//************************************************************************************** +( + DWORD ThreadId, + int Register, + int Size, + LPVOID Address, + DWORD Type, + PVOID Callback +) +{ + //if (DisableThreadSuspend) + // return SetBreakpointWithoutThread(ThreadId, Register, Size, Address, Type, Callback); + + PBREAKPOINTINFO pBreakpointInfo; + PTHREADBREAKPOINTS CurrentThreadBreakpoint; + HANDLE hSetBreakpointThread; + DWORD SetBreakpointThreadId; + BOOL RetVal; + + if (Register > 3 || Register < 0) + { + DoOutputDebugString("SetBreakpoint: Error - register value %d, can only have value 0-3.\n", Register); + return FALSE; + } - DoOutputDebugString("SetHardwareBreakpoint: about to call SetBreakpointThread\n"); + CurrentThreadBreakpoint = GetThreadBreakpoints(ThreadId); - hSetBreakpointThread = CreateThread( - NULL, - 0, - SetBreakpointThread, - pBreakpointInfo, - 0, - &ThreadId); + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("SetBreakpoint: Creating new thread breakpoints for thread 0x%x.\n", ThreadId); + CurrentThreadBreakpoint = CreateThreadBreakpoints(ThreadId); + } + + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("SetBreakpoint: Cannot create new thread breakpoints - error.\n"); + return FALSE; + } - if (hSetBreakpointThread == NULL) + pBreakpointInfo = &CurrentThreadBreakpoint->BreakpointInfo[Register]; + + if (CurrentThreadBreakpoint->ThreadHandle == NULL) { - DoOutputDebugString("Failed to create SetBreakpointThread thread\n"); - return 0; + DoOutputDebugString("SetBreakpoint: There is no thread handle in the thread breakpoint - Error.\n"); + return FALSE; } - DoOutputDebugString("SetHardwareBreakpoint: SetBreakpointThread called, beginning wait\n"); + + pBreakpointInfo->ThreadHandle = CurrentThreadBreakpoint->ThreadHandle; + pBreakpointInfo->Register = Register; + pBreakpointInfo->Size = Size; + pBreakpointInfo->Address = Address; + pBreakpointInfo->Type = Type; + pBreakpointInfo->Callback = Callback; + + if (VECTORED_HANDLER) + { + CAPEExceptionFilterHandle = AddVectoredExceptionHandler(1, CAPEExceptionFilter); + OriginalExceptionHandler = NULL; + } + else + { + OriginalExceptionHandler = SetUnhandledExceptionFilter(CAPEExceptionFilter); + CAPEExceptionFilterHandle = NULL; + } - // Wait until thread has terminated - WaitForSingleObject(hSetBreakpointThread, INFINITE); + __try + { + hSetBreakpointThread = CreateThread( + NULL, + 0, + SetBreakpointThread, + pBreakpointInfo, + 0, + &SetBreakpointThreadId); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputErrorString("SetBreakpoint: Unable to create SetBreakpointThread thread"); + } - CloseHandle(hSetBreakpointThread); - - DoOutputDebugString("SetHardwareBreakpoint: Callback = 0x%x, Address = 0x%x, Size = 0x%x, Register = %i, ThreadHandle = 0x%x, Type = 0x%x\n", - pBreakpointInfo->Callback, - pBreakpointInfo->Address, - pBreakpointInfo->Size, - pBreakpointInfo->Register, - pBreakpointInfo->ThreadHandle, - pBreakpointInfo->Type); - - return 1; + if (hSetBreakpointThread) + { + // If this hasn't happened in under a second, we bail + // and set without creating a thread + RetVal = WaitForSingleObject(hSetBreakpointThread, 1000); + + if (RetVal != WAIT_OBJECT_0) + { + TerminateThread(hSetBreakpointThread, 0); + DoOutputDebugString("SetBreakpoint: SetBreakpointThread timeout, thread killed.\n"); + + RetVal = ResumeThread(CurrentThreadBreakpoint->ThreadHandle); + if (RetVal == -1) + { + DoOutputErrorString("SetBreakpoint: ResumeThread failed. About to set breakpoint without thread.\n"); + } + else if (RetVal == 0) + { + DoOutputDebugString("SetBreakpoint: Sample thread was not suspended. About to set breakpoint without thread.\n"); + } + else + { + DoOutputDebugString("SetBreakpoint: Sample thread was suspended, now resumed. About to set breakpoint without thread.\n"); + } + + return SetBreakpointWithoutThread(ThreadId, Register, Size, Address, Type, Callback); + } + + DoOutputDebugString("SetBreakpoint: Set bp %d type %d at address 0x%x, size %d with Callback 0x%x, ThreadHandle = 0x%x.\n", + pBreakpointInfo->Register, + pBreakpointInfo->Type, + pBreakpointInfo->Address, + pBreakpointInfo->Size, + pBreakpointInfo->Callback, + pBreakpointInfo->ThreadHandle + ); + + CloseHandle(hSetBreakpointThread); + + return TRUE; + } + else + { + __try + { + RetVal = SetBreakpointWithoutThread(ThreadId, Register, Size, Address, Type, Callback); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputErrorString("SetBreakpoint: Error calling SetBreakpointWithoutThread"); + return FALSE; + } + + return RetVal; + } } //************************************************************************************** -BOOL ClearHardwareBreakpoint +BOOL ClearBreakpoint(DWORD ThreadId, int Register) //************************************************************************************** -( - DWORD ThreadId, - int Register -) { + return ClearBreakpointWithoutThread(ThreadId, Register); +/* PBREAKPOINTINFO pBreakpointInfo; - PTHREADBREAKPOINTS CurrentThreadBreakpoints; + PTHREADBREAKPOINTS CurrentThreadBreakpoint; HANDLE hClearBreakpointThread; + BOOL RetVal; if (Register > 3 || Register < 0) { - DoOutputDebugString("ClearHardwareBreakpoint: Error - register value %d, can only have value 0-3.\n", Register); + DoOutputDebugString("ClearBreakpoint: Error - register value %d, can only have value 0-3.\n", Register); return FALSE; } - CurrentThreadBreakpoints = GetThreadBreakpoints(ThreadId); + CurrentThreadBreakpoint = GetThreadBreakpoints(ThreadId); - if (CurrentThreadBreakpoints == NULL) + if (CurrentThreadBreakpoint == NULL) { DoOutputDebugString("Cannot find thread breakpoints - failed to clear.\n"); return FALSE; } - pBreakpointInfo = &CurrentThreadBreakpoints->BreakpointInfo[Register]; + pBreakpointInfo = &CurrentThreadBreakpoint->BreakpointInfo[Register]; - if (CurrentThreadBreakpoints->ThreadHandle == NULL) + if (CurrentThreadBreakpoint->ThreadHandle == NULL) { - DoOutputDebugString("ClearHardwareBreakpoint: There is no thread handle in the threadbreakpoint!! FATAL ERROR.\n"); + DoOutputDebugString("ClearBreakpoint: There is no thread handle in the thread breakpoint - Error.\n"); return FALSE; } - else DoOutputDebugString("ClearHardwareBreakpoint: Thread handle 0x%x found in BreakpointInfo struct.\n", CurrentThreadBreakpoints->ThreadHandle); - - DoOutputDebugString("About to create ClearBreakpointThread thread\n"); - pBreakpointInfo->ThreadHandle = CurrentThreadBreakpoints->ThreadHandle; - - hClearBreakpointThread = CreateThread(NULL, 0, ClearBreakpointThread, pBreakpointInfo, 0, &ThreadId); + pBreakpointInfo->ThreadHandle = CurrentThreadBreakpoint->ThreadHandle; - if (hClearBreakpointThread == NULL) - { - DoOutputDebugString("Failed to create ClearBreakpointThread thread\n"); - return 0; - } + __try + { + hClearBreakpointThread = CreateThread(NULL, 0, ClearBreakpointThread, pBreakpointInfo, 0, &ThreadId); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputErrorString("ClearBreakpoint: Unable to create ClearBreakpointThread thread"); + } - DoOutputDebugString("Successfully created ClearBreakpointThread thread\n"); + if (hClearBreakpointThread) + { + DoOutputDebugString("ClearBreakpoint: thread created, handle 0x%x.\n", hClearBreakpointThread); + + // If this hasn't happened in under a second, we bail + // and clear without creating a thread + RetVal = WaitForSingleObject(hClearBreakpointThread, 1000); + + DoOutputDebugString("ClearBreakpoint: Aboot tae close handle.\n"); + //CloseHandle(hClearBreakpointThread); + + if (RetVal != WAIT_OBJECT_0) + { + DoOutputDebugString("ClearBreakpoint: thread timeout, falling back to clearing without thread.\n"); - // Wait until thread has terminated. - WaitForSingleObject(hClearBreakpointThread, INFINITE); + return ClearBreakpointWithoutThread(ThreadId, Register); + } + + DoOutputDebugString("ClearBreakpoint: Cleared breakpoint %d.\n", pBreakpointInfo->Register); - // Close thread handle and free memory allocations. - pBreakpointInfo->Register = 0; + return TRUE; + } + else + { + __try + { + RetVal = ClearBreakpointWithoutThread(ThreadId, Register); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputErrorString("ClearBreakpoint: Error calling ClearBreakpointWithoutThread"); + return FALSE; + } + + return RetVal; + } + + //pBreakpointInfo->Register = 0; pBreakpointInfo->Size = 0; pBreakpointInfo->Address = 0; pBreakpointInfo->Type = 0; pBreakpointInfo->Callback = NULL; - CheckDebugRegisters(pBreakpointInfo->ThreadHandle, 0); + return TRUE; +*/ +} + +//************************************************************************************** +BOOL SetNextAvailableBreakpoint +//************************************************************************************** +( + DWORD ThreadId, + unsigned int* Register, + int Size, + LPVOID Address, + DWORD Type, + PVOID Callback +) +{ + PTHREADBREAKPOINTS CurrentThreadBreakpoint = GetThreadBreakpoints(ThreadId); + + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("SetNextAvailableBreakpoint: Creating new thread breakpoints for thread 0x%x.\n", ThreadId); + CurrentThreadBreakpoint = CreateThreadBreakpoints(ThreadId); + } - return 1; + if (CurrentThreadBreakpoint == NULL) + { + DoOutputDebugString("SetNextAvailableBreakpoint: Cannot create new thread breakpoints - FATAL.\n"); + return FALSE; + } + + if (GetNextAvailableBreakpoint(ThreadId, Register) == FALSE) + { + DoOutputDebugString("SetNextAvailableBreakpoint: GetNextAvailableBreakpoint failed\n"); + return FALSE; + } + + return SetBreakpoint(ThreadId, *Register, Size, Address, Type, Callback); } //************************************************************************************** @@ -1171,19 +2195,41 @@ BOOL InitialiseDebugger(void) } // Initialise any global variables - + ChildProcessId = 0; + SingleStepHandler = NULL; + SampleVectoredHandler = NULL; + VECTORED_HANDLER = TRUE; + +#ifndef _WIN64 // Ensure wow64 patch is installed if needed WoW64fix(); +#endif return TRUE; } +//************************************************************************************** +DWORD_PTR GetNestedStackPointer(void) +//************************************************************************************** +{ + CONTEXT context; + + RtlCaptureContext(&context); + +#ifdef _WIN64 + return (DWORD_PTR)context.Rsp; +#else + return (DWORD_PTR)context.Esp; +#endif +} + +#ifndef _WIN64 //************************************************************************************** __declspec (naked dllexport) void DebuggerInit(void) //************************************************************************************** { DWORD StackPointer; - + _asm { push ebp @@ -1194,13 +2240,16 @@ __declspec (naked dllexport) void DebuggerInit(void) pushad } - InitialiseDebugger(); - -// Target specific code - -// End of target specific code + DebuggerInitialised = InitialiseDebugger(); + +// Package specific code + GuardPageHandler = (GUARD_PAGE_HANDLER)ExtractionGuardPageHandler; +// End of package specific code - DoOutputDebugString("Debugger initialised, about to execute OEP.\n"); + if (!DebuggerInitialised) + DoOutputDebugString("Debugger initialisation failure!\n"); + else + DoOutputDebugString("Debugger initialisation complete, about to execute OEP at 0x%x\n", OEP); _asm { @@ -1209,11 +2258,72 @@ __declspec (naked dllexport) void DebuggerInit(void) pop ebp jmp OEP } +} +#else +#pragma optimize("", off) +//************************************************************************************** +void DebuggerInit(void) +//************************************************************************************** +{ + DWORD_PTR StackPointer; + + StackPointer = GetNestedStackPointer() - 8; // this offset has been determined experimentally - TODO: tidy + + DebuggerInitialised = InitialiseDebugger(); + +// Package specific code + GuardPageHandler = (GUARD_PAGE_HANDLER)ExtractionGuardPageHandler; +// End of package specific code + + if (!DebuggerInitialised) + DoOutputDebugString("Debugger initialisation failure!\n"); + else + DoOutputDebugString("Debugger initialisation complete, about to execute OEP at 0x%x\n", OEP); + + OEP(); +} +#pragma optimize("", on) +#endif + +BOOL SendDebuggerMessage(DWORD Input) +{ + BOOL fSuccess; + DWORD cbReplyBytes, cbWritten; + //struct DEBUGGER_DATA DebuggerData; + + //memset(&DebuggerData, 0, sizeof(struct DEBUGGER_DATA)); + + cbReplyBytes = sizeof(DWORD_PTR); + + if (hCapePipe == NULL) + { + DoOutputErrorString("SendDebuggerMessage: hCapePipe NULL."); + return FALSE; + } + + // Write the reply to the pipe. + fSuccess = WriteFile + ( + hCapePipe, // handle to pipe + &Input, // buffer to write from + cbReplyBytes, // number of bytes to write + &cbWritten, // number of bytes written + NULL // not overlapped I/O + ); + + if (!fSuccess || cbReplyBytes != cbWritten) + { + DoOutputErrorString("SendDebuggerMessage: Failed to send message via pipe"); + return FALSE; + } + DoOutputDebugString("SendDebuggerMessage: Sent message via pipe: 0x%x\n", Input); + + return TRUE; } //************************************************************************************** -DWORD WINAPI DebuggerThread(LPVOID lpParam) +DWORD WINAPI DebuggerLaunch(LPVOID lpParam) //************************************************************************************** { HANDLE hPipe; @@ -1224,7 +2334,7 @@ DWORD WINAPI DebuggerThread(LPVOID lpParam) char lpszPipename[MAX_PATH]; OSVERSIONINFO VersionInfo; - DoOutputDebugString("DebuggerThread: About to connect to CAPEpipe.\n"); + DoOutputDebugString("DebuggerLaunch: About to connect to CAPEpipe.\n"); memset(lpszPipename, 0, MAX_PATH*sizeof(CHAR)); sprintf_s(lpszPipename, MAX_PATH, "\\\\.\\pipe\\CAPEpipe_%x", GetCurrentProcessId()); @@ -1245,13 +2355,13 @@ DWORD WINAPI DebuggerThread(LPVOID lpParam) if (GetLastError() != ERROR_PIPE_BUSY) { - DoOutputErrorString("Could not open pipe"); + DoOutputErrorString("DebuggerLaunch: Could not open pipe"); return -1; } if (!WaitNamedPipe(lpszPipename, 20)) { - DoOutputDebugString("Could not open pipe: 20 ms wait timed out.\n"); + DoOutputDebugString("DebuggerLaunch: Could not open pipe: 20 ms wait timed out.\n"); return -1; } } @@ -1267,7 +2377,7 @@ DWORD WINAPI DebuggerThread(LPVOID lpParam) ); if (!fSuccess) { - DoOutputDebugString("SetNamedPipeHandleState failed.\n"); + DoOutputDebugString("DebuggerLaunch: SetNamedPipeHandleState failed.\n"); return -1; } @@ -1286,36 +2396,67 @@ DWORD WINAPI DebuggerThread(LPVOID lpParam) ); if (!fSuccess) { - DoOutputErrorString("WriteFile to pipe failed"); + DoOutputErrorString("DebuggerLaunch: WriteFile to pipe failed"); return -1; } - DoOutputDebugString("DebuggerInit VA sent to loader: 0x%x\n", FuncAddress); + DoOutputDebugString("DebuggerLaunch: DebuggerInit VA sent to loader: 0x%x\n", FuncAddress); fSuccess = ReadFile( hPipe, &OEP, - sizeof(DWORD), + sizeof(DWORD_PTR), &cbRead, NULL); if (!fSuccess && GetLastError() == ERROR_MORE_DATA) { - DoOutputDebugString("ReadFile on Pipe: ERROR_MORE_DATA\n"); + DoOutputDebugString("DebuggerLaunch: ReadFile on Pipe: ERROR_MORE_DATA\n"); CloseHandle(hPipe); return -1; } if (!fSuccess) { - DoOutputErrorString("ReadFile from pipe failed"); + DoOutputErrorString("DebuggerLaunch: ReadFile (OEP) from pipe failed"); CloseHandle(hPipe); return -1; } - DoOutputDebugString("Read OEP from pipe: 0x%x\n", OEP); + DoOutputDebugString("DebuggerLaunch: Read OEP from pipe: 0x%x\n", OEP); - //CloseHandle(hPipe); + while (1) + { + fSuccess = ReadFile( + hPipe, + &OEP, + sizeof(DWORD_PTR), + &cbRead, + NULL); + + if (!fSuccess && GetLastError() == ERROR_BROKEN_PIPE) + { + DoOutputDebugString("DebuggerLaunch: Pipe closed, no further updates to OEP\n"); + CloseHandle(hPipe); + break; + } + + if (!fSuccess && GetLastError() == ERROR_MORE_DATA) + { + DoOutputDebugString("DebuggerLaunch: ReadFile on Pipe: ERROR_MORE_DATA\n"); + CloseHandle(hPipe); + return -1; + } + + if (!fSuccess) + { + DoOutputErrorString("DebuggerLaunch: ReadFile from pipe failed"); + CloseHandle(hPipe); + return -1; + } + else + DoOutputDebugString("DebuggerLaunch: Read updated EP from pipe: 0x%x\n", OEP); + } ZeroMemory(&VersionInfo, sizeof(OSVERSIONINFO)); VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); @@ -1326,7 +2467,7 @@ DWORD WINAPI DebuggerThread(LPVOID lpParam) if (NT5) { DoOutputDebugString("NT5: Leaving debugger thread alive.\n"); - while(1) + while (1) { Sleep(500000); } @@ -1353,18 +2494,18 @@ BOOL DebugNewProcess(unsigned int ProcessId, unsigned int ThreadId, DWORD Creati hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, ProcessId); if (hProcess == NULL) { - DoOutputErrorString("CAPE debug pipe: OpenProcess failed"); + DoOutputErrorString("DebugNewProcess: OpenProcess failed"); return FALSE; } hThread = OpenThread(THREAD_ALL_ACCESS, TRUE, ThreadId); if (hThread == NULL) { - DoOutputErrorString("CAPE debug pipe: OpenThread failed"); + DoOutputErrorString("DebugNewProcess: OpenThread failed"); return FALSE; } - hParentPipe = CreateNamedPipe + hCapePipe = CreateNamedPipe ( lpszPipename, PIPE_ACCESS_DUPLEX, @@ -1378,38 +2519,33 @@ BOOL DebugNewProcess(unsigned int ProcessId, unsigned int ThreadId, DWORD Creati NULL ); - if (hParentPipe == INVALID_HANDLE_VALUE) + if (hCapePipe == INVALID_HANDLE_VALUE) { - DoOutputErrorString("CreateNamedPipe failed"); + DoOutputErrorString("DebugNewProcess: CreateNamedPipe failed"); return FALSE; } -#ifndef STANDALONE - //pipe("PROCESS:%d:%d,%d", 0, ProcessId, 0); // we need CreateRemoteThread injection - pipe("PROCESS:%d:%d,%d", (CreationFlags & CREATE_SUSPENDED) ? 1 : 0, ProcessId, ThreadId); - DoOutputDebugString("DebugNewProcess: Announcing new process to Cuckoo.\n"); -#endif + DoOutputDebugString("DebugNewProcess: Announcing new process to Cuckoo, pid: %d\n", ProcessId); + pipe("DEBUGGER:%d,%d", ProcessId, ThreadId); - fConnected = ConnectNamedPipe(hParentPipe, NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); + fConnected = ConnectNamedPipe(hCapePipe, NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); fSuccess = FALSE; cbBytesRead = 0; if (!fConnected) { - DoOutputDebugString("The client could not connect, closing pipe.\n"); - - CloseHandle(hParentPipe); - - return -15; + DoOutputDebugString("DebugNewProcess: The client could not connect, closing pipe.\n"); + CloseHandle(hCapePipe); + return FALSE; } - DoOutputDebugString("Client connected\n"); + DoOutputDebugString("DebugNewProcess: Client connected.\n"); fSuccess = ReadFile ( - hParentPipe, - &RemoteFuncAddress, - sizeof(DWORD), + hCapePipe, + &DebuggerEP, + sizeof(DWORD_PTR), &cbBytesRead, NULL ); @@ -1418,36 +2554,40 @@ BOOL DebugNewProcess(unsigned int ProcessId, unsigned int ThreadId, DWORD Creati { if (GetLastError() == ERROR_BROKEN_PIPE) { - DoOutputErrorString("Client disconnected."); + DoOutputErrorString("DebugNewProcess: Client disconnected."); } else { - DoOutputErrorString("ReadFile failed."); + DoOutputErrorString("DebugNewProcess: ReadFile failed."); } } - if (!RemoteFuncAddress) + if (!DebuggerEP) { - DoOutputErrorString("Successfully read from pipe, however RemoteFuncAddress = 0."); + DoOutputErrorString("DebugNewProcess: Successfully read from pipe, however DebuggerEP = 0."); return FALSE; } Context.ContextFlags = CONTEXT_ALL; if (!GetThreadContext(hThread, &Context)) { - DoOutputDebugString("GetThreadContext failed - FATAL\n"); + DoOutputDebugString("DebugNewProcess: GetThreadContext failed - FATAL\n"); return FALSE; } +#ifdef _WIN64 + OEP = (PVOID)Context.Rcx; +#else OEP = (PVOID)Context.Eax; +#endif cbWritten = 0; - cbReplyBytes = sizeof(DWORD); + cbReplyBytes = sizeof(DWORD_PTR); - // Write the reply to the pipe. + // Send the OEP to the new process fSuccess = WriteFile ( - hParentPipe, + hCapePipe, &OEP, cbReplyBytes, &cbWritten, @@ -1455,7 +2595,7 @@ BOOL DebugNewProcess(unsigned int ProcessId, unsigned int ThreadId, DWORD Creati ); if (!fSuccess || cbReplyBytes != cbWritten) { - DoOutputErrorString("Failed to send OEP via pipe."); + DoOutputErrorString("DebugNewProcess: Failed to send OEP via pipe."); return FALSE; } @@ -1463,17 +2603,24 @@ BOOL DebugNewProcess(unsigned int ProcessId, unsigned int ThreadId, DWORD Creati Context.ContextFlags = CONTEXT_ALL; - Context.Eax = RemoteFuncAddress; // eax holds new entry point +#ifdef _WIN64 + Context.Rcx = DebuggerEP; // set the new EP to debugger_init +#else + Context.Eax = DebuggerEP; +#endif if (!SetThreadContext(hThread, &Context)) { - DoOutputDebugString("Failed to set new EP\n"); + DoOutputDebugString("DebugNewProcess: Failed to set new EP\n"); return FALSE; } - DoOutputDebugString("Set new EP to DebuggerInit: 0x%x\n", Context.Eax); +#ifdef _WIN64 + DoOutputDebugString("DebugNewProcess: Set new EP to DebuggerInit: 0x%x\n", Context.Rcx); +#else + DoOutputDebugString("DebugNewProcess: Set new EP to DebuggerInit: 0x%x\n", Context.Eax); +#endif - //CloseHandle(hParentPipe); CloseHandle(hProcess); CloseHandle(hThread); @@ -1484,31 +2631,35 @@ BOOL DebugNewProcess(unsigned int ProcessId, unsigned int ThreadId, DWORD Creati int launch_debugger() //************************************************************************************** { - DWORD NewThreadId; - HANDLE hDebuggerThread; - - DoOutputDebugString("CAPE: Launching debugger.\n"); - - hDebuggerThread = CreateThread( - NULL, - 0, - DebuggerThread, - NULL, - 0, - &NewThreadId); - - if (hDebuggerThread == NULL) + if (DEBUGGER_LAUNCHER) { - DoOutputDebugString("CAPE: Failed to create debug pipe thread.\n"); - return 0; + DWORD NewThreadId; + HANDLE hDebuggerLaunch; + + hDebuggerLaunch = CreateThread( + NULL, + 0, + DebuggerLaunch, + NULL, + 0, + &NewThreadId); + + if (hDebuggerLaunch == NULL) + { + DoOutputDebugString("CAPE: Failed to create debugger launch thread.\n"); + return 0; + } + + DoOutputDebugString("CAPE: Launching debugger.\n"); + + CloseHandle(hDebuggerLaunch); + + return 1; } else { - DoOutputDebugString("CAPE: Successfully created debug pipe thread.\n"); + DebuggerInitialised = InitialiseDebugger(); + + return DebuggerInitialised; } - - CloseHandle(hDebuggerThread); - - return 1; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/CAPE/Debugger.h b/CAPE/Debugger.h index d089e41..754cd8b 100644 --- a/CAPE/Debugger.h +++ b/CAPE/Debugger.h @@ -1,10 +1,23 @@ #pragma once +#define DEBUGGER_LAUNCHER 0 + #define BP_EXEC 0x00 #define BP_WRITE 0x01 #define BP_RESERVED 0x02 #define BP_READWRITE 0x03 +#define EXECUTABLE_FLAGS (PAGE_EXECUTE | PAGE_EXECUTE_READ | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY) + +#define EXTRACTION_MIN_SIZE 0x1001 + +typedef struct _EXCEPTION_REGISTRATION_RECORD { + struct _EXCEPTION_REGISTRATION_RECORD *Next; + PEXCEPTION_ROUTINE Handler; +} EXCEPTION_REGISTRATION_RECORD; + +typedef EXCEPTION_REGISTRATION_RECORD *PEXCEPTION_REGISTRATION_RECORD; + typedef struct BreakpointInfo { HANDLE ThreadHandle; @@ -25,42 +38,75 @@ typedef struct ThreadBreakpoints struct ThreadBreakpoints *NextThreadBreakpoints; } THREADBREAKPOINTS, *PTHREADBREAKPOINTS; +typedef struct GuardPages +{ + PVOID BaseAddress; + SIZE_T RegionSize; + ULONG Protect; + BOOL WriteDetected; + PVOID LastWriteAddress; + BOOL ReadDetected; + PVOID LastReadBy; + BOOL PagesDumped; + struct GuardPages *NextGuardPages; +} GUARDPAGES, *PGUARDPAGES; + +struct GuardPages *GuardPageList; + typedef BOOL (cdecl *SINGLE_STEP_HANDLER)(struct _EXCEPTION_POINTERS*); +typedef BOOL (cdecl *GUARD_PAGE_HANDLER)(struct _EXCEPTION_POINTERS*); +typedef BOOL (cdecl *SAMPLE_HANDLER)(struct _EXCEPTION_POINTERS*); + +typedef void (WINAPI *PWIN32ENTRY)(); #ifdef __cplusplus extern "C" { #endif -BOOL SetHardwareBreakpoint -( - DWORD ThreadId, - int Register, - int Size, - LPVOID Address, - DWORD Type, - PVOID Callback -); - -BOOL ClearHardwareBreakpoint(DWORD ThreadId, int Register); - -BOOL SetExceptionHardwareBreakpoint -( - PCONTEXT Context, - int Register, - int Size, - LPVOID Address, - DWORD Type, - PVOID Callback -); - -BOOL ClearExceptionHardwareBreakpoint(PCONTEXT Context, PBREAKPOINTINFO pBreakpointInfo); +BOOL DebuggerInitialised; + +void* CAPE_var; + +LONG WINAPI CAPEExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo); +PVOID CAPEExceptionFilterHandle; +SAMPLE_HANDLER SampleVectoredHandler; +PEXCEPTION_ROUTINE SEH_TopLevelHandler; +LPTOP_LEVEL_EXCEPTION_FILTER OriginalExceptionHandler; +BOOL VECTORED_HANDLER; + +DWORD ChildProcessId; +DWORD ChildThreadId; +DWORD_PTR DebuggerEP; +PWIN32ENTRY OEP; + +BOOL SetBreakpoint(DWORD ThreadId, int Register, int Size, LPVOID Address, DWORD Type, PVOID Callback); +BOOL ClearBreakpoint(DWORD ThreadId, int Register); +BOOL ContextSetBreakpoint(PCONTEXT Context, int Register, int Size, LPVOID Address, DWORD Type, PVOID Callback); +BOOL GetNextAvailableBreakpoint(DWORD ThreadId, unsigned int* Register); +BOOL ContextGetNextAvailableBreakpoint(PCONTEXT Context, unsigned int* Register); +BOOL ContextUpdateCurrentBreakpoint(PCONTEXT Context, int Size, LPVOID Address, DWORD Type, PVOID Callback); +BOOL SetNextAvailableBreakpoint(DWORD ThreadId, unsigned int* Register, int Size, LPVOID Address, DWORD Type, PVOID Callback); +BOOL ContextSetNextAvailableBreakpoint(PCONTEXT Context, unsigned int* Register, int Size, LPVOID Address, DWORD Type, PVOID Callback); +BOOL ContextClearBreakpoint(PCONTEXT Context, PBREAKPOINTINFO pBreakpointInfo); +BOOL ClearBreakpointsInRange(DWORD ThreadId, PVOID BaseAddress, SIZE_T Size); BOOL SetSingleStepMode(PCONTEXT Context, PVOID Handler); BOOL ClearSingleStepMode(PCONTEXT Context); -BOOL ClearAllDebugRegisters(HANDLE hThread); +BOOL ContextClearAllBreakpoints(PCONTEXT Context); +BOOL ClearAllBreakpoints(DWORD ThreadId); BOOL CheckDebugRegisters(HANDLE hThread, PCONTEXT pContext); +int CheckDebugRegister(HANDLE hThread, int Register); +int ContextCheckDebugRegister(CONTEXT Context, int Register); BOOL InitialiseDebugger(void); BOOL DebugNewProcess(unsigned int ProcessId, unsigned int ThreadId, DWORD CreationFlags); +BOOL SendDebuggerMessage(DWORD Input); int launch_debugger(void); +BOOL IsInGuardPages(PVOID Address); +PGUARDPAGES GetGuardPages(PVOID Address); +BOOL DropGuardPages(PGUARDPAGES GuardPages); +PGUARDPAGES CreateGuardPagess(); +BOOL AddGuardPages(PVOID Address, SIZE_T RegionSize, ULONG Protect); +BOOL ReinstateGuardPages(PGUARDPAGES GuardPages); +BOOL DisableGuardPages(PGUARDPAGES GuardPages); #ifdef __cplusplus } diff --git a/CAPE/GetThreadId.c b/CAPE/GetThreadId.c index 360a104..727bf75 100644 --- a/CAPE/GetThreadId.c +++ b/CAPE/GetThreadId.c @@ -117,5 +117,5 @@ DWORD MyGetThreadId FreeLibrary(hModule); - return (DWORD)ThreadBasicInfo.ClientId.UniqueThread; + return (DWORD)(UINT_PTR)ThreadBasicInfo.ClientId.UniqueThread; } diff --git a/CAPE/Output.c b/CAPE/Output.c index fb805a4..80b7d10 100644 --- a/CAPE/Output.c +++ b/CAPE/Output.c @@ -18,13 +18,19 @@ along with this program.If not, see . #include #include #include - +#include "cape.h" #include "..\pipe.h" +#include "..\config.h" + +#define MAX_INT_STRING_LEN 10 // 4294967294 TCHAR DebugOutput[MAX_PATH]; TCHAR PipeOutput[MAX_PATH]; TCHAR ErrorOutput[MAX_PATH]; +extern struct CapeMetadata *CapeMetaData; +extern ULONG_PTR base_of_dll_of_interest; + //************************************************************************************** void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...) //************************************************************************************** @@ -35,11 +41,11 @@ void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...) memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); _vsntprintf_s(DebugOutput, MAX_PATH, MAX_PATH, lpOutputString, args); +#ifdef STANDALONE OutputDebugString(DebugOutput); - +#else memset(PipeOutput, 0, MAX_PATH*sizeof(TCHAR)); _sntprintf_s(PipeOutput, MAX_PATH, MAX_PATH, "DEBUG:%s", DebugOutput); -#ifndef STANDALONE pipe(PipeOutput, strlen(PipeOutput)); #endif va_end(args); @@ -72,11 +78,11 @@ void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...) memset(ErrorOutput, 0, MAX_PATH*sizeof(TCHAR)); _sntprintf_s(ErrorOutput, MAX_PATH, MAX_PATH, "Error %d (0x%x) - %s: %s", ErrorCode, ErrorCode, DebugOutput, (char*)lpMsgBuf); +#ifdef STANDALONE OutputDebugString(ErrorOutput); - +#else memset(PipeOutput, 0, MAX_PATH*sizeof(TCHAR)); _sntprintf_s(PipeOutput, MAX_PATH, MAX_PATH, "DEBUG:%s", ErrorOutput); -#ifndef STANDALONE pipe(PipeOutput, strlen(PipeOutput)); #endif @@ -89,14 +95,134 @@ void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...) void CapeOutputFile(_In_ LPCTSTR lpOutputFile) //************************************************************************************** { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _sntprintf_s(DebugOutput, MAX_PATH, MAX_PATH, "CAPE Output file: %s", lpOutputFile); - OutputDebugString(DebugOutput); + char MetadataPath[MAX_PATH]; + HANDLE hMetadata; + SIZE_T BufferSize; + char *Buffer; + DWORD dwBytesWritten; + + if (CapeMetaData && CapeMetaData->DumpType == PROCDUMP) + { + memset(MetadataPath, 0, MAX_PATH * sizeof(TCHAR)); + _sntprintf_s(MetadataPath, MAX_PATH, MAX_PATH, "%s_info.txt", lpOutputFile); + hMetadata = CreateFile(MetadataPath, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + + if (hMetadata == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_EXISTS) + { + DoOutputDebugString("CAPE metadata filename exists already: %s", MetadataPath); + return; + } + + if (hMetadata == INVALID_HANDLE_VALUE) + { + DoOutputErrorString("Could not create CAPE metadata file"); + return; + } + + BufferSize = 3 * (MAX_PATH + MAX_INT_STRING_LEN + 2) + 2; //// max size string can be + + Buffer = malloc(BufferSize); + + // if our file of interest is a dll, we need to update cape module path now + if (base_of_dll_of_interest) + { + if (g_config.file_of_interest == NULL) + { + DoOutputDebugString("CAPE Error: g_config.file_of_interest is NULL.\n", g_config.file_of_interest); + return; + } + + CapeMetaData->ModulePath = (char*)malloc(MAX_PATH); + WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, (LPCWSTR)g_config.file_of_interest, wcslen(g_config.file_of_interest)+1, CapeMetaData->ModulePath, MAX_PATH, NULL, NULL); + } + else + CapeMetaData->ModulePath = CapeMetaData->ProcessPath; + + // This metadata format is specific to process dumps + _snprintf_s(Buffer, BufferSize, BufferSize, "%d\n%d\n%s\n%s\n", CapeMetaData->DumpType, CapeMetaData->Pid, CapeMetaData->ProcessPath, CapeMetaData->ModulePath); + + if (FALSE == WriteFile(hMetadata, Buffer, strlen(Buffer), &dwBytesWritten, NULL)) + { + DoOutputDebugString("WriteFile error on CAPE metadata file %s\n"); + CloseHandle(hMetadata); + free(Buffer); + return; + } + + CloseHandle(hMetadata); + + memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); + _sntprintf_s(DebugOutput, MAX_PATH, MAX_PATH, "Process dump output file: %s", lpOutputFile); +#ifdef STANDALONE + OutputDebugString(DebugOutput); +#else + memset(PipeOutput, 0, MAX_PATH*sizeof(TCHAR)); + _sntprintf_s(PipeOutput, MAX_PATH, MAX_PATH, "FILE_DUMP:%s", lpOutputFile); + pipe(PipeOutput, strlen(PipeOutput)); +#endif - memset(PipeOutput, 0, MAX_PATH*sizeof(TCHAR)); - _sntprintf_s(PipeOutput, MAX_PATH, MAX_PATH, "FILE_CAPE:%s", lpOutputFile); -#ifndef STANDALONE - pipe(PipeOutput, strlen(PipeOutput)); + } + else if (CapeMetaData && CapeMetaData->DumpType != PROCDUMP) + { + memset(MetadataPath, 0, MAX_PATH * sizeof(TCHAR)); + _sntprintf_s(MetadataPath, MAX_PATH, MAX_PATH, "%s_info.txt", lpOutputFile); + hMetadata = CreateFile(MetadataPath, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); + + if (hMetadata == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_EXISTS) + { + DoOutputDebugString("CAPE metadata filename exists already: %s", MetadataPath); + return; + } + + if (hMetadata == INVALID_HANDLE_VALUE) + { + DoOutputErrorString("Could not create CAPE metadata file"); + return; + } + + BufferSize = 3 * (MAX_PATH + MAX_INT_STRING_LEN + 2) + 2; //// max size string can be + + Buffer = malloc(BufferSize); + + CapeMetaData->ModulePath = CapeMetaData->ProcessPath; + + if (CapeMetaData->DumpType == EXTRACTION_PE || CapeMetaData->DumpType == EXTRACTION_SHELLCODE) + { + // Extraction-specific format + _snprintf_s(Buffer, BufferSize, BufferSize, "%d\n%d\n%s\n%s\n0x%x\n", CapeMetaData->DumpType, CapeMetaData->Pid, CapeMetaData->ProcessPath, CapeMetaData->ModulePath, (DWORD)CapeMetaData->Address); + } + else if (CapeMetaData->DumpType == INJECTION_PE || CapeMetaData->DumpType == INJECTION_SHELLCODE || CapeMetaData->DumpType == EVILGRAB_PAYLOAD || CapeMetaData->DumpType == EVILGRAB_DATA) + { + if (CapeMetaData->TargetProcess && CapeMetaData->ProcessPath) + // Injection-specific format + _snprintf_s(Buffer, BufferSize, BufferSize, "%d\n%d\n%s\n%s\n%s\n%d\n", CapeMetaData->DumpType, CapeMetaData->Pid, CapeMetaData->ProcessPath, CapeMetaData->ModulePath, CapeMetaData->TargetProcess, CapeMetaData->TargetPid); + } + else + if (CapeMetaData->ProcessPath) + _snprintf_s(Buffer, BufferSize, BufferSize, "%d\n%d\n%s\n%s\n", CapeMetaData->DumpType, CapeMetaData->Pid, CapeMetaData->ProcessPath, CapeMetaData->ModulePath); + + if (FALSE == WriteFile(hMetadata, Buffer, strlen(Buffer), &dwBytesWritten, NULL)) + { + DoOutputDebugString("WriteFile error on CAPE metadata file %s\n"); + CloseHandle(hMetadata); + free(Buffer); + return; + } + + CloseHandle(hMetadata); + + memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); + _sntprintf_s(DebugOutput, MAX_PATH, MAX_PATH, "CAPE Output file: %s", lpOutputFile); +#ifdef STANDALONE + OutputDebugString(DebugOutput); +#else + memset(PipeOutput, 0, MAX_PATH*sizeof(TCHAR)); + _sntprintf_s(PipeOutput, MAX_PATH, MAX_PATH, "FILE_CAPE:%s", lpOutputFile); + pipe(PipeOutput, strlen(PipeOutput)); #endif + } + else + DoOutputDebugString("No CAPE metadata (or wrong type) for file: %s\n", lpOutputFile); + return; -} \ No newline at end of file +} diff --git a/CAPE/Scylla/ApiReader.h b/CAPE/Scylla/ApiReader.h index 45e67ef..54d1431 100644 --- a/CAPE/Scylla/ApiReader.h +++ b/CAPE/Scylla/ApiReader.h @@ -29,6 +29,7 @@ class ApiReader : public ProcessAccessHelp void addFoundApiToModuleList(DWORD_PTR iatAddress, ApiInfo * apiFound, bool isNewModule, bool isSuspect); void clearAll(); bool isInvalidMemoryForIat( DWORD_PTR address ); + void parseModuleWithOwnProcess( ModuleInfo * module ); private: bool readExportTableAlwaysFromDisk; void parseIAT(DWORD_PTR addressIAT, BYTE * iatBuffer, SIZE_T size); @@ -49,7 +50,6 @@ class ApiReader : public ProcessAccessHelp void findApiByModule(ModuleInfo * module, char * searchFunctionName, WORD ordinal, DWORD_PTR * vaApi, DWORD_PTR * rvaApi); bool isModuleLoadedInOwnProcess( ModuleInfo * module ); - void parseModuleWithOwnProcess( ModuleInfo * module ); bool isPeAndExportTableValid(PIMAGE_NT_HEADERS pNtHeader); void findApiInProcess( ModuleInfo * module, char * searchFunctionName, WORD ordinal, DWORD_PTR * vaApi, DWORD_PTR * rvaApi ); bool findApiInExportTable(ModuleInfo *module, PIMAGE_EXPORT_DIRECTORY pExportDir, DWORD_PTR deltaAddress, char * searchFunctionName, WORD ordinal, DWORD_PTR * vaApi, DWORD_PTR * rvaApi); diff --git a/CAPE/Scylla/IATReferenceScan.cpp b/CAPE/Scylla/IATReferenceScan.cpp index 471a21d..7e1690e 100644 --- a/CAPE/Scylla/IATReferenceScan.cpp +++ b/CAPE/Scylla/IATReferenceScan.cpp @@ -67,8 +67,6 @@ void IATReferenceScan::startScan(DWORD_PTR imageBase, DWORD imageSize, DWORD_PTR iatDirectImportList.reserve(50); } - - DWORD_PTR section = imageBase; do @@ -410,7 +408,6 @@ void IATReferenceScan::patchNewIat(DWORD_PTR stdImagebase, DWORD_PTR newIatBaseA } } - void IATReferenceScan::printDirectImportLog() { DoOutputDebugString("------------------------------------------------------------"); @@ -455,7 +452,6 @@ void IATReferenceScan::printDirectImportLog() DoOutputDebugString("------------------------------------------------------------"); } - void IATReferenceScan::findDirectIatReferenceCallJmp( _DInst * instruction ) { IATReference ref; @@ -735,5 +731,3 @@ DWORD IATReferenceScan::addAdditionalApisToList() return newIatSize; } - - diff --git a/CAPE/Scylla/IATSearch.cpp b/CAPE/Scylla/IATSearch.cpp index f035fa7..4404f3f 100644 --- a/CAPE/Scylla/IATSearch.cpp +++ b/CAPE/Scylla/IATSearch.cpp @@ -51,6 +51,7 @@ bool IATSearch::findIATAdvanced( DWORD_PTR startAddress, DWORD_PTR* addressIAT, #ifdef DEBUG_COMMENTS DoOutputDebugString("findAPIAddressInIAT2 :: error reading memory"); #endif + delete [] dataBuffer; return false; } @@ -277,6 +278,7 @@ bool IATSearch::findIATStartAndSize(DWORD_PTR address, DWORD_PTR * addressIAT, D #ifdef DEBUG_COMMENTS DoOutputDebugString("findIATStartAddress :: error reading memory"); #endif + delete [] dataBuffer; return false; } diff --git a/CAPE/Scylla/ImportsHandling.cpp b/CAPE/Scylla/ImportsHandling.cpp index ba791f0..4724f15 100644 --- a/CAPE/Scylla/ImportsHandling.cpp +++ b/CAPE/Scylla/ImportsHandling.cpp @@ -3,12 +3,6 @@ #include "Thunks.h" #include "Architecture.h" -#include -#include -#include "multitree.h" // CMultiSelectTreeViewCtrl - -//#include "resource.h" - //#define DEBUG_COMMENTS extern "C" void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); @@ -59,59 +53,6 @@ ImportsHandling::ImportsHandling() ImportsHandling::~ImportsHandling() { - TreeIcons.Destroy(); -} - -bool ImportsHandling::isModule(CTreeItem item) -{ - return (0 != getModuleThunk(item)); -} - -bool ImportsHandling::isImport(CTreeItem item) -{ - return (0 != getImportThunk(item)); -} - -ImportModuleThunk * ImportsHandling::getModuleThunk(CTreeItem item) -{ - stdext::hash_map::const_iterator it; - it = itemData.find(item); - if(it != itemData.end()) - { - const TreeItemData * data = &it->second; - if(data->isModule) - { - return data->module; - } - } - return NULL; -} - -ImportThunk * ImportsHandling::getImportThunk(CTreeItem item) -{ - stdext::hash_map::const_iterator it; - TreeItemData * data = getItemData(item); - if(data && !data->isModule) - { - return data->import; - } - return NULL; -} - -void ImportsHandling::setItemData(CTreeItem item, const TreeItemData * data) -{ - itemData[item] = *data; -} - -ImportsHandling::TreeItemData * ImportsHandling::getItemData(CTreeItem item) -{ - stdext::hash_map::iterator it; - it = itemData.find(item); - if(it != itemData.end()) - { - return &it->second; - } - return NULL; } void ImportsHandling::updateCounts() @@ -144,160 +85,17 @@ void ImportsHandling::updateCounts() } } -/*bool ImportsHandling::addImport(const CHAR * moduleName, const CHAR * name, DWORD_PTR va, DWORD_PTR rva, WORD ordinal, bool valid, bool suspect) -{ - ImportThunk import; - ImportModuleThunk * module = 0; - std::map::iterator iterator1; - - if (moduleList.size() > 1) - { - iterator1 = moduleList.begin(); - while (iterator1 != moduleList.end()) - { - if (rva >= iterator1->second.firstThunk) - { - iterator1++; - if (iterator1 == moduleList.end()) - { - iterator1--; - module = &(iterator1->second); - break; - } - else if (rva < iterator1->second.firstThunk) - { - iterator1--; - module = &(iterator1->second); - break; - } - } - } - } - else - { - iterator1 = moduleList.begin(); - module = &(iterator1->second); - } - - if (!module) - { - DoOutputDebugString("ImportsHandling::addFunction module not found rva " PRINTF_DWORD_PTR_FULL, rva); - return false; - } - - //TODO - import.suspect = true; - import.valid = false; - import.va = va; - import.rva = rva; - import.ordinal = ordinal; - - strcpy_s(import.moduleName, MAX_PATH, moduleName); - strcpy_s(import.name, MAX_PATH, name); - - module->thunkList.insert(std::pair(import.rva, import)); - - return true; -} -*/ - -/* -bool ImportsHandling::addModule(const CHAR * moduleName, DWORD_PTR firstThunk) -{ - ImportModuleThunk module; - - module.firstThunk = firstThunk; - strcpy_s(module.moduleName, MAX_PATH, moduleName); - - moduleList.insert(std::pair(firstThunk,module)); - - return true; -} - -void ImportsHandling::displayAllImports() -{ - std::map::iterator it_module; - std::map::iterator it_import; - - //TreeImports.DeleteAllItems(); - itemData.clear(); - //TreeImports.SetImageList(TreeIcons); - - it_module = moduleList.begin(); - while (it_module != moduleList.end()) - { - ImportModuleThunk &moduleThunk = it_module->second; - - moduleThunk.key = moduleThunk.firstThunk; // This belongs elsewhere... - //moduleThunk.hTreeItem = addDllToTreeView(TreeImports, &moduleThunk); - - it_import = moduleThunk.thunkList.begin(); - while (it_import != moduleThunk.thunkList.end()) - { - ImportThunk &importThunk = it_import->second; - - importThunk.key = importThunk.rva; // This belongs elsewhere... - importThunk.hTreeItem = addApiToTreeView(TreeImports, moduleThunk.hTreeItem, &importThunk); - - it_import++; - } - - it_module++; - } - - updateCounts(); -} -*/ - void ImportsHandling::clearAllImports() { - //TreeImports.DeleteAllItems(); - itemData.clear(); moduleList.clear(); updateCounts(); } -/* -CTreeItem ImportsHandling::addDllToTreeView(CMultiSelectTreeViewCtrl& idTreeView, ImportModuleThunk * moduleThunk) -{ - CTreeItem item = idTreeView.InsertItem("", NULL, TVI_ROOT); - - item.SetData(itemData.size()); - - TreeItemData data; - data.isModule = true; - data.module = moduleThunk; - - setItemData(item, &data); - - updateModuleInTreeView(moduleThunk, item); - return item; -} - -CTreeItem ImportsHandling::addApiToTreeView(CMultiSelectTreeViewCtrl& idTreeView, CTreeItem parentDll, ImportThunk * importThunk) -{ - CTreeItem item = idTreeView.InsertItem("", parentDll, TVI_LAST); - - item.SetData(itemData.size()); - - TreeItemData data; - data.isModule = false; - data.import = importThunk; - - setItemData(item, &data); - - updateImportInTreeView(importThunk, item); - return item; -} -*/ - void ImportsHandling::selectImports(bool invalid, bool suspect) { std::map::iterator it_module; std::map::iterator it_import; - //TreeImports.SelectAllItems(FALSE); //remove selection - it_module = moduleList.begin(); while (it_module != moduleList.end()) { @@ -307,13 +105,6 @@ void ImportsHandling::selectImports(bool invalid, bool suspect) while (it_import != moduleThunk.thunkList.end()) { ImportThunk &importThunk = it_import->second; - - if ((invalid && !importThunk.valid) || (suspect && importThunk.suspect)) - { - //TreeImports.SelectItem(importThunk.hTreeItem, TRUE); - importThunk.hTreeItem.EnsureVisible(); - } - it_import++; } @@ -321,232 +112,6 @@ void ImportsHandling::selectImports(bool invalid, bool suspect) } } -bool ImportsHandling::invalidateImport(CTreeItem item) -{ - ImportThunk * import = getImportThunk(item); - if(import) - { - CTreeItem parent = item.GetParent(); - if(!parent.IsNull()) - { - const ImportModuleThunk * module = getModuleThunk(parent); - if(module) - { - import->invalidate(); - - updateImportInTreeView(import, import->hTreeItem); - updateModuleInTreeView(module, module->hTreeItem); - - updateCounts(); - return true; - } - } - } - return false; -} - -bool ImportsHandling::invalidateModule(CTreeItem item) -{ - ImportModuleThunk * module = getModuleThunk(item); - if(module) - { - std::map::iterator it_import; - - it_import = module->thunkList.begin(); - while(it_import != module->thunkList.end()) - { - ImportThunk * import = &it_import->second; - import->invalidate(); - updateImportInTreeView(import, import->hTreeItem); - it_import++; - } - - updateModuleInTreeView(module, module->hTreeItem); - - updateCounts(); - return true; - } - return false; -} - -bool ImportsHandling::setImport(CTreeItem item, const CHAR * moduleName, const CHAR * apiName, WORD ordinal, WORD hint, bool valid, bool suspect) -{ - ImportThunk * import = getImportThunk(item); - if(import) - { - CTreeItem parent = item.GetParent(); - if(!parent.IsNull()) - { - ImportModuleThunk * module = getModuleThunk(parent); - if(module) - { - - strcpy_s(import->moduleName, moduleName); - strcpy_s(import->name, apiName); - import->ordinal = ordinal; - //import->apiAddressVA = api->va; //?? - import->hint = hint; - import->valid = valid; - import->suspect = suspect; - - if (module->isValid()) - { - scanAndFixModuleList(); - //displayAllImports(); - } - else - { - updateImportInTreeView(import, item); - updateCounts(); - } - return true; - } - } - } - return false; -} - -void ImportsHandling::updateImportInTreeView(const ImportThunk * importThunk, CTreeItem item) -{ - if (importThunk->valid) - { - CHAR tempString[300]; - - if (importThunk->name[0] != 0x00) - { - sprintf_s(tempString, "ord: %04X name: %s", importThunk->ordinal, importThunk->name); - } - else - { - sprintf_s(tempString, "ord: %04X", importThunk->ordinal); - } - - sprintf_s(stringBuffer, " rva: " PRINTF_DWORD_PTR_HALF " mod: %s %s", importThunk->rva, importThunk->moduleName, tempString); - } - else - { - sprintf_s(stringBuffer, " rva: " PRINTF_DWORD_PTR_HALF " ptr: " PRINTF_DWORD_PTR_FULL, importThunk->rva, importThunk->apiAddressVA); - } - -// item.SetText(stringBuffer); -// Icon icon = getAppropiateIcon(importThunk); -// item.SetImage(icon, icon); -} - -void ImportsHandling::updateModuleInTreeView(const ImportModuleThunk * importThunk, CTreeItem item) -{ - sprintf_s(stringBuffer, "%s (%d) FThunk: " PRINTF_DWORD_PTR_HALF, importThunk->moduleName,importThunk->thunkList.size(), importThunk->firstThunk); - - item.SetText(stringBuffer); - Icon icon = getAppropiateIcon(importThunk->isValid()); - item.SetImage(icon, icon); -} - -ImportsHandling::Icon ImportsHandling::getAppropiateIcon(const ImportThunk * importThunk) -{ - if(importThunk->valid) - { - if(importThunk->suspect) - { - return iconWarning; - } - else - { - return iconCheck; - } - } - else - { - return iconError; - } -} - -ImportsHandling::Icon ImportsHandling::getAppropiateIcon(bool valid) -{ - if(valid) - { - return iconCheck; - } - else - { - return iconError; - } -} - -bool ImportsHandling::cutImport(CTreeItem item) -{ - ImportThunk * import = getImportThunk(item); - if(import) - { - CTreeItem parent = item.GetParent(); - if(!parent.IsNull()) - { - ImportModuleThunk * module = getModuleThunk(parent); - if(module) - { - itemData.erase(item); - import->hTreeItem.Delete(); - module->thunkList.erase(import->key); - import = 0; - - if (module->thunkList.empty()) - { - itemData.erase(parent); - module->hTreeItem.Delete(); - moduleList.erase(module->key); - module = 0; - } - else - { - if (module->isValid() && module->moduleName[0] == L'?') - { - //update module name - strcpy_s(module->moduleName, module->thunkList.begin()->second.moduleName); - } - - module->firstThunk = module->thunkList.begin()->second.rva; - updateModuleInTreeView(module, module->hTreeItem); - } - - updateCounts(); - return true; - } - } - } - return false; -} - -bool ImportsHandling::cutModule(CTreeItem item) -{ - ImportModuleThunk * module = getModuleThunk(item); - if(module) - { - CTreeItem child = item.GetChild(); - while(!child.IsNull()) - { - itemData.erase(child); - child = child.GetNextSibling(); - } - itemData.erase(item); - module->hTreeItem.Delete(); - moduleList.erase(module->key); - module = 0; - updateCounts(); - return true; - } - return false; -} - -DWORD_PTR ImportsHandling::getApiAddressByNode(CTreeItem item) -{ - const ImportThunk * import = getImportThunk(item); - if(import) - { - return import->apiAddressVA; - } - return 0; -} - void ImportsHandling::scanAndFixModuleList() { CHAR prevModuleName[MAX_PATH] = {0}; @@ -787,29 +352,3 @@ bool ImportsHandling::addFunctionToModuleList(const ImportThunk * apiFound) module->thunkList[import.key] = import; return true; } - -void ImportsHandling::expandAllTreeNodes() -{ - changeExpandStateOfTreeNodes(TVE_EXPAND); -} - -void ImportsHandling::collapseAllTreeNodes() -{ - changeExpandStateOfTreeNodes(TVE_COLLAPSE); -} - -void ImportsHandling::changeExpandStateOfTreeNodes(UINT flag) -{ - std::map::iterator it_module; - - it_module = moduleList.begin(); - while (it_module != moduleList.end()) - { - ImportModuleThunk &moduleThunk = it_module->second; - - moduleThunk.hTreeItem.Expand(flag); - - it_module++; - } -} - diff --git a/CAPE/Scylla/ImportsHandling.h b/CAPE/Scylla/ImportsHandling.h index 75299ed..3c1ee9b 100644 --- a/CAPE/Scylla/ImportsHandling.h +++ b/CAPE/Scylla/ImportsHandling.h @@ -1,15 +1,9 @@ #pragma once +#include #include #include -// WTL -#include -#include -#include // CTreeItem - -class CMultiSelectTreeViewCtrl; - class ImportThunk; class ImportModuleThunk; @@ -26,28 +20,10 @@ class ImportsHandling unsigned int invalidThunkCount() const { return m_invalidThunkCount; } unsigned int suspectThunkCount() const { return m_suspectThunkCount; } - bool isModule(CTreeItem item); - bool isImport(CTreeItem item); - - ImportModuleThunk * getModuleThunk(CTreeItem item); - ImportThunk * getImportThunk(CTreeItem item); - - //void displayAllImports(); void clearAllImports(); void selectImports(bool invalid, bool suspect); - bool invalidateImport(CTreeItem item); - bool invalidateModule(CTreeItem item); - bool setImport(CTreeItem item, const CHAR * moduleName, const CHAR * apiName, WORD ordinal = 0, WORD hint = 0, bool valid = true, bool suspect = false); - bool cutImport(CTreeItem item); - bool cutModule(CTreeItem item); - //bool addImport(const CHAR * moduleName, const CHAR * name, DWORD_PTR va, DWORD_PTR rva, WORD ordinal = 0, bool valid = true, bool suspect = false); - //bool addModule(const CHAR * moduleName, DWORD_PTR firstThunk); - - DWORD_PTR getApiAddressByNode(CTreeItem selectedTreeNode); void scanAndFixModuleList(); - void expandAllTreeNodes(); - void collapseAllTreeNodes(); private: DWORD numberOfFunctions; @@ -56,58 +32,15 @@ class ImportsHandling unsigned int m_invalidThunkCount; unsigned int m_suspectThunkCount; - struct TreeItemData - { - bool isModule; - union - { - ImportModuleThunk * module; - ImportThunk * import; - }; - }; - - stdext::hash_map itemData; - - void setItemData(CTreeItem item, const TreeItemData * data); - TreeItemData * getItemData(CTreeItem item); - CHAR stringBuffer[600]; - //CMultiSelectTreeViewCtrl& TreeImports; - CImageList TreeIcons; - CIcon hIconCheck; - CIcon hIconWarning; - CIcon hIconError; - - // They have to be added to the image list in that order! - enum Icon { - iconCheck = 0, - iconWarning, - iconError - }; - void updateCounts(); - CTreeItem addDllToTreeView(CMultiSelectTreeViewCtrl& idTreeView, ImportModuleThunk * moduleThunk); - CTreeItem addApiToTreeView(CMultiSelectTreeViewCtrl& idTreeView, CTreeItem parentDll, ImportThunk * importThunk); - - void updateImportInTreeView(const ImportThunk * importThunk, CTreeItem item); - void updateModuleInTreeView(const ImportModuleThunk * importThunk, CTreeItem item); - - //bool isItemSelected(CTreeItem hItem); - //void unselectItem(CTreeItem htItem); - //bool selectItem(CTreeItem hItem, bool select = true); bool findNewModules(std::map & thunkList); - Icon getAppropiateIcon(const ImportThunk * importThunk); - Icon getAppropiateIcon(bool valid); - bool addModuleToModuleList(const CHAR * moduleName, DWORD_PTR firstThunk); void addUnknownModuleToModuleList(DWORD_PTR firstThunk); bool addNotFoundApiToModuleList(const ImportThunk * apiNotFound); bool addFunctionToModuleList(const ImportThunk * apiFound); bool isNewModule(const CHAR * moduleName); - - void changeExpandStateOfTreeNodes(UINT flag); - }; diff --git a/CAPE/Scylla/PeParser.cpp b/CAPE/Scylla/PeParser.cpp index 079ea8d..87727f5 100644 --- a/CAPE/Scylla/PeParser.cpp +++ b/CAPE/Scylla/PeParser.cpp @@ -1,4 +1,3 @@ - #include "PeParser.h" #include "ProcessAccessHelp.h" #include @@ -6,11 +5,15 @@ #pragma comment(lib, "Imagehlp.lib") +//#define DEBUG_COMMENTS +#define SIZE_LIMIT 0x1000000 + extern "C" void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); extern "C" void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); extern "C" void CapeOutputFile(LPCTSTR lpOutputFile); +extern "C" void ProcessDumpOutputFile(LPCTSTR lpOutputFile); -char ScyllaOutputPath[MAX_PATH]; +char CapeOutputPath[MAX_PATH]; PeParser::PeParser() { @@ -46,7 +49,7 @@ PeParser::PeParser(const DWORD_PTR moduleBase, bool readSectionHeaders) if (moduleBaseAddress) { readPeHeaderFromProcess(readSectionHeaders); - + if (readSectionHeaders) { if (isValidPeFile()) @@ -95,6 +98,7 @@ void PeParser::initClass() filename = 0; fileSize = 0; + dumpSize = 0; moduleBaseAddress = 0; hFile = INVALID_HANDLE_VALUE; } @@ -221,7 +225,10 @@ bool PeParser::readPeHeaderFromProcess(bool readSectionHeaders) if (readSize < correctSize) { - readSize = correctSize; +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::readPeHeaderFromProcess: Correcting header size to 0x%x.\n", correctSize); +#endif + readSize = correctSize; delete [] headerMemory; headerMemory = new BYTE[readSize]; @@ -272,7 +279,6 @@ bool PeParser::readPeHeaderFromFile(bool readSectionHeaders) } } - delete [] headerMemory; headerMemory = new BYTE[readSize]; @@ -296,20 +302,104 @@ bool PeParser::readPeSectionsFromProcess() { bool retValue = true; DWORD_PTR readOffset = 0; + DWORD fileAlignment = 0, sectionAlignment = 0; + unsigned int NumberOfSections = getNumberOfSections(); + + if (isPE32()) + { + fileAlignment = pNTHeader32->OptionalHeader.FileAlignment; + sectionAlignment = pNTHeader32->OptionalHeader.SectionAlignment; + } + else + { + fileAlignment = pNTHeader64->OptionalHeader.FileAlignment; + sectionAlignment = pNTHeader64->OptionalHeader.SectionAlignment; + } - listPeSection.reserve(getNumberOfSections()); - - for (WORD i = 0; i < getNumberOfSections(); i++) + listPeSection.reserve(NumberOfSections); + + for (WORD i = 0; i < NumberOfSections; i++) { readOffset = listPeSection[i].sectionHeader.VirtualAddress + moduleBaseAddress; - listPeSection[i].normalSize = listPeSection[i].sectionHeader.Misc.VirtualSize; + if (i < NumberOfSections - 1) + { + if ((listPeSection[i].sectionHeader.Misc.VirtualSize) > (listPeSection[i+1].sectionHeader.VirtualAddress - listPeSection[i].sectionHeader.VirtualAddress)) + { + listPeSection[i].normalSize = alignValue(listPeSection[i+1].sectionHeader.VirtualAddress - listPeSection[i].sectionHeader.VirtualAddress, sectionAlignment); +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::readPeSectionsFromProcess: Correcting VirtualSize for section %d from 0x%x to 0x%x.\n", i+1, listPeSection[i].sectionHeader.Misc.VirtualSize, listPeSection[i].normalSize); +#endif + } + else + { + listPeSection[i].normalSize = alignValue(listPeSection[i].sectionHeader.Misc.VirtualSize, sectionAlignment); +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::readPeSectionsFromProcess: VirtualSize for section %d ok: 0x%x.\n", i+1, listPeSection[i].sectionHeader.Misc.VirtualSize); +#endif + } + + if (i) + { + DWORD EndOfPreviousSection = alignValue(listPeSection[i-1].sectionHeader.VirtualAddress + listPeSection[i-1].sectionHeader.Misc.VirtualSize, sectionAlignment); + + if (listPeSection[i].sectionHeader.VirtualAddress && (listPeSection[i].sectionHeader.VirtualAddress != EndOfPreviousSection)) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::readPeSectionsFromProcess: Correcting VirtualAddress for section %d from: 0x%x to 0x%x.\n", i+1, listPeSection[i].sectionHeader.VirtualAddress, EndOfPreviousSection); +#endif + listPeSection[i].sectionHeader.VirtualAddress = EndOfPreviousSection; + } + } + } + else + { + if ((listPeSection[i].sectionHeader.Misc.VirtualSize) > alignValue(listPeSection[i].sectionHeader.SizeOfRawData, sectionAlignment)) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::readPeSectionsFromProcess: Correcting VirtualSize for last section (%d) from 0x%x to 0x%x.\n", i+1, listPeSection[i].sectionHeader.Misc.VirtualSize, alignValue(listPeSection[i].sectionHeader.SizeOfRawData, sectionAlignment)); +#endif + listPeSection[i].normalSize = alignValue(listPeSection[i].sectionHeader.SizeOfRawData, sectionAlignment); + } + else + { + listPeSection[i].normalSize = alignValue(listPeSection[i].sectionHeader.Misc.VirtualSize, sectionAlignment); +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::readPeSectionsFromProcess: VirtualSize for last section (%d) ok: 0x%x.\n", i+1, listPeSection[i].sectionHeader.Misc.VirtualSize); +#endif + } + + if (i) + { + DWORD EndOfPreviousSection = alignValue(listPeSection[i-1].sectionHeader.VirtualAddress + listPeSection[i-1].sectionHeader.Misc.VirtualSize, sectionAlignment); + + if (listPeSection[i].sectionHeader.VirtualAddress && (listPeSection[i].sectionHeader.VirtualAddress != EndOfPreviousSection)) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::readPeSectionsFromProcess: Correcting VirtualAddress for last section (%d) from: 0x%x to 0x%x.\n", i+1, listPeSection[i].sectionHeader.VirtualAddress, EndOfPreviousSection); +#endif + listPeSection[i].sectionHeader.VirtualAddress = EndOfPreviousSection; + } + } + } + + if (listPeSection[i].sectionHeader.Misc.VirtualSize > SIZE_LIMIT) + { + DoOutputDebugString("PeParser: Section %d size too big: 0x%x\n", i+1, listPeSection[i].sectionHeader.Misc.VirtualSize); + return false; + } if (!readSectionFromProcess(readOffset, listPeSection[i])) { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::readPeSectionsFromProcess: readSectionFromProcess failed offset 0x%x, section %d\n", readOffset, i+1); +#endif retValue = false; } } +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::readPeSectionsFromProcess: readSectionFromProcess success.\n"); +#endif return retValue; } @@ -321,7 +411,6 @@ bool PeParser::readPeSectionsFromFile() listPeSection.reserve(getNumberOfSections()); - if (openFileHandle()) { for (WORD i = 0; i < getNumberOfSections(); i++) @@ -396,7 +485,8 @@ std::vector & PeParser::getSectionHeaderList() void PeParser::getDosAndNtHeader(BYTE * memory, LONG size) { pDosHeader = (PIMAGE_DOS_HEADER)memory; - + DWORD readSize = getInitialHeaderReadSize(true); + pNTHeader32 = 0; pNTHeader64 = 0; dosStubSize = 0; @@ -418,6 +508,74 @@ void PeParser::getDosAndNtHeader(BYTE * memory, LONG size) pDosHeader->e_lfanew = sizeof(IMAGE_DOS_HEADER); } } + + if (!pDosHeader->e_lfanew) + { + // In case the header until and including 'PE' has been zeroed (e.g. Ursnif) + PIMAGE_NT_HEADERS pNtHeader = NULL; + WORD* MachineProbe = (WORD*)&pDosHeader->e_lfanew; + while ((PUCHAR)MachineProbe < (PUCHAR)&pDosHeader + (readSize - offsetof(IMAGE_DOS_HEADER, e_lfanew))) + { + if (*MachineProbe == IMAGE_FILE_MACHINE_I386 || *MachineProbe == IMAGE_FILE_MACHINE_AMD64) + pNtHeader = (PIMAGE_NT_HEADERS)((PUCHAR)MachineProbe - 4); + MachineProbe += sizeof(WORD); + } + + if (pNtHeader) + pDosHeader->e_lfanew = (LONG)((PUCHAR)pNtHeader - (PUCHAR)pDosHeader); + } + + if (!pDosHeader->e_lfanew) + { + // In case the header until and including 'PE' is missing + PIMAGE_NT_HEADERS pNtHeader = NULL; + WORD* MachineProbe = (WORD*)pDosHeader; + while ((PUCHAR)MachineProbe < (PUCHAR)pDosHeader + (readSize - offsetof(IMAGE_DOS_HEADER, e_lfanew))) + { + if (*MachineProbe == IMAGE_FILE_MACHINE_I386 || *MachineProbe == IMAGE_FILE_MACHINE_AMD64) + { + if ((PUCHAR)MachineProbe >= (PUCHAR)pDosHeader + 4 && !pNtHeader) + { + pNtHeader = (PIMAGE_NT_HEADERS)((PUCHAR)MachineProbe - 4); + } + } + MachineProbe += sizeof(WORD); + + if (pNtHeader && (PUCHAR)pNtHeader == (PUCHAR)pDosHeader) + { + SIZE_T HeaderShift = sizeof(IMAGE_DOS_HEADER); + delete [] headerMemory; + headerMemory = new BYTE[readSize]; + memset(headerMemory, 0, readSize); + if (ProcessAccessHelp::readMemoryPartlyFromProcess(moduleBaseAddress, readSize - HeaderShift, headerMemory + HeaderShift)) + { + pDosHeader = (PIMAGE_DOS_HEADER)headerMemory; + pNtHeader = (PIMAGE_NT_HEADERS)(headerMemory + HeaderShift); + pDosHeader->e_lfanew = (LONG)((PUCHAR)pNtHeader - (PUCHAR)pDosHeader); + } +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::getDosAndNtHeader: Corrected: DOS header 0x%x, lfanew 0x%x, NT header 0x%x.\n", pDosHeader, pDosHeader->e_lfanew, pNtHeader); +#endif + } + } + } + + if (pDosHeader->e_lfanew && pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) + { + PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PUCHAR)pDosHeader + (ULONG)pDosHeader->e_lfanew); + + if ((pNtHeader->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) || (pNtHeader->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)) + { + pDosHeader->e_magic = IMAGE_DOS_SIGNATURE; + pNtHeader->Signature = IMAGE_NT_SIGNATURE; + } + } + + if (pDosHeader->e_lfanew) + { + pNTHeader32 = (PIMAGE_NT_HEADERS32)((DWORD_PTR)pDosHeader + pDosHeader->e_lfanew); + pNTHeader64 = (PIMAGE_NT_HEADERS64)((DWORD_PTR)pDosHeader + pDosHeader->e_lfanew); + } } DWORD PeParser::calcCorrectPeHeaderSize(bool readSectionHeaders) @@ -508,7 +666,7 @@ bool PeParser::openFileHandle() return (hFile != INVALID_HANDLE_VALUE); } -bool PeParser::openWriteFileHandle( const CHAR * newFile ) +bool PeParser::openWriteFileHandle(const CHAR *newFile) { if (newFile) { @@ -517,9 +675,8 @@ bool PeParser::openWriteFileHandle( const CHAR * newFile ) else { // If no name was specified, let's give it a temporary name to allow it to be renamed later with its hash value - hFile = CreateFile(SCYLLA_OUTPUT_FILE, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + hFile = CreateFile(CAPE_OUTPUT_FILE, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); } - return (hFile != INVALID_HANDLE_VALUE); } @@ -558,6 +715,9 @@ bool PeParser::readSectionFrom(const DWORD_PTR readOffset, PeFileSection & peFil if (!readOffset || !readSize) { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser: readSectionFrom: readOffset or readSize zero: 0x%x, 0x%x\n", readOffset, readSize); +#endif return true; //section without data is valid } @@ -566,6 +726,10 @@ bool PeParser::readSectionFrom(const DWORD_PTR readOffset, PeFileSection & peFil peFileSection.dataSize = readSize; peFileSection.normalSize = readSize; +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser: readSectionFrom: readSize <= maxReadSize: 0x%x.\n", readSize); +#endif + if (isProcess) { return readPeSectionFromProcess(readOffset, peFileSection); @@ -584,11 +748,14 @@ bool PeParser::readSectionFrom(const DWORD_PTR readOffset, PeFileSection & peFil } currentOffset = readOffset + readSize - currentReadSize; +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser: About to reverse-scan section from 0x%p size 0x%x.\n", readOffset, readSize); +#endif while(currentOffset >= readOffset) //start from the end { ZeroMemory(data, currentReadSize); - + if (isProcess) { retValue = ProcessAccessHelp::readMemoryPartlyFromProcess(currentOffset, currentReadSize, data); @@ -600,14 +767,24 @@ bool PeParser::readSectionFrom(const DWORD_PTR readOffset, PeFileSection & peFil if (!retValue) { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser: readMemory failure reading from 0x%p (currentReadSize 0x%x).\n", currentOffset, currentReadSize); +#endif break; } +#ifdef DEBUG_COMMENTS + //else + // DoOutputDebugString("PeParser: Read memory chunk from 0x%p size 0x%x.\n", currentOffset, currentReadSize); +#endif valuesFound = isMemoryNotNull(data, currentReadSize); if (valuesFound) { //found some real code +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser: readMemory found data at 0x%p (currentReadSize 0x%x).\n", currentOffset, currentReadSize); +#endif currentOffset += valuesFound; if (readOffset < currentOffset) @@ -627,15 +804,21 @@ bool PeParser::readSectionFrom(const DWORD_PTR readOffset, PeFileSection & peFil break; } +#ifdef DEBUG_COMMENTS + //else + // DoOutputDebugString("PeParser: readMemory found nothing at 0x%p (currentReadSize 0x%x).\n", currentOffset, currentReadSize); +#endif currentReadSize = maxReadSize; currentOffset -= currentReadSize; } - if (peFileSection.dataSize) { - if (isProcess) +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser: readSectionFrom: About to read full PE section from 0x%p size 0x%x.\n", readOffset, peFileSection.dataSize); +#endif + if (isProcess) { retValue = readPeSectionFromProcess(readOffset, peFileSection); } @@ -644,11 +827,14 @@ bool PeParser::readSectionFrom(const DWORD_PTR readOffset, PeFileSection & peFil retValue = readPeSectionFromFile((DWORD)readOffset, peFileSection); } } +#ifdef DEBUG_COMMENTS + else + DoOutputDebugString("PeParser: No data read from section at 0x%p.\n", readOffset); +#endif return retValue; } - DWORD PeParser::isMemoryNotNull( BYTE * data, int dataSize ) { for (int i = (dataSize - 1); i >= 0; i--) @@ -662,15 +848,22 @@ DWORD PeParser::isMemoryNotNull( BYTE * data, int dataSize ) return 0; } -bool PeParser::savePeFileToDisk( const CHAR * newFile ) +bool PeParser::savePeFileToDisk(const CHAR *newFile) { - bool retValue = true; - char *HashString; + bool retValue = true, SectionDataWritten = false; + char *CapeName; +#ifdef DEBUG_COMMENTS + //DoOutputDebugString("PeParser::savePeFileToDisk: Function entry.\n"); +#endif + DWORD dwFileOffset = 0, dwWriteSize = 0; if (getNumberOfSections() != listPeSection.size()) { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::savePeFileToDisk: Number of sections mismatch error.\n"); +#endif return false; } @@ -696,7 +889,6 @@ bool PeParser::savePeFileToDisk( const CHAR * newFile ) dwFileOffset += dwWriteSize; } - //Pe Header if (isPE32()) { @@ -731,7 +923,6 @@ bool PeParser::savePeFileToDisk( const CHAR * newFile ) if (!listPeSection[i].sectionHeader.PointerToRawData) continue; - if (listPeSection[i].sectionHeader.PointerToRawData > dwFileOffset) { dwWriteSize = listPeSection[i].sectionHeader.PointerToRawData - dwFileOffset; //padding @@ -748,6 +939,9 @@ bool PeParser::savePeFileToDisk( const CHAR * newFile ) if (dwWriteSize) { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::savePeFileToDisk: Writing section %d of size 0x%x bytes.\n", i+1, dwWriteSize); +#endif if (!ProcessAccessHelp::writeMemoryToFile(hFile, listPeSection[i].sectionHeader.PointerToRawData, dwWriteSize, listPeSection[i].data)) { retValue = false; @@ -755,6 +949,8 @@ bool PeParser::savePeFileToDisk( const CHAR * newFile ) } dwFileOffset += dwWriteSize; + SectionDataWritten = true; + if (listPeSection[i].dataSize < listPeSection[i].sectionHeader.SizeOfRawData) //padding { dwWriteSize = listPeSection[i].sectionHeader.SizeOfRawData - listPeSection[i].dataSize; @@ -767,7 +963,10 @@ bool PeParser::savePeFileToDisk( const CHAR * newFile ) dwFileOffset += dwWriteSize; } } - +#ifdef DEBUG_COMMENTS + else + DoOutputDebugString("PeParser::savePeFileToDisk: Nothing to write for section %d.\n", i+1); +#endif } //add overlay? @@ -782,41 +981,76 @@ bool PeParser::savePeFileToDisk( const CHAR * newFile ) } SetEndOfFile(hFile); + dumpSize = dwFileOffset; - if (newFile) - closeFileHandle(); - else + closeFileHandle(); + + // If only headers are written, fail + // (this will allow a subsequent 'raw' memory dump) + if (!SectionDataWritten) + return false; + + if (!newFile) { - HashString = GetHashFromHandle(hFile); - closeFileHandle(); - if (!GetFullPathName(SCYLLA_OUTPUT_FILE, MAX_PATH, ScyllaOutputPath, NULL)) + if (!GetFullPathName(CAPE_OUTPUT_FILE, MAX_PATH, CapeOutputPath, NULL)) { - DoOutputErrorString("There was a problem obtaining the full file path"); + DoOutputErrorString("savePeFileToDisk: There was a problem obtaining the full file path"); return 0; } - if (MoveFile(ScyllaOutputPath, HashString)) + CapeName = GetName(); + + if (MoveFile(CapeOutputPath, CapeName)) { - memset(ScyllaOutputPath, 0, MAX_PATH); + memset(CapeOutputPath, 0, MAX_PATH); - if (!GetFullPathName(HashString, MAX_PATH, ScyllaOutputPath, NULL)) + if (!GetFullPathName(CapeName, MAX_PATH, CapeOutputPath, NULL)) { - DoOutputErrorString("There was a problem obtaining the full file path"); + DoOutputErrorString("savePeFileToDisk: There was a problem obtaining the full file path"); return 0; } - CapeOutputFile(ScyllaOutputPath); - return 1; + CapeOutputFile(CapeOutputPath); + } + else if (GetLastError() == ERROR_ALREADY_EXISTS) // have seen this occasionally + { + DoOutputDebugString("savePeFileToDisk: Name clash, trying to obtain new name..."); + + CapeName = GetName(); + + if (MoveFile(CapeOutputPath, CapeName)) + { + memset(CapeOutputPath, 0, MAX_PATH); + + if (!GetFullPathName(CapeName, MAX_PATH, CapeOutputPath, NULL)) + { + DoOutputErrorString("savePeFileToDisk: There was a problem obtaining the full file path"); + return 0; + } + + CapeOutputFile(CapeOutputPath); + } + else + { + DoOutputErrorString("savePeFileToDisk: Failed twice to rename file"); + + if (!DeleteFile(CapeOutputPath)) + { + DoOutputErrorString("savePeFileToDisk: There was a problem deleting the file: %s", CapeOutputPath); + } + + return 0; + } } else { - DoOutputErrorString("There was a problem renaming the file"); + DoOutputErrorString("savePeFileToDisk: There was a problem renaming the file"); - if (!DeleteFile(ScyllaOutputPath)) + if (!DeleteFile(CapeOutputPath)) { - DoOutputErrorString("There was a problem deleting the file: %s", ScyllaOutputPath); + DoOutputErrorString("savePeFileToDisk: There was a problem deleting the file: %s", CapeOutputPath); } return 0; @@ -827,20 +1061,169 @@ bool PeParser::savePeFileToDisk( const CHAR * newFile ) return retValue; } -bool PeParser::saveCompletePeToDisk( const CHAR * newFile ) +bool PeParser::savePeFileToHandle(HANDLE FileHandle) +{ + bool retValue = true, SectionDataWritten = false; + +#ifdef DEBUG_COMMENTS + //DoOutputDebugString("PeParser::savePeFileToDisk: Function entry.\n"); +#endif + + DWORD dwFileOffset = 0, dwWriteSize = 0; + + if (getNumberOfSections() != listPeSection.size()) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::savePeFileToDisk: Number of sections mismatch error.\n"); +#endif + return false; + } + + //Dos header + dwWriteSize = sizeof(IMAGE_DOS_HEADER); + if (!ProcessAccessHelp::writeMemoryToFile(FileHandle, dwFileOffset, dwWriteSize, pDosHeader)) + { + retValue = false; + } + dwFileOffset += dwWriteSize; + + + if (dosStubSize && pDosStub) + { + //Dos Stub + dwWriteSize = dosStubSize; + if (!ProcessAccessHelp::writeMemoryToFile(FileHandle, dwFileOffset, dwWriteSize, pDosStub)) + { + retValue = false; + } + dwFileOffset += dwWriteSize; + } + + //Pe Header + if (isPE32()) + { + dwWriteSize = sizeof(IMAGE_NT_HEADERS32); + } + else + { + dwWriteSize = sizeof(IMAGE_NT_HEADERS64); + } + + if (!ProcessAccessHelp::writeMemoryToFile(FileHandle, dwFileOffset, dwWriteSize, pNTHeader32)) + { + retValue = false; + } + dwFileOffset += dwWriteSize; + + //section headers + dwWriteSize = sizeof(IMAGE_SECTION_HEADER); + + for (WORD i = 0; i < getNumberOfSections(); i++) + { + if (!ProcessAccessHelp::writeMemoryToFile(FileHandle, dwFileOffset, dwWriteSize, &listPeSection[i].sectionHeader)) + { + retValue = false; + break; + } + dwFileOffset += dwWriteSize; + } + + for (WORD i = 0; i < getNumberOfSections(); i++) + { + if (!listPeSection[i].sectionHeader.PointerToRawData) + continue; + + if (listPeSection[i].sectionHeader.PointerToRawData > dwFileOffset) + { + dwWriteSize = listPeSection[i].sectionHeader.PointerToRawData - dwFileOffset; //padding + + if (!writeZeroMemoryToFile(FileHandle, dwFileOffset, dwWriteSize)) + { + retValue = false; + break; + } + dwFileOffset += dwWriteSize; + } + + dwWriteSize = listPeSection[i].dataSize; + + if (dwWriteSize) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::savePeFileToDisk: Writing section %d of size 0x%x bytes.\n", i+1, dwWriteSize); +#endif + if (!ProcessAccessHelp::writeMemoryToFile(FileHandle, listPeSection[i].sectionHeader.PointerToRawData, dwWriteSize, listPeSection[i].data)) + { + retValue = false; + break; + } + dwFileOffset += dwWriteSize; + + SectionDataWritten = true; + + if (listPeSection[i].dataSize < listPeSection[i].sectionHeader.SizeOfRawData) //padding + { + dwWriteSize = listPeSection[i].sectionHeader.SizeOfRawData - listPeSection[i].dataSize; + + if (!writeZeroMemoryToFile(FileHandle, dwFileOffset, dwWriteSize)) + { + retValue = false; + break; + } + dwFileOffset += dwWriteSize; + } + } +#ifdef DEBUG_COMMENTS + else + DoOutputDebugString("PeParser::savePeFileToDisk: Nothing to write for section %d.\n", i+1); +#endif + } + + //add overlay? + if (overlaySize && overlayData) + { + dwWriteSize = overlaySize; + if (!ProcessAccessHelp::writeMemoryToFile(FileHandle, dwFileOffset, dwWriteSize, overlayData)) + { + retValue = false; + } + dwFileOffset += dwWriteSize; + } + + //SetEndOfFile(FileHandle); + dumpSize = dwFileOffset; + + // If only headers are written, fail + // (this will allow a subsequent 'raw' memory dump) + if (!SectionDataWritten) + return false; + + return retValue; +} + +bool PeParser::saveCompletePeToDisk(const CHAR *newFile) { bool retValue = true; DWORD dwWriteSize = 0; - char *HashString; + char *CapeName; if (getNumberOfSections() != listPeSection.size()) { return false; } + if (listPeSection[getNumberOfSections()-1].sectionHeader.PointerToRawData < pNTHeader32->OptionalHeader.FileAlignment + || listPeSection[getNumberOfSections()-1].sectionHeader.SizeOfRawData < pNTHeader32->OptionalHeader.FileAlignment) + { + DoOutputDebugString("PE Parser: Error - image seems incomplete: (%d sections, PointerToRawData: 0x%x, SizeOfRawData: 0x%x) - dump failed.\n", getNumberOfSections(), listPeSection[getNumberOfSections()-1].sectionHeader.PointerToRawData, listPeSection[getNumberOfSections()-1].sectionHeader.SizeOfRawData); + return false; + } + if (openWriteFileHandle(newFile)) { - DoOutputDebugString("Number of sections: %d, PointerToRawData: 0x%x, SizeOfRawData: 0x%x\n", getNumberOfSections(), listPeSection[getNumberOfSections()-1].sectionHeader.PointerToRawData, listPeSection[getNumberOfSections()-1].sectionHeader.SizeOfRawData); +#ifdef DEBUG_COMMENTS + DoOutputDebugString("Number of sections: %d, PointerToRawData: 0x%x, SizeOfRawData: 0x%x\n", getNumberOfSections(), listPeSection[getNumberOfSections() - 1].sectionHeader.PointerToRawData, listPeSection[getNumberOfSections() - 1].sectionHeader.SizeOfRawData); +#endif dwWriteSize = listPeSection[getNumberOfSections()-1].sectionHeader.PointerToRawData + listPeSection[getNumberOfSections()-1].sectionHeader.SizeOfRawData; @@ -851,51 +1234,86 @@ bool PeParser::saveCompletePeToDisk( const CHAR * newFile ) } SetEndOfFile(hFile); + dumpSize = dwWriteSize; if (newFile) closeFileHandle(); else { - HashString = GetHashFromHandle(hFile); - closeFileHandle(); - if (!GetFullPathName(SCYLLA_OUTPUT_FILE, MAX_PATH, ScyllaOutputPath, NULL)) + if (!GetFullPathName(CAPE_OUTPUT_FILE, MAX_PATH, CapeOutputPath, NULL)) { - DoOutputErrorString("There was a problem obtaining the full file path"); + DoOutputErrorString("saveCompletePeToDisk: There was a problem obtaining the full file path"); return 0; } - if (MoveFile(ScyllaOutputPath, HashString)) + CapeName = GetName(); + + if (MoveFile(CapeOutputPath, CapeName)) { - memset(ScyllaOutputPath, 0, MAX_PATH); + memset(CapeOutputPath, 0, MAX_PATH); - if (!GetFullPathName(HashString, MAX_PATH, ScyllaOutputPath, NULL)) + if (!GetFullPathName(CapeName, MAX_PATH, CapeOutputPath, NULL)) { - DoOutputErrorString("There was a problem obtaining the full file path"); + DoOutputErrorString("saveCompletePeToDisk: There was a problem obtaining the full file path"); return 0; } - CapeOutputFile(ScyllaOutputPath); - return 1; + CapeOutputFile(CapeOutputPath); } else { - DoOutputErrorString("There was a problem renaming the file"); + DoOutputErrorString("saveCompletePeToDisk: There was a problem renaming the file"); - if (!DeleteFile(ScyllaOutputPath)) + if (!DeleteFile(CapeOutputPath)) { - DoOutputErrorString("There was a problem deleting the file: %s", ScyllaOutputPath); + DoOutputErrorString("saveCompletePeToDisk: There was a problem deleting the file: %s", CapeOutputPath); } return 0; } } - } + } return retValue; } +bool PeParser::saveCompletePeToHandle(HANDLE FileHandle) +{ + DWORD dwWriteSize = 0; + + if (getNumberOfSections() != listPeSection.size()) + { + return false; + } + + if (listPeSection[getNumberOfSections()-1].sectionHeader.PointerToRawData < pNTHeader32->OptionalHeader.FileAlignment + || listPeSection[getNumberOfSections()-1].sectionHeader.SizeOfRawData < pNTHeader32->OptionalHeader.FileAlignment) + { + DoOutputDebugString("PE Parser: Error - image seems incomplete: (%d sections, PointerToRawData: 0x%x, SizeOfRawData: 0x%x) - dump failed.\n", getNumberOfSections(), listPeSection[getNumberOfSections()-1].sectionHeader.PointerToRawData, listPeSection[getNumberOfSections()-1].sectionHeader.SizeOfRawData); + return false; + } + +#ifdef DEBUG_COMMENTS + DoOutputDebugString("Number of sections: %d, PointerToRawData: 0x%x, SizeOfRawData: 0x%x\n", getNumberOfSections(), listPeSection[getNumberOfSections() - 1].sectionHeader.PointerToRawData, listPeSection[getNumberOfSections() - 1].sectionHeader.SizeOfRawData); +#endif + + dwWriteSize = listPeSection[getNumberOfSections()-1].sectionHeader.PointerToRawData + + listPeSection[getNumberOfSections()-1].sectionHeader.SizeOfRawData; + + if (!ProcessAccessHelp::writeMemoryToFile(FileHandle, 0, dwWriteSize, (LPCVOID)moduleBaseAddress)) + { + DoOutputDebugString("saveCompletePeToHandle: writeMemoryToFile failed.\n"); + return false; + } + + //SetEndOfFile(FileHandle); + dumpSize = dwWriteSize; + + return true; +} + bool PeParser::writeZeroMemoryToFile(HANDLE hFile, DWORD fileOffset, DWORD size) { bool retValue = false; @@ -1082,12 +1500,15 @@ void PeParser::fixPeHeader() pNTHeader32->OptionalHeader.SizeOfImage = getSectionHeaderBasedSizeOfImage(); - if (moduleBaseAddress) - { - pNTHeader32->OptionalHeader.ImageBase = (DWORD)moduleBaseAddress; - } - pNTHeader32->OptionalHeader.SizeOfHeaders = alignValue(dwSize + pNTHeader32->FileHeader.SizeOfOptionalHeader + (getNumberOfSections() * sizeof(IMAGE_SECTION_HEADER)), pNTHeader32->OptionalHeader.FileAlignment); + +// if (moduleBaseAddress && moduleBaseAddress != pNTHeader32->OptionalHeader.ImageBase) +// { +// pNTHeader32->OptionalHeader.ImageBase = (DWORD)moduleBaseAddress; +//#ifdef DEBUG_COMMENTS +// DoOutputDebugString("fixPeHeader: ImageBase set to 0x%x.\n", pNTHeader32->OptionalHeader.ImageBase); +//#endif +// } } else { @@ -1107,12 +1528,15 @@ void PeParser::fixPeHeader() pNTHeader64->OptionalHeader.SizeOfImage = getSectionHeaderBasedSizeOfImage(); - if (moduleBaseAddress) - { - pNTHeader64->OptionalHeader.ImageBase = moduleBaseAddress; - } - pNTHeader64->OptionalHeader.SizeOfHeaders = alignValue(dwSize + pNTHeader64->FileHeader.SizeOfOptionalHeader + (getNumberOfSections() * sizeof(IMAGE_SECTION_HEADER)), pNTHeader64->OptionalHeader.FileAlignment); + +// if (moduleBaseAddress && moduleBaseAddress != pNTHeader64->OptionalHeader.ImageBase) +// { +// pNTHeader64->OptionalHeader.ImageBase = (DWORD)moduleBaseAddress; +//#ifdef DEBUG_COMMENTS +// DoOutputDebugString("fixPeHeader: ImageBase set to 0x%x.\n", pNTHeader64->OptionalHeader.ImageBase); +//#endif +// } } removeIatDirectory(); @@ -1174,6 +1598,7 @@ bool PeFileSectionSortByVirtualAddress(const PeFileSection& d1, const PeFileSect void PeParser::alignAllSectionHeaders() { + unsigned int NumberOfSections; DWORD sectionAlignment = 0; DWORD fileAlignment = 0; DWORD newFileSize = 0; @@ -1189,20 +1614,91 @@ void PeParser::alignAllSectionHeaders() fileAlignment = pNTHeader64->OptionalHeader.FileAlignment; } + NumberOfSections = getNumberOfSections(); + std::sort(listPeSection.begin(), listPeSection.end(), PeFileSectionSortByPointerToRawData); //sort by PointerToRawData ascending - newFileSize = pDosHeader->e_lfanew + sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER) + pNTHeader32->FileHeader.SizeOfOptionalHeader + (getNumberOfSections() * sizeof(IMAGE_SECTION_HEADER)); + newFileSize = pDosHeader->e_lfanew + sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER) + pNTHeader32->FileHeader.SizeOfOptionalHeader + (NumberOfSections * sizeof(IMAGE_SECTION_HEADER)); - - for (WORD i = 0; i < getNumberOfSections(); i++) - { + for (WORD i = 0; i < NumberOfSections; i++) + { listPeSection[i].sectionHeader.VirtualAddress = alignValue(listPeSection[i].sectionHeader.VirtualAddress, sectionAlignment); - listPeSection[i].sectionHeader.Misc.VirtualSize = alignValue(listPeSection[i].sectionHeader.Misc.VirtualSize, sectionAlignment); listPeSection[i].sectionHeader.PointerToRawData = alignValue(newFileSize, fileAlignment); listPeSection[i].sectionHeader.SizeOfRawData = alignValue(listPeSection[i].dataSize, fileAlignment); + + newFileSize = listPeSection[i].sectionHeader.PointerToRawData + listPeSection[i].sectionHeader.SizeOfRawData; + } + + for (WORD i = 0; i < NumberOfSections; i++) + { + if (i < NumberOfSections - 1) + { + + if ((listPeSection[i].sectionHeader.Misc.VirtualSize) > (listPeSection[i+1].sectionHeader.VirtualAddress - listPeSection[i].sectionHeader.VirtualAddress)) + { + listPeSection[i].sectionHeader.Misc.VirtualSize = alignValue(listPeSection[i+1].sectionHeader.VirtualAddress - listPeSection[i].sectionHeader.VirtualAddress, sectionAlignment); +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::alignAllSectionHeaders: Correcting VirtualSize for last section (%d) from 0x%x to 0x%x.\n", i+1, listPeSection[i].sectionHeader.Misc.VirtualSize, alignValue(listPeSection[i].sectionHeader.SizeOfRawData, sectionAlignment)); +#endif + } + else + { + listPeSection[i].sectionHeader.Misc.VirtualSize = alignValue(listPeSection[i].sectionHeader.Misc.VirtualSize, sectionAlignment); +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::alignAllSectionHeaders: VirtualSize for section %d ok: 0x%x.\n", i+1, listPeSection[i].sectionHeader.Misc.VirtualSize); +#endif + } + + if (i) + { + DWORD EndOfPreviousSection = alignValue(listPeSection[i-1].sectionHeader.VirtualAddress + listPeSection[i-1].sectionHeader.Misc.VirtualSize, sectionAlignment); + + if (listPeSection[i].sectionHeader.VirtualAddress && (listPeSection[i].sectionHeader.VirtualAddress != EndOfPreviousSection)) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::alignAllSectionHeaders: Correcting VirtualAddress for section %d from: 0x%x to 0x%x.\n", i+1, listPeSection[i].sectionHeader.VirtualAddress, EndOfPreviousSection); +#endif + listPeSection[i].sectionHeader.VirtualAddress = EndOfPreviousSection; + } + } + } + else + { + if ((listPeSection[i].sectionHeader.Misc.VirtualSize) > alignValue(listPeSection[i].sectionHeader.SizeOfRawData, sectionAlignment)) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::alignAllSectionHeaders: Correcting VirtualSize for last section (%d) from 0x%x to 0x%x.\n", i+1, listPeSection[i].sectionHeader.Misc.VirtualSize, alignValue(listPeSection[i].sectionHeader.SizeOfRawData, sectionAlignment)); +#endif + listPeSection[i].sectionHeader.Misc.VirtualSize = alignValue(listPeSection[i].sectionHeader.SizeOfRawData, sectionAlignment); + } + else + { + listPeSection[i].sectionHeader.Misc.VirtualSize = alignValue(listPeSection[i].sectionHeader.Misc.VirtualSize, sectionAlignment); +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::alignAllSectionHeaders: VirtualSize for last section (%d) ok: 0x%x.\n", i+1, listPeSection[i].sectionHeader.Misc.VirtualSize); +#endif + } + + if (i) + { + DWORD EndOfPreviousSection = alignValue(listPeSection[i-1].sectionHeader.VirtualAddress + listPeSection[i-1].sectionHeader.Misc.VirtualSize, sectionAlignment); + + if (listPeSection[i].sectionHeader.VirtualAddress && (listPeSection[i].sectionHeader.VirtualAddress != EndOfPreviousSection)) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("PeParser::alignAllSectionHeaders: Correcting VirtualAddress for last section (%d) from: 0x%x to 0x%x.\n", i+1, listPeSection[i].sectionHeader.VirtualAddress, EndOfPreviousSection); +#endif + listPeSection[i].sectionHeader.VirtualAddress = EndOfPreviousSection; + } + } + } - newFileSize = listPeSection[i].sectionHeader.PointerToRawData + listPeSection[i].sectionHeader.SizeOfRawData; + if (listPeSection[i].sectionHeader.Misc.VirtualSize > SIZE_LIMIT) + { + DoOutputDebugString("PeParser::alignAllSectionHeaders: Section %d size too big: 0x%x\n", i+1, listPeSection[i].sectionHeader.Misc.VirtualSize); + //return; + } } std::sort(listPeSection.begin(), listPeSection.end(), PeFileSectionSortByVirtualAddress); //sort by VirtualAddress ascending @@ -1212,21 +1708,31 @@ bool PeParser::dumpProcess(DWORD_PTR modBase, DWORD_PTR entryPoint, const CHAR * { moduleBaseAddress = modBase; - if (readPeSectionsFromProcess()) - { - setDefaultFileAlignment(); +#ifdef DEBUG_COMMENTS + DoOutputDebugString("DumpProcess: called with modBase = 0x%x.\n", modBase); +#endif + + if (!readPeSectionsFromProcess()) + DoOutputDebugString("DumpProcess: There was a problem reading one or more sections, the dump may be incomplete.\n"); +#ifdef DEBUG_COMMENTS + else + DoOutputDebugString("DumpProcess: Successfully read all sections.\n"); +#endif + setDefaultFileAlignment(); - setEntryPointVa(entryPoint); + if (entryPoint) + setEntryPointVa(entryPoint); - alignAllSectionHeaders(); - fixPeHeader(); + alignAllSectionHeaders(); - getFileOverlay(); + fixPeHeader(); - return savePeFileToDisk(dumpFilePath); - } - - return false; + getFileOverlay(); + +#ifdef DEBUG_COMMENTS + DoOutputDebugString("dumpProcess DEBUG: Fixups complete, about to save to disk.\n"); +#endif + return savePeFileToDisk(dumpFilePath); } bool PeParser::dumpProcess(DWORD_PTR modBase, DWORD_PTR entryPoint, const CHAR * dumpFilePath, std::vector & sectionList) @@ -1252,6 +1758,37 @@ bool PeParser::dumpProcess(DWORD_PTR modBase, DWORD_PTR entryPoint, const CHAR * return dumpProcess(modBase, entryPoint, dumpFilePath); } +bool PeParser::dumpProcessToHandle(DWORD_PTR modBase, DWORD_PTR entryPoint, HANDLE FileHandle) +{ + moduleBaseAddress = modBase; + +#ifdef DEBUG_COMMENTS + DoOutputDebugString("DumpProcess: called with modBase = 0x%x.\n", modBase); +#endif + + if (!readPeSectionsFromProcess()) + DoOutputDebugString("DumpProcess: There was a problem reading one or more sections, the dump may be incomplete.\n"); +#ifdef DEBUG_COMMENTS + else + DoOutputDebugString("DumpProcess: Successfully read all sections.\n"); +#endif + setDefaultFileAlignment(); + + if (entryPoint) + setEntryPointVa(entryPoint); + + alignAllSectionHeaders(); + + fixPeHeader(); + + getFileOverlay(); + +#ifdef DEBUG_COMMENTS + DoOutputDebugString("dumpProcess DEBUG: Fixups complete, about to save to disk.\n"); +#endif + return savePeFileToHandle(FileHandle); +} + void PeParser::setEntryPointVa(DWORD_PTR entryPoint) { DWORD entryPointRva = (DWORD)(entryPoint - moduleBaseAddress); diff --git a/CAPE/Scylla/PeParser.h b/CAPE/Scylla/PeParser.h index fd8ff74..dcf31f3 100644 --- a/CAPE/Scylla/PeParser.h +++ b/CAPE/Scylla/PeParser.h @@ -4,9 +4,8 @@ #include //#include "DumpSectionGui.h" -#define SCYLLA_OUTPUT_FILE "ScyllaOutput.bin" - -extern "C" char* GetHashFromHandle(HANDLE hFile); +#define CAPE_OUTPUT_FILE "CapeOutput.bin" +extern "C" char* GetName(); class PeFileSection { public: @@ -71,13 +70,16 @@ class PeParser bool readPeSectionsFromProcess(); bool readPeSectionsFromFile(); bool savePeFileToDisk(const CHAR * newFile); + bool savePeFileToHandle(HANDLE FileHandle); bool saveCompletePeToDisk(const CHAR * newFile); + bool saveCompletePeToHandle(HANDLE FileHandle); void removeDosStub(); void alignAllSectionHeaders(); void fixPeHeader(); void setDefaultFileAlignment(); bool dumpProcess(DWORD_PTR modBase, DWORD_PTR entryPoint, const CHAR * dumpFilePath); bool dumpProcess(DWORD_PTR modBase, DWORD_PTR entryPoint, const CHAR * dumpFilePath, std::vector & sectionList); + bool dumpProcessToHandle(DWORD_PTR modBase, DWORD_PTR entryPoint, HANDLE FileHandle); void setEntryPointVa(DWORD_PTR entryPoint); void setEntryPointRva(DWORD entryPoint); @@ -92,6 +94,10 @@ class PeParser DWORD getSectionAddressRVAByIndex( int index ); PIMAGE_NT_HEADERS getCurrentNtHeader(); + std::vector listPeSection; + + DWORD dumpSize; + protected: PeParser(); @@ -115,7 +121,6 @@ class PeParser DWORD dosStubSize; PIMAGE_NT_HEADERS32 pNTHeader32; PIMAGE_NT_HEADERS64 pNTHeader64; - std::vector listPeSection; BYTE * overlayData; DWORD overlaySize; /************************************************************************/ @@ -124,6 +129,7 @@ class PeParser BYTE * headerMemory; HANDLE hFile; + HANDLE hInfoFile; DWORD fileSize; bool readPeHeaderFromFile(bool readSectionHeaders); @@ -159,6 +165,4 @@ class PeParser void removeIatDirectory(); bool getFileOverlay(); - }; - diff --git a/CAPE/Scylla/ProcessAccessHelp.cpp b/CAPE/Scylla/ProcessAccessHelp.cpp index 6bc7680..10eebb5 100644 --- a/CAPE/Scylla/ProcessAccessHelp.cpp +++ b/CAPE/Scylla/ProcessAccessHelp.cpp @@ -83,7 +83,7 @@ HANDLE ProcessAccessHelp::NativeOpenProcess(DWORD dwDesiredAccess, DWORD dwProce NTSTATUS ntStatus = 0; InitializeObjectAttributes(&ObjectAttributes, 0, 0, 0, 0); - cid.UniqueProcess = (HANDLE)dwProcessId; + cid.UniqueProcess = (HANDLE)(UINT_PTR)dwProcessId; ntStatus = NativeWinApi::NtOpenProcess(&hProcess,dwDesiredAccess,&ObjectAttributes, &cid); @@ -609,6 +609,7 @@ LPVOID ProcessAccessHelp::createFileMappingView(const CHAR * filePath, DWORD acc #ifdef DEBUG_COMMENTS DoOutputDebugString("createFileMappingView :: GetLastError() == ERROR_ALREADY_EXISTS"); #endif + CloseHandle(hMappedFile); return NULL; } diff --git a/CAPE/Scylla/Thunks.h b/CAPE/Scylla/Thunks.h index 3be2a74..27918bb 100644 --- a/CAPE/Scylla/Thunks.h +++ b/CAPE/Scylla/Thunks.h @@ -4,9 +4,9 @@ #include // WTL -#include -#include -#include // CTreeItem +//#include +//#include +//#include // CTreeItem class ImportThunk { @@ -21,7 +21,7 @@ class ImportThunk bool valid; bool suspect; - CTreeItem hTreeItem; +// CTreeItem hTreeItem; DWORD_PTR key; void invalidate(); @@ -35,7 +35,7 @@ class ImportModuleThunk DWORD_PTR firstThunk; - CTreeItem hTreeItem; +// CTreeItem hTreeItem; DWORD_PTR key; DWORD_PTR getFirstThunk() const; diff --git a/CAPE/Scylla/multitree.h b/CAPE/Scylla/multitree.h deleted file mode 100644 index 4b793a0..0000000 --- a/CAPE/Scylla/multitree.h +++ /dev/null @@ -1,608 +0,0 @@ -#pragma once - -///////////////////////////////////////////////////////////////////////////// -// MultiSelectTree - A tree control with multi-select capabilities -// -// Written by Bjarke Viksoe (bjarke@viksoe.dk) -// Copyright (c) 2005 Bjarke Viksoe. -// -// Add the following macro to the parent's message map: -// REFLECT_NOTIFICATIONS() -// -// This code may be used in compiled form in any way you desire. This -// source file may be redistributed by any means PROVIDING it is -// not sold for profit without the authors written consent, and -// providing that this notice and the authors name is included. -// -// This file is provided "as is" with no expressed or implied warranty. -// The author accepts no liability if it causes any damage to you or your -// computer whatsoever. It's free, so don't hassle me about it. -// -// Beware of bugs. -// - -#ifndef __cplusplus - #error WTL requires C++ compilation (use a .cpp suffix) -#endif - -#ifndef __ATLMISC_H__ - #error multitree.h requires atlmisc.h to be included first -#endif - -#ifndef __ATLCRACK_H__ - #error multitree.h requires atlcrack.h to be included first -#endif - -#ifndef __ATLCTRLS_H__ - #error multitree.h requires atlctrls.h to be included first -#endif - -// Extended MultiSelectTree styles -static const DWORD MTVS_EX_NOMARQUEE = 0x00000001; - -// New control notifications -static const UINT TVN_ITEMSELECTING = 0x0001; -static const UINT TVN_ITEMSELECTED = 0x0002; - -static bool operator==(const CTreeItem& ti1, const CTreeItem& ti2) -{ - return ti1.m_hTreeItem == ti2.m_hTreeItem; -} - -template< class T, class TBase = CTreeViewCtrlEx, class TWinTraits = CControlWinTraits > -class ATL_NO_VTABLE CMultiSelectTreeViewImpl : - public CWindowImpl< T, TBase, TWinTraits >, - public CCustomDraw< T > -{ -public: - DECLARE_WND_SUPERCLASS(NULL, TBase::GetWndClassName()) - - DWORD m_dwExStyle; // Additional styles - CTreeItem m_hExtSelStart; // Item where SHIFT was last pressed - bool m_bMarquee; // Are we drawing rubberband? - CPoint m_ptDragStart; // Point where rubberband started - CPoint m_ptDragOld; // Last mousepos of rubberband - - CSimpleMap m_aData; - - CMultiSelectTreeViewImpl() : m_dwExStyle(0), m_bMarquee(false) - { - } - - CTreeItem _MakeItem(HTREEITEM hItem) const - { - return CTreeItem(hItem, (CTreeViewCtrlEx*)this); - } - - // Operations - - BOOL SubclassWindow(HWND hWnd) - { - ATLASSERT(m_hWnd == NULL); - ATLASSERT(::IsWindow(hWnd)); - - BOOL bRet = CWindowImpl< T, TBase, TWinTraits >::SubclassWindow(hWnd); - if( bRet ) - _Init(); - return bRet; - } - - DWORD SetExtendedTreeStyle(DWORD dwStyle) - { - ATLASSERT(!m_ctrlTree.IsWindow()); // Before control is created, please! - - DWORD dwOldStyle = m_dwTreeStyle; - m_dwTreeStyle = dwStyle; - return dwOldStyle; - } - - BOOL SelectItem(HTREEITEM hItem, BOOL bSelect) - { - ATLASSERT(::IsWindow(m_hWnd)); - - _SelectItem(hItem, bSelect == TRUE); - if( bSelect ) - TBase::SelectItem(hItem); - return TRUE; - } - - BOOL SelectAllItems(BOOL bSelect) - { - ATLASSERT(::IsWindow(m_hWnd)); - - for( int i = 0; i < m_aData.GetSize(); i++ ) - { - _SelectItem(i, bSelect == TRUE); - } - return TRUE; - } - - BOOL IsItemSelected(HTREEITEM hItem) - { - ATLASSERT(::IsWindow(m_hWnd)); - - int iIndex = m_aData.FindKey(hItem); - if( iIndex >= 0 ) - { - return m_aData.GetValueAt(iIndex) ? TRUE : FALSE; - } - return FALSE; - } - - CTreeItem GetSelectedItem() const - { - ATLASSERT(false); // Not usable! - return GetFirstSelectedItem(); - } - - CTreeItem GetFocusItem() const - { - return TBase::GetSelectedItem(); - } - - UINT GetItemState(HTREEITEM hItem, UINT nStateMask) const - { - UINT nRes = TBase::GetItemState(hItem, nStateMask); - if( (nStateMask & TVIS_SELECTED) != 0 ) - { - int iIndex = m_aData.FindKey(hItem); - if( iIndex >= 0 ) - { - nRes &= ~TVIS_SELECTED; - if( m_aData.GetValueAt(iIndex) ) - nRes |= TVIS_SELECTED; - } - } - return nRes; - } - - CTreeItem GetFirstSelectedItem() const - { - HTREEITEM item = NULL; - if( m_aData.GetSize() > 0 ) - { - for( int i = 0; i < m_aData.GetSize(); i++ ) - { - if( m_aData.GetValueAt(i) ) - { - item = m_aData.GetKeyAt(i); - break; - } - } - } - return _MakeItem(item); - } - - CTreeItem GetNextSelectedItem(HTREEITEM hItem) const - { - HTREEITEM item = NULL; - int iIndex = m_aData.FindKey(hItem); - if( iIndex >= 0 ) - { - for( int i = iIndex + 1; i < m_aData.GetSize(); i++ ) - { - if( m_aData.GetValueAt(i) ) - { - item = m_aData.GetKeyAt(i); - break; - } - } - } - return _MakeItem(item); - } - - int GetSelectedCount() const - { - int nCount = 0; - for( int i = 0; i < m_aData.GetSize(); i++ ) - { - if( m_aData.GetValueAt(i) ) - nCount++; - } - return nCount; - } - - // Implementation - - void _Init() - { - ATLASSERT(::IsWindow(m_hWnd)); - - ModifyStyle(TVS_SHOWSELALWAYS, 0); - } - - void _SelectItem(int iIndex, bool bSelect, int action = TVC_UNKNOWN) - { - if( iIndex < 0 ) - return; - bool bSelected = m_aData.GetValueAt(iIndex); - // Don't change if state is already updated (avoids flicker) - if( bSelected == bSelect ) - return; - HTREEITEM hItem = m_aData.GetKeyAt(iIndex); - CWindow parent = GetParent(); - // Send notifications - NMTREEVIEW nmtv = { 0 }; - nmtv.hdr.code = TVN_ITEMSELECTING; - nmtv.hdr.hwndFrom = m_hWnd; - nmtv.hdr.idFrom = GetDlgCtrlID(); - nmtv.action = action; - nmtv.itemNew.hItem = hItem; - nmtv.itemNew.lParam = GetItemData(hItem); - nmtv.itemNew.state = bSelect ? TVIS_SELECTED : 0; - nmtv.itemNew.stateMask = TVIS_SELECTED; - if( parent.SendMessage(WM_NOTIFY, nmtv.hdr.idFrom, (LPARAM) &nmtv) != 0 ) - return; - // Change state - m_aData.SetAtIndex(iIndex, hItem, bSelect); - // Repaint item - CRect rcItem; - if( GetItemRect(hItem, &rcItem, FALSE) ) - InvalidateRect(&rcItem, TRUE); - // More notifications - nmtv.hdr.code = TVN_ITEMSELECTED; - parent.SendMessage(WM_NOTIFY, nmtv.hdr.idFrom, (LPARAM) &nmtv); - } - - void _SelectItem(HTREEITEM hItem, bool bSelect, int action = TVC_UNKNOWN) - { - _SelectItem(m_aData.FindKey(hItem), bSelect, action); - } - - void _SelectTree(HTREEITEM hItem, HTREEITEM hGoal, int action) - { - if( !_SelectTreeSub(hItem, hGoal, action) ) - return; - hItem = GetParentItem(hItem); - while( (hItem = GetNextSiblingItem(hItem)) != NULL ) - { - if( !_SelectTreeSub(hItem, hGoal, action) ) - return; - } - } - - bool _SelectTreeSub(HTREEITEM hItem, HTREEITEM hGoal, int action) - { - while( hItem != NULL ) - { - _SelectItem(hItem, true, action); - if( hItem == hGoal ) - return false; - if( (TBase::GetItemState(hItem, TVIS_EXPANDED) & TVIS_EXPANDED) != 0 ) - { - if( !_SelectTreeSub(GetChildItem(hItem), hGoal, action) ) - return false; - } - hItem = GetNextSiblingItem(hItem); - } - return true; - } - - /* - TODO: keep list of 'temporary' selected items - if you select an item with the mouse and it gets - out of the selection rectangle it stays selected. - it should unselect it but keep old selected items - (when holding CTRL) - */ - void _SelectBox(CRect rc) - { - HTREEITEM hItem = GetFirstVisibleItem(); - while( hItem != NULL ) - { - int i = m_aData.FindKey(hItem); - if(i >= 0 && !m_aData.GetValueAt(i)) // ignore already selected - { - CRect rcItem, rcTemp; - GetItemRect(hItem, &rcItem, TRUE); - _SelectItem(hItem, rcTemp.IntersectRect(&rcItem, &rc) == TRUE, TVC_BYMOUSE); - } - hItem = GetNextVisibleItem(hItem); - } - } - - void _DrawDragRect(CPoint pt) - { - CClientDC dc(m_hWnd); - CSize szFrame(1, 1); - CRect rect(m_ptDragStart, pt); - rect.NormalizeRect(); - //CRect rectOld(m_ptDragStart, m_ptDragOld); - //rectOld.NormalizeRect(); - dc.DrawDragRect(&rect, szFrame, NULL/*&rectOld*/, szFrame); - } - - // Message map and handlers - - BEGIN_MSG_MAP_EX(CMultiSelectTreeViewImpl) - MESSAGE_HANDLER_EX(WM_CREATE, OnCreate) - MSG_WM_DESTROY(OnDestroy) - MSG_WM_KEYDOWN(OnKeyDown) - MSG_WM_KEYUP(OnKeyUp) - MSG_WM_CHAR(OnChar) - MSG_WM_SETFOCUS(OnSetFocus) - MSG_WM_LBUTTONDOWN(OnLButtonDown) - MSG_WM_LBUTTONUP(OnLButtonUp) - MSG_WM_MOUSEMOVE(OnMouseMove) - MSG_WM_CAPTURECHANGED(OnCaptureChanged) - MESSAGE_HANDLER_EX(TVM_INSERTITEM, OnInsertItem) - REFLECTED_NOTIFY_CODE_HANDLER_EX(TVN_DELETEITEM, OnDeleteItem) - CHAIN_MSG_MAP_ALT( CCustomDraw< T >, 1 ) - END_MSG_MAP() - - LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam) - { - LRESULT lRes = DefWindowProc(); - _Init(); - return lRes; - } - - void OnDestroy() - { - m_aData.RemoveAll(); - SetMsgHandled(FALSE); - } - - void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) - { - if( nChar == VK_SHIFT ) - m_hExtSelStart = GetFocusItem(); - - if( ::GetKeyState(VK_SHIFT) < 0 && m_hExtSelStart == GetFocusItem() ) - { - switch( nChar ) - { - case VK_UP: - case VK_DOWN: - case VK_HOME: - case VK_END: - case VK_NEXT: - case VK_PRIOR: - for( int i = 0; i < m_aData.GetSize(); i++ ) - { - _SelectItem(i, false, TVC_BYKEYBOARD); - } - } - } - SetMsgHandled(FALSE); - } - - void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) - { - if( ::GetKeyState(VK_SHIFT) < 0 ) - { - switch( nChar ) - { - case VK_UP: - case VK_DOWN: - case VK_HOME: - case VK_END: - case VK_NEXT: - case VK_PRIOR: - HTREEITEM hItem = GetFocusItem(); - // Is current or first-shift-item the upper item? - CRect rcItem1, rcItem2; - GetItemRect(m_hExtSelStart, &rcItem1, TRUE); - GetItemRect(hItem, &rcItem2, TRUE); - // Select from current item to item where SHIFT was pressed - if( rcItem1.top > rcItem2.top ) - _SelectTree(hItem, m_hExtSelStart, TVC_BYKEYBOARD); - else - _SelectTree(m_hExtSelStart, hItem, TVC_BYKEYBOARD); - _SelectItem(hItem, true, TVC_BYKEYBOARD); - } - } - SetMsgHandled(FALSE); - } - - void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) - { - if( nChar == VK_SPACE ) - { - HTREEITEM hItem = GetFocusItem(); - _SelectItem(hItem, IsItemSelected(hItem) == TRUE/*GetItemState(hItem, TVIS_SELECTED) & TVIS_SELECTED) == 0*/, TVC_BYKEYBOARD); - return; - } - SetMsgHandled(FALSE); - } - - void OnSetFocus(CWindow wndOld) - { - DefWindowProc(); - // FIX: We really need the focus-rectangle in this control since it - // improves the navigation a lot. So let's ask Windows to display it. - SendMessage(WM_UPDATEUISTATE, MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS)); - } - - void OnLButtonDown(UINT nFlags, CPoint point) - { - SetMsgHandled(FALSE); - - // Hit-test and figure out where we're clicking... - TVHITTESTINFO hti = { 0 }; - hti.pt = point; - HTREEITEM hItem = HitTest(&hti); - if( (hItem == NULL || (hti.flags & TVHT_ONITEMRIGHT) != 0) ) - { - if( (m_dwExStyle & MTVS_EX_NOMARQUEE) == 0 && ::DragDetect(m_hWnd, point) ) - { - // Great we're dragging a rubber-band - // Clear selection if CTRL is not down - if( ::GetKeyState(VK_CONTROL) >= 0 ) - { - for( int i = 0; i < m_aData.GetSize(); i++ ) - { - _SelectItem(i, false, TVC_BYMOUSE); - } - UpdateWindow(); - } - // Now start drawing the rubber-band... - SetCapture(); - m_ptDragStart = m_ptDragOld = point; - _DrawDragRect(point); - m_bMarquee = true; - SetMsgHandled(FALSE); //SetMsgHandled(TRUE); - return; - } - } - - if( hItem == NULL ) - return; - - if( (hti.flags & TVHT_ONITEMBUTTON) != 0 ) - return; - - // Great, let's do an advanced selection - if( (hti.flags & TVHT_ONITEMRIGHT) != 0 ) - { - for( int i = 0; i < m_aData.GetSize(); i++ ) - { - _SelectItem(i, false, TVC_BYMOUSE); - } - return; - } - int iIndex = m_aData.FindKey(hItem); - if( iIndex < 0 ) - return; - // Simulate drag'n'drop? - if( m_aData.GetValueAt(iIndex) && (GetStyle() & TVS_DISABLEDRAGDROP) == 0 && ::DragDetect(m_hWnd, point) ) - { - NMTREEVIEW nmtv = { 0 }; - nmtv.hdr.code = TVN_BEGINDRAG; - nmtv.hdr.hwndFrom = m_hWnd; - nmtv.hdr.idFrom = GetDlgCtrlID(); - nmtv.itemNew.hItem = hItem; - nmtv.itemNew.lParam = GetItemData(hItem); - CWindow parent = GetParent(); - parent.SendMessage(WM_NOTIFY, nmtv.hdr.idFrom, (LPARAM) &nmtv); - } - bool bSelected = m_aData.GetValueAt(iIndex); - if( ::GetKeyState(VK_SHIFT) < 0 ) - { - // Is current or first-shift-item the upper item? - CRect rcItem1, rcItem2; - GetItemRect(m_hExtSelStart, &rcItem1, TRUE); - GetItemRect(hItem, &rcItem2, TRUE); - // Select from current item to item where SHIFT was pressed - if( rcItem1.top > rcItem2.top ) - _SelectTree(hItem, m_hExtSelStart, TVC_BYMOUSE); - else - _SelectTree(m_hExtSelStart, hItem, TVC_BYMOUSE); - } - else if( ::GetKeyState(VK_CONTROL) < 0 ) - { - // Just toggle item - _SelectItem(iIndex, !bSelected, TVC_BYMOUSE); - } - else - { - // Remove current selection and replace it with clicked item - for( int i = 0; i < m_aData.GetSize(); i++ ) - { - _SelectItem(i, i == iIndex, TVC_BYMOUSE); - } - } - } - - void OnLButtonUp(UINT nFlags, CPoint point) - { - if( m_bMarquee ) - ReleaseCapture(); - SetMsgHandled(FALSE); - } - - void OnMouseMove(UINT nFlags, CPoint point) - { - if( m_bMarquee ) - { - CRect rc(m_ptDragStart, point); - _DrawDragRect(m_ptDragOld); - rc.NormalizeRect(); - _SelectBox(rc); - UpdateWindow(); - _DrawDragRect(point); - m_ptDragOld = point; - } - SetMsgHandled(FALSE); - } - - void OnCaptureChanged(CWindow wnd) - { - if( m_bMarquee ) - { - _DrawDragRect(m_ptDragOld); - m_bMarquee = false; - } - SetMsgHandled(FALSE); - } - - LRESULT OnInsertItem(UINT uMsg, WPARAM wParam, LPARAM lParam) - { - HTREEITEM hItem = (HTREEITEM) DefWindowProc(uMsg, wParam, lParam); - if( hItem == NULL ) - return (LRESULT) hItem; - // We manage a bit of extra information for each item. We'll store - // this in an ATL::CSimpleMap. Not a particular speedy structure for lookups. - // Don't keep too many items around in the tree! - m_aData.Add(hItem, false); - return (LRESULT) hItem; - } - - LRESULT OnDeleteItem(NMHDR* pnmh) - { - const NMTREEVIEW* lpNMTV = (NMTREEVIEW*) pnmh; - m_aData.Remove(lpNMTV->itemNew.hItem); - return 0; - } - - // Custom Draw - - DWORD OnPrePaint(int /*idCtrl*/, NMCUSTOMDRAW* /*lpNMCustomDraw*/) - { - return CDRF_NOTIFYITEMDRAW; // We need per-item notifications - } - - DWORD OnItemPrePaint(int /*idCtrl*/, NMCUSTOMDRAW* lpNMCustomDraw) - { - NMTVCUSTOMDRAW* lpTVCD = (NMTVCUSTOMDRAW*) lpNMCustomDraw; - HTREEITEM hItem = (HTREEITEM) lpTVCD->nmcd.dwItemSpec; - int iIndex = m_aData.FindKey(hItem); - if( iIndex >= 0 ) - { - bool bSelected = m_aData.GetValueAt(iIndex); - // Trick TreeView into displaying correct selection colors - if( bSelected ) - { - lpTVCD->clrText = ::GetSysColor(COLOR_HIGHLIGHTTEXT); - lpTVCD->clrTextBk = ::GetSysColor(COLOR_HIGHLIGHT); - } - else - { - // Special case of tree-item actually have selection, but our - // state says it is currently not selected (CTRL+click on same item twice). - if( (lpTVCD->nmcd.uItemState & CDIS_SELECTED) != 0 ) - { - COLORREF clrText = GetTextColor(); - if( clrText == CLR_NONE ) - clrText = ::GetSysColor(COLOR_WINDOWTEXT); - COLORREF clrBack = GetBkColor(); - if( clrBack == CLR_NONE ) - clrBack = ::GetSysColor(COLOR_WINDOW); - //CDCHandle dc = lpTVCD->nmcd.hdc; - //dc.SetTextColor(clrText); - //dc.SetBkColor(clrBack); - lpTVCD->clrText = clrText; - lpTVCD->clrTextBk = clrBack; - } - } - return CDRF_NEWFONT; - } - return CDRF_DODEFAULT; - } -}; - -class CMultiSelectTreeViewCtrl : public CMultiSelectTreeViewImpl > -{ -public: - DECLARE_WND_SUPERCLASS(_T("WTL_MultiSelectTree"), GetWndClassName()) -}; diff --git a/CAPE/ScyllaHarness.cpp b/CAPE/ScyllaHarness.cpp index 25da76a..bd308de 100644 --- a/CAPE/ScyllaHarness.cpp +++ b/CAPE/ScyllaHarness.cpp @@ -6,7 +6,7 @@ This program is free software : you can redistribute it and / or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the @@ -22,6 +22,8 @@ along with this program.If not, see . #include "Scylla\ImportRebuilder.h" #include "Scylla\ImportsHandling.h" +typedef unsigned __int64 QWORD; + #define USE_PE_HEADER_FROM_DISK FALSE #define SCAN_DIRECT_IMPORTS FALSE #define FIX_DIRECT_IMPORTS_NORMAL FALSE @@ -29,11 +31,15 @@ along with this program.If not, see . #define CREATE_NEW_IAT_IN_SECTION FALSE #define OFT_SUPPORT FALSE -#define SCYLLA_OUTPUT_FILE "ScyllaOutput.bin" +//#define DEBUG_COMMENTS + +#define CAPE_OUTPUT_FILE "CapeOutput.bin" extern "C" void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); extern "C" void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); -extern char ScyllaOutputPath[MAX_PATH]; +extern "C" int ScanForNonZero(LPVOID Buffer, unsigned int Size); + +extern char CapeOutputPath[MAX_PATH]; //************************************************************************************** void ScyllaInitCurrentProcess() @@ -54,38 +60,38 @@ extern "C" int ScyllaDumpCurrentProcess(DWORD NewOEP) { DWORD_PTR entrypoint = 0; PeParser * peFile = 0; - void* modBase; + DWORD ModuleBase; - modBase = GetModuleHandle(NULL); + ModuleBase = (DWORD)(ULONG_PTR)GetModuleHandle(NULL); ScyllaInitCurrentProcess(); - DoOutputDebugString("Instantiating PeParser with address: 0x%x", modBase); + DoOutputDebugString("DumpCurrentProcess: Instantiating PeParser with address: 0x%x", ModuleBase); - peFile = new PeParser((DWORD_PTR)modBase, TRUE); + peFile = new PeParser(ModuleBase, TRUE); if (peFile->isValidPeFile()) { if (NewOEP) entrypoint = NewOEP; else - entrypoint = peFile->getEntryPoint() + (DWORD)modBase; - - DoOutputDebugString("Module entry point VA is 0x%x", entrypoint); + entrypoint = peFile->getEntryPoint() + ModuleBase; + + DoOutputDebugString("DumpCurrentProcess: Module entry point VA is 0x%x", entrypoint); - if (peFile->dumpProcess((DWORD_PTR)modBase, entrypoint, NULL)) + if (peFile->dumpProcess(ModuleBase, entrypoint, NULL)) { - DoOutputDebugString("Module image dump success.\n"); + DoOutputDebugString("DumpCurrentProcess: Module image dump success.\n"); } else { - DoOutputDebugString("Error: Cannot dump image."); + DoOutputErrorString("DumpCurrentProcess: Error - Cannot dump image"); delete peFile; return 0; } } else { - DoOutputDebugString("Error: Invalid PE file or invalid PE header. Try reading PE header from disk/process."); + DoOutputDebugString("DumpCurrentProcess: Invalid PE file or invalid PE header."); delete peFile; return 0; } @@ -109,7 +115,7 @@ void ScyllaInit(HANDLE hProcess) } //************************************************************************************** -extern "C" int ScyllaDumpProcess(HANDLE hProcess, DWORD_PTR modBase, DWORD NewOEP) +extern "C" int ScyllaDumpProcess(HANDLE hProcess, DWORD_PTR ModuleBase, DWORD NewOEP) //************************************************************************************** { DWORD_PTR entrypoint = 0; @@ -117,9 +123,9 @@ extern "C" int ScyllaDumpProcess(HANDLE hProcess, DWORD_PTR modBase, DWORD NewOE ScyllaInit(hProcess); - DoOutputDebugString("Instantiating PeParser with address: 0x%x", modBase); + DoOutputDebugString("DumpProcess: Instantiating PeParser with address: 0x%x", ModuleBase); - peFile = new PeParser((DWORD_PTR)modBase, TRUE); + peFile = new PeParser(ModuleBase, TRUE); if (peFile->isValidPeFile()) { @@ -127,24 +133,25 @@ extern "C" int ScyllaDumpProcess(HANDLE hProcess, DWORD_PTR modBase, DWORD NewOE entrypoint = NewOEP; else entrypoint = peFile->getEntryPoint(); - entrypoint = entrypoint + (DWORD)modBase; + + entrypoint = entrypoint + ModuleBase; - DoOutputDebugString("Module entry point VA is 0x%x", entrypoint); + DoOutputDebugString("DumpProcess: Module entry point VA is 0x%x", entrypoint); - if (peFile->dumpProcess((DWORD_PTR)modBase, entrypoint, NULL)) + if (peFile->dumpProcess(ModuleBase, entrypoint, NULL)) { - DoOutputDebugString("Module image dump success"); + DoOutputDebugString("DumpProcess: Module image dump success"); } else { - DoOutputDebugString("Error: Cannot dump image."); + DoOutputErrorString("DumpProcess: Error - Cannot dump image"); delete peFile; return 0; } } else { - DoOutputDebugString("Error: Invalid PE file or invalid PE header. Try reading PE header from disk/process."); + DoOutputDebugString("DumpProcess: Invalid PE file or invalid PE header."); delete peFile; return 0; } @@ -154,43 +161,203 @@ extern "C" int ScyllaDumpProcess(HANDLE hProcess, DWORD_PTR modBase, DWORD NewOE return 1; } +//************************************************************************************** +DWORD SafeGetDword(PVOID Address) +//************************************************************************************** +{ + DWORD RetVal = NULL; + + __try + { + RetVal = *(DWORD*)Address; + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputDebugString("SafeGetDword: Exception occured reading memory address 0x%x\n", Address); + return NULL; + } + + return RetVal; +} + //************************************************************************************** extern "C" int ScyllaDumpPE(DWORD_PTR Buffer) //************************************************************************************** { - DWORD_PTR entrypoint = 0; + DWORD_PTR PointerToLastSection, entrypoint = 0; PeParser * peFile = 0; - + unsigned int SizeOfLastSection, NumberOfSections = 0; + NativeWinApi::initialize(); ProcessAccessHelp::setCurrentProcessAsTarget(); - DoOutputDebugString("Instantiating PeParser with address: 0x%x", Buffer); - - peFile = new PeParser((DWORD_PTR)Buffer, TRUE); + DoOutputDebugString("DumpPE: Instantiating PeParser with address: 0x%x", Buffer); + peFile = new PeParser((DWORD_PTR)Buffer, TRUE); + if (peFile->isValidPeFile()) { + NumberOfSections = peFile->getNumberOfSections(); + + if (NumberOfSections == 0) + { + DoOutputDebugString("DumpPE: no sections in PE image, ignoring.\n"); + return 0; + } + + PointerToLastSection = SafeGetDword(&(peFile->listPeSection[NumberOfSections - 1].sectionHeader.PointerToRawData)); + + if (!PointerToLastSection) + { + DoOutputDebugString("DumpPE: failed to obtain pointer to last section.\n"); + return 0; + } + + PointerToLastSection += (DWORD_PTR)Buffer; + + SizeOfLastSection = SafeGetDword(&(peFile->listPeSection[NumberOfSections - 1].sectionHeader.SizeOfRawData)); + + if (!SizeOfLastSection) + { + DoOutputDebugString("DumpPE: failed to obtain size of last section.\n"); + return 0; + } + + if (!ScanForNonZero((LPVOID)PointerToLastSection, SizeOfLastSection)) + { + DoOutputDebugString("DumpPE: Empty or inaccessible last section, file image seems incomplete (from 0x%x to 0x%x).\n", PointerToLastSection, (DWORD_PTR)PointerToLastSection + SizeOfLastSection); + return 0; + } + + entrypoint = peFile->getEntryPoint(); + if (peFile->saveCompletePeToDisk(NULL)) { - DoOutputDebugString("PE file in memory dumped successfully."); + DoOutputDebugString("DumpPE: PE file in memory dumped successfully."); } else { - DoOutputDebugString("Error: Cannot dump PE file from memory."); + DoOutputDebugString("DumpPE: Error: Cannot dump PE file from memory."); delete peFile; return 0; } } else { - DoOutputDebugString("Error: Invalid PE file or invalid PE header. Try reading PE header from disk/process."); + DoOutputDebugString("DumpPE: Error: Invalid PE file or invalid PE header."); delete peFile; return 0; } delete peFile; + + return 1; +} +//************************************************************************************** +extern "C" int LooksLikeSectionBoundary(DWORD_PTR Buffer) +//************************************************************************************** +{ + __try + { + if + ( + (*(DWORD*)((BYTE*)Buffer - 4) == 0) && // end of previous section has zeros + (*(DWORD*)((BYTE*)Buffer) != 0) // beginning of section is non-zero + ) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("LooksLikeSectionBoundary: Yes - end of previous candidate section zero, beginning of candidate section at 0x%x non-zero.\n", Buffer); +#endif + return 1; + } + else + { +#ifdef DEBUG_COMMENTS + if (*(DWORD*)((BYTE*)Buffer - 4) != 0) + DoOutputDebugString("LooksLikeSectionBoundary: No - end of previous candidate section 0x%x not zero.\n", Buffer); + + if (*(DWORD*)((BYTE*)Buffer) == 0) + DoOutputDebugString("LooksLikeSectionBoundary: No - beginning of candidate section 0x%x zero.\n", Buffer); +#endif + return 0; + } + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputDebugString("LooksLikeSectionBoundary: Exception occured reading around suspected boundary at 0x%x\n", Buffer); + return 0; + } +} + +//************************************************************************************** +extern "C" int IsPeImageVirtual(DWORD_PTR Buffer) +//************************************************************************************** +{ + PeParser * peFile = 0; + unsigned int NumberOfSections = 0; + DWORD SectionBasedFileSize; + + NativeWinApi::initialize(); + + ProcessAccessHelp::setCurrentProcessAsTarget(); + + peFile = new PeParser((DWORD_PTR)Buffer, TRUE); + + if (peFile->isValidPeFile()) + { + NumberOfSections = peFile->getNumberOfSections(); + SectionBasedFileSize = peFile->getSectionHeaderBasedFileSize(); +#ifdef DEBUG_COMMENTS + DoOutputDebugString("IsPeImageVirtual: NumberOfSections %d, SectionBasedFileSize 0x%x.\n", NumberOfSections, SectionBasedFileSize); +#endif + if (NumberOfSections == 0) + // makes no difference in this case + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("IsPeImageVirtual: zero sections, therefore meaningless.\n"); +#endif + delete peFile; + return 1; + } + + for (unsigned int SectionIndex = 0; SectionIndex < NumberOfSections; SectionIndex++) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString + ( + "IsPeImageVirtual: Section %d, PointerToRawData 0x%x, VirtualAddress 0x%x, SizeOfRawData 0x%x, VirtualSize 0x%x.\n", + SectionIndex+1, + peFile->listPeSection[SectionIndex].sectionHeader.PointerToRawData, + peFile->listPeSection[SectionIndex].sectionHeader.VirtualAddress, + peFile->listPeSection[SectionIndex].sectionHeader.SizeOfRawData, + peFile->listPeSection[SectionIndex].sectionHeader.Misc.VirtualSize + ); +#endif + if (peFile->listPeSection[SectionIndex].sectionHeader.PointerToRawData != peFile->listPeSection[SectionIndex].sectionHeader.VirtualAddress) + { + if (LooksLikeSectionBoundary((DWORD_PTR)Buffer + peFile->listPeSection[SectionIndex].sectionHeader.PointerToRawData)) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("IsPeImageVirtual: Found what looks like a 'raw' section boundary - image looks raw.\n"); +#endif + delete peFile; + return 0; + } + else if (LooksLikeSectionBoundary((DWORD_PTR)Buffer + peFile->listPeSection[SectionIndex].sectionHeader.VirtualAddress)) + { +#ifdef DEBUG_COMMENTS + DoOutputDebugString("IsPeImageVirtual: Found what looks like a virtual section boundary - image looks virtual.\n"); +#endif + delete peFile; + return 1; + } + } + } + } + + delete peFile; return 1; } @@ -228,6 +395,7 @@ extern "C" int ScyllaDumpCurrentProcessFixImports(DWORD NewOEP) DWORD addressIAT, sizeIAT; BOOL IAT_Found, AdvancedIATSearch = FALSE; bool isAfter; + DWORD ModuleBase; IATSearch iatSearch; ApiReader apiReader; @@ -237,7 +405,7 @@ extern "C" int ScyllaDumpCurrentProcessFixImports(DWORD NewOEP) DWORD_PTR entrypointRVA = 0; PeParser * peFile = 0; - void* modBase = GetModuleHandle(NULL); + ModuleBase = (DWORD)(ULONG_PTR)GetModuleHandle(NULL); //Clear stuff first ProcessAccessHelp::ownModuleList.clear(); @@ -251,49 +419,211 @@ extern "C" int ScyllaDumpCurrentProcessFixImports(DWORD NewOEP) ProcessAccessHelp::getProcessModules(ProcessAccessHelp::hProcess, ProcessAccessHelp::ownModuleList); ProcessAccessHelp::moduleList = ProcessAccessHelp::ownModuleList; - ProcessAccessHelp::targetImageBase = (DWORD_PTR)modBase; + ProcessAccessHelp::targetImageBase = ModuleBase; ProcessAccessHelp::getSizeOfImageCurrentProcess(); // Enumerate DLLs and imported functions apiReader.readApisFromModuleList(); - DoOutputDebugString("Instantiating PeParser with address: 0x%x", modBase); + DoOutputDebugString("DumpCurrentProcessFixImports: Instantiating PeParser with address: 0x%x", ModuleBase); - peFile = new PeParser((DWORD_PTR)modBase, TRUE); + peFile = new PeParser(ModuleBase, TRUE); if (peFile->isValidPeFile()) { if (NewOEP) - entrypointRVA = NewOEP - (DWORD)modBase; + entrypointRVA = NewOEP - ModuleBase; else entrypointRVA = peFile->getEntryPoint(); - DoOutputDebugString("Module entry point VA is 0x%x", (DWORD)modBase + entrypointRVA); + DoOutputDebugString(TEXT("DumpCurrentProcessFixImports: Module entry point VA is 0x%x"), ModuleBase + entrypointRVA); // Let's dump then fix the dump on disk - if (peFile->dumpProcess((DWORD_PTR)modBase, (DWORD)modBase + entrypointRVA, SCYLLA_OUTPUT_FILE)) + if (peFile->dumpProcess(ModuleBase, ModuleBase + entrypointRVA, CAPE_OUTPUT_FILE)) { - DoOutputDebugString("Module image dump success %s", ScyllaOutputPath); + DoOutputDebugString("DumpCurrentProcessFixImports: Module image dump success %s", CapeOutputPath); } // IAT search - we'll try the simple search first - IAT_Found = iatSearch.searchImportAddressTableInProcess((DWORD)modBase + entrypointRVA, (DWORD_PTR*)&addressIAT, &sizeIAT, FALSE); + IAT_Found = iatSearch.searchImportAddressTableInProcess(ModuleBase + entrypointRVA, (DWORD_PTR*)&addressIAT, &sizeIAT, FALSE); + + // Let's try the advanced search now + if (IAT_Found == FALSE) + IAT_Found = iatSearch.searchImportAddressTableInProcess(ModuleBase + entrypointRVA, (DWORD_PTR*)&addressIAT, &sizeIAT, TRUE); + + if (addressIAT && sizeIAT) + { + DoOutputDebugString(TEXT("DumpCurrentProcessFixImports: Found IAT: 0x%x, size: 0x%x"), addressIAT, sizeIAT); + + apiReader.readAndParseIAT(addressIAT, sizeIAT, importsHandling.moduleList); + importsHandling.scanAndFixModuleList(); + + if (SCAN_DIRECT_IMPORTS) + { + iatReferenceScan.ScanForDirectImports = true; + iatReferenceScan.ScanForNormalImports = false; + + iatReferenceScan.apiReader = &apiReader; + iatReferenceScan.startScan(ProcessAccessHelp::targetImageBase, (DWORD)ProcessAccessHelp::targetSizeOfImage, addressIAT, sizeIAT); + + DoOutputDebugString("DumpCurrentProcessFixImports: Direct imports - Found %d possible direct imports with %d unique APIs", iatReferenceScan.numberOfFoundDirectImports(), iatReferenceScan.numberOfFoundUniqueDirectImports()); + + if (iatReferenceScan.numberOfFoundDirectImports() > 0) + { + if (iatReferenceScan.numberOfDirectImportApisNotInIat() > 0) + { + DoOutputDebugString("DumpCurrentProcessFixImports: Direct imports - Found %d additional api addresses", iatReferenceScan.numberOfDirectImportApisNotInIat()); + DWORD sizeIatNew = iatReferenceScan.addAdditionalApisToList(); + DoOutputDebugString("DumpCurrentProcessFixImports: Direct imports - Old IAT size 0x%08x new IAT size 0x%08x", sizeIAT, sizeIatNew); + importsHandling.scanAndFixModuleList(); + } + + iatReferenceScan.printDirectImportLog(); + + if (FIX_DIRECT_IMPORTS_NORMAL) + { + // From the Scylla source: + // "Direct Imports found. I can patch only direct imports by JMP/CALL + // (use universal method if you don't like this) + // but where is the junk byte?\r\n\r\nYES = After Instruction\r\nNO = + // Before the Instruction\r\nCancel = Do nothing", L"Information", MB_YESNOCANCEL|MB_ICONINFORMATION); + + // This hasn't yet been tested! + isAfter = 1; + + iatReferenceScan.patchDirectImportsMemory(isAfter); + DoOutputDebugString("DumpCurrentProcessFixImports: Direct imports patched."); + } + } + } + + if (isIATOutsidePeImage(addressIAT)) + { + DoOutputDebugString("DumpCurrentProcessFixImports: Warning - IAT is not inside the PE image, requires rebasing."); + } + + ImportRebuilder importRebuild(CAPE_OUTPUT_FILE); + + if (OFT_SUPPORT) + { + // Untested + importRebuild.enableOFTSupport(); + DoOutputDebugString("DumpCurrentProcessFixImports: OFT support enabled.\n"); + } + + if (SCAN_DIRECT_IMPORTS && FIX_DIRECT_IMPORTS_UNIVERSAL) + { + if (iatReferenceScan.numberOfFoundDirectImports() > 0) + { + // Untested + importRebuild.iatReferenceScan = &iatReferenceScan; + importRebuild.BuildDirectImportsJumpTable = TRUE; + } + } + + if (CREATE_NEW_IAT_IN_SECTION) + { + importRebuild.iatReferenceScan = &iatReferenceScan; + importRebuild.enableNewIatInSection(addressIAT, sizeIAT); + } + + if (importRebuild.rebuildImportTable(NULL, importsHandling.moduleList)) + { + DoOutputDebugString("DumpCurrentProcessFixImports: Import table rebuild success.\n"); + delete peFile; + return 1; + } + else + { + DoOutputDebugString("DumpCurrentProcessFixImports: Import table rebuild failed, falling back to unfixed dump.\n"); + peFile->savePeFileToDisk(NULL); + } + } + else + { + DoOutputDebugString("DumpCurrentProcessFixImports: Warning - Unable to find IAT in scan.\n"); + } + + } + else + { + DoOutputDebugString("DumpCurrentProcessFixImports: Error - Invalid PE file or invalid PE header. Try reading PE header from disk/process."); + delete peFile; + return 0; + } + + delete peFile; + + return 1; +} + +//************************************************************************************** +extern "C" int ScyllaDumpProcessFixImports(HANDLE hProcess, DWORD_PTR ModuleBase, DWORD NewOEP) +//************************************************************************************** +{ + bool isAfter; + DWORD sizeIAT; + DWORD_PTR addressIAT; + BOOL IAT_Found, AdvancedIATSearch = FALSE; + + IATSearch iatSearch; + ApiReader apiReader; + IATReferenceScan iatReferenceScan; + ImportsHandling importsHandling; + + DWORD_PTR entrypointRVA = 0; + PeParser * peFile = 0; + + //Clear stuff first + apiReader.clearAll(); + importsHandling.clearAllImports(); + + NativeWinApi::initialize(); + + ProcessAccessHelp::ownModuleList.clear(); + ProcessAccessHelp::hProcess = hProcess; + ProcessAccessHelp::getProcessModules(ProcessAccessHelp::hProcess, ProcessAccessHelp::moduleList); + ProcessAccessHelp::targetImageBase = ModuleBase; + + apiReader.readApisFromModuleList(); + + DoOutputDebugString(TEXT("DumpProcessFixImports: Instantiating PeParser with address: 0x%x"), ModuleBase); + + peFile = new PeParser(ModuleBase, true); + + if (peFile->isValidPeFile()) + { + if (NewOEP) + entrypointRVA = NewOEP - ModuleBase; + else + entrypointRVA = peFile->getEntryPoint(); + + DoOutputDebugString(TEXT("DumpProcessFixImports: Module entry point VA is 0x%x"), ModuleBase + entrypointRVA); + + // Let's dump then fix the dump on disk + if (peFile->dumpProcess(ModuleBase, ModuleBase + entrypointRVA, CAPE_OUTPUT_FILE)) + { + DoOutputDebugString("Module image dump success %s", CapeOutputPath); + } + + // We'll try the simple search first + IAT_Found = iatSearch.searchImportAddressTableInProcess(ModuleBase + entrypointRVA, &addressIAT, &sizeIAT, FALSE); // Let's try the advanced search now if (IAT_Found == FALSE) - IAT_Found = iatSearch.searchImportAddressTableInProcess((DWORD)modBase + entrypointRVA, (DWORD_PTR*)&addressIAT, &sizeIAT, TRUE); + IAT_Found = iatSearch.searchImportAddressTableInProcess(ModuleBase + entrypointRVA, &addressIAT, &sizeIAT, TRUE); if (addressIAT && sizeIAT) { - DoOutputDebugString("Found IAT: 0x%x, size: 0x%x", addressIAT, sizeIAT); + DoOutputDebugString(TEXT("DumpProcessFixImports: Found IAT - 0x%x, size: 0x%x"), addressIAT, sizeIAT); apiReader.readAndParseIAT(addressIAT, sizeIAT, importsHandling.moduleList); importsHandling.scanAndFixModuleList(); if (SCAN_DIRECT_IMPORTS) { - iatReferenceScan.ScanForDirectImports = TRUE; - iatReferenceScan.ScanForNormalImports = FALSE; + iatReferenceScan.ScanForDirectImports = true; + iatReferenceScan.ScanForNormalImports = false; iatReferenceScan.apiReader = &apiReader; iatReferenceScan.startScan(ProcessAccessHelp::targetImageBase, (DWORD)ProcessAccessHelp::targetSizeOfImage, addressIAT, sizeIAT); @@ -331,10 +661,10 @@ extern "C" int ScyllaDumpCurrentProcessFixImports(DWORD NewOEP) if (isIATOutsidePeImage(addressIAT)) { - DoOutputDebugString("Warning, IAT is not inside the PE image, requires rebasing."); + DoOutputDebugString("Warning - IAT is not inside the PE image, requires rebasing."); } - ImportRebuilder importRebuild(SCYLLA_OUTPUT_FILE); + ImportRebuilder importRebuild(CapeOutputPath); if (OFT_SUPPORT) { @@ -367,14 +697,14 @@ extern "C" int ScyllaDumpCurrentProcessFixImports(DWORD NewOEP) } else { - DoOutputDebugString("Import table rebuild failed.\n"); - } + DoOutputDebugString("Import table rebuild failed, falling back to unfixed dump.\n"); + peFile->savePeFileToDisk(NULL); + } } else { DoOutputDebugString("Warning: Unable to find IAT in scan.\n"); } - } else { diff --git a/CAPE/wow64ext/internal.h b/CAPE/w64wow64/internal.h similarity index 97% rename from CAPE/wow64ext/internal.h rename to CAPE/w64wow64/internal.h index e33cc3c..e09a8b3 100644 --- a/CAPE/wow64ext/internal.h +++ b/CAPE/w64wow64/internal.h @@ -62,10 +62,12 @@ #define X64_Push(r) EMIT(0x48 | ((r) >> 3)) EMIT(0x50 | ((r) & 7)) #define X64_Pop(r) EMIT(0x48 | ((r) >> 3)) EMIT(0x58 | ((r) & 7)) +#define REX_W EMIT(0x48) __asm + //to fool M$ inline asm compiler I'm using 2 DWORDs instead of DWORD64 //use of DWORD64 will generate wrong 'pop word ptr[]' and it will break stack union reg64 { - DWORD dw[2]; - DWORD64 v; + DWORD64 v; + DWORD dw[2]; }; diff --git a/CAPE/w64wow64/w64wow64.c b/CAPE/w64wow64/w64wow64.c new file mode 100644 index 0000000..9140519 --- /dev/null +++ b/CAPE/w64wow64/w64wow64.c @@ -0,0 +1,469 @@ +#ifndef _WIN64 +/* +W64oWoW64 +Copyright (C) 2012 George Nicolaou + +This file is part of W64oWoW64. + +W64oWoW64 is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +W64oWoW64 is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with W64oWoW64. If not, see . +*/ +#include +#include "internal.h" +#include "w64wow64.h" +#include "w64wow64defs.h" +#include "windef.h" + +extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); +extern void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); + +FUNCTIONPTRS sFunctions = { 0 }; + +/** +* +* X64Call Part of WOW64Ext Library +* See internals.h +*/ +extern unsigned __int64 X64Call(DWORD64 func, int argC, ...) +{ + va_list args; + va_start(args, argC); + union reg64 _rcx = { (argC > 0) ? argC--, va_arg(args, DWORD64) : 0 }; + union reg64 _rdx = { (argC > 0) ? argC--, va_arg(args, DWORD64) : 0 }; + union reg64 _r8 = { (argC > 0) ? argC--, va_arg(args, DWORD64) : 0 }; + union reg64 _r9 = { (argC > 0) ? argC--, va_arg(args, DWORD64) : 0 }; + union reg64 _rax = { 0 }; + + union reg64 restArgs = { (DWORD64)&va_arg(args, DWORD64) }; + + // conversion to QWORD for easier use in inline assembly + union reg64 _argC = { (DWORD64)argC }; + DWORD back_esp = 0; + WORD back_fs = 0; + + __asm + { + ;// reset FS segment, to properly handle RFG + mov back_fs, fs + mov eax, 0x2B + mov fs, ax + + ;// keep original esp in back_esp variable + mov back_esp, esp + + ;// align esp to 0x10, without aligned stack some syscalls may return errors ! + ;// (actually, for syscalls it is sufficient to align to 8, but SSE opcodes + ;// requires 0x10 alignment), it will be further adjusted according to the + ;// number of arguments above 4 + and esp, 0xFFFFFFF0 + + X64_Start(); + + ;// below code is compiled as x86 inline asm, but it is executed as x64 code + ;// that's why it need sometimes REX_W() macro, right column contains detailed + ;// transcription how it will be interpreted by CPU + + ;// fill first four arguments + REX_W mov ecx, _rcx.dw[0] ;// mov rcx, qword ptr [_rcx] + REX_W mov edx, _rdx.dw[0] ;// mov rdx, qword ptr [_rdx] + push _r8.v ;// push qword ptr [_r8] + X64_Pop(_R8); ;// pop r8 + push _r9.v ;// push qword ptr [_r9] + X64_Pop(_R9); ;// pop r9 + ;// + REX_W mov eax, _argC.dw[0] ;// mov rax, qword ptr [_argC] + ;// + ;// final stack adjustment, according to the ;// + ;// number of arguments above 4 ;// + test al, 1 ;// test al, 1 + jnz _no_adjust ;// jnz _no_adjust + sub esp, 8 ;// sub rsp, 8 +_no_adjust: ;// + ;// + push edi ;// push rdi + REX_W mov edi, restArgs.dw[0] ;// mov rdi, qword ptr [restArgs] + ;// + ;// put rest of arguments on the stack ;// + REX_W test eax, eax ;// test rax, rax + jz _ls_e ;// je _ls_e + REX_W lea edi, dword ptr [edi + 8*eax - 8] ;// lea rdi, [rdi + rax*8 - 8] + ;// +_ls: ;// + REX_W test eax, eax ;// test rax, rax + jz _ls_e ;// je _ls_e + push dword ptr [edi] ;// push qword ptr [rdi] + REX_W sub edi, 8 ;// sub rdi, 8 + REX_W sub eax, 1 ;// sub rax, 1 + jmp _ls ;// jmp _ls +_ls_e: ;// + ;// + ;// create stack space for spilling registers ;// + REX_W sub esp, 0x20 ;// sub rsp, 20h + ;// + call func ;// call qword ptr [func] + ;// + ;// cleanup stack ;// + REX_W mov ecx, _argC.dw[0] ;// mov rcx, qword ptr [_argC] + REX_W lea esp, dword ptr [esp + 8*ecx + 0x20] ;// lea rsp, [rsp + rcx*8 + 20h] + ;// + pop edi ;// pop rdi + ;// + // set return value ;// + REX_W mov _rax.dw[0], eax ;// mov qword ptr [_rax], rax + + X64_End(); + + mov ax, ds + mov ss, ax + mov esp, back_esp + + ;// restore FS segment + mov ax, back_fs + mov fs, ax + } + return _rax.v; +} +#pragma warning(pop) + +PTEB64 NtTeb64( void ) +{ + X64_Start(); + GETTEB(); + X64_End(); +} + +PLDR_DATA_TABLE_ENTRY64 GetModule64LdrTable( wchar_t * lwcModuleName ) +{ + PTEB64 psTeb = NtTeb64(); + //PPEB64 psPeb = + PPEB_LDR_DATA Ldr = psTeb->ProcessEnvironmentBlock->Ldr; + PLDR_DATA_TABLE_ENTRY64 psDataEntryStart = + (PLDR_DATA_TABLE_ENTRY64)Ldr->InLoadOrderModuleList.Flink; + PLDR_DATA_TABLE_ENTRY64 psDataEntryCurrent = psDataEntryStart; + + do { + if( memcmp( (DWORD64)psDataEntryCurrent->BaseDllName.Buffer, lwcModuleName, + psDataEntryCurrent->BaseDllName.Length ) == 0 ) { + return psDataEntryCurrent; + } + psDataEntryCurrent = + (PLDR_DATA_TABLE_ENTRY64)psDataEntryCurrent->InLoadOrderLinks.Flink; + } while( psDataEntryStart != psDataEntryCurrent && psDataEntryCurrent ); + return NULL; +} + +extern void __cdecl SetLastErrorFromX64Call(DWORD64 status) +{ + typedef ULONG (WINAPI *RtlNtStatusToDosError_t)(NTSTATUS Status); + typedef ULONG (WINAPI *RtlSetLastWin32Error_t)(NTSTATUS Status); + + static RtlNtStatusToDosError_t RtlNtStatusToDosError = NULL; + static RtlSetLastWin32Error_t RtlSetLastWin32Error = NULL; + + if ((NULL == RtlNtStatusToDosError) || (NULL == RtlSetLastWin32Error)) + { + HMODULE ntdll = GetModuleHandleW(L"ntdll.dll"); + RtlNtStatusToDosError = (RtlNtStatusToDosError_t)GetProcAddress(ntdll, "RtlNtStatusToDosError"); + RtlSetLastWin32Error = (RtlSetLastWin32Error_t)GetProcAddress(ntdll, "RtlSetLastWin32Error"); + } + + if ((NULL != RtlNtStatusToDosError) && (NULL != RtlSetLastWin32Error)) + { + RtlSetLastWin32Error(RtlNtStatusToDosError((DWORD)status)); + } +} + +extern SIZE_T VirtualQueryEx64(HANDLE hProcess, DWORD64 lpAddress, MEMORY_BASIC_INFORMATION64* lpBuffer, SIZE_T dwLength) +{ + DWORD64 lvpNtdll = GetModuleBase64( L"ntdll.dll" ); + static DWORD ntqvm = 0; + if (0 == ntqvm) + { + ntqvm = (DWORD)GetProcAddress64(lvpNtdll, "NtQueryVirtualMemory"); + if (0 == ntqvm) + return 0; + } + DWORD64 ret = 0; + X64Call(ntqvm, 6, (DWORD64)hProcess, lpAddress, (DWORD64)0, (DWORD64)lpBuffer, (DWORD64)dwLength, (DWORD64)&ret); + return (SIZE_T)ret; +} + +#pragma warning(push) +#pragma warning(disable : 4244) +extern DWORD64 VirtualAllocEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) +{ + DWORD64 lvpNtdll = GetModuleBase64( L"ntdll.dll" ); + static DWORD64 ntavm = 0; + if (0 == ntavm) + { + ntavm = GetProcAddress64(lvpNtdll, "NtAllocateVirtualMemory"); + if (0 == ntavm) + return 0; + } + + DWORD64 tmpAddr = lpAddress; + DWORD64 tmpSize = dwSize; + DWORD64 ret = X64Call(ntavm, 6, (DWORD64)hProcess, (DWORD64)&tmpAddr, (DWORD64)0, (DWORD64)&tmpSize, (DWORD64)flAllocationType, (DWORD64)flProtect); + if (STATUS_SUCCESS != ret) + { + SetLastErrorFromX64Call(ret); + return FALSE; + } + else + return tmpAddr; +} + +extern BOOL VirtualFreeEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD dwFreeType) +{ + DWORD64 lvpNtdll = GetModuleBase64( L"ntdll.dll" ); + static DWORD64 ntfvm = 0; + if (0 == ntfvm) + { + ntfvm = GetProcAddress64(lvpNtdll, "NtFreeVirtualMemory"); + if (0 == ntfvm) + return 0; + } + + DWORD64 tmpAddr = lpAddress; + DWORD64 tmpSize = dwSize; + DWORD64 ret = X64Call(ntfvm, 4, (DWORD64)hProcess, (DWORD64)&tmpAddr, (DWORD64)&tmpSize, (DWORD64)dwFreeType); + if (STATUS_SUCCESS != ret) + { + SetLastErrorFromX64Call(ret); + return FALSE; + } + else + return TRUE; +} + +extern BOOL VirtualProtectEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flNewProtect, DWORD* lpflOldProtect) +{ + DWORD64 lvpNtdll = GetModuleBase64( L"ntdll.dll" ); + static DWORD64 ntpvm = 0; + if (0 == ntpvm) + { + ntpvm = GetProcAddress64(lvpNtdll, "NtProtectVirtualMemory"); + if (0 == ntpvm) + return 0; + } + + DWORD64 tmpAddr = lpAddress; + DWORD64 tmpSize = dwSize; + DWORD64 ret = X64Call(ntpvm, 5, (DWORD64)hProcess, (DWORD64)&tmpAddr, (DWORD64)&tmpSize, (DWORD64)flNewProtect, (DWORD64)lpflOldProtect); + if (STATUS_SUCCESS != ret) + { + SetLastErrorFromX64Call(ret); + return FALSE; + } + else + return TRUE; +} +#pragma warning(pop) + +extern BOOL ReadProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesRead) +{ + DWORD64 lvpNtdll = GetModuleBase64( L"ntdll.dll" ); + static DWORD nrvm = 0; + if (0 == nrvm) + { + nrvm = (DWORD)GetProcAddress64(lvpNtdll, "NtReadVirtualMemory"); + if (0 == nrvm) + return 0; + } + DWORD64 ret = X64Call(nrvm, 5, (DWORD64)hProcess, lpBaseAddress, (DWORD64)lpBuffer, (DWORD64)nSize, (DWORD64)lpNumberOfBytesRead); + if (STATUS_SUCCESS != ret) + return FALSE; + else + return TRUE; +} + +extern BOOL WriteProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesWritten) +{ + DWORD64 lvpNtdll = GetModuleBase64( L"ntdll.dll" ); + static DWORD nrvm = 0; + if (0 == nrvm) + { + nrvm = (DWORD)GetProcAddress64(lvpNtdll, "NtWriteVirtualMemory"); + if (0 == nrvm) + return 0; + } + DWORD64 ret = X64Call(nrvm, 5, (DWORD64)hProcess, lpBaseAddress, (DWORD64)lpBuffer, (DWORD64)nSize, (DWORD64)lpNumberOfBytesWritten); + if (STATUS_SUCCESS != ret) + return FALSE; + else + return TRUE; +} + +DWORD64 GetModuleBase64( wchar_t * lwcModuleName ) +{ + PLDR_DATA_TABLE_ENTRY64 LdrEntry = GetModule64LdrTable( lwcModuleName ); + return (DWORD64)LdrEntry->DllBase; +} + +PIMAGE_NT_HEADERS64 GetModule64NtHeader( DWORD64 lvpBaseAddress ) +{ + PIMAGE_DOS_HEADER psDosHeader = (PIMAGE_DOS_HEADER)lvpBaseAddress; + return (PIMAGE_NT_HEADERS64)( ((__int8 *)lvpBaseAddress) + + psDosHeader->e_lfanew ); +} + +DWORD64 GetModule64PEBaseAddress( DWORD64 lvpBaseAddress ) +{ + PIMAGE_NT_HEADERS64 psNtHeader = GetModule64NtHeader( lvpBaseAddress ); + return (DWORD64)psNtHeader->OptionalHeader.ImageBase; +} + +DWORD64 GetModule64EntryRVA( DWORD64 lvpBaseAddress ) +{ + PIMAGE_NT_HEADERS64 psNtHeader = GetModule64NtHeader( lvpBaseAddress ); + return (DWORD64)psNtHeader->OptionalHeader.AddressOfEntryPoint; +} + +extern DWORD64 GetProcAddress64( DWORD64 lvpBaseAddress, char * lpszProcName ) +{ + PIMAGE_NT_HEADERS64 psNtHeader = GetModule64NtHeader( lvpBaseAddress ); + char * lpcModBase = (char *)lvpBaseAddress; + PIMAGE_EXPORT_DIRECTORY psExportDir = (PIMAGE_EXPORT_DIRECTORY)( lpcModBase + + psNtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress ); + + int nNumberOfNames = psExportDir->NumberOfNames; + unsigned long * lpulFunctions = + (unsigned long *)( lpcModBase + psExportDir->AddressOfFunctions ); + + unsigned long * lpulNames = + (unsigned long *)( lpcModBase + psExportDir->AddressOfNames ); + + unsigned short * lpusOrdinals = + (unsigned short *) ( lpcModBase + psExportDir->AddressOfNameOrdinals ); + + int i; + char * lpszFunctionName; + for( i = 0; i < nNumberOfNames; i++ ) { + lpszFunctionName = ((__int8 *)lpulNames[i]) + (int)lvpBaseAddress; + if( strcmp( lpszFunctionName, lpszProcName ) == 0 ) { + return ( (__int8 *)lvpBaseAddress ) + + lpulFunctions[ lpusOrdinals[i] ]; + } + } + return NULL; +} + +BOOL FreeKnownDllPage( wchar_t * lpwzKnownDllName ) +{ + DWORD64 hSection = 0; + DWORD64 lvpBaseAddress = 0; + DWORD64 lvpRealBaseAddress = 0; + DWORD64 stViewSize = 0; + DWORD64 stRegionSize = 0; + PTEB64 psTeb; + X64Call( sFunctions.LdrGetKnownDllSectionHandle, 3, + (DWORD64)lpwzKnownDllName, + (DWORD64)0, + (DWORD64)&hSection ); + + psTeb = NtTeb64(); + psTeb->NtTib.ArbitraryUserPointer = (DWORD64)lpwzKnownDllName; + + X64Call( sFunctions.NtMapViewOfSection, 10, + (DWORD64)hSection, + (DWORD64)-1, + (DWORD64)&lvpBaseAddress, + (DWORD64)0, + (DWORD64)0, + (DWORD64)0, + (DWORD64)&stViewSize, + (DWORD64)ViewUnmap, + (DWORD64)0, + (DWORD64)PAGE_READONLY ); + + lvpRealBaseAddress = + (DWORD64)GetModule64PEBaseAddress( (DWORD64)lvpBaseAddress ); + + X64Call( sFunctions.NtFreeVirtualMemory, 4, + (DWORD64)-1, + (DWORD64)&lvpRealBaseAddress, + (DWORD64)&stRegionSize, + (DWORD64)MEM_RELEASE ); + + X64Call( sFunctions.NtUnmapViewOfSection, 2, (DWORD64)-1, + (DWORD64)lvpBaseAddress ); + return TRUE; +} + +extern DWORD64 LoadLibrary64A( char * lpcLibraryName ) +{ + if( sFunctions.LoadLibraryA == NULL ) { + sFunctions.LoadLibraryA = + GetProcAddress64( GetModuleBase64( L"kernel32.dll" ), "LoadLibraryA" ); + } + return (DWORD64)X64Call( sFunctions.LoadLibraryA, 1, (DWORD64)lpcLibraryName ); +} + +extern BOOL InitializeW64oWoW64() +{ + DWORD64 lvpNtdll = GetModuleBase64( L"ntdll.dll" ); + UNICODE_STRING64 sUnicodeString; + __int8 * lvpKernelBaseBase; + __int8 * lvpKernel32Base; + PLDR_DATA_TABLE_ENTRY64 lpsKernel32Ldr; + PLDR_DATA_TABLE_ENTRY64 lpsKernelBaseLdr; + + sFunctions.LdrGetKnownDllSectionHandle = GetProcAddress64( lvpNtdll, + "LdrGetKnownDllSectionHandle" ); + sFunctions.NtFreeVirtualMemory = GetProcAddress64( lvpNtdll, + "NtFreeVirtualMemory" ); + sFunctions.NtMapViewOfSection = GetProcAddress64( lvpNtdll, + "NtMapViewOfSection" ); + sFunctions.NtUnmapViewOfSection = GetProcAddress64( lvpNtdll, + "NtUnmapViewOfSection" ); + + if( FreeKnownDllPage( L"kernel32.dll" ) == FALSE) return FALSE; + if( FreeKnownDllPage( L"user32.dll" ) == FALSE ) return FALSE; + + sUnicodeString.Length = 0x18; + sUnicodeString.MaximumLength = 0x1a; + sUnicodeString.Buffer = (DWORD64)L"kernel32.dll"; + if( X64Call( GetProcAddress64( lvpNtdll, "LdrLoadDll" ), 4, + (DWORD64)0, + (DWORD64)0, + (DWORD64)&sUnicodeString, + (DWORD64)&lvpKernel32Base ) != NULL ) { + DoOutputErrorString("Failed to load 64-bit kernel32.dll"); + return FALSE; + } + + lvpKernelBaseBase = (__int8 *)GetModuleBase64( L"KERNELBASE.dll"); + X64Call( ( lvpKernelBaseBase + (int)GetModule64EntryRVA( lvpKernelBaseBase ) ), + 3, + (DWORD64)lvpKernelBaseBase, + (DWORD64)DLL_PROCESS_ATTACH, + (DWORD64)0 ); + + X64Call( ( lvpKernel32Base + (int)GetModule64EntryRVA( lvpKernel32Base ) ), + 3, + (DWORD64)lvpKernel32Base, + (DWORD64)DLL_PROCESS_ATTACH, + (DWORD64)0 ); + + lpsKernel32Ldr = GetModule64LdrTable( L"kernel32.dll" ); + lpsKernel32Ldr->LoadCount = 0xffff; + lpsKernel32Ldr->Flags += LDRP_ENTRY_PROCESSED | LDRP_PROCESS_ATTACH_CALLED; + + lpsKernelBaseLdr = GetModule64LdrTable( L"KERNELBASE.dll" ); + lpsKernelBaseLdr->LoadCount = 0xffff; + lpsKernelBaseLdr->Flags += LDRP_ENTRY_PROCESSED | LDRP_PROCESS_ATTACH_CALLED; + + return TRUE; +} + +#endif \ No newline at end of file diff --git a/CAPE/w64wow64/w64wow64.h b/CAPE/w64wow64/w64wow64.h new file mode 100644 index 0000000..ffdbe37 --- /dev/null +++ b/CAPE/w64wow64/w64wow64.h @@ -0,0 +1,44 @@ +/* +W64oWoW64 +Copyright (C) 2012 George Nicolaou + +This file is part of W64oWoW64. + +W64oWoW64 is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +W64oWoW64 is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with W64oWoW64. If not, see . +*/ +#pragma once + +#include + +#ifndef STATUS_SUCCESS +# define STATUS_SUCCESS 0 +#endif + +#ifndef __W64WOW64_H_ +#define __W64WOW64_H_ + +unsigned __int64 X64Call( DWORD64 lvpFunctionPtr, int nArgc, ... ); +void __cdecl SetLastErrorFromX64Call(DWORD64 status); +DWORD64 GetProcAddress64( DWORD64 lvpBaseAddress, char * lpszProcName ); +DWORD64 LoadLibrary64A( char * lpcLibraryName ); +DWORD64 GetModuleBase64( wchar_t * lwcModuleName ); + +DWORD64 VirtualAllocEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect); +BOOL VirtualFreeEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flNewProtect, DWORD* lpflOldProtect); +BOOL VirtualProtectEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flNewProtect, DWORD* lpflOldProtect); +BOOL ReadProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesRead); +BOOL WriteProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesWritten); + +extern BOOL InitializeW64oWoW64(void); +#endif \ No newline at end of file diff --git a/CAPE/w64wow64/w64wow64defs.h b/CAPE/w64wow64/w64wow64defs.h new file mode 100644 index 0000000..d5cd378 --- /dev/null +++ b/CAPE/w64wow64/w64wow64defs.h @@ -0,0 +1,34 @@ +/* +W64oWoW64 +Copyright (C) 2012 George Nicolaou + +This file is part of W64oWoW64. + +W64oWoW64 is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +W64oWoW64 is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with W64oWoW64. If not, see . +*/ +#define GETTEB() \ +{ \ + EMIT(0x65) EMIT(0x48) EMIT(0x8b) EMIT(0x04) EMIT(0x25) EMIT(0x30) EMIT(0x00) EMIT(0x00) EMIT(0x00) \ +} + + +typedef struct { + void * LdrGetKnownDllSectionHandle; + void * NtMapViewOfSection; + void * NtFreeVirtualMemory; + void * NtUnmapViewOfSection; + void * LoadLibraryA; +} FUNCTIONPTRS; + +BOOL InitializeW64oWoW64( void ); \ No newline at end of file diff --git a/CAPE/w64wow64/windef.h b/CAPE/w64wow64/windef.h new file mode 100644 index 0000000..fd7b487 --- /dev/null +++ b/CAPE/w64wow64/windef.h @@ -0,0 +1,93 @@ +/* +W64oWoW64 +Copyright (C) 2012 George Nicolaou + +This file is part of W64oWoW64. + +W64oWoW64 is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +W64oWoW64 is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with W64oWoW64. If not, see . +*/ +#include + +typedef struct _CLIENT_ID64 +{ + DWORD64 UniqueProcess; + DWORD64 UniqueThread; +} CLIENT_ID64, *PCLIENT_ID64; + + +typedef struct _PEB_LDR_DATA +{ + ULONG Length; + UCHAR Initialized; + DWORD64 SsHandle; + LIST_ENTRY64 InLoadOrderModuleList; + LIST_ENTRY64 InMemoryOrderModuleList; + LIST_ENTRY64 InInitializationOrderModuleList; + DWORD64 EntryInProgress; +} PEB_LDR_DATA, *PPEB_LDR_DATA; + + +typedef struct _PEB64 +{ + UCHAR InheritedAddressSpace; + UCHAR ReadImageFileExecOptions; + UCHAR BeingDebugged; + UCHAR BitField; + ULONG ImageUsesLargePages: 1; + ULONG IsProtectedProcess: 1; + ULONG IsLegacyProcess: 1; + ULONG IsImageDynamicallyRelocated: 1; + ULONG SpareBits: 4; + DWORD64 Mutant; + DWORD64 ImageBaseAddress; + PPEB_LDR_DATA Ldr; +} PEB64, *PPEB64; + +typedef struct _LSA_UNICODE_STRING { + USHORT Length; + USHORT MaximumLength; + DWORD64 Buffer; +} UNICODE_STRING64, * PUNICODE_STRING64; + +typedef struct _TEB64 +{ + NT_TIB64 NtTib; + DWORD64 EnvironmentPointer; + CLIENT_ID64 ClientId; + DWORD64 ActiveRpcHandle; + DWORD64 ThreadLocalStoragePointer; + PPEB64 ProcessEnvironmentBlock; +} TEB64, *PTEB64; + +typedef struct _LDR_DATA_TABLE_ENTRY64 +{ + LIST_ENTRY64 InLoadOrderLinks; + LIST_ENTRY64 InMemoryOrderLinks; + LIST_ENTRY64 InInitializationOrderLinks; + DWORD64 DllBase; + DWORD64 EntryPoint; + ULONG SizeOfImage; + UNICODE_STRING64 FullDllName; + UNICODE_STRING64 BaseDllName; + ULONG Flags; + WORD LoadCount; +} LDR_DATA_TABLE_ENTRY54, *PLDR_DATA_TABLE_ENTRY64; + +#define LDRP_PROCESS_ATTACH_CALLED 0x000080000 +#define LDRP_ENTRY_PROCESSED 0x000004000 + +typedef enum _SECTION_INHERIT { + ViewShare = 1, + ViewUnmap = 2 +} SECTION_INHERIT, * PSECTION_INHERIT; \ No newline at end of file diff --git a/CAPE/wow64_fix.cpp b/CAPE/wow64_fix.c similarity index 81% rename from CAPE/wow64_fix.cpp rename to CAPE/wow64_fix.c index e8bc595..23932e4 100644 --- a/CAPE/wow64_fix.cpp +++ b/CAPE/wow64_fix.c @@ -16,8 +16,9 @@ You should have received a copy of the GNU General Public License along with this program.If not, see . */ #ifndef _WIN64 -#include "wow64ext\wow64ext.h" -// ReWolf's wow64ext library: https://github.com/rwfpl/rewolf-wow64ext +#include "w64wow64\w64wow64.h" +// Based upon ReWolf's wow64ext library: +// https://github.com/rwfpl/rewolf-wow64ext #define DR7_MASK_RWE0 0xFFFDFFFF // 11111111111111011111111111111111 #define DR7_MASK_RWE1 0xFFDFFFFF // 11111111110111111111111111111111 @@ -26,28 +27,28 @@ along with this program.If not, see . const int PAGE_SIZE = 0x1000; -extern "C" void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); -extern "C" void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); +extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); +extern void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); BOOL WoW64HookInstalled; -LPVOID lpHookCode = nullptr; -LPVOID lpNewJumpLocation; +DWORD64 lpHookCode = (DWORD64)NULL; +DWORD64 lpNewJumpLocation; -DWORD pfnKiUserExceptionDispatcher; -DWORD pfnNtSetContextThread; -DWORD pfnWow64PrepareForException; +DWORD64 pfnKiUserExceptionDispatcher; +DWORD64 pfnNtSetContextThread; +DWORD64 pfnWow64PrepareForException; //************************************************************************************** -extern "C" BOOL WoW64PatchBreakpoint(unsigned int Register) +extern BOOL WoW64PatchBreakpoint(unsigned int Register) //************************************************************************************** { if (WoW64HookInstalled == FALSE) return FALSE; - + DoOutputDebugString("WoW64PatchBreakpoint entry, debug register: %d, current DR7 mask = 0x%x\n", Register, *(DWORD*)(((PBYTE)lpNewJumpLocation)+37)); - switch(Register) + switch(Register) { case 0: *(DWORD*)(((PBYTE)lpNewJumpLocation)+37) = (*(DWORD*)(((PBYTE)lpNewJumpLocation)+37) & DR7_MASK_RWE0); @@ -62,14 +63,14 @@ extern "C" BOOL WoW64PatchBreakpoint(unsigned int Register) *(DWORD*)(((PBYTE)lpNewJumpLocation)+37) = (*(DWORD*)(((PBYTE)lpNewJumpLocation)+37) & DR7_MASK_RWE3); break; } - + DoOutputDebugString("WoW64PatchBreakpoint: patched DR7 mask = 0x%x\n", *(DWORD*)(((PBYTE)lpNewJumpLocation)+37)); - + return TRUE; } //************************************************************************************** -extern "C" BOOL WoW64UnpatchBreakpoint(unsigned int Register) +extern BOOL WoW64UnpatchBreakpoint(unsigned int Register) //************************************************************************************** { if (WoW64HookInstalled == FALSE) @@ -77,34 +78,34 @@ extern "C" BOOL WoW64UnpatchBreakpoint(unsigned int Register) DoOutputDebugString("WoW64UnpatchBreakpoint entry, debug register: %d, current DR7 mask = 0x%x\n", Register, *(DWORD*)(((PBYTE)lpNewJumpLocation)+37)); - switch(Register) + switch(Register) { case 0: *(DWORD*)(((PBYTE)lpNewJumpLocation)+37) = (*(DWORD*)(((PBYTE)lpNewJumpLocation)+37) | ~DR7_MASK_RWE0); - break; - case 1: + break; + case 1: *(DWORD*)(((PBYTE)lpNewJumpLocation)+37) = (*(DWORD*)(((PBYTE)lpNewJumpLocation)+37) | ~DR7_MASK_RWE1); - break; - case 2: + break; + case 2: *(DWORD*)(((PBYTE)lpNewJumpLocation)+37) = (*(DWORD*)(((PBYTE)lpNewJumpLocation)+37) | ~DR7_MASK_RWE2); - break; - case 3: + break; + case 3: *(DWORD*)(((PBYTE)lpNewJumpLocation)+37) = (*(DWORD*)(((PBYTE)lpNewJumpLocation)+37) | ~DR7_MASK_RWE3); break; } - + DoOutputDebugString("WoW64UnpatchBreakpoint: unpatched DR7 mask = 0x%x\n", *(DWORD*)(((PBYTE)lpNewJumpLocation)+37)); - + return TRUE; } //************************************************************************************** -const LPVOID CreateHook(const DWORD_PTR pKiUserExceptionDispatcher, const DWORD_PTR pNtSetContextThread64, const DWORD_PTR pWow64PrepareForException) +const DWORD64 CreateHook(const DWORD_PTR pKiUserExceptionDispatcher, const DWORD_PTR pNtSetContextThread64, const DWORD_PTR pWow64PrepareForException) //************************************************************************************** // credit to Omega Red http://pastebin.ca/raw/475547 { unsigned char HookBytes[] = - { + { 0x81, 0xBC, 0x24, 0xF0, 0x04, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x40, //cmp dword [rsp+0x4f0], 0x4000001e ; wow64 single step? 0 0x75, 0x37, //jne hook_end 11 @@ -121,8 +122,8 @@ const LPVOID CreateHook(const DWORD_PTR pKiUserExceptionDispatcher, const DWORD_ 0x4C, 0x89, 0xEA, //mov rdx, r13 59 0x4D, 0x89, 0xF0, //mov r8, r14 62 0x4D, 0x89, 0xF9, //mov r9, r15 65 -//hook_end - 0xFC, //cld - first two instructions from KiUserExceptionDispatcher 68 +//hook_end + 0xFC, //cld - first two instructions from KiUserExceptionDispatcher 68 0x48, 0xB8, 0xDD, 0xCC, 0xBB, 0xAA, 0x00, 0x00, 0x00, 0x00, //mov rax, 0AABBCCDDh 69 0x50, //push rax - jump back to KiUserExceptionDispatcher+8 79 0x48, 0xB8, 0xDD, 0xCC, 0xBB, 0xAA, 0x00, 0x00, 0x00, 0x00, //mov rax, 0AABBCCDDh 80 @@ -130,22 +131,22 @@ const LPVOID CreateHook(const DWORD_PTR pKiUserExceptionDispatcher, const DWORD_ 0xC3 //ret 94 }; // 86 - lpHookCode = (LPVOID)VirtualAllocEx64((HANDLE) -1, NULL, PAGE_SIZE, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); - + lpHookCode = VirtualAllocEx64((HANDLE) -1, (DWORD64)NULL, PAGE_SIZE, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); + //insert relative address of NtSetContextThread64 from instruction after call DWORD RelativeOffset = pNtSetContextThread64 - ((DWORD)lpHookCode + 56); memcpy(&HookBytes[52], &RelativeOffset, sizeof(DWORD_PTR)); - + //insert VA of Wow64PrepareForException memcpy(&HookBytes[71], &pWow64PrepareForException, sizeof(DWORD_PTR)); - + //insert address to return to from hook code at 8 bytes into KiUserExceptionDispatcher DWORD ReturnAddress = pKiUserExceptionDispatcher + 8; - memcpy(&HookBytes[82], &ReturnAddress, sizeof(DWORD_PTR)); //(8 is address of third instruction) - + memcpy(&HookBytes[82], &ReturnAddress, sizeof(DWORD_PTR)); //(8 is address of third instruction) + //copy it to newly created page - (void)memcpy(lpHookCode, (const void *)HookBytes, sizeof(HookBytes)); - + memcpy((LPVOID)lpHookCode, (const void *)HookBytes, sizeof(HookBytes)); + return lpHookCode; } @@ -156,10 +157,10 @@ const void EnableWow64Hook() unsigned char trampolineBytes[] = { 0xE9, 0xDD, 0xCC, 0xBB, 0xAA, // jmp +0xAABBCCDDEE+5 - 0xCC, 0xCC, 0xCC // + 0xCC, 0xCC, 0xCC // }; DWORD pNew = (DWORD)lpNewJumpLocation; - DWORD pOrig = pfnKiUserExceptionDispatcher + 5; + DWORD pOrig = (DWORD)pfnKiUserExceptionDispatcher + 5; DWORD RelativeOffset = pNew - pOrig; memcpy(&trampolineBytes[1], (PVOID)&RelativeOffset, sizeof(DWORD_PTR)); @@ -169,18 +170,18 @@ const void EnableWow64Hook() DoOutputErrorString("VirtualProtectEx64 failed to set PAGE_EXECUTE_READWRITE"); return; } - + memcpy((PVOID)pfnKiUserExceptionDispatcher, &trampolineBytes, sizeof(trampolineBytes)); if (!VirtualProtectEx64((HANDLE)-1, (DWORD64)pfnKiUserExceptionDispatcher, PAGE_SIZE, dwOldProtect, &dwOldProtect)) { DoOutputErrorString("VirtualProtect failed to restore dwOldProtect"); return; - } + } } //************************************************************************************** -extern "C" BOOL WoW64fix(void) +extern BOOL WoW64fix(void) //************************************************************************************** { IsWow64Process(GetCurrentProcess(), &WoW64HookInstalled); @@ -189,21 +190,24 @@ extern "C" BOOL WoW64fix(void) DoOutputDebugString("WoW64 not detected.\n"); return FALSE; } - - DWORD ntdll64 = getNTDLL64(); - DWORD wow64dll = GetModuleHandle64(L"wow64.dll"); - DWORD pfnWow64PrepareForException = GetProcAddress64(wow64dll, "Wow64PrepareForException"); + + //DWORD ntdll64 = getNTDLL64(); + //DWORD wow64dll = GetModuleHandle64(L"wow64.dll"); + + DWORD64 ntdll64 = GetModuleBase64(L"ntdll.dll"); + DWORD64 wow64dll = GetModuleBase64(L"wow64.dll"); + DWORD64 pfnWow64PrepareForException = GetProcAddress64(wow64dll, "Wow64PrepareForException"); pfnKiUserExceptionDispatcher = GetProcAddress64(ntdll64, "KiUserExceptionDispatcher"); - pfnNtSetContextThread = GetProcAddress64(ntdll64, "NtSetContextThread"); + pfnNtSetContextThread = GetProcAddress64(ntdll64, "NtSetContextThread"); DoOutputDebugString("WoW64 detected: 64-bit ntdll base: 0x%x, KiUserExceptionDispatcher: 0x%x, NtSetContextThread: 0x%x, Wow64PrepareForException: 0x%x\n", ntdll64, pfnKiUserExceptionDispatcher, pfnNtSetContextThread, pfnWow64PrepareForException); - + lpNewJumpLocation = CreateHook((DWORD_PTR)pfnKiUserExceptionDispatcher, (DWORD_PTR)pfnNtSetContextThread, (DWORD_PTR)pfnWow64PrepareForException); - + EnableWow64Hook(); - + DoOutputDebugString("WoW64 workaround: KiUserExceptionDispatcher hook installed at: 0x%x\n", lpNewJumpLocation); - + return TRUE; } #endif \ No newline at end of file diff --git a/CAPE/wow64ext/wow64ext.cpp b/CAPE/wow64ext/wow64ext.cpp deleted file mode 100644 index 89c6a46..0000000 --- a/CAPE/wow64ext/wow64ext.cpp +++ /dev/null @@ -1,338 +0,0 @@ -#ifndef _WIN64 -#/** - * - * WOW64Ext Library - * - * Copyright (c) 2012 ReWolf - * http://blog.rewolf.pl/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - */ - -#include -#include "internal.h" -#include "wow64ext.h" - -#pragma warning(push) -#pragma warning(disable : 4409) -extern "C" DWORD64 X64Call(DWORD func, int argC, ...) -{ - va_list args; - va_start(args, argC); - DWORD64 _rcx = (argC > 0) ? argC--, va_arg(args, DWORD64) : 0; - DWORD64 _rdx = (argC > 0) ? argC--, va_arg(args, DWORD64) : 0; - DWORD64 _r8 = (argC > 0) ? argC--, va_arg(args, DWORD64) : 0; - DWORD64 _r9 = (argC > 0) ? argC--, va_arg(args, DWORD64) : 0; - reg64 _rax; - _rax.v = 0; - - DWORD64 restArgs = (DWORD64)&va_arg(args, DWORD64); - - //conversion to QWORD for easier use in inline assembly - DWORD64 _argC = argC; - DWORD64 _func = func; - - DWORD back_esp = 0; - - __asm - { - ;//keep original esp in back_esp variable - mov back_esp, esp - - ;//align esp to 8, without aligned stack some syscalls may return errors ! - and esp, 0xFFFFFFF8 - - X64_Start(); - - ;//fill first four arguments - push _rcx - X64_Pop(_RCX); - push _rdx - X64_Pop(_RDX); - push _r8 - X64_Pop(_R8); - push _r9 - X64_Pop(_R9); - - push edi - - push restArgs - X64_Pop(_RDI); - - push _argC - X64_Pop(_RAX); - - ;//put rest of arguments on the stack - test eax, eax - jz _ls_e - lea edi, dword ptr [edi + 8*eax - 8] - - _ls: - test eax, eax - jz _ls_e - push dword ptr [edi] - sub edi, 8 - sub eax, 1 - jmp _ls - _ls_e: - - ;//create stack space for spilling registers - sub esp, 0x20 - - call _func - - ;//cleanup stack - push _argC - X64_Pop(_RCX); - lea esp, dword ptr [esp + 8*ecx + 0x20] - - pop edi - - //set return value - X64_Push(_RAX); - pop _rax.dw[0] - - X64_End(); - - mov esp, back_esp - } - return _rax.v; -} -#pragma warning(pop) - -TEB64* getTEB64() -{ - reg64 reg; - reg.v = 0; - X64_Start(); - //R12 register should always contain pointer to TEB64 in WoW64 processes - X64_Push(_R12); - //below pop will pop QWORD from stack, as we're in x64 mode now - __asm pop reg.dw[0] - X64_End(); - //upper 32 bits should be always 0 in WoW64 processes - if (reg.dw[1] != 0) - return 0; - return (TEB64*)reg.dw[0]; -} - -extern "C" DWORD GetModuleHandle64(wchar_t* lpModuleName) -{ - DWORD module = 0; - - TEB64* teb64 = getTEB64(); - PEB64* peb64 = (PEB64*)teb64->ProcessEnvironmentBlock; - PEB_LDR_DATA64* ldr = (PEB_LDR_DATA64*)peb64->Ldr; - - LDR_DATA_TABLE_ENTRY64* head = (LDR_DATA_TABLE_ENTRY64*)ldr->InLoadOrderModuleList.Flink; - do - { - if (memcmp((void*)head->BaseDllName.Buffer, lpModuleName, head->BaseDllName.Length) == 0) - module = (DWORD)head->DllBase; - head = (LDR_DATA_TABLE_ENTRY64*)head->InLoadOrderLinks.Flink; - } - while (head != (LDR_DATA_TABLE_ENTRY64*)&ldr->InLoadOrderModuleList); - return module; -} - -extern "C" DWORD getNTDLL64() -{ - static DWORD ntdll64 = 0; - if (0 != ntdll64) - return ntdll64; - - ntdll64 = GetModuleHandle64(L"ntdll.dll"); - return ntdll64; -} - -DWORD getLdrGetProcedureAddress() -{ - BYTE* modBase = (BYTE*)getNTDLL64(); - IMAGE_NT_HEADERS64* inh = (IMAGE_NT_HEADERS64*)(modBase + ((IMAGE_DOS_HEADER*)modBase)->e_lfanew); - IMAGE_DATA_DIRECTORY& idd = inh->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT]; - if (0 == idd.VirtualAddress) - return 0; - - IMAGE_EXPORT_DIRECTORY* ied = (IMAGE_EXPORT_DIRECTORY*)(modBase + idd.VirtualAddress); - - DWORD* rvaTable = (DWORD*)(modBase + ied->AddressOfFunctions); - WORD* ordTable = (WORD*)(modBase + ied->AddressOfNameOrdinals); - DWORD* nameTable = (DWORD*)(modBase + ied->AddressOfNames); - //lazy search, there is no need to use binsearch for just one function - for (DWORD i = 0; i < ied->NumberOfFunctions; i++) - { - if (strcmp((char*)modBase + nameTable[i], "LdrGetProcedureAddress")) - continue; - else - return (DWORD)(modBase + rvaTable[ordTable[i]]); - } - return 0; -} - -extern "C" __declspec(dllexport) VOID __cdecl SetLastErrorFromX64Call(DWORD64 status) -{ - typedef ULONG (WINAPI *RtlNtStatusToDosError_t)(NTSTATUS Status); - typedef ULONG (WINAPI *RtlSetLastWin32Error_t)(NTSTATUS Status); - - static RtlNtStatusToDosError_t RtlNtStatusToDosError = nullptr; - static RtlSetLastWin32Error_t RtlSetLastWin32Error = nullptr; - - if ((nullptr == RtlNtStatusToDosError) || (nullptr == RtlSetLastWin32Error)) - { - HMODULE ntdll = GetModuleHandleW(L"ntdll.dll"); - RtlNtStatusToDosError = (RtlNtStatusToDosError_t)GetProcAddress(ntdll, "RtlNtStatusToDosError"); - RtlSetLastWin32Error = (RtlSetLastWin32Error_t)GetProcAddress(ntdll, "RtlSetLastWin32Error"); - } - - if ((nullptr != RtlNtStatusToDosError) && (nullptr != RtlSetLastWin32Error)) - { - RtlSetLastWin32Error(RtlNtStatusToDosError((DWORD)status)); - } -} - -extern "C" DWORD GetProcAddress64(DWORD hModule, char* funcName) -{ - static DWORD _LdrGetProcedureAddress = 0; - if (0 == _LdrGetProcedureAddress) - { - _LdrGetProcedureAddress = getLdrGetProcedureAddress(); - if (0 == _LdrGetProcedureAddress) - return 0; - } - - _UNICODE_STRING_T fName = { 0 }; - fName.Buffer = (DWORD64)funcName; - fName.Length = (WORD)strlen(funcName); - fName.MaximumLength = fName.Length + 1; - DWORD64 funcRet = 0; - X64Call(_LdrGetProcedureAddress, 4, (DWORD64)hModule, (DWORD64)&fName, (DWORD64)0, (DWORD64)&funcRet); - return (DWORD)funcRet; -} - -extern "C" SIZE_T VirtualQueryEx64(HANDLE hProcess, DWORD64 lpAddress, MEMORY_BASIC_INFORMATION64* lpBuffer, SIZE_T dwLength) -{ - static DWORD ntqvm = 0; - if (0 == ntqvm) - { - ntqvm = (DWORD)GetProcAddress64(getNTDLL64(), "NtQueryVirtualMemory"); - if (0 == ntqvm) - return 0; - } - DWORD64 ret = 0; - X64Call(ntqvm, 6, (DWORD64)hProcess, lpAddress, (DWORD64)0, (DWORD64)lpBuffer, (DWORD64)dwLength, (DWORD64)&ret); - return (SIZE_T)ret; -} - -#pragma warning(push) -#pragma warning(disable : 4244) -extern "C" DWORD64 VirtualAllocEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) -{ - static DWORD64 ntavm = 0; - if (0 == ntavm) - { - ntavm = GetProcAddress64(getNTDLL64(), "NtAllocateVirtualMemory"); - if (0 == ntavm) - return 0; - } - - DWORD64 tmpAddr = lpAddress; - DWORD64 tmpSize = dwSize; - DWORD64 ret = X64Call(ntavm, 6, (DWORD64)hProcess, (DWORD64)&tmpAddr, (DWORD64)0, (DWORD64)&tmpSize, (DWORD64)flAllocationType, (DWORD64)flProtect); - if (STATUS_SUCCESS != ret) - { - SetLastErrorFromX64Call(ret); - return FALSE; - } - else - return tmpAddr; -} - -extern "C" BOOL VirtualFreeEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD dwFreeType) -{ - static DWORD64 ntfvm = 0; - if (0 == ntfvm) - { - ntfvm = GetProcAddress64(getNTDLL64(), "NtFreeVirtualMemory"); - if (0 == ntfvm) - return 0; - } - - DWORD64 tmpAddr = lpAddress; - DWORD64 tmpSize = dwSize; - DWORD64 ret = X64Call(ntfvm, 4, (DWORD64)hProcess, (DWORD64)&tmpAddr, (DWORD64)&tmpSize, (DWORD64)dwFreeType); - if (STATUS_SUCCESS != ret) - { - SetLastErrorFromX64Call(ret); - return FALSE; - } - else - return TRUE; -} - -extern "C" BOOL VirtualProtectEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flNewProtect, DWORD* lpflOldProtect) -{ - static DWORD64 ntpvm = 0; - if (0 == ntpvm) - { - ntpvm = GetProcAddress64(getNTDLL64(), "NtProtectVirtualMemory"); - if (0 == ntpvm) - return 0; - } - - DWORD64 tmpAddr = lpAddress; - DWORD64 tmpSize = dwSize; - DWORD64 ret = X64Call(ntpvm, 5, (DWORD64)hProcess, (DWORD64)&tmpAddr, (DWORD64)&tmpSize, (DWORD64)flNewProtect, (DWORD64)lpflOldProtect); - if (STATUS_SUCCESS != ret) - { - SetLastErrorFromX64Call(ret); - return FALSE; - } - else - return TRUE; -} -#pragma warning(pop) - -extern "C" BOOL ReadProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesRead) -{ - static DWORD nrvm = 0; - if (0 == nrvm) - { - nrvm = (DWORD)GetProcAddress64(getNTDLL64(), "NtReadVirtualMemory"); - if (0 == nrvm) - return 0; - } - DWORD64 ret = X64Call(nrvm, 5, (DWORD64)hProcess, lpBaseAddress, (DWORD64)lpBuffer, (DWORD64)nSize, (DWORD64)lpNumberOfBytesRead); - if (STATUS_SUCCESS != ret) - return FALSE; - else - return TRUE; -} - -extern "C" BOOL WriteProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesWritten) -{ - static DWORD nrvm = 0; - if (0 == nrvm) - { - nrvm = (DWORD)GetProcAddress64(getNTDLL64(), "NtWriteVirtualMemory"); - if (0 == nrvm) - return 0; - } - DWORD64 ret = X64Call(nrvm, 5, (DWORD64)hProcess, lpBaseAddress, (DWORD64)lpBuffer, (DWORD64)nSize, (DWORD64)lpNumberOfBytesWritten); - if (STATUS_SUCCESS != ret) - return FALSE; - else - return TRUE; -} -#endif \ No newline at end of file diff --git a/CAPE/wow64ext/wow64ext.h b/CAPE/wow64ext/wow64ext.h deleted file mode 100644 index 309645d..0000000 --- a/CAPE/wow64ext/wow64ext.h +++ /dev/null @@ -1,348 +0,0 @@ -/** - * - * WOW64Ext Library - * - * Copyright (c) 2012 ReWolf - * http://blog.rewolf.pl/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include - -#ifndef STATUS_SUCCESS -# define STATUS_SUCCESS 0 -#endif - -#pragma pack(push) -#pragma pack(1) -template -struct _LIST_ENTRY_T -{ - T Flink; - T Blink; -}; - -template -struct _UNICODE_STRING_T -{ - union - { - struct - { - WORD Length; - WORD MaximumLength; - }; - T dummy; - }; - T Buffer; -}; - -template -struct _NT_TIB_T -{ - T ExceptionList; - T StackBase; - T StackLimit; - T SubSystemTib; - T FiberData; - T ArbitraryUserPointer; - T Self; -}; - -template -struct _CLIENT_ID -{ - T UniqueProcess; - T UniqueThread; -}; - -template -struct _TEB_T_ -{ - _NT_TIB_T NtTib; - T EnvironmentPointer; - _CLIENT_ID ClientId; - T ActiveRpcHandle; - T ThreadLocalStoragePointer; - T ProcessEnvironmentBlock; - DWORD LastErrorValue; - DWORD CountOfOwnedCriticalSections; - T CsrClientThread; - T Win32ThreadInfo; - DWORD User32Reserved[26]; - //rest of the structure is not defined for now, as it is not needed -}; - -template -struct _LDR_DATA_TABLE_ENTRY_T -{ - _LIST_ENTRY_T InLoadOrderLinks; - _LIST_ENTRY_T InMemoryOrderLinks; - _LIST_ENTRY_T InInitializationOrderLinks; - T DllBase; - T EntryPoint; - union - { - DWORD SizeOfImage; - T dummy01; - }; - _UNICODE_STRING_T FullDllName; - _UNICODE_STRING_T BaseDllName; - DWORD Flags; - WORD LoadCount; - WORD TlsIndex; - union - { - _LIST_ENTRY_T HashLinks; - struct - { - T SectionPointer; - T CheckSum; - }; - }; - union - { - T LoadedImports; - DWORD TimeDateStamp; - }; - T EntryPointActivationContext; - T PatchInformation; - _LIST_ENTRY_T ForwarderLinks; - _LIST_ENTRY_T ServiceTagLinks; - _LIST_ENTRY_T StaticLinks; - T ContextInformation; - T OriginalBase; - _LARGE_INTEGER LoadTime; -}; - -template -struct _PEB_LDR_DATA_T -{ - DWORD Length; - DWORD Initialized; - T SsHandle; - _LIST_ENTRY_T InLoadOrderModuleList; - _LIST_ENTRY_T InMemoryOrderModuleList; - _LIST_ENTRY_T InInitializationOrderModuleList; - T EntryInProgress; - DWORD ShutdownInProgress; - T ShutdownThreadId; - -}; - -template -struct _PEB_T -{ - union - { - struct - { - BYTE InheritedAddressSpace; - BYTE ReadImageFileExecOptions; - BYTE BeingDebugged; - BYTE BitField; - }; - T dummy01; - }; - T Mutant; - T ImageBaseAddress; - T Ldr; - T ProcessParameters; - T SubSystemData; - T ProcessHeap; - T FastPebLock; - T AtlThunkSListPtr; - T IFEOKey; - T CrossProcessFlags; - T UserSharedInfoPtr; - DWORD SystemReserved; - DWORD AtlThunkSListPtr32; - T ApiSetMap; - T TlsExpansionCounter; - T TlsBitmap; - DWORD TlsBitmapBits[2]; - T ReadOnlySharedMemoryBase; - T HotpatchInformation; - T ReadOnlyStaticServerData; - T AnsiCodePageData; - T OemCodePageData; - T UnicodeCaseTableData; - DWORD NumberOfProcessors; - union - { - DWORD NtGlobalFlag; - NGF dummy02; - }; - LARGE_INTEGER CriticalSectionTimeout; - T HeapSegmentReserve; - T HeapSegmentCommit; - T HeapDeCommitTotalFreeThreshold; - T HeapDeCommitFreeBlockThreshold; - DWORD NumberOfHeaps; - DWORD MaximumNumberOfHeaps; - T ProcessHeaps; - T GdiSharedHandleTable; - T ProcessStarterHelper; - T GdiDCAttributeList; - T LoaderLock; - DWORD OSMajorVersion; - DWORD OSMinorVersion; - WORD OSBuildNumber; - WORD OSCSDVersion; - DWORD OSPlatformId; - DWORD ImageSubsystem; - DWORD ImageSubsystemMajorVersion; - T ImageSubsystemMinorVersion; - T ActiveProcessAffinityMask; - T GdiHandleBuffer[A]; - T PostProcessInitRoutine; - T TlsExpansionBitmap; - DWORD TlsExpansionBitmapBits[32]; - T SessionId; - ULARGE_INTEGER AppCompatFlags; - ULARGE_INTEGER AppCompatFlagsUser; - T pShimData; - T AppCompatInfo; - _UNICODE_STRING_T CSDVersion; - T ActivationContextData; - T ProcessAssemblyStorageMap; - T SystemDefaultActivationContextData; - T SystemAssemblyStorageMap; - T MinimumStackCommit; - T FlsCallback; - _LIST_ENTRY_T FlsListHead; - T FlsBitmap; - DWORD FlsBitmapBits[4]; - T FlsHighIndex; - T WerRegistrationData; - T WerShipAssertPtr; - T pContextData; - T pImageHeaderHash; - T TracingFlags; -}; - -typedef _LDR_DATA_TABLE_ENTRY_T LDR_DATA_TABLE_ENTRY32; -typedef _LDR_DATA_TABLE_ENTRY_T LDR_DATA_TABLE_ENTRY64; - -typedef _TEB_T_ TEB32; -typedef _TEB_T_ TEB64; - -typedef _PEB_LDR_DATA_T PEB_LDR_DATA32; -typedef _PEB_LDR_DATA_T PEB_LDR_DATA64; - -typedef _PEB_T PEB32; -typedef _PEB_T PEB64; - -#pragma pack(pop) - -#ifdef WOW64EXT_EXPORTS -# define SPEC dllexport -#else -# define SPEC dllimport -#endif - -extern "C" -{ - DWORD64 X64Call(DWORD func, int argC, ...); - DWORD GetModuleHandle64(wchar_t* lpModuleName); - DWORD getNTDLL64(); - DWORD GetProcAddress64(DWORD hModule, char* funcName); - SIZE_T VirtualQueryEx64(HANDLE hProcess, DWORD64 lpAddress, MEMORY_BASIC_INFORMATION64* lpBuffer, SIZE_T dwLength); - DWORD64 VirtualAllocEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect); - BOOL VirtualFreeEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD dwFreeType); - - BOOL VirtualProtectEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flNewProtect, DWORD* lpflOldProtect); - BOOL ReadProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesRead); - BOOL WriteProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesWritten); -} - - typedef struct DECLSPEC_ALIGN(16) _CONTEXT64 { - - // WinNT.h - // - // Register parameter home addresses. - // - // N.B. These fields are for convience - they could be used to extend the - // context record in the future. - // - - DWORD64 P1Home; - DWORD64 P2Home; - DWORD64 P3Home; - DWORD64 P4Home; - DWORD64 P5Home; - DWORD64 P6Home; - - // - // Control flags. - // - - DWORD ContextFlags; - DWORD MxCsr; - - // - // Segment Registers and processor flags. - // - - WORD SegCs; - WORD SegDs; - WORD SegEs; - WORD SegFs; - WORD SegGs; - WORD SegSs; - DWORD EFlags; - - // - // Debug registers - // - - DWORD64 Dr0; - DWORD64 Dr1; - DWORD64 Dr2; - DWORD64 Dr3; - DWORD64 Dr6; - DWORD64 Dr7; - - // - // Integer registers. - // - - DWORD64 Rax; - DWORD64 Rcx; - DWORD64 Rdx; - DWORD64 Rbx; - DWORD64 Rsp; - DWORD64 Rbp; - DWORD64 Rsi; - DWORD64 Rdi; - DWORD64 R8; - DWORD64 R9; - DWORD64 R10; - DWORD64 R11; - DWORD64 R12; - DWORD64 R13; - DWORD64 R14; - DWORD64 R15; - - // - // Program counter. - // - - DWORD64 Rip; - - // [...] snip -} CONTEXT64, *PCONTEXT64; diff --git a/bson/bson.vcxproj b/bson/bson.vcxproj index cae92ba..dd0c78e 100644 --- a/bson/bson.vcxproj +++ b/bson/bson.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -21,31 +21,32 @@ {0DA99545-93E9-4C1B-861B-C4DAB5360AA8} Win32Proj + 10.0.17134.0 StaticLibrary true - v140 + v141 MultiByte StaticLibrary true - v140 + v141_xp MultiByte StaticLibrary false - v140_xp + v141_xp MultiByte true StaticLibrary false - v140_xp + v141_xp MultiByte true diff --git a/config.c b/config.c index 7130d0f..a2216fe 100644 --- a/config.c +++ b/config.c @@ -23,6 +23,9 @@ along with this program. If not, see . #include "log.h" #include "hooking.h" +extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); +extern void* CAPE_var; + int read_config(void) { // TODO unicode support @@ -47,6 +50,7 @@ int read_config(void) #else g_config.hook_type = HOOK_HOTPATCH_JMP_INDIRECT; #endif + g_config.procmemdump = 0; memset(buf, 0, sizeof(buf)); while (fgets(buf, sizeof(buf), fp) != NULL) @@ -214,6 +218,25 @@ int read_config(void) p = p2 + 1; } } + else if (!strcmp(key, "breakpoint")) { + CAPE_var = (void*)(DWORD_PTR)strtoul(value, NULL, 10); + DoOutputDebugString("CAPE_var set to 0x%x", CAPE_var); + } + else if (!strcmp(key, "procmemdump")) { + g_config.procmemdump = value[0] == '1'; + if (g_config.procmemdump) + DoOutputDebugString("Process memory dumps enabled.\n"); + else + DoOutputDebugString("Process memory dumps disabled.\n"); + } + else if (!strcmp(key, "import_reconstruction")) { + g_config.import_reconstruction = value[0] == '1'; + if (g_config.import_reconstruction) + DoOutputDebugString("Import reconstruction of process dumps enabled.\n"); + else + DoOutputDebugString("Import reconstruction of process dumps disabled.\n"); + } + } } diff --git a/config.h b/config.h index 931bf76..b92e851 100644 --- a/config.h +++ b/config.h @@ -104,6 +104,12 @@ struct _g_config { char *excluded_apinames[EXCLUSION_MAX]; wchar_t *excluded_dllnames[EXCLUSION_MAX]; + + // should we dump each process on exit/analysis timeout? + int procmemdump; + + // should we attempt import reconstruction on each process dump? (slow) + int import_reconstruction; }; extern struct _g_config g_config; diff --git a/cuckoomon.c b/cuckoomon.c index ad21d4c..8f4b578 100644 --- a/cuckoomon.c +++ b/cuckoomon.c @@ -34,6 +34,8 @@ along with this program. If not, see . volatile int dummy_val; extern void init_CAPE(); +extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); +extern LONG WINAPI CAPEExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo); void disable_tail_call_optimization(void) { @@ -84,6 +86,8 @@ static hook_t g_hooks[] = { //HOOK_SPECIAL(ntdll, NtCreateThreadEx), //HOOK_SPECIAL(ntdll, NtTerminateThread), + //HOOK_SPECIAL(kernel32, HeapAlloc), + // has special handling HOOK_SPECIAL(jscript, COleScript_ParseScriptText), @@ -348,17 +352,19 @@ static hook_t g_hooks[] = { // Misc Hooks // - //HOOK(ntdll, memcpy), HOOK(msvcrt, memcpy), - HOOK(msvcrt, srand), + HOOK(ntdll, memcpy), + HOOK(kernel32, GetProcessHeap), // for debugging only //HOOK(kernel32, GetLastError), + HOOK(user32, ChangeWindowMessageFilter), HOOK(user32, SetWindowsHookExA), HOOK(user32, SetWindowsHookExW), HOOK(user32, UnhookWindowsHookEx), HOOK(kernel32, SetUnhandledExceptionFilter), + HOOK(ntdll, RtlAddVectoredExceptionHandler), HOOK(kernel32, SetErrorMode), HOOK(ntdll, LdrGetDllHandle), HOOK(ntdll, LdrGetProcedureAddress), @@ -569,6 +575,7 @@ static hook_t g_hooks[] = { HOOK(advapi32, CryptCreateHash), HOOK(advapi32, CryptEnumProvidersA), HOOK(advapi32, CryptEnumProvidersW), + HOOK(advapi32, QueryUsersOnEncryptedFile), HOOK(wintrust, HTTPSCertificateTrust), HOOK(wintrust, HTTPSFinalProv), @@ -595,6 +602,7 @@ static hook_t g_hooks[] = { HOOK(cryptsp, CryptCreateHash), HOOK(cryptsp, CryptEnumProvidersA), HOOK(cryptsp, CryptEnumProvidersW), + HOOK(cryptsp, CryptHashSessionKey) }; void set_hooks_dll(const wchar_t *library) @@ -768,10 +776,18 @@ LONG WINAPI cuckoomon_exception_handler(__in struct _EXCEPTION_POINTERS *Excepti } #endif - if (g_config.debug == 1 && ExceptionInfo->ExceptionRecord->ExceptionCode < 0xc0000000) return EXCEPTION_CONTINUE_SEARCH; + if (ExceptionInfo->ExceptionRecord->ExceptionCode == DBG_PRINTEXCEPTION_C) + return EXCEPTION_CONTINUE_SEARCH; + + if (ExceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_SINGLE_STEP) + return CAPEExceptionFilter(ExceptionInfo); + + if (ExceptionInfo->ExceptionRecord->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION) + return CAPEExceptionFilter(ExceptionInfo); + hook_disable(); get_lasterrors(&lasterror); @@ -822,6 +838,7 @@ LONG WINAPI cuckoomon_exception_handler(__in struct _EXCEPTION_POINTERS *Excepti eipptr[0], eipptr[1], eipptr[2], eipptr[3], eipptr[4], eipptr[5], eipptr[6], eipptr[7], eipptr[8], eipptr[9], eipptr[10], eipptr[11], eipptr[12], eipptr[13], eipptr[14], eipptr[15]); } debug_message(msg); + DoOutputDebugString(msg); if (dllname) free(dllname); free(msg); @@ -923,7 +940,6 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved) #ifdef STANDALONE // initialise CAPE - resolve_runtime_apis(); init_CAPE(); return TRUE; #endif @@ -1001,6 +1017,9 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved) // initialize the log file log_init(CUCKOODBG); + // initialise CAPE + init_CAPE(); + // initialize the Sleep() skipping stuff init_sleep_skip(g_config.first_process); @@ -1030,9 +1049,6 @@ BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved) // initialize context watchdog //init_watchdog(); - // initialise CAPE - init_CAPE(); - #ifndef _WIN64 if (!g_config.no_stealth) { /* for people too lazy to setup VMs properly */ diff --git a/cuckoomon.vcxproj b/cuckoomon.vcxproj index 6f3dc2f..f7daa12 100644 --- a/cuckoomon.vcxproj +++ b/cuckoomon.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -21,34 +21,38 @@ {15C69A24-71D1-4A1A-B39B-0466181ACD7E} Win32Proj - 8.1 + 7.0 DynamicLibrary true - v140 + v141 MultiByte + false DynamicLibrary true - v140 + v141 MultiByte + false DynamicLibrary false - v140_xp + v141_xp MultiByte true + false DynamicLibrary false - v140_xp + v141_xp NotSet true + false @@ -78,25 +82,25 @@ true AllRules.ruleset false - CAPE + Extraction $(VC_IncludePath);$(WindowsSdk_71A_IncludePath);C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\WTL91\Include; true AllRules.ruleset false - CAPE_x64 + Extraction_x64 .dll $(VC_IncludePath);$(WindowsSdk_71A_IncludePath);C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\WTL91\Include; - CUCKOODBG;WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS_DEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;CUCKOOMON_EXPORTS;%(PreprocessorDefinitions) + CUCKOODBG;WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS_DEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;CUCKOOMON_EXPORTS;%(PreprocessorDefinitions);_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS MultiThreadedDebug Level3 ProgramDatabase Disabled - .\bson;.\distorm3.2-package\include;%(AdditionalIncludeDirectories) + .\bson;.\distorm\include;%(AdditionalIncludeDirectories) Default @@ -115,12 +119,12 @@ - CUCKOODBG;WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS_DEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;CUCKOOMON_EXPORTS;%(PreprocessorDefinitions) + CUCKOODBG;WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS_DEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;CUCKOOMON_EXPORTS;%(PreprocessorDefinitions);_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS MultiThreadedDebug Level3 ProgramDatabase Disabled - .\bson;.\distorm3.2-package\include;%(AdditionalIncludeDirectories) + .\bson;.\distorm\include;%(AdditionalIncludeDirectories) Default @@ -138,11 +142,11 @@ - WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGSNDEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;CUCKOOMON_EXPORTS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions) + WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGSNDEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;CUCKOOMON_EXPORTS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;CAPE_EXTRACTION;%(PreprocessorDefinitions);_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS MultiThreaded Level3 ProgramDatabase - .\bson;.\distorm3.2-package\include;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WTL81\Include;%(AdditionalIncludeDirectories) + .\bson;.\distorm\include;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\WTL81\Include;%(AdditionalIncludeDirectories) true false NoExtensions @@ -169,11 +173,11 @@ - WIN32;_WIN64;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGSNDEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;CUCKOOMON_EXPORTS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;%(PreprocessorDefinitions) + WIN32;_WIN64;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGSNDEBUG;_WINDOWS;_USRDLL;MONGO_HAVE_STDINT;MONGO_STATIC_BUILD;CUCKOOMON_EXPORTS;_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS;CAPE_EXTRACTION;%(PreprocessorDefinitions);_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS MultiThreaded Level3 ProgramDatabase - .\bson;.\distorm3.2-package\include;%(AdditionalIncludeDirectories) + .\bson;.\distorm\include;%(AdditionalIncludeDirectories) true false @@ -198,6 +202,7 @@ + @@ -213,20 +218,19 @@ - - + + - - - - - - - - - - + + + + + + + + + @@ -421,19 +425,21 @@ - - + + + + - - - - - - - - - - + + + + + + + + + + diff --git a/cuckoomon.vcxproj.filters b/cuckoomon.vcxproj.filters index 1a6ee9d..3c8f7ee 100644 --- a/cuckoomon.vcxproj.filters +++ b/cuckoomon.vcxproj.filters @@ -192,36 +192,6 @@ Source Files - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - Source Files\CAPE @@ -249,12 +219,6 @@ Source Files\CAPE\Scylla - - Source Files\CAPE\wow64ext - - - Source Files\CAPE - Source Files\CAPE\Scylla @@ -276,6 +240,42 @@ Source Files\CAPE\Scylla + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\CAPE + @@ -323,36 +323,6 @@ Header Files - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - Header Files\CAPE @@ -371,12 +341,6 @@ Header Files\CAPE\Scylla - - Header Files\CAPE\wow64ext - - - Header Files\CAPE\wow64ext - Header Files\CAPE\Scylla @@ -395,9 +359,6 @@ Header Files\CAPE\Scylla - - Header Files\CAPE\Scylla - Header Files\CAPE\Scylla @@ -407,5 +368,50 @@ Header Files\CAPE\Scylla + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + \ No newline at end of file diff --git a/distorm/COPYING b/distorm/COPYING new file mode 100644 index 0000000..4f365dd --- /dev/null +++ b/distorm/COPYING @@ -0,0 +1,26 @@ +:[diStorm3}: +The ultimate disassembler library. +Copyright (c) 2003-2016, Gil Dabah +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Gil Dabah nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL GIL DABAH BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/distorm3.2-package/include/distorm.h b/distorm/include/distorm.h similarity index 89% rename from distorm3.2-package/include/distorm.h rename to distorm/include/distorm.h index 09db9d2..cce3314 100644 --- a/distorm3.2-package/include/distorm.h +++ b/distorm/include/distorm.h @@ -1,4 +1,4 @@ -/* diStorm3 3.2 */ +/* diStorm 3.3.3 */ /* distorm.h @@ -6,20 +6,8 @@ distorm.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ @@ -91,10 +79,10 @@ typedef unsigned __int8 uint8_t; /* * Operand Size or Adderss size are stored inside the flags: - * 0 - 16 bits - * 1 - 32 bits - * 2 - 64 bits - * 3 - reserved + * 00 - 16 bits + * 01 - 32 bits + * 10 - 64 bits + * 11 - reserved * * If you call these set-macros more than once, you will have to clean the bits before doing so. */ @@ -104,6 +92,8 @@ typedef unsigned __int8 uint8_t; #define FLAG_GET_ADDRSIZE(flags) (((flags) >> 10) & 3) /* To get the LOCK/REPNZ/REP prefixes. */ #define FLAG_GET_PREFIX(flags) ((flags) & 7) +/* Indicates whether the instruction is privileged. */ +#define FLAG_GET_PRIVILEGED(flags) (((flags) & FLAG_PRIVILEGED_INSTRUCTION) != 0) /* * Macros to extract segment registers from 'segment': @@ -179,7 +169,7 @@ typedef struct { */ uint8_t index; - /* Size of: + /* Size in bits of: O_REG: register O_IMM: instruction.imm O_IMM1: instruction.imm.ex.i1 @@ -206,29 +196,33 @@ typedef struct { #define FLAG_HINT_TAKEN (1 << 3) /* Indicates there is a hint non-taken for Jcc instructions only. */ #define FLAG_HINT_NOT_TAKEN (1 << 4) -/* The Imm value is signed extended. */ +/* The Imm value is signed extended (E.G in 64 bit decoding mode, a 32 bit imm is usually sign extended into 64 bit imm). */ #define FLAG_IMM_SIGNED (1 << 5) /* The destination operand is writable. */ #define FLAG_DST_WR (1 << 6) /* The instruction uses RIP-relative indirection. */ #define FLAG_RIP_RELATIVE (1 << 7) +/* See flag FLAG_GET_XXX macros above. */ + +/* The instruction is privileged and can only be used from Ring0. */ +#define FLAG_PRIVILEGED_INSTRUCTION (1 << 15) + /* No register was defined. */ #define R_NONE ((uint8_t)-1) -#define REGS64_BASE (0) -#define REGS32_BASE (16) -#define REGS16_BASE (32) -#define REGS8_BASE (48) -#define REGS8_REX_BASE (64) -#define SREGS_BASE (68) -/* #define RIP 74 */ -#define FPUREGS_BASE (75) -#define MMXREGS_BASE (83) -#define SSEREGS_BASE (91) -#define AVXREGS_BASE (107) -#define CREGS_BASE (123) -#define DREGS_BASE (132) +#define REGS64_BASE 0 +#define REGS32_BASE 16 +#define REGS16_BASE 32 +#define REGS8_BASE 48 +#define REGS8_REX_BASE 64 +#define SREGS_BASE 68 +#define FPUREGS_BASE 75 +#define MMXREGS_BASE 83 +#define SSEREGS_BASE 91 +#define AVXREGS_BASE 107 +#define CREGS_BASE 123 +#define DREGS_BASE 132 #define OPERANDS_NO (4) @@ -244,12 +238,12 @@ typedef struct { /* Unused prefixes mask, for each bit that is set that prefix is not used (LSB is byte [addr + 0]). */ uint16_t unusedPrefixesMask; /* Mask of registers that were used in the operands, only used for quick look up, in order to know *some* operand uses that register class. */ - uint16_t usedRegistersMask; + uint32_t usedRegistersMask; /* ID of opcode in the global opcode table. Use for mnemonic look up. */ uint16_t opcode; /* Up to four operands per instruction, ignored if ops[n].type == O_NONE. */ _Operand ops[OPERANDS_NO]; - /* Size of the whole instruction. */ + /* Size of the whole instruction in bytes. */ uint8_t size; /* Segment information of memory indirection, default segment, or overriden one, can be -1. Use SEGMENT macros. */ uint8_t segment; @@ -258,6 +252,8 @@ typedef struct { uint8_t dispSize; /* Meta defines the instruction set class, and the flow control flags. Use META macros. */ uint8_t meta; + /* The CPU flags that the instruction operates upon. */ + uint16_t modifiedFlagsMask, testedFlagsMask, undefinedFlagsMask; uint8_t imm_encoded_size; } _DInst; @@ -280,7 +276,7 @@ typedef struct { _WString mnemonic; /* Mnemonic of decoded instruction, prefixed if required by REP, LOCK etc. */ _WString operands; /* Operands of the decoded instruction, up to 3 operands, comma-seperated. */ _WString instructionHex; /* Hex dump - little endian, including prefixes. */ - unsigned int size; /* Size of decoded instruction. */ + unsigned int size; /* Size of decoded instruction in bytes. */ _OffsetType offset; /* Start offset of the decoded instruction. */ } _DecodedInst; @@ -301,11 +297,30 @@ typedef struct { #define RM_AVX 0x800 /* YMM0 - YMM15 */ #define RM_CR 0x1000 /* CR0, CR2, CR3, CR4, CR8 */ #define RM_DR 0x2000 /* DR0, DR1, DR2, DR3, DR6, DR7 */ +#define RM_R8 0x4000 /* R8B, R8W, R8D, R8 */ +#define RM_R9 0x8000 /* R9B, R9W, R9D, R9 */ +#define RM_R10 0x10000 /* R10B, R10W, R10D, R10 */ +#define RM_R11 0x20000 /* R11B, R11W, R11D, R11 */ +#define RM_R12 0x40000 /* R12B, R12W, R12D, R12 */ +#define RM_R13 0x80000 /* R13B, R13W, R13D, R13 */ +#define RM_R14 0x100000 /* R14B, R14W, R14D, R14 */ +#define RM_R15 0x200000 /* R15B, R15W, R15D, R15 */ + /* RIP should be checked using the 'flags' field and FLAG_RIP_RELATIVE. * Segments should be checked using the segment macros. * For now R8 - R15 are not supported and non general purpose registers map into same RM. */ +/* CPU flags that instructions modify, test or undefine (are EFLAGS compatible!). */ +#define D_CF 1 /* Carry */ +#define D_PF 4 /* Parity */ +#define D_AF 0x10 /* Auxiliary */ +#define D_ZF 0x40 /* Zero */ +#define D_SF 0x80 /* Sign */ +#define D_IF 0x200 /* Interrupt */ +#define D_DF 0x400 /* Direction */ +#define D_OF 0x800 /* Overflow */ + /* * Instructions Set classes: * if you want a better understanding of the available classes, look at disOps project, file: x86sets.py. @@ -418,6 +433,11 @@ typedef enum { DECRES_NONE, DECRES_SUCCESS, DECRES_MEMORYERR, DECRES_INPUTERR, D * Notes: 1)The minimal size of maxInstructions is 15. * 2)You will have to synchronize the offset,code and length by yourself if you pass code fragments and not a complete code block! */ + +/* distorm_decompose + * See more documentation online at the GitHub project's wiki. + * + */ #ifdef SUPPORT_64BIT_OFFSET _DecodeResult distorm_decompose64(_CodeInfo* ci, _DInst result[], unsigned int maxInstructions, unsigned int* usedInstructionsCount); diff --git a/distorm/include/mnemonics.h b/distorm/include/mnemonics.h new file mode 100644 index 0000000..ef9889c --- /dev/null +++ b/distorm/include/mnemonics.h @@ -0,0 +1,301 @@ +/* +mnemonics.h + +diStorm3 - Powerful disassembler for X86/AMD64 +http://ragestorm.net/distorm/ +distorm at gmail dot com +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. +*/ + + +#ifndef MNEMONICS_H +#define MNEMONICS_H + +#ifdef __cplusplus + extern "C" { +#endif + +#ifndef DISTORM_LIGHT + +typedef struct WMnemonic { + unsigned char length; + unsigned char p[1]; /* p is a null terminated string, which contains 'length' characters. */ +} _WMnemonic; + +typedef struct WRegister { + unsigned int length; + unsigned char p[6]; /* p is a null terminated string. */ +} _WRegister; + +extern const unsigned char _MNEMONICS[]; +extern const _WRegister _REGISTERS[]; + +#endif /* DISTORM_LIGHT */ + +#ifdef __cplusplus +} /* End Of Extern */ +#endif + +#define GET_REGISTER_NAME(r) (unsigned char*)_REGISTERS[(r)].p +#define GET_MNEMONIC_NAME(m) ((_WMnemonic*)&_MNEMONICS[(m)])->p + + typedef enum { + I_UNDEFINED = 0, I_AAA = 66, I_AAD = 389, I_AAM = 384, I_AAS = 76, I_ADC = 31, I_ADD = 11, I_ADDPD = 3132, + I_ADDPS = 3125, I_ADDSD = 3146, I_ADDSS = 3139, I_ADDSUBPD = 6416, I_ADDSUBPS = 6426, + I_AESDEC = 9231, I_AESDECLAST = 9248, I_AESENC = 9189, I_AESENCLAST = 9206, + I_AESIMC = 9172, I_AESKEYGENASSIST = 9817, I_AND = 41, I_ANDNPD = 3043, I_ANDNPS = 3035, + I_ANDPD = 3012, I_ANDPS = 3005, I_ARPL = 111, I_BLENDPD = 9394, I_BLENDPS = 9375, + I_BLENDVPD = 7641, I_BLENDVPS = 7631, I_BOUND = 104, I_BSF = 4368, I_BSR = 4380, + I_BSWAP = 960, I_BT = 872, I_BTC = 934, I_BTR = 912, I_BTS = 887, I_CALL = 456, + I_CALL_FAR = 260, I_CBW = 228, I_CDQ = 250, I_CDQE = 239, I_CLC = 492, I_CLD = 512, + I_CLFLUSH = 4351, I_CLGI = 1855, I_CLI = 502, I_CLTS = 541, I_CMC = 487, I_CMOVA = 694, + I_CMOVAE = 663, I_CMOVB = 656, I_CMOVBE = 686, I_CMOVG = 754, I_CMOVGE = 738, + I_CMOVL = 731, I_CMOVLE = 746, I_CMOVNO = 648, I_CMOVNP = 723, I_CMOVNS = 708, + I_CMOVNZ = 678, I_CMOVO = 641, I_CMOVP = 716, I_CMOVS = 701, I_CMOVZ = 671, + I_CMP = 71, I_CMPEQPD = 4471, I_CMPEQPS = 4392, I_CMPEQSD = 4629, I_CMPEQSS = 4550, + I_CMPLEPD = 4489, I_CMPLEPS = 4410, I_CMPLESD = 4647, I_CMPLESS = 4568, I_CMPLTPD = 4480, + I_CMPLTPS = 4401, I_CMPLTSD = 4638, I_CMPLTSS = 4559, I_CMPNEQPD = 4510, I_CMPNEQPS = 4431, + I_CMPNEQSD = 4668, I_CMPNEQSS = 4589, I_CMPNLEPD = 4530, I_CMPNLEPS = 4451, + I_CMPNLESD = 4688, I_CMPNLESS = 4609, I_CMPNLTPD = 4520, I_CMPNLTPS = 4441, + I_CMPNLTSD = 4678, I_CMPNLTSS = 4599, I_CMPORDPD = 4540, I_CMPORDPS = 4461, + I_CMPORDSD = 4698, I_CMPORDSS = 4619, I_CMPS = 301, I_CMPUNORDPD = 4498, I_CMPUNORDPS = 4419, + I_CMPUNORDSD = 4656, I_CMPUNORDSS = 4577, I_CMPXCHG = 898, I_CMPXCHG16B = 6395, + I_CMPXCHG8B = 6384, I_COMISD = 2801, I_COMISS = 2793, I_CPUID = 865, I_CQO = 255, + I_CRC32 = 9280, I_CVTDQ2PD = 6809, I_CVTDQ2PS = 3329, I_CVTPD2DQ = 6819, I_CVTPD2PI = 2703, + I_CVTPD2PS = 3255, I_CVTPH2PS = 4183, I_CVTPI2PD = 2517, I_CVTPI2PS = 2507, + I_CVTPS2DQ = 3339, I_CVTPS2PD = 3245, I_CVTPS2PH = 4193, I_CVTPS2PI = 2693, + I_CVTSD2SI = 2723, I_CVTSD2SS = 3275, I_CVTSI2SD = 2537, I_CVTSI2SS = 2527, + I_CVTSS2SD = 3265, I_CVTSS2SI = 2713, I_CVTTPD2DQ = 6798, I_CVTTPD2PI = 2636, + I_CVTTPS2DQ = 3349, I_CVTTPS2PI = 2625, I_CVTTSD2SI = 2658, I_CVTTSS2SI = 2647, + I_CWD = 245, I_CWDE = 233, I_DAA = 46, I_DAS = 56, I_DEC = 86, I_DIV = 1646, + I_DIVPD = 3521, I_DIVPS = 3514, I_DIVSD = 3535, I_DIVSS = 3528, I_DPPD = 9637, + I_DPPS = 9624, I_EMMS = 4122, I_ENTER = 340, I_EXTRACTPS = 9502, I_EXTRQ = 4158, + I_F2XM1 = 1192, I_FABS = 1123, I_FADD = 1023, I_FADDP = 1549, I_FBLD = 1601, + I_FBSTP = 1607, I_FCHS = 1117, I_FCLEX = 7311, I_FCMOVB = 1376, I_FCMOVBE = 1392, + I_FCMOVE = 1384, I_FCMOVNB = 1445, I_FCMOVNBE = 1463, I_FCMOVNE = 1454, I_FCMOVNU = 1473, + I_FCMOVU = 1401, I_FCOM = 1035, I_FCOMI = 1512, I_FCOMIP = 1623, I_FCOMP = 1041, + I_FCOMPP = 1563, I_FCOS = 1311, I_FDECSTP = 1238, I_FDIV = 1061, I_FDIVP = 1594, + I_FDIVR = 1067, I_FDIVRP = 1586, I_FEDISI = 1488, I_FEMMS = 574, I_FENI = 1482, + I_FFREE = 1527, I_FIADD = 1317, I_FICOM = 1331, I_FICOMP = 1338, I_FIDIV = 1361, + I_FIDIVR = 1368, I_FILD = 1418, I_FIMUL = 1324, I_FINCSTP = 1247, I_FINIT = 7326, + I_FIST = 1432, I_FISTP = 1438, I_FISTTP = 1424, I_FISUB = 1346, I_FISUBR = 1353, + I_FLD = 1074, I_FLD1 = 1141, I_FLDCW = 1098, I_FLDENV = 1090, I_FLDL2E = 1155, + I_FLDL2T = 1147, I_FLDLG2 = 1170, I_FLDLN2 = 1178, I_FLDPI = 1163, I_FLDZ = 1186, + I_FMUL = 1029, I_FMULP = 1556, I_FNCLEX = 7303, I_FNINIT = 7318, I_FNOP = 1111, + I_FNSAVE = 7333, I_FNSTCW = 7288, I_FNSTENV = 7271, I_FNSTSW = 7348, I_FPATAN = 1213, + I_FPREM = 1256, I_FPREM1 = 1230, I_FPTAN = 1206, I_FRNDINT = 1288, I_FRSTOR = 1519, + I_FSAVE = 7341, I_FSCALE = 1297, I_FSETPM = 1496, I_FSIN = 1305, I_FSINCOS = 1279, + I_FSQRT = 1272, I_FST = 1079, I_FSTCW = 7296, I_FSTENV = 7280, I_FSTP = 1084, + I_FSTSW = 7356, I_FSUB = 1048, I_FSUBP = 1579, I_FSUBR = 1054, I_FSUBRP = 1571, + I_FTST = 1129, I_FUCOM = 1534, I_FUCOMI = 1504, I_FUCOMIP = 1614, I_FUCOMP = 1541, + I_FUCOMPP = 1409, I_FXAM = 1135, I_FXCH = 1105, I_FXRSTOR = 9914, I_FXRSTOR64 = 9923, + I_FXSAVE = 9886, I_FXSAVE64 = 9894, I_FXTRACT = 1221, I_FYL2X = 1199, I_FYL2XP1 = 1263, + I_GETSEC = 633, I_HADDPD = 4203, I_HADDPS = 4211, I_HLT = 482, I_HSUBPD = 4237, + I_HSUBPS = 4245, I_IDIV = 1651, I_IMUL = 117, I_IN = 447, I_INC = 81, I_INS = 123, + I_INSERTPS = 9569, I_INSERTQ = 4165, I_INT = 367, I_INT_3 = 360, I_INT1 = 476, + I_INTO = 372, I_INVD = 555, I_INVEPT = 8306, I_INVLPG = 1727, I_INVLPGA = 1869, + I_INVPCID = 8323, I_INVVPID = 8314, I_IRET = 378, I_JA = 166, I_JAE = 147, + I_JB = 143, I_JBE = 161, I_JCXZ = 427, I_JECXZ = 433, I_JG = 202, I_JGE = 192, + I_JL = 188, I_JLE = 197, I_JMP = 462, I_JMP_FAR = 467, I_JNO = 138, I_JNP = 183, + I_JNS = 174, I_JNZ = 156, I_JO = 134, I_JP = 179, I_JRCXZ = 440, I_JS = 170, + I_JZ = 152, I_LAHF = 289, I_LAR = 522, I_LDDQU = 7016, I_LDMXCSR = 9944, I_LDS = 335, + I_LEA = 223, I_LEAVE = 347, I_LES = 330, I_LFENCE = 4287, I_LFS = 917, I_LGDT = 1703, + I_LGS = 922, I_LIDT = 1709, I_LLDT = 1668, I_LMSW = 1721, I_LODS = 313, I_LOOP = 421, + I_LOOPNZ = 406, I_LOOPZ = 414, I_LSL = 527, I_LSS = 907, I_LTR = 1674, I_LZCNT = 4385, + I_MASKMOVDQU = 7141, I_MASKMOVQ = 7131, I_MAXPD = 3581, I_MAXPS = 3574, I_MAXSD = 3595, + I_MAXSS = 3588, I_MFENCE = 4313, I_MINPD = 3461, I_MINPS = 3454, I_MINSD = 3475, + I_MINSS = 3468, I_MONITOR = 1771, I_MOV = 218, I_MOVAPD = 2481, I_MOVAPS = 2473, + I_MOVBE = 9273, I_MOVD = 3942, I_MOVDDUP = 2208, I_MOVDQ2Q = 6544, I_MOVDQA = 3968, + I_MOVDQU = 3976, I_MOVHLPS = 2173, I_MOVHPD = 2367, I_MOVHPS = 2359, I_MOVLHPS = 2350, + I_MOVLPD = 2190, I_MOVLPS = 2182, I_MOVMSKPD = 2837, I_MOVMSKPS = 2827, I_MOVNTDQ = 6871, + I_MOVNTDQA = 7917, I_MOVNTI = 952, I_MOVNTPD = 2578, I_MOVNTPS = 2569, I_MOVNTQ = 6863, + I_MOVNTSD = 2596, I_MOVNTSS = 2587, I_MOVQ = 3948, I_MOVQ2DQ = 6535, I_MOVS = 295, + I_MOVSD = 2132, I_MOVSHDUP = 2375, I_MOVSLDUP = 2198, I_MOVSS = 2125, I_MOVSX = 939, + I_MOVSXD = 10027, I_MOVUPD = 2117, I_MOVUPS = 2109, I_MOVZX = 927, I_MPSADBW = 9650, + I_MUL = 1641, I_MULPD = 3192, I_MULPS = 3185, I_MULSD = 3206, I_MULSS = 3199, + I_MWAIT = 1780, I_NEG = 1636, I_NOP = 581, I_NOT = 1631, I_OR = 27, I_ORPD = 3075, + I_ORPS = 3069, I_OUT = 451, I_OUTS = 128, I_PABSB = 7710, I_PABSD = 7740, I_PABSW = 7725, + I_PACKSSDW = 3871, I_PACKSSWB = 3703, I_PACKUSDW = 7938, I_PACKUSWB = 3781, + I_PADDB = 7226, I_PADDD = 7256, I_PADDQ = 6503, I_PADDSB = 6952, I_PADDSW = 6969, + I_PADDUSB = 6642, I_PADDUSW = 6661, I_PADDW = 7241, I_PALIGNR = 9432, I_PAND = 6629, + I_PANDN = 6687, I_PAUSE = 10035, I_PAVGB = 6702, I_PAVGUSB = 2100, I_PAVGW = 6747, + I_PBLENDVB = 7621, I_PBLENDW = 9413, I_PCLMULQDQ = 9669, I_PCMPEQB = 4065, + I_PCMPEQD = 4103, I_PCMPEQQ = 7898, I_PCMPEQW = 4084, I_PCMPESTRI = 9748, + I_PCMPESTRM = 9725, I_PCMPGTB = 3724, I_PCMPGTD = 3762, I_PCMPGTQ = 8109, + I_PCMPGTW = 3743, I_PCMPISTRI = 9794, I_PCMPISTRM = 9771, I_PEXTRB = 9451, + I_PEXTRD = 9468, I_PEXTRQ = 9476, I_PEXTRW = 6333, I_PF2ID = 1936, I_PF2IW = 1929, + I_PFACC = 2050, I_PFADD = 1999, I_PFCMPEQ = 2057, I_PFCMPGE = 1960, I_PFCMPGT = 2006, + I_PFMAX = 2015, I_PFMIN = 1969, I_PFMUL = 2066, I_PFNACC = 1943, I_PFPNACC = 1951, + I_PFRCP = 1976, I_PFRCPIT1 = 2022, I_PFRCPIT2 = 2073, I_PFRSQIT1 = 2032, I_PFRSQRT = 1983, + I_PFSUB = 1992, I_PFSUBR = 2042, I_PHADDD = 7397, I_PHADDSW = 7414, I_PHADDW = 7380, + I_PHMINPOSUW = 8281, I_PHSUBD = 7473, I_PHSUBSW = 7490, I_PHSUBW = 7456, I_PI2FD = 1922, + I_PI2FW = 1915, I_PINSRB = 9552, I_PINSRD = 9590, I_PINSRQ = 9598, I_PINSRW = 6316, + I_PMADDUBSW = 7433, I_PMADDWD = 7095, I_PMAXSB = 8196, I_PMAXSD = 8213, I_PMAXSW = 6986, + I_PMAXUB = 6670, I_PMAXUD = 8247, I_PMAXUW = 8230, I_PMINSB = 8128, I_PMINSD = 8145, + I_PMINSW = 6924, I_PMINUB = 6612, I_PMINUD = 8179, I_PMINUW = 8162, I_PMOVMSKB = 6553, + I_PMOVSXBD = 7776, I_PMOVSXBQ = 7797, I_PMOVSXBW = 7755, I_PMOVSXDQ = 7860, + I_PMOVSXWD = 7818, I_PMOVSXWQ = 7839, I_PMOVZXBD = 8004, I_PMOVZXBQ = 8025, + I_PMOVZXBW = 7983, I_PMOVZXDQ = 8088, I_PMOVZXWD = 8046, I_PMOVZXWQ = 8067, + I_PMULDQ = 7881, I_PMULHRSW = 7560, I_PMULHRW = 2083, I_PMULHUW = 6762, I_PMULHW = 6781, + I_PMULLD = 8264, I_PMULLW = 6518, I_PMULUDQ = 7076, I_POP = 22, I_POPA = 98, + I_POPCNT = 4360, I_POPF = 277, I_POR = 6941, I_PREFETCH = 1894, I_PREFETCHNTA = 2424, + I_PREFETCHT0 = 2437, I_PREFETCHT1 = 2449, I_PREFETCHT2 = 2461, I_PREFETCHW = 1904, + I_PSADBW = 7114, I_PSHUFB = 7363, I_PSHUFD = 4010, I_PSHUFHW = 4018, I_PSHUFLW = 4027, + I_PSHUFW = 4002, I_PSIGNB = 7509, I_PSIGND = 7543, I_PSIGNW = 7526, I_PSLLD = 7046, + I_PSLLDQ = 9869, I_PSLLQ = 7061, I_PSLLW = 7031, I_PSRAD = 6732, I_PSRAW = 6717, + I_PSRLD = 6473, I_PSRLDQ = 9852, I_PSRLQ = 6488, I_PSRLW = 6458, I_PSUBB = 7166, + I_PSUBD = 7196, I_PSUBQ = 7211, I_PSUBSB = 6890, I_PSUBSW = 6907, I_PSUBUSB = 6574, + I_PSUBUSW = 6593, I_PSUBW = 7181, I_PSWAPD = 2092, I_PTEST = 7651, I_PUNPCKHBW = 3802, + I_PUNPCKHDQ = 3848, I_PUNPCKHQDQ = 3917, I_PUNPCKHWD = 3825, I_PUNPCKLBW = 3634, + I_PUNPCKLDQ = 3680, I_PUNPCKLQDQ = 3892, I_PUNPCKLWD = 3657, I_PUSH = 16, + I_PUSHA = 91, I_PUSHF = 270, I_PXOR = 7003, I_RCL = 977, I_RCPPS = 2975, I_RCPSS = 2982, + I_RCR = 982, I_RDFSBASE = 9904, I_RDGSBASE = 9934, I_RDMSR = 600, I_RDPMC = 607, + I_RDRAND = 10048, I_RDTSC = 593, I_RDTSCP = 1886, I_RET = 325, I_RETF = 354, + I_ROL = 967, I_ROR = 972, I_ROUNDPD = 9318, I_ROUNDPS = 9299, I_ROUNDSD = 9356, + I_ROUNDSS = 9337, I_RSM = 882, I_RSQRTPS = 2937, I_RSQRTSS = 2946, I_SAHF = 283, + I_SAL = 997, I_SALC = 394, I_SAR = 1002, I_SBB = 36, I_SCAS = 319, I_SETA = 807, + I_SETAE = 780, I_SETB = 774, I_SETBE = 800, I_SETG = 859, I_SETGE = 845, I_SETL = 839, + I_SETLE = 852, I_SETNO = 767, I_SETNP = 832, I_SETNS = 819, I_SETNZ = 793, + I_SETO = 761, I_SETP = 826, I_SETS = 813, I_SETZ = 787, I_SFENCE = 4343, I_SGDT = 1691, + I_SHL = 987, I_SHLD = 876, I_SHR = 992, I_SHRD = 892, I_SHUFPD = 6358, I_SHUFPS = 6350, + I_SIDT = 1697, I_SKINIT = 1861, I_SLDT = 1657, I_SMSW = 1715, I_SQRTPD = 2877, + I_SQRTPS = 2869, I_SQRTSD = 2893, I_SQRTSS = 2885, I_STC = 497, I_STD = 517, + I_STGI = 1849, I_STI = 507, I_STMXCSR = 9973, I_STOS = 307, I_STR = 1663, I_SUB = 51, + I_SUBPD = 3401, I_SUBPS = 3394, I_SUBSD = 3415, I_SUBSS = 3408, I_SWAPGS = 1878, + I_SYSCALL = 532, I_SYSENTER = 614, I_SYSEXIT = 624, I_SYSRET = 547, I_TEST = 206, + I_TZCNT = 4373, I_UCOMISD = 2764, I_UCOMISS = 2755, I_UD2 = 569, I_UNPCKHPD = 2318, + I_UNPCKHPS = 2308, I_UNPCKLPD = 2276, I_UNPCKLPS = 2266, I_VADDPD = 3161, + I_VADDPS = 3153, I_VADDSD = 3177, I_VADDSS = 3169, I_VADDSUBPD = 6436, I_VADDSUBPS = 6447, + I_VAESDEC = 9239, I_VAESDECLAST = 9260, I_VAESENC = 9197, I_VAESENCLAST = 9218, + I_VAESIMC = 9180, I_VAESKEYGENASSIST = 9834, I_VANDNPD = 3060, I_VANDNPS = 3051, + I_VANDPD = 3027, I_VANDPS = 3019, I_VBLENDPD = 9403, I_VBLENDPS = 9384, I_VBLENDVPD = 9703, + I_VBLENDVPS = 9692, I_VBROADCASTF128 = 7694, I_VBROADCASTSD = 7680, I_VBROADCASTSS = 7666, + I_VCMPEQPD = 5110, I_VCMPEQPS = 4708, I_VCMPEQSD = 5914, I_VCMPEQSS = 5512, + I_VCMPEQ_OSPD = 5291, I_VCMPEQ_OSPS = 4889, I_VCMPEQ_OSSD = 6095, I_VCMPEQ_OSSS = 5693, + I_VCMPEQ_UQPD = 5197, I_VCMPEQ_UQPS = 4795, I_VCMPEQ_UQSD = 6001, I_VCMPEQ_UQSS = 5599, + I_VCMPEQ_USPD = 5400, I_VCMPEQ_USPS = 4998, I_VCMPEQ_USSD = 6204, I_VCMPEQ_USSS = 5802, + I_VCMPFALSEPD = 5232, I_VCMPFALSEPS = 4830, I_VCMPFALSESD = 6036, I_VCMPFALSESS = 5634, + I_VCMPFALSE_OSPD = 5441, I_VCMPFALSE_OSPS = 5039, I_VCMPFALSE_OSSD = 6245, + I_VCMPFALSE_OSSS = 5843, I_VCMPGEPD = 5259, I_VCMPGEPS = 4857, I_VCMPGESD = 6063, + I_VCMPGESS = 5661, I_VCMPGE_OQPD = 5471, I_VCMPGE_OQPS = 5069, I_VCMPGE_OQSD = 6275, + I_VCMPGE_OQSS = 5873, I_VCMPGTPD = 5269, I_VCMPGTPS = 4867, I_VCMPGTSD = 6073, + I_VCMPGTSS = 5671, I_VCMPGT_OQPD = 5484, I_VCMPGT_OQPS = 5082, I_VCMPGT_OQSD = 6288, + I_VCMPGT_OQSS = 5886, I_VCMPLEPD = 5130, I_VCMPLEPS = 4728, I_VCMPLESD = 5934, + I_VCMPLESS = 5532, I_VCMPLE_OQPD = 5317, I_VCMPLE_OQPS = 4915, I_VCMPLE_OQSD = 6121, + I_VCMPLE_OQSS = 5719, I_VCMPLTPD = 5120, I_VCMPLTPS = 4718, I_VCMPLTSD = 5924, + I_VCMPLTSS = 5522, I_VCMPLT_OQPD = 5304, I_VCMPLT_OQPS = 4902, I_VCMPLT_OQSD = 6108, + I_VCMPLT_OQSS = 5706, I_VCMPNEQPD = 5153, I_VCMPNEQPS = 4751, I_VCMPNEQSD = 5957, + I_VCMPNEQSS = 5555, I_VCMPNEQ_OQPD = 5245, I_VCMPNEQ_OQPS = 4843, I_VCMPNEQ_OQSD = 6049, + I_VCMPNEQ_OQSS = 5647, I_VCMPNEQ_OSPD = 5457, I_VCMPNEQ_OSPS = 5055, I_VCMPNEQ_OSSD = 6261, + I_VCMPNEQ_OSSS = 5859, I_VCMPNEQ_USPD = 5345, I_VCMPNEQ_USPS = 4943, I_VCMPNEQ_USSD = 6149, + I_VCMPNEQ_USSS = 5747, I_VCMPNGEPD = 5210, I_VCMPNGEPS = 4808, I_VCMPNGESD = 6014, + I_VCMPNGESS = 5612, I_VCMPNGE_UQPD = 5413, I_VCMPNGE_UQPS = 5011, I_VCMPNGE_UQSD = 6217, + I_VCMPNGE_UQSS = 5815, I_VCMPNGTPD = 5221, I_VCMPNGTPS = 4819, I_VCMPNGTSD = 6025, + I_VCMPNGTSS = 5623, I_VCMPNGT_UQPD = 5427, I_VCMPNGT_UQPS = 5025, I_VCMPNGT_UQSD = 6231, + I_VCMPNGT_UQSS = 5829, I_VCMPNLEPD = 5175, I_VCMPNLEPS = 4773, I_VCMPNLESD = 5979, + I_VCMPNLESS = 5577, I_VCMPNLE_UQPD = 5373, I_VCMPNLE_UQPS = 4971, I_VCMPNLE_UQSD = 6177, + I_VCMPNLE_UQSS = 5775, I_VCMPNLTPD = 5164, I_VCMPNLTPS = 4762, I_VCMPNLTSD = 5968, + I_VCMPNLTSS = 5566, I_VCMPNLT_UQPD = 5359, I_VCMPNLT_UQPS = 4957, I_VCMPNLT_UQSD = 6163, + I_VCMPNLT_UQSS = 5761, I_VCMPORDPD = 5186, I_VCMPORDPS = 4784, I_VCMPORDSD = 5990, + I_VCMPORDSS = 5588, I_VCMPORD_SPD = 5387, I_VCMPORD_SPS = 4985, I_VCMPORD_SSD = 6191, + I_VCMPORD_SSS = 5789, I_VCMPTRUEPD = 5279, I_VCMPTRUEPS = 4877, I_VCMPTRUESD = 6083, + I_VCMPTRUESS = 5681, I_VCMPTRUE_USPD = 5497, I_VCMPTRUE_USPS = 5095, I_VCMPTRUE_USSD = 6301, + I_VCMPTRUE_USSS = 5899, I_VCMPUNORDPD = 5140, I_VCMPUNORDPS = 4738, I_VCMPUNORDSD = 5944, + I_VCMPUNORDSS = 5542, I_VCMPUNORD_SPD = 5330, I_VCMPUNORD_SPS = 4928, I_VCMPUNORD_SSD = 6134, + I_VCMPUNORD_SSS = 5732, I_VCOMISD = 2818, I_VCOMISS = 2809, I_VCVTDQ2PD = 6841, + I_VCVTDQ2PS = 3360, I_VCVTPD2DQ = 6852, I_VCVTPD2PS = 3296, I_VCVTPS2DQ = 3371, + I_VCVTPS2PD = 3285, I_VCVTSD2SI = 2744, I_VCVTSD2SS = 3318, I_VCVTSI2SD = 2558, + I_VCVTSI2SS = 2547, I_VCVTSS2SD = 3307, I_VCVTSS2SI = 2733, I_VCVTTPD2DQ = 6829, + I_VCVTTPS2DQ = 3382, I_VCVTTSD2SI = 2681, I_VCVTTSS2SI = 2669, I_VDIVPD = 3550, + I_VDIVPS = 3542, I_VDIVSD = 3566, I_VDIVSS = 3558, I_VDPPD = 9643, I_VDPPS = 9630, + I_VERR = 1679, I_VERW = 1685, I_VEXTRACTF128 = 9538, I_VEXTRACTPS = 9513, + I_VFMADD132PD = 8409, I_VFMADD132PS = 8396, I_VFMADD132SD = 8435, I_VFMADD132SS = 8422, + I_VFMADD213PD = 8689, I_VFMADD213PS = 8676, I_VFMADD213SD = 8715, I_VFMADD213SS = 8702, + I_VFMADD231PD = 8969, I_VFMADD231PS = 8956, I_VFMADD231SD = 8995, I_VFMADD231SS = 8982, + I_VFMADDSUB132PD = 8348, I_VFMADDSUB132PS = 8332, I_VFMADDSUB213PD = 8628, + I_VFMADDSUB213PS = 8612, I_VFMADDSUB231PD = 8908, I_VFMADDSUB231PS = 8892, + I_VFMSUB132PD = 8461, I_VFMSUB132PS = 8448, I_VFMSUB132SD = 8487, I_VFMSUB132SS = 8474, + I_VFMSUB213PD = 8741, I_VFMSUB213PS = 8728, I_VFMSUB213SD = 8767, I_VFMSUB213SS = 8754, + I_VFMSUB231PD = 9021, I_VFMSUB231PS = 9008, I_VFMSUB231SD = 9047, I_VFMSUB231SS = 9034, + I_VFMSUBADD132PD = 8380, I_VFMSUBADD132PS = 8364, I_VFMSUBADD213PD = 8660, + I_VFMSUBADD213PS = 8644, I_VFMSUBADD231PD = 8940, I_VFMSUBADD231PS = 8924, + I_VFNMADD132PD = 8514, I_VFNMADD132PS = 8500, I_VFNMADD132SD = 8542, I_VFNMADD132SS = 8528, + I_VFNMADD213PD = 8794, I_VFNMADD213PS = 8780, I_VFNMADD213SD = 8822, I_VFNMADD213SS = 8808, + I_VFNMADD231PD = 9074, I_VFNMADD231PS = 9060, I_VFNMADD231SD = 9102, I_VFNMADD231SS = 9088, + I_VFNMSUB132PD = 8570, I_VFNMSUB132PS = 8556, I_VFNMSUB132SD = 8598, I_VFNMSUB132SS = 8584, + I_VFNMSUB213PD = 8850, I_VFNMSUB213PS = 8836, I_VFNMSUB213SD = 8878, I_VFNMSUB213SS = 8864, + I_VFNMSUB231PD = 9130, I_VFNMSUB231PS = 9116, I_VFNMSUB231SD = 9158, I_VFNMSUB231SS = 9144, + I_VHADDPD = 4219, I_VHADDPS = 4228, I_VHSUBPD = 4253, I_VHSUBPS = 4262, I_VINSERTF128 = 9525, + I_VINSERTPS = 9579, I_VLDDQU = 7023, I_VLDMXCSR = 9963, I_VMASKMOVDQU = 7153, + I_VMASKMOVPD = 7971, I_VMASKMOVPS = 7959, I_VMAXPD = 3610, I_VMAXPS = 3602, + I_VMAXSD = 3626, I_VMAXSS = 3618, I_VMCALL = 1735, I_VMCLEAR = 10011, I_VMFUNC = 1803, + I_VMINPD = 3490, I_VMINPS = 3482, I_VMINSD = 3506, I_VMINSS = 3498, I_VMLAUNCH = 1743, + I_VMLOAD = 1833, I_VMMCALL = 1824, I_VMOVAPD = 2498, I_VMOVAPS = 2489, I_VMOVD = 3954, + I_VMOVDDUP = 2256, I_VMOVDQA = 3984, I_VMOVDQU = 3993, I_VMOVHLPS = 2217, + I_VMOVHPD = 2404, I_VMOVHPS = 2395, I_VMOVLHPS = 2385, I_VMOVLPD = 2236, I_VMOVLPS = 2227, + I_VMOVMSKPD = 2858, I_VMOVMSKPS = 2847, I_VMOVNTDQ = 6880, I_VMOVNTDQA = 7927, + I_VMOVNTPD = 2615, I_VMOVNTPS = 2605, I_VMOVQ = 3961, I_VMOVSD = 2165, I_VMOVSHDUP = 2413, + I_VMOVSLDUP = 2245, I_VMOVSS = 2157, I_VMOVUPD = 2148, I_VMOVUPS = 2139, I_VMPSADBW = 9659, + I_VMPTRLD = 10002, I_VMPTRST = 6407, I_VMREAD = 4150, I_VMRESUME = 1753, I_VMRUN = 1817, + I_VMSAVE = 1841, I_VMULPD = 3221, I_VMULPS = 3213, I_VMULSD = 3237, I_VMULSS = 3229, + I_VMWRITE = 4174, I_VMXOFF = 1763, I_VMXON = 10020, I_VORPD = 3088, I_VORPS = 3081, + I_VPABSB = 7717, I_VPABSD = 7747, I_VPABSW = 7732, I_VPACKSSDW = 3881, I_VPACKSSWB = 3713, + I_VPACKUSDW = 7948, I_VPACKUSWB = 3791, I_VPADDB = 7233, I_VPADDD = 7263, + I_VPADDQ = 6510, I_VPADDSB = 6960, I_VPADDSW = 6977, I_VPADDUSW = 6651, I_VPADDW = 7248, + I_VPALIGNR = 9441, I_VPAND = 6635, I_VPANDN = 6694, I_VPAVGB = 6709, I_VPAVGW = 6754, + I_VPBLENDVB = 9714, I_VPBLENDW = 9422, I_VPCLMULQDQ = 9680, I_VPCMPEQB = 4074, + I_VPCMPEQD = 4112, I_VPCMPEQQ = 7907, I_VPCMPEQW = 4093, I_VPCMPESTRI = 9759, + I_VPCMPESTRM = 9736, I_VPCMPGTB = 3733, I_VPCMPGTD = 3771, I_VPCMPGTQ = 8118, + I_VPCMPGTW = 3752, I_VPCMPISTRI = 9805, I_VPCMPISTRM = 9782, I_VPERM2F128 = 9287, + I_VPERMILPD = 7592, I_VPERMILPS = 7581, I_VPEXTRB = 9459, I_VPEXTRD = 9484, + I_VPEXTRQ = 9493, I_VPEXTRW = 6341, I_VPHADDD = 7405, I_VPHADDSW = 7423, I_VPHADDW = 7388, + I_VPHMINPOSUW = 8293, I_VPHSUBD = 7481, I_VPHSUBSW = 7499, I_VPHSUBW = 7464, + I_VPINSRB = 9560, I_VPINSRD = 9606, I_VPINSRQ = 9615, I_VPINSRW = 6324, I_VPMADDUBSW = 7444, + I_VPMADDWD = 7104, I_VPMAXSB = 8204, I_VPMAXSD = 8221, I_VPMAXSW = 6994, I_VPMAXUB = 6678, + I_VPMAXUD = 8255, I_VPMAXUW = 8238, I_VPMINSB = 8136, I_VPMINSD = 8153, I_VPMINSW = 6932, + I_VPMINUB = 6620, I_VPMINUD = 8187, I_VPMINUW = 8170, I_VPMOVMSKB = 6563, + I_VPMOVSXBD = 7786, I_VPMOVSXBQ = 7807, I_VPMOVSXBW = 7765, I_VPMOVSXDQ = 7870, + I_VPMOVSXWD = 7828, I_VPMOVSXWQ = 7849, I_VPMOVZXBD = 8014, I_VPMOVZXBQ = 8035, + I_VPMOVZXBW = 7993, I_VPMOVZXDQ = 8098, I_VPMOVZXWD = 8056, I_VPMOVZXWQ = 8077, + I_VPMULDQ = 7889, I_VPMULHRSW = 7570, I_VPMULHUW = 6771, I_VPMULHW = 6789, + I_VPMULLD = 8272, I_VPMULLW = 6526, I_VPMULUDQ = 7085, I_VPOR = 6946, I_VPSADBW = 7122, + I_VPSHUFB = 7371, I_VPSHUFD = 4036, I_VPSHUFHW = 4045, I_VPSHUFLW = 4055, + I_VPSIGNB = 7517, I_VPSIGND = 7551, I_VPSIGNW = 7534, I_VPSLLD = 7053, I_VPSLLDQ = 9877, + I_VPSLLQ = 7068, I_VPSLLW = 7038, I_VPSRAD = 6739, I_VPSRAW = 6724, I_VPSRLD = 6480, + I_VPSRLDQ = 9860, I_VPSRLQ = 6495, I_VPSRLW = 6465, I_VPSUBB = 7173, I_VPSUBD = 7203, + I_VPSUBQ = 7218, I_VPSUBSB = 6898, I_VPSUBSW = 6915, I_VPSUBUSB = 6583, I_VPSUBUSW = 6602, + I_VPSUBW = 7188, I_VPTEST = 7658, I_VPUNPCKHBW = 3813, I_VPUNPCKHDQ = 3859, + I_VPUNPCKHQDQ = 3929, I_VPUNPCKHWD = 3836, I_VPUNPCKLBW = 3645, I_VPUNPCKLDQ = 3691, + I_VPUNPCKLQDQ = 3904, I_VPUNPCKLWD = 3668, I_VPXOR = 7009, I_VRCPPS = 2989, + I_VRCPSS = 2997, I_VROUNDPD = 9327, I_VROUNDPS = 9308, I_VROUNDSD = 9365, + I_VROUNDSS = 9346, I_VRSQRTPS = 2955, I_VRSQRTSS = 2965, I_VSHUFPD = 6375, + I_VSHUFPS = 6366, I_VSQRTPD = 2910, I_VSQRTPS = 2901, I_VSQRTSD = 2928, I_VSQRTSS = 2919, + I_VSTMXCSR = 9992, I_VSUBPD = 3430, I_VSUBPS = 3422, I_VSUBSD = 3446, I_VSUBSS = 3438, + I_VTESTPD = 7612, I_VTESTPS = 7603, I_VUCOMISD = 2783, I_VUCOMISS = 2773, + I_VUNPCKHPD = 2339, I_VUNPCKHPS = 2328, I_VUNPCKLPD = 2297, I_VUNPCKLPS = 2286, + I_VXORPD = 3117, I_VXORPS = 3109, I_VZEROALL = 4140, I_VZEROUPPER = 4128, + I_WAIT = 10042, I_WBINVD = 561, I_WRFSBASE = 9953, I_WRGSBASE = 9982, I_WRMSR = 586, + I_XABORT = 1007, I_XADD = 946, I_XBEGIN = 1015, I_XCHG = 212, I_XEND = 1811, + I_XGETBV = 1787, I_XLAT = 400, I_XOR = 61, I_XORPD = 3102, I_XORPS = 3095, + I_XRSTOR = 4295, I_XRSTOR64 = 4303, I_XSAVE = 4271, I_XSAVE64 = 4278, I_XSAVEOPT = 4321, + I_XSAVEOPT64 = 4331, I_XSETBV = 1795, I__3DNOW = 10056 + } _InstructionType; + +typedef enum { + R_RAX, R_RCX, R_RDX, R_RBX, R_RSP, R_RBP, R_RSI, R_RDI, R_R8, R_R9, R_R10, R_R11, R_R12, R_R13, R_R14, R_R15, + R_EAX, R_ECX, R_EDX, R_EBX, R_ESP, R_EBP, R_ESI, R_EDI, R_R8D, R_R9D, R_R10D, R_R11D, R_R12D, R_R13D, R_R14D, R_R15D, + R_AX, R_CX, R_DX, R_BX, R_SP, R_BP, R_SI, R_DI, R_R8W, R_R9W, R_R10W, R_R11W, R_R12W, R_R13W, R_R14W, R_R15W, + R_AL, R_CL, R_DL, R_BL, R_AH, R_CH, R_DH, R_BH, R_R8B, R_R9B, R_R10B, R_R11B, R_R12B, R_R13B, R_R14B, R_R15B, + R_SPL, R_BPL, R_SIL, R_DIL, + R_ES, R_CS, R_SS, R_DS, R_FS, R_GS, + R_RIP, + R_ST0, R_ST1, R_ST2, R_ST3, R_ST4, R_ST5, R_ST6, R_ST7, + R_MM0, R_MM1, R_MM2, R_MM3, R_MM4, R_MM5, R_MM6, R_MM7, + R_XMM0, R_XMM1, R_XMM2, R_XMM3, R_XMM4, R_XMM5, R_XMM6, R_XMM7, R_XMM8, R_XMM9, R_XMM10, R_XMM11, R_XMM12, R_XMM13, R_XMM14, R_XMM15, + R_YMM0, R_YMM1, R_YMM2, R_YMM3, R_YMM4, R_YMM5, R_YMM6, R_YMM7, R_YMM8, R_YMM9, R_YMM10, R_YMM11, R_YMM12, R_YMM13, R_YMM14, R_YMM15, + R_CR0, R_UNUSED0, R_CR2, R_CR3, R_CR4, R_UNUSED1, R_UNUSED2, R_UNUSED3, R_CR8, + R_DR0, R_DR1, R_DR2, R_DR3, R_UNUSED4, R_UNUSED5, R_DR6, R_DR7 +} _RegisterType; + +#endif /* MNEMONICS_H */ diff --git a/distorm3.2-package/src/config.h b/distorm/src/config.h similarity index 85% rename from distorm3.2-package/src/config.h rename to distorm/src/config.h index 30f7d39..164536f 100644 --- a/distorm3.2-package/src/config.h +++ b/distorm/src/config.h @@ -4,20 +4,8 @@ config.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ @@ -25,7 +13,7 @@ along with this program. If not, see #define CONFIG_H /* diStorm version number. */ -#define __DISTORMV__ 0x030200 +#define __DISTORMV__ 0x030304 #include /* memset, memcpy - can be easily self implemented for libc independency. */ diff --git a/distorm3.2-package/src/decoder.c b/distorm/src/decoder.c similarity index 84% rename from distorm3.2-package/src/decoder.c rename to distorm/src/decoder.c index 8123753..b76f710 100644 --- a/distorm3.2-package/src/decoder.c +++ b/distorm/src/decoder.c @@ -4,20 +4,8 @@ decoder.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ @@ -27,6 +15,7 @@ along with this program. If not, see #include "prefix.h" #include "x86defs.h" #include "operands.h" +#include "insts.h" #include "../include/mnemonics.h" @@ -77,8 +66,17 @@ static _DecodeType decode_get_effective_op_size(_DecodeType dt, _iflags decodedP return dt; } +/* A helper macro to convert from diStorm's CPU flags to EFLAGS. */ +#define CONVERT_FLAGS_TO_EFLAGS(dst, src, field) dst->field = ((src->field & D_COMPACT_SAME_FLAGS) | \ + ((src->field & D_COMPACT_IF) ? D_IF : 0) | \ + ((src->field & D_COMPACT_DF) ? D_DF : 0) | \ + ((src->field & D_COMPACT_OF) ? D_OF : 0)); + static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) { + /* Remember whether the instruction is privileged. */ + uint16_t privilegedFlag = 0; + /* The ModR/M byte of the current instruction. */ unsigned int modrm = 0; @@ -93,6 +91,8 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) /* Holds the info about the current found instruction. */ _InstInfo* ii = NULL; + _InstInfo iip; /* Privileged instruction cache. */ + _InstSharedInfo* isi = NULL; /* Used only for special CMP instructions which have pseudo opcodes suffix. */ unsigned char cmpType = 0; @@ -104,13 +104,26 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) */ int lockable = FALSE; - /* Calcualte (and cache) effective-operand-size and effective-address-size only once. */ + /* Calculate (and cache) effective-operand-size and effective-address-size only once. */ _DecodeType effOpSz, effAdrSz; _iflags instFlags; ii = inst_lookup(ci, ps); if (ii == NULL) goto _Undecodable; - instFlags = INST_INFO_FLAGS(ii); + isi = &InstSharedInfoTable[ii->sharedIndex]; + instFlags = FlagsTable[isi->flagsIndex]; + privilegedFlag = ii->opcodeId & OPCODE_ID_PRIVILEGED; + + if (privilegedFlag) { + /* + * Copy the privileged instruction info so we can remove the privileged bit + * from the opcodeId field. This makes sure we're not modifying the tables + * in case we lookup this privileged instruction later. + */ + iip = *ii; + iip.opcodeId &= ~OPCODE_ID_PRIVILEGED; + ii = &iip; + } /* * If both REX and OpSize are available we will have to disable the OpSize, because REX has precedence. @@ -132,8 +145,8 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) * Which practically means, don't allow 32 bits instructions in 16 bits decoding mode, but do allow * 16 bits instructions in 32 bits decoding mode, of course... - * NOTE: Make sure the instruction set for 32 bits has explicitly this specfic flag set. - * NOTE2: Make sure the instruction set for 64 bits has explicitly this specfic flag set. + * NOTE: Make sure the instruction set for 32 bits has explicitly this specific flag set. + * NOTE2: Make sure the instruction set for 64 bits has explicitly this specific flag set. * If this is the case, drop what we've got and restart all over after DB'ing that byte. @@ -179,22 +192,22 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) * Note: do-while with a constant 0 makes the compiler warning about it. */ for (;;) { - if (ii->d != OT_NONE) { - if (!operands_extract(ci, di, ii, (_OpType)ii->d, ONT_1, modrm, ps, effOpSz, effAdrSz, &lockable)) goto _Undecodable; + if (isi->d != OT_NONE) { + if (!operands_extract(ci, di, ii, instFlags, (_OpType)isi->d, ONT_1, modrm, ps, effOpSz, effAdrSz, &lockable)) goto _Undecodable; } else break; - if (ii->s != OT_NONE) { - if (!operands_extract(ci, di, ii, (_OpType)ii->s, ONT_2, modrm, ps, effOpSz, effAdrSz, NULL)) goto _Undecodable; + if (isi->s != OT_NONE) { + if (!operands_extract(ci, di, ii, instFlags, (_OpType)isi->s, ONT_2, modrm, ps, effOpSz, effAdrSz, NULL)) goto _Undecodable; } else break; /* Use third operand, only if the flags says this InstInfo requires it. */ if (instFlags & INST_USE_OP3) { - if (!operands_extract(ci, di, ii, (_OpType)((_InstInfoEx*)ii)->op3, ONT_3, modrm, ps, effOpSz, effAdrSz, NULL)) goto _Undecodable; + if (!operands_extract(ci, di, ii, instFlags, (_OpType)((_InstInfoEx*)ii)->op3, ONT_3, modrm, ps, effOpSz, effAdrSz, NULL)) goto _Undecodable; } else break; /* Support for a fourth operand is added for (i.e:) INSERTQ instruction. */ if (instFlags & INST_USE_OP4) { - if (!operands_extract(ci, di, ii, (_OpType)((_InstInfoEx*)ii)->op4, ONT_4, modrm, ps, effOpSz, effAdrSz, NULL)) goto _Undecodable; + if (!operands_extract(ci, di, ii, instFlags, (_OpType)((_InstInfoEx*)ii)->op4, ONT_4, modrm, ps, effOpSz, effAdrSz, NULL)) goto _Undecodable; } break; } /* Continue here after all operands were extracted. */ @@ -203,7 +216,8 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) if (instFlags & INST_3DNOW_FETCH) { ii = inst_lookup_3dnow(ci); if (ii == NULL) goto _Undecodable; - instFlags = INST_INFO_FLAGS(ii); + isi = &InstSharedInfoTable[ii->sharedIndex]; + instFlags = FlagsTable[isi->flagsIndex]; } /* Check whether pseudo opcode is needed, only for CMP instructions: */ @@ -259,7 +273,7 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) else if ((instFlags & (INST_PRE_ADDR_SIZE | INST_NATIVE)) == (INST_PRE_ADDR_SIZE | INST_NATIVE)) { di->opcode = ii->opcodeId; - /* If LOOPxx gets here from 64bits, it must be Decode32Bits because Address Size perfix is set. */ + /* If LOOPxx gets here from 64bits, it must be Decode32Bits because Address Size prefix is set. */ ps->usedPrefixes |= INST_PRE_ADDR_SIZE; } /* @@ -332,14 +346,14 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) * Therefore, we use another table to fix the offset. */ if (instFlags & INST_PRE_VEX) { - /* Use the AVX pesudo compare mnemonics table. */ + /* Use the AVX pseudo compare mnemonics table. */ di->opcode = ii->opcodeId + VCmpMnemonicOffsets[cmpType]; } else { - /* Use the SSE psuedo compare mnemonics table. */ + /* Use the SSE pseudo compare mnemonics table. */ di->opcode = ii->opcodeId + CmpMnemonicOffsets[cmpType]; } } - + /* * Store the address size inside the flags. * This is necessary for the caller to know the size of rSP when using PUSHA for example. @@ -352,13 +366,21 @@ static _DecodeResult decode_inst(_CodeInfo* ci, _PrefixState* ps, _DInst* di) /* Set the unused prefixes mask. */ di->unusedPrefixesMask = prefixes_set_unused_mask(ps); + /* Fix privileged. Assumes the privilegedFlag is 0x8000 only. */ + di->flags |= privilegedFlag; + /* Copy instruction meta. */ - di->meta = ii->meta; + di->meta = isi->meta; if (di->segment == 0) di->segment = R_NONE; /* Take into account the O_MEM base register for the mask. */ if (di->base != R_NONE) di->usedRegistersMask |= _REGISTERTORCLASS[di->base]; + /* Copy CPU affected flags. */ + CONVERT_FLAGS_TO_EFLAGS(di, isi, modifiedFlagsMask); + CONVERT_FLAGS_TO_EFLAGS(di, isi, testedFlagsMask); + CONVERT_FLAGS_TO_EFLAGS(di, isi, undefinedFlagsMask); + /* Calculate the size of the instruction we've just decoded. */ di->size = (uint8_t)((ci->code - startCode) & 0xff); return DECRES_SUCCESS; @@ -395,6 +417,8 @@ _DecodeResult decode_internal(_CodeInfo* _ci, int supportOldIntr, _DInst result[ _PrefixState ps; unsigned int prefixSize; _CodeInfo ci; + unsigned int features; + unsigned int mfc; _OffsetType codeOffset = _ci->codeOffset; const uint8_t* code = _ci->code; @@ -419,10 +443,15 @@ _DecodeResult decode_internal(_CodeInfo* _ci, int supportOldIntr, _DInst result[ #ifdef DISTORM_LIGHT supportOldIntr; /* Unreferenced. */ -#endif + /* + * Only truncate address if we are using the decompose interface. + * Otherwise, we use the textual interface which needs full addresses for formatting bytes output. + * So distorm_format will truncate later. + */ if (_ci->features & DF_MAXIMUM_ADDR32) addrMask = 0xffffffff; else if (_ci->features & DF_MAXIMUM_ADDR16) addrMask = 0xffff; +#endif /* No entries are used yet. */ *usedInstructionsCount = 0; @@ -548,13 +577,26 @@ _DecodeResult decode_internal(_CodeInfo* _ci, int supportOldIntr, _DInst result[ pdi->addr = startInstOffset & addrMask; /* pdi->disp &= addrMask; */ - /* Advance to next instruction. */ - codeLen -= pdi->size; - codeOffset += pdi->size; - code += pdi->size; + if ((decodeResult == DECRES_INPUTERR) && (ps.decodedPrefixes & INST_PRE_VEX)) { + if (ps.prefixExtType == PET_VEX3BYTES) { + prefixSize -= 2; + codeLen += 2; + } else if (ps.prefixExtType == PET_VEX2BYTES) { + prefixSize -= 1; + codeLen += 1; + } + ps.last = ps.start + prefixSize - 1; + code = ps.last + 1; + codeOffset = startInstOffset + prefixSize; + } else { + /* Advance to next instruction. */ + codeLen -= pdi->size; + codeOffset += pdi->size; + code += pdi->size; - /* Instruction's size should include prefixes. */ - pdi->size += (uint8_t)prefixSize; + /* Instruction's size should include prefixes. */ + pdi->size += (uint8_t)prefixSize; + } /* Drop all prefixes and the instruction itself, because the instruction wasn't successfully decoded. */ if ((decodeResult == DECRES_INPUTERR) && (~_ci->features & DF_RETURN_FC_ONLY)) { @@ -590,14 +632,16 @@ _DecodeResult decode_internal(_CodeInfo* _ci, int supportOldIntr, _DInst result[ _ci->nextOffset = codeOffset; /* Check whether we need to stop on any flow control instruction. */ - if ((decodeResult == DECRES_SUCCESS) && (_ci->features & DF_STOP_ON_FLOW_CONTROL)) { - if (((_ci->features & DF_STOP_ON_CALL) && (META_GET_FC(pdi->meta) == FC_CALL)) || - ((_ci->features & DF_STOP_ON_RET) && (META_GET_FC(pdi->meta) == FC_RET)) || - ((_ci->features & DF_STOP_ON_SYS) && (META_GET_FC(pdi->meta) == FC_SYS)) || - ((_ci->features & DF_STOP_ON_UNC_BRANCH) && (META_GET_FC(pdi->meta) == FC_UNC_BRANCH)) || - ((_ci->features & DF_STOP_ON_CND_BRANCH) && (META_GET_FC(pdi->meta) == FC_CND_BRANCH)) || - ((_ci->features & DF_STOP_ON_INT) && (META_GET_FC(pdi->meta) == FC_INT)) || - ((_ci->features & DF_STOP_ON_CMOV) && (META_GET_FC(pdi->meta) == FC_CMOV))) + features = _ci->features; + mfc = META_GET_FC(pdi->meta); + if ((decodeResult == DECRES_SUCCESS) && (features & DF_STOP_ON_FLOW_CONTROL)) { + if (((features & DF_STOP_ON_CALL) && (mfc == FC_CALL)) || + ((features & DF_STOP_ON_RET) && (mfc == FC_RET)) || + ((features & DF_STOP_ON_SYS) && (mfc == FC_SYS)) || + ((features & DF_STOP_ON_UNC_BRANCH) && (mfc == FC_UNC_BRANCH)) || + ((features & DF_STOP_ON_CND_BRANCH) && (mfc == FC_CND_BRANCH)) || + ((features & DF_STOP_ON_INT) && (mfc == FC_INT)) || + ((features & DF_STOP_ON_CMOV) && (mfc == FC_CMOV))) return DECRES_SUCCESS; } } diff --git a/distorm3.2-package/src/decoder.h b/distorm/src/decoder.h similarity index 100% rename from distorm3.2-package/src/decoder.h rename to distorm/src/decoder.h diff --git a/distorm3.2-package/src/distorm.c b/distorm/src/distorm.c similarity index 88% rename from distorm3.2-package/src/distorm.c rename to distorm/src/distorm.c index 2b865a6..f4bc9d8 100644 --- a/distorm3.2-package/src/distorm.c +++ b/distorm/src/distorm.c @@ -5,20 +5,8 @@ diStorm3 C Library Interface diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ @@ -64,9 +52,10 @@ along with this program. If not, see #ifndef DISTORM_LIGHT -/* Helper function to concat an explicit size when it's unknown from the operands. */ +/* Helper function to concatenate an explicit size when it's unknown from the operands. */ static void distorm_format_size(_WString* str, const _DInst* di, int opNum) { + int isSizingRequired = 0; /* * We only have to output the size explicitly if it's not clear from the operands. * For example: @@ -75,9 +64,42 @@ static void distorm_format_size(_WString* str, const _DInst* di, int opNum) * * If given operand number is higher than 2, then output the size anyways. */ - if (((opNum >= 2) || ((di->ops[0].type != O_REG) && (di->ops[1].type != O_REG))) || - /* INS/OUTS are exception, because DX is a port specifier and not a real src/dst register. */ - ((di->opcode == I_INS) || (di->opcode == I_OUTS))) { + isSizingRequired = ((opNum >= 2) || ((di->ops[0].type != O_REG) && (di->ops[1].type != O_REG))); + + /* Still not sure? Try some special instructions. */ + if (!isSizingRequired) { + /* + * INS/OUTS are exception, because DX is a port specifier and not a real src/dst register. + * A few exceptions that always requires sizing: + * MOVZX, MOVSX, MOVSXD. + * ROL, ROR, RCL, RCR, SHL, SHR, SAL, SAR. + * SHLD, SHRD. + */ + switch (di->opcode) + { + case I_INS: + case I_OUTS: + case I_MOVZX: + case I_MOVSX: + case I_MOVSXD: + case I_ROL: + case I_ROR: + case I_RCL: + case I_RCR: + case I_SHL: + case I_SHR: + case I_SAL: + case I_SAR: + case I_SHLD: + case I_SHRD: + isSizingRequired = 1; + break; + default: /* Instruction doesn't require sizing. */ break; + } + } + + if (isSizingRequired) + { switch (di->ops[opNum].size) { case 0: break; /* OT_MEM's unknown size. */ @@ -125,10 +147,11 @@ static void distorm_format_signed_disp(_WString* str, const _DInst* di, uint64_t /* Copy other fields. */ result->size = di->size; - result->offset = di->addr & addrMask; + result->offset = di->addr; if (di->flags == FLAG_NOT_DECODABLE) { str = &result->mnemonic; + result->offset &= addrMask; strclear_WS(&result->operands); strcpy_WSN(str, "DB "); str_code_hb(str, di->imm.byte); @@ -139,9 +162,13 @@ static void distorm_format_signed_disp(_WString* str, const _DInst* di, uint64_t str = &result->instructionHex; strclear_WS(str); + /* Gotta have full address for (di->addr - ci->codeOffset) to work in all modes. */ for (i = 0; i < di->size; i++) str_hex_b(str, ci->code[(unsigned int)(di->addr - ci->codeOffset + i)]); + /* Truncate address now. */ + result->offset &= addrMask; + str = &result->mnemonic; switch (FLAG_GET_PREFIX(di->flags)) { @@ -149,7 +176,9 @@ static void distorm_format_signed_disp(_WString* str, const _DInst* di, uint64_t strcpy_WSN(str, "LOCK "); break; case FLAG_REP: - strcpy_WSN(str, "REP "); + /* REP prefix for CMPS and SCAS is really a REPZ. */ + if ((di->opcode == I_CMPS) || (di->opcode == I_SCAS)) strcpy_WSN(str, "REPZ "); + else strcpy_WSN(str, "REP "); break; case FLAG_REPNZ: strcpy_WSN(str, "REPNZ "); @@ -203,7 +232,7 @@ static void distorm_format_signed_disp(_WString* str, const _DInst* di, uint64_t break; case O_IMM: /* If the instruction is 'push', show explicit size (except byte imm). */ - if (di->opcode == I_PUSH && di->ops[i].size != 8) distorm_format_size(str, di, i); + if ((di->opcode == I_PUSH) && (di->ops[i].size != 8)) distorm_format_size(str, di, i); /* Special fix for negative sign extended immediates. */ if ((di->flags & FLAG_IMM_SIGNED) && (di->ops[i].size == 8)) { if (di->imm.sbyte < 0) { diff --git a/distorm3.2-package/src/instructions.c b/distorm/src/instructions.c similarity index 91% rename from distorm3.2-package/src/instructions.c rename to distorm/src/instructions.c index df122b9..0f120de 100644 --- a/distorm3.2-package/src/instructions.c +++ b/distorm/src/instructions.c @@ -4,20 +4,8 @@ instructions.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ @@ -33,13 +21,16 @@ along with this program. If not, see #define INST_NODE_INDEX(n) ((n) & 0x1fff) #define INST_NODE_TYPE(n) ((n) >> 13) +/* Helper macro to read the actual flags that are associated with an inst-info. */ +#define INST_INFO_FLAGS(ii) (FlagsTable[InstSharedInfoTable[(ii)->sharedIndex].flagsIndex]) + /* I use the trie data structure as I found it most fitting to a disassembler mechanism. When you read a byte and have to decide if it's enough or you should read more bytes, 'till you get to the instruction information. It's really fast because you POP the instruction info in top 3 iterates on the DB, because an instruction can be formed from two bytes + 3 bits reg from the ModR/M byte. For a simple explanation, check this out: http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Tree/Trie/ -Futher reading: http://en.wikipedia.org/wiki/Trie +Further reading: http://en.wikipedia.org/wiki/Trie The first GATE (array you read off a trie data structure), as I call them, is statically allocated by the compiler. The second and third gates if used are being allocated dynamically by the instructions-insertion functionality. @@ -83,9 +74,9 @@ But if you read 1, you know that you go to an instruction (in this case, a RET). That's why there's an Instruction-Node structure, it tells you whether you got to an instruction or another list so you should keep on reading byte). -In Intel, you could go through 4 gates at top, because there're instructions which are built from 2 bytes and another smaller list +In Intel, you could go through 4 gates at top, because there are instructions which are built from 2 bytes and another smaller list for the REG part, or newest SSE4 instructions which use 4 bytes for opcode. -Therefore, Intel's first gate is 256 long, and other gates are 256 (/72) or 8 long, yes, it costs pretty much alot of memory +Therefore, Intel's first gate is 256 long, and other gates are 256 (/72) or 8 long, yes, it costs pretty much a lot of memory for non-used defined instructions, but I think that it still rocks. */ @@ -136,7 +127,7 @@ static _InstInfo* inst_get_info(_InstNode in, int index) * Now, it's a mandatory prefix and NOT an operand size one. * 66480f2dc0 db 0x48; CVTPD2PI XMM0, XMM0 * Although this instruction doesn't require a REX.W, it just shows, that even if it did - it doesn't matter. - * REX.W is dropped because it's not requried, but the decode function disabled the operand size even so. + * REX.W is dropped because it's not required, but the decode function disabled the operand size even so. */ static _InstInfo* inst_lookup_prefixed(_InstNode in, _PrefixState* ps) { @@ -225,7 +216,7 @@ static _InstInfo* inst_vex_mod_lookup(_CodeInfo* ci, _InstNode in, _InstInfo* ii /* Make a second lookup for this special instruction. */ return inst_get_info(in, index); } - /* Return the original one, in case we didn't find a stuited instruction. */ + /* Return the original one, in case we didn't find a suited instruction. */ return ii; } @@ -383,14 +374,17 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) * And since the DB can't be patched dynamically, because the DB has to be multi-threaded compliant, * I have no choice but to check for ARPL/MOVSXD right here - "right about now, the funk soul brother, check it out now, the funk soul brother...", fatboy slim */ - return ci->dt == Decode64Bits ? &II_movsxd : &II_arpl; + if (ci->dt == Decode64Bits) { + return &II_MOVSXD; + } /* else ARPL will be returned because its defined in the DB already. */ + break; case INST_NOP_INDEX: /* Nopnopnop */ /* Check for Pause, since it's prefixed with 0xf3, which is not a real mandatory prefix. */ if (ps->decodedPrefixes & INST_PRE_REP) { /* Flag this prefix as used. */ ps->usedPrefixes |= INST_PRE_REP; - return &II_pause; + return &II_PAUSE; } /* @@ -402,7 +396,7 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) * Note that if the REX.B is used, then the register is not RAX anymore but R8, which means it's not a NOP. */ if (rex & PREFIX_EX_W) ps->usedPrefixes |= INST_PRE_REX; - if ((ci->dt != Decode64Bits) || (~rex & PREFIX_EX_B)) return &II_nop; + if ((ci->dt != Decode64Bits) || (~rex & PREFIX_EX_B)) return &II_NOP; break; case INST_LEA_INDEX: @@ -417,7 +411,7 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) return instType == INT_INFO ? &InstInfos[INST_NODE_INDEX(in)] : (_InstInfo*)&InstInfosEx[INST_NODE_INDEX(in)]; } - /* Read second byte, still doens't mean all of its bits are used (I.E: ModRM). */ + /* Read second byte, still doesn't mean all of its bits are used (I.E: ModRM). */ ci->code += 1; ci->codeLen -= 1; if (ci->codeLen < 0) return NULL; @@ -428,7 +422,23 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) /* Try single byte instruction + reg byte OR one whole byte (OCST_1dBYTES). */ if (instType == INT_LIST_DIVIDED) { - /* OCST_1dBYTES is relatively simple to OCST_2dBYTES, since it's really divided at 0xc0. */ + + /* Checking for inst by REG bits is higher priority if it's found not to be divided instruction. */ + { + _InstNode in2 = InstructionsTree[INST_NODE_INDEX(in) + ((tmpIndex1 >> 3) & 7)]; + /* + * Do NOT check for NULL here, since we do a bit of a guess work, + * hence we don't override 'in', cause we might still need it. + */ + instType = INST_NODE_TYPE(in2); + + if (instType == INT_INFO) ii = &InstInfos[INST_NODE_INDEX(in2)]; + else if (instType == INT_INFOEX) ii = (_InstInfo*)&InstInfosEx[INST_NODE_INDEX(in2)]; + if ((ii != NULL) && (INST_INFO_FLAGS(ii) & INST_NOT_DIVIDED)) return ii; + /* ii is reset below. */ + } + + /* Continue normally because of wait prefix. */ if (tmpIndex1 < INST_DIVIDED_MODRM) { /* An instruction which requires a ModR/M byte. Thus it's 1.3 bytes long instruction. */ tmpIndex1 = (tmpIndex1 >> 3) & 7; /* Isolate the 3 REG/OPCODE bits. */ @@ -437,7 +447,7 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) * Divided instructions can't be in the range of 0x8-0xc0. * That's because 0-8 are used for 3 bits group. * And 0xc0-0xff are used for not-divided instruction. - * So the inbetween range is omitted, thus saving some more place in the tables. + * So the in between range is omitted, thus saving some more place in the tables. */ tmpIndex1 -= INST_DIVIDED_MODRM - 8; } @@ -471,21 +481,21 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) instType = INST_NODE_TYPE(in); /* This is where we check if we just read two escape bytes in a row, which means it is a 3DNow! instruction. */ - if ((tmpIndex0 == _3DNOW_ESCAPE_BYTE) && (tmpIndex1 == _3DNOW_ESCAPE_BYTE)) return &II_3dnow; + if ((tmpIndex0 == _3DNOW_ESCAPE_BYTE) && (tmpIndex1 == _3DNOW_ESCAPE_BYTE)) return &II_3DNOW; /* 2 bytes instruction (OCST_2BYTES). */ if (instType < INT_INFOS) return instType == INT_INFO ? &InstInfos[INST_NODE_INDEX(in)] : (_InstInfo*)&InstInfosEx[INST_NODE_INDEX(in)]; /* - * 2 bytes + mandatory perfix. + * 2 bytes + mandatory prefix. * Mandatory prefixes can be anywhere in the prefixes. * There cannot be more than one mandatory prefix, unless it's a normal operand size prefix. */ if (instType == INT_LIST_PREFIXED) return inst_lookup_prefixed(in, ps); } - /* Read third byte, still doens't mean all of its bits are used (I.E: ModRM). */ + /* Read third byte, still doesn't mean all of its bits are used (I.E: ModRM). */ ci->code += 1; ci->codeLen -= 1; if (ci->codeLen < 0) return NULL; @@ -501,7 +511,10 @@ _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps) return instType == INT_INFO ? &InstInfos[INST_NODE_INDEX(in)] : (_InstInfo*)&InstInfosEx[INST_NODE_INDEX(in)]; /* It has to be a prefixed table then. */ - return inst_lookup_prefixed(in, ps); + ii = inst_lookup_prefixed(in, ps); + /* RDRAND and VMPTRLD share same 2.3 bytes opcode, and alternate on the MOD bits. See insts.h for more info. */ + if ((ii != NULL) && (ii->opcodeId == I_VMPTRLD) && (tmpIndex1 >= INST_DIVIDED_MODRM)) return &II_RDRAND; + return ii; } /* Try 2 bytes + divided range (OCST_2dBYTES). */ diff --git a/distorm3.2-package/src/instructions.h b/distorm/src/instructions.h similarity index 88% rename from distorm3.2-package/src/instructions.h rename to distorm/src/instructions.h index 43be7d9..b8d8a64 100644 --- a/distorm3.2-package/src/instructions.h +++ b/distorm/src/instructions.h @@ -4,20 +4,8 @@ instructions.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ @@ -58,9 +46,9 @@ typedef enum OpType { /* 16 bits immediate using the first imm-slot */ OT_IMM16_1, /* 8 bits immediate using the first imm-slot */ - OT_IMM8_1, + OT_IMM8_1, /* 8 bits immediate using the second imm-slot */ - OT_IMM8_2, + OT_IMM8_2, /* Use a 8bit register */ OT_REG8, @@ -240,39 +228,39 @@ typedef enum OpType { /* ModR/M for 32 bits. */ OT_RM32, /* Reg32/Reg64 (prefix width) or Mem8. */ - OT_REG32_64_M8, + OT_REG32_64_M8, /* Reg32/Reg64 (prefix width) or Mem16. */ - OT_REG32_64_M16, + OT_REG32_64_M16, /* Reg32/Reg 64 depends on prefix width only. */ - OT_WREG32_64, + OT_WREG32_64, /* RM32/RM64 depends on prefix width only. */ - OT_WRM32_64, + OT_WRM32_64, /* XMM or Mem32/Mem64 depends on perfix width only. */ - OT_WXMM32_64, + OT_WXMM32_64, /* XMM is encoded in VEX.VVVV. */ - OT_VXMM, + OT_VXMM, /* XMM is encoded in the high nibble of an immediate byte. */ - OT_XMM_IMM, + OT_XMM_IMM, /* YMM/XMM is dependent on VEX.L. */ - OT_YXMM, + OT_YXMM, /* YMM/XMM (depends on prefix length) is encoded in the high nibble of an immediate byte. */ - OT_YXMM_IMM, + OT_YXMM_IMM, /* YMM is encoded in reg. */ - OT_YMM, + OT_YMM, /* YMM or Mem256. */ - OT_YMM256, + OT_YMM256, /* YMM is encoded in VEX.VVVV. */ - OT_VYMM, + OT_VYMM, /* YMM/XMM is dependent on VEX.L, and encoded in VEX.VVVV. */ - OT_VYXMM, + OT_VYXMM, /* YMM/XMM or Mem64/Mem256 is dependent on VEX.L. */ - OT_YXMM64_256, + OT_YXMM64_256, /* YMM/XMM or Mem128/Mem256 is dependent on VEX.L. */ - OT_YXMM128_256, + OT_YXMM128_256, /* XMM or Mem64/Mem256 is dependent on VEX.L. */ - OT_LXMM64_128, + OT_LXMM64_128, /* Mem128/Mem256 is dependent on VEX.L. */ - OT_LMEM128_256 + OT_LMEM128_256 } _OpType; /* Flags for instruction: */ @@ -376,6 +364,9 @@ typedef enum OpType { /* Indicates that the instruction doesn't use the VVVV field of the VEX prefix, if it does then it's undecodable. */ #define INST_VEX_V_UNUSED (1 << 6) +/* Indication that the instruction is privileged (Ring 0), this should be checked on the opcodeId field. */ +#define OPCODE_ID_PRIVILEGED ((uint16_t)0x8000) + /* * Indicates which operand is being decoded. * Destination (1st), Source (2nd), op3 (3rd), op4 (4th). @@ -383,17 +374,49 @@ typedef enum OpType { */ typedef enum {ONT_NONE = -1, ONT_1 = 0, ONT_2 = 1, ONT_3 = 2, ONT_4 = 3} _OperandNumberType; +/* CPU Flags that instructions modify, test or undefine, in compacted form (CF,PF,AF,ZF,SF are 1:1 map to EFLAGS). */ +#define D_COMPACT_CF 1 /* Carry */ +#define D_COMPACT_PF 4 /* Parity */ +#define D_COMPACT_AF 0x10 /* Auxiliary */ +#define D_COMPACT_ZF 0x40 /* Zero */ +#define D_COMPACT_SF 0x80 /* Sign */ +/* The following flags have to be translated to EFLAGS. */ +#define D_COMPACT_IF 2 /* Interrupt */ +#define D_COMPACT_DF 8 /* Direction */ +#define D_COMPACT_OF 0x20 /* Overflow */ + +/* The mask of flags that are already compatible with EFLAGS. */ +#define D_COMPACT_SAME_FLAGS (D_COMPACT_CF | D_COMPACT_PF | D_COMPACT_AF | D_COMPACT_ZF | D_COMPACT_SF) + /* - * Info about the instruction, source/dest types, its name in text and flags. - * This structure is used for the instructions DB and NOT for the disassembled result code! - * This is the BASE structure, there are extentions to this structure below. + * In order to save more space for storing the DB statically, + * I came up with another level of shared info. + * Because I saw that most of the information that instructions use repeats itself. + * + * Info about the instruction, source/dest types, meta and flags. + * _InstInfo points to a table of _InstSharedInfo. */ - typedef struct { - uint8_t flagsIndex; /* An index into FlagsTables. */ + uint8_t flagsIndex; /* An index into FlagsTables */ uint8_t s, d; /* OpType. */ uint8_t meta; /* Hi 5 bits = Instruction set class | Lo 3 bits = flow control flags. */ - uint16_t opcodeId; /* The opcodeId is really a byte-offset into the mnemonics table. */ + /* + * The following are CPU flag masks that the instruction changes. + * The flags are compacted so 8 bits representation is enough. + * They will be expanded in runtime to be compatible to EFLAGS. + */ + uint8_t modifiedFlagsMask; + uint8_t testedFlagsMask; + uint8_t undefinedFlagsMask; +} _InstSharedInfo; + +/* + * This structure is used for the instructions DB and NOT for the disassembled result code! + * This is the BASE structure, there are extensions to this structure below. + */ +typedef struct { + uint16_t sharedIndex; /* An index into the SharedInfoTable. */ + uint16_t opcodeId; /* The opcodeId is really a byte-offset into the mnemonics table. MSB is a privileged indication. */ } _InstInfo; /* @@ -406,7 +429,6 @@ typedef struct { * therefore, I decided to make the extended structure contain all extra info in the same structure. * There are a few instructions (SHLD/SHRD/IMUL and SSE too) which use third operand (or a fourth). * A flag will indicate it uses a third/fourth operand. - * */ typedef struct { /* Base structure (doesn't get accessed directly from code). */ @@ -435,9 +457,6 @@ typedef enum { /* Instruction node is treated as { int index:13; int type:3; } */ typedef uint16_t _InstNode; -/* Helper macro to read the actual flags that are associated with an inst-info. */ -#define INST_INFO_FLAGS(ii) (FlagsTable[(ii)->flagsIndex]) - _InstInfo* inst_lookup(_CodeInfo* ci, _PrefixState* ps); _InstInfo* inst_lookup_3dnow(_CodeInfo* ci); diff --git a/distorm/src/insts.c b/distorm/src/insts.c new file mode 100644 index 0000000..a081a2d --- /dev/null +++ b/distorm/src/insts.c @@ -0,0 +1,7939 @@ +/* +insts.c + +diStorm3 - Powerful disassembler for X86/AMD64 +http://ragestorm.net/distorm/ +distorm at gmail dot com +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. +*/ + + +#include "config.h" +#include "insts.h" +#include "instructions.h" + + +/* +* GENERATED BY disOps at Sun Jul 09 21:22:14 2017 +*/ + +_InstInfo II_MOVSXD = /*II*/{ 0x1d3, 10027 }; +_InstInfo II_NOP = /*II*/{ 0x53, 581 }; +_InstInfo II_PAUSE = /*II*/{ 0x88, 10035 }; +_InstInfo II_WAIT = /*II*/{ 0x53, 10042 }; +_InstInfo II_RDRAND = /*II*/{ 0x1d4, 10048 }; +_InstInfo II_3DNOW = /*II*/{ 0x1d5, 10056 }; + +_iflags FlagsTable[101] = { + 0x80000011, + 0x80000000, + 0x800400, + 0x80800400, + 0x800080, + 0x800100, + 0x80800100, + 0x800200, + 0x80800200, + 0x800000, + 0x1, + 0x0, + 0x80800000, + 0x1000000, + 0x81000000, + 0x808000, + 0x800001, + 0x80020001, + 0x1002000, + 0x60, + 0x64, + 0x80000001, + 0x4010000, + 0x1008000, + 0x80000060, + 0x83000064, + 0x3000064, + 0x83000000, + 0x3008000, + 0x200, + 0xc000, + 0x4014000, + 0x8, + 0x81000009, + 0x9, + 0x80000009, + 0x1000808, + 0x81000808, + 0x80020009, + 0x1001008, + 0x81001008, + 0x80000019, + 0x3000009, + 0x83000009, + 0x83000008, + 0xc0000011, + 0x40000001, + 0xc0800011, + 0x40800001, + 0xc0000019, + 0xc1000001, + 0xc0000001, + 0xc0000003, + 0x41000000, + 0x40000000, + 0x40000008, + 0x40000009, + 0x41000001, + 0x43000001, + 0x40000003, + 0x48000000, + 0x200009, + 0x20000009, + 0x60020009, + 0x60000009, + 0x80090009, + 0x200b0009, + 0x20020009, + 0x80100009, + 0x21100009, + 0x87000009, + 0x20009, + 0x20000008, + 0x1000009, + 0x10020009, + 0x160009, + 0x100009, + 0x47000009, + 0x47090009, + 0x40090009, + 0x80002009, + 0xc0000009, + 0x2001, + 0x80002001, + 0x410009, + 0x20420009, + 0x20060009, + 0x120009, + 0x21020009, + 0xc7000019, + 0x20100009, + 0xc0002009, + 0x40002008, + 0xc0000000, + 0xc0002008, + 0x4020009, + 0x40100009, + 0x60120009, + 0x41000009, + 0x83000001, + 0x200001 +}; + +_InstNode Table_0F = 256; +_InstNode Table_0F_0F = 1440; +_InstNode Table_0F_38 = 1896; +_InstNode Table_0F_3A = 2152; + +_InstInfo InstInfos[1246] = { + /*II_00*/{ 0x0, 11 }, + /*II_01*/{ 0x1, 11 }, + /*II_02*/{ 0x2, 11 }, + /*II_03*/{ 0x3, 11 }, + /*II_04*/{ 0x4, 11 }, + /*II_05*/{ 0x5, 11 }, + /*II_06*/{ 0x6, 16 }, + /*II_07*/{ 0x7, 22 }, + /*II_08*/{ 0x8, 27 }, + /*II_09*/{ 0x9, 27 }, + /*II_0A*/{ 0xa, 27 }, + /*II_0B*/{ 0xb, 27 }, + /*II_0C*/{ 0xc, 27 }, + /*II_0D*/{ 0xd, 27 }, + /*II_0E*/{ 0xe, 16 }, + /*II_10*/{ 0xf, 31 }, + /*II_11*/{ 0x10, 31 }, + /*II_12*/{ 0x11, 31 }, + /*II_13*/{ 0x12, 31 }, + /*II_14*/{ 0x13, 31 }, + /*II_15*/{ 0x14, 31 }, + /*II_16*/{ 0x15, 16 }, + /*II_17*/{ 0x16, 22 }, + /*II_18*/{ 0xf, 36 }, + /*II_19*/{ 0x10, 36 }, + /*II_1A*/{ 0x11, 36 }, + /*II_1B*/{ 0x12, 36 }, + /*II_1C*/{ 0x13, 36 }, + /*II_1D*/{ 0x14, 36 }, + /*II_1E*/{ 0x17, 16 }, + /*II_1F*/{ 0x18, 22 }, + /*II_20*/{ 0x19, 41 }, + /*II_21*/{ 0x1a, 41 }, + /*II_22*/{ 0x1b, 41 }, + /*II_23*/{ 0x1c, 41 }, + /*II_24*/{ 0x1d, 41 }, + /*II_25*/{ 0x1e, 41 }, + /*II_27*/{ 0x1f, 46 }, + /*II_28*/{ 0x0, 51 }, + /*II_29*/{ 0x1, 51 }, + /*II_2A*/{ 0x2, 51 }, + /*II_2B*/{ 0x3, 51 }, + /*II_2C*/{ 0x4, 51 }, + /*II_2D*/{ 0x5, 51 }, + /*II_2F*/{ 0x1f, 56 }, + /*II_30*/{ 0x20, 61 }, + /*II_31*/{ 0x21, 61 }, + /*II_32*/{ 0x22, 61 }, + /*II_33*/{ 0x23, 61 }, + /*II_34*/{ 0x24, 61 }, + /*II_35*/{ 0x25, 61 }, + /*II_37*/{ 0x26, 66 }, + /*II_38*/{ 0x27, 71 }, + /*II_39*/{ 0x28, 71 }, + /*II_3A*/{ 0x29, 71 }, + /*II_3B*/{ 0x2a, 71 }, + /*II_3C*/{ 0x2b, 71 }, + /*II_3D*/{ 0x2c, 71 }, + /*II_3F*/{ 0x26, 76 }, + /*II_40*/{ 0x2d, 81 }, + /*II_40*/{ 0x2d, 81 }, + /*II_40*/{ 0x2d, 81 }, + /*II_40*/{ 0x2d, 81 }, + /*II_40*/{ 0x2d, 81 }, + /*II_40*/{ 0x2d, 81 }, + /*II_40*/{ 0x2d, 81 }, + /*II_40*/{ 0x2d, 81 }, + /*II_48*/{ 0x2d, 86 }, + /*II_48*/{ 0x2d, 86 }, + /*II_48*/{ 0x2d, 86 }, + /*II_48*/{ 0x2d, 86 }, + /*II_48*/{ 0x2d, 86 }, + /*II_48*/{ 0x2d, 86 }, + /*II_48*/{ 0x2d, 86 }, + /*II_48*/{ 0x2d, 86 }, + /*II_50*/{ 0x2e, 16 }, + /*II_50*/{ 0x2e, 16 }, + /*II_50*/{ 0x2e, 16 }, + /*II_50*/{ 0x2e, 16 }, + /*II_50*/{ 0x2e, 16 }, + /*II_50*/{ 0x2e, 16 }, + /*II_50*/{ 0x2e, 16 }, + /*II_50*/{ 0x2e, 16 }, + /*II_58*/{ 0x2f, 22 }, + /*II_58*/{ 0x2f, 22 }, + /*II_58*/{ 0x2f, 22 }, + /*II_58*/{ 0x2f, 22 }, + /*II_58*/{ 0x2f, 22 }, + /*II_58*/{ 0x2f, 22 }, + /*II_58*/{ 0x2f, 22 }, + /*II_58*/{ 0x2f, 22 }, + /*II_60*/{ 0x30, 91 }, + /*II_61*/{ 0x30, 98 }, + /*II_62*/{ 0x31, 104 }, + /*II_63*/{ 0x32, 111 }, + /*II_68*/{ 0x33, 16 }, + /*II_6A*/{ 0x35, 16 }, + /*II_6C*/{ 0x36, 32891 }, + /*II_6D*/{ 0x37, 32891 }, + /*II_6E*/{ 0x38, 32896 }, + /*II_6F*/{ 0x39, 32896 }, + /*II_70*/{ 0x3a, 134 }, + /*II_71*/{ 0x3a, 138 }, + /*II_72*/{ 0x3b, 143 }, + /*II_73*/{ 0x3b, 147 }, + /*II_74*/{ 0x3c, 152 }, + /*II_75*/{ 0x3c, 156 }, + /*II_76*/{ 0x3d, 161 }, + /*II_77*/{ 0x3d, 166 }, + /*II_78*/{ 0x3e, 170 }, + /*II_79*/{ 0x3e, 174 }, + /*II_7A*/{ 0x3f, 179 }, + /*II_7B*/{ 0x3f, 183 }, + /*II_7C*/{ 0x40, 188 }, + /*II_7D*/{ 0x40, 192 }, + /*II_7E*/{ 0x41, 197 }, + /*II_7F*/{ 0x41, 202 }, + /*II_84*/{ 0x42, 206 }, + /*II_85*/{ 0x43, 206 }, + /*II_86*/{ 0x44, 212 }, + /*II_87*/{ 0x45, 212 }, + /*II_88*/{ 0x46, 218 }, + /*II_89*/{ 0x47, 218 }, + /*II_8A*/{ 0x48, 218 }, + /*II_8B*/{ 0x49, 218 }, + /*II_8C*/{ 0x4a, 218 }, + /*II_8D*/{ 0x4b, 223 }, + /*II_8E*/{ 0x4c, 218 }, + /*II_90*/{ 0x4d, 212 }, + /*II_91*/{ 0x4d, 212 }, + /*II_92*/{ 0x4d, 212 }, + /*II_93*/{ 0x4d, 212 }, + /*II_94*/{ 0x4d, 212 }, + /*II_95*/{ 0x4d, 212 }, + /*II_96*/{ 0x4d, 212 }, + /*II_97*/{ 0x4d, 212 }, + /*II_9A*/{ 0x4f, 260 }, + /*II_9C*/{ 0x50, 270 }, + /*II_9D*/{ 0x51, 277 }, + /*II_9E*/{ 0x52, 283 }, + /*II_9F*/{ 0x53, 289 }, + /*II_A0*/{ 0x54, 218 }, + /*II_A1*/{ 0x55, 218 }, + /*II_A2*/{ 0x56, 218 }, + /*II_A3*/{ 0x57, 218 }, + /*II_A4*/{ 0x58, 295 }, + /*II_A5*/{ 0x59, 295 }, + /*II_A6*/{ 0x5a, 301 }, + /*II_A7*/{ 0x5b, 301 }, + /*II_A8*/{ 0x5c, 206 }, + /*II_A9*/{ 0x5d, 206 }, + /*II_AA*/{ 0x5e, 307 }, + /*II_AB*/{ 0x5f, 307 }, + /*II_AC*/{ 0x60, 313 }, + /*II_AD*/{ 0x61, 313 }, + /*II_AE*/{ 0x62, 319 }, + /*II_AF*/{ 0x63, 319 }, + /*II_B0*/{ 0x64, 218 }, + /*II_B0*/{ 0x64, 218 }, + /*II_B0*/{ 0x64, 218 }, + /*II_B0*/{ 0x64, 218 }, + /*II_B0*/{ 0x64, 218 }, + /*II_B0*/{ 0x64, 218 }, + /*II_B0*/{ 0x64, 218 }, + /*II_B0*/{ 0x64, 218 }, + /*II_B8*/{ 0x65, 218 }, + /*II_B8*/{ 0x65, 218 }, + /*II_B8*/{ 0x65, 218 }, + /*II_B8*/{ 0x65, 218 }, + /*II_B8*/{ 0x65, 218 }, + /*II_B8*/{ 0x65, 218 }, + /*II_B8*/{ 0x65, 218 }, + /*II_B8*/{ 0x65, 218 }, + /*II_C2*/{ 0x66, 325 }, + /*II_C3*/{ 0x67, 325 }, + /*II_C4*/{ 0x68, 330 }, + /*II_C5*/{ 0x68, 335 }, + /*II_C8*/{ 0x69, 340 }, + /*II_C9*/{ 0x6a, 347 }, + /*II_CA*/{ 0x6b, 354 }, + /*II_CB*/{ 0x6c, 354 }, + /*II_CC*/{ 0x6d, 360 }, + /*II_CD*/{ 0x6e, 367 }, + /*II_CE*/{ 0x6f, 372 }, + /*II_CF*/{ 0x70, 33146 }, + /*II_D4*/{ 0x71, 384 }, + /*II_D5*/{ 0x71, 389 }, + /*II_D6*/{ 0x72, 394 }, + /*II_D7*/{ 0x73, 400 }, + /*II_E0*/{ 0x74, 406 }, + /*II_E1*/{ 0x74, 414 }, + /*II_E2*/{ 0x75, 421 }, + /*II_E4*/{ 0x77, 33215 }, + /*II_E5*/{ 0x78, 33215 }, + /*II_E6*/{ 0x79, 33219 }, + /*II_E7*/{ 0x7a, 33219 }, + /*II_E8*/{ 0x7b, 456 }, + /*II_E9*/{ 0x7c, 462 }, + /*II_EA*/{ 0x7d, 467 }, + /*II_EB*/{ 0x7e, 462 }, + /*II_EC*/{ 0x7f, 33215 }, + /*II_ED*/{ 0x80, 33215 }, + /*II_EE*/{ 0x81, 33219 }, + /*II_EF*/{ 0x82, 33219 }, + /*II_F1*/{ 0x6d, 476 }, + /*II_F4*/{ 0x53, 33250 }, + /*II_F5*/{ 0x83, 487 }, + /*II_F8*/{ 0x83, 492 }, + /*II_F9*/{ 0x83, 497 }, + /*II_FA*/{ 0x84, 33270 }, + /*II_FB*/{ 0x84, 33275 }, + /*II_FC*/{ 0x85, 512 }, + /*II_FD*/{ 0x85, 517 }, + /*II_0F_02*/{ 0x86, 522 }, + /*II_0F_03*/{ 0x86, 527 }, + /*II_0F_05*/{ 0x87, 532 }, + /*II_0F_06*/{ 0x88, 33309 }, + /*II_0F_07*/{ 0x87, 547 }, + /*II_0F_08*/{ 0x88, 33323 }, + /*II_0F_09*/{ 0x88, 33329 }, + /*II_0F_0B*/{ 0x89, 569 }, + /*II_0F_0E*/{ 0x8a, 574 }, + /*II_0F_1F*/{ 0x8b, 581 }, + /*II_0F_20*/{ 0x8c, 32986 }, + /*II_0F_21*/{ 0x8d, 32986 }, + /*II_0F_22*/{ 0x8e, 32986 }, + /*II_0F_23*/{ 0x8f, 32986 }, + /*II_0F_30*/{ 0x88, 33354 }, + /*II_0F_31*/{ 0x88, 33361 }, + /*II_0F_32*/{ 0x88, 33368 }, + /*II_0F_33*/{ 0x88, 33375 }, + /*II_0F_34*/{ 0x87, 614 }, + /*II_0F_35*/{ 0x87, 624 }, + /*II_0F_37*/{ 0x90, 633 }, + /*II_0F_40*/{ 0x91, 641 }, + /*II_0F_41*/{ 0x91, 648 }, + /*II_0F_42*/{ 0x92, 656 }, + /*II_0F_43*/{ 0x92, 663 }, + /*II_0F_44*/{ 0x93, 671 }, + /*II_0F_45*/{ 0x93, 678 }, + /*II_0F_46*/{ 0x94, 686 }, + /*II_0F_47*/{ 0x94, 694 }, + /*II_0F_48*/{ 0x95, 701 }, + /*II_0F_49*/{ 0x95, 708 }, + /*II_0F_4A*/{ 0x96, 716 }, + /*II_0F_4B*/{ 0x96, 723 }, + /*II_0F_4C*/{ 0x97, 731 }, + /*II_0F_4D*/{ 0x97, 738 }, + /*II_0F_4E*/{ 0x98, 746 }, + /*II_0F_4F*/{ 0x98, 754 }, + /*II_0F_80*/{ 0x99, 134 }, + /*II_0F_81*/{ 0x99, 138 }, + /*II_0F_82*/{ 0x9a, 143 }, + /*II_0F_83*/{ 0x9a, 147 }, + /*II_0F_84*/{ 0x9b, 152 }, + /*II_0F_85*/{ 0x9b, 156 }, + /*II_0F_86*/{ 0x9c, 161 }, + /*II_0F_87*/{ 0x9c, 166 }, + /*II_0F_88*/{ 0x9d, 170 }, + /*II_0F_89*/{ 0x9d, 174 }, + /*II_0F_8A*/{ 0x9e, 179 }, + /*II_0F_8B*/{ 0x9e, 183 }, + /*II_0F_8C*/{ 0x9f, 188 }, + /*II_0F_8D*/{ 0x9f, 192 }, + /*II_0F_8E*/{ 0xa0, 197 }, + /*II_0F_8F*/{ 0xa0, 202 }, + /*II_0F_90*/{ 0xa1, 761 }, + /*II_0F_91*/{ 0xa1, 767 }, + /*II_0F_92*/{ 0xa2, 774 }, + /*II_0F_93*/{ 0xa2, 780 }, + /*II_0F_94*/{ 0xa3, 787 }, + /*II_0F_95*/{ 0xa3, 793 }, + /*II_0F_96*/{ 0xa4, 800 }, + /*II_0F_97*/{ 0xa4, 807 }, + /*II_0F_98*/{ 0xa5, 813 }, + /*II_0F_99*/{ 0xa5, 819 }, + /*II_0F_9A*/{ 0xa6, 826 }, + /*II_0F_9B*/{ 0xa6, 832 }, + /*II_0F_9C*/{ 0xa7, 839 }, + /*II_0F_9D*/{ 0xa7, 845 }, + /*II_0F_9E*/{ 0xa8, 852 }, + /*II_0F_9F*/{ 0xa8, 859 }, + /*II_0F_A0*/{ 0xa9, 16 }, + /*II_0F_A1*/{ 0xaa, 22 }, + /*II_0F_A2*/{ 0x88, 865 }, + /*II_0F_A3*/{ 0xab, 872 }, + /*II_0F_A8*/{ 0xad, 16 }, + /*II_0F_A9*/{ 0xae, 22 }, + /*II_0F_AA*/{ 0xaf, 882 }, + /*II_0F_AB*/{ 0xb0, 887 }, + /*II_0F_AF*/{ 0xb1, 117 }, + /*II_0F_B0*/{ 0xb2, 898 }, + /*II_0F_B1*/{ 0xb3, 898 }, + /*II_0F_B2*/{ 0xb4, 907 }, + /*II_0F_B3*/{ 0xb0, 912 }, + /*II_0F_B4*/{ 0xb4, 917 }, + /*II_0F_B5*/{ 0xb4, 922 }, + /*II_0F_B6*/{ 0xb5, 927 }, + /*II_0F_B7*/{ 0xb6, 927 }, + /*II_0F_B9*/{ 0x89, 569 }, + /*II_0F_BB*/{ 0xb0, 934 }, + /*II_0F_BE*/{ 0xb5, 939 }, + /*II_0F_BF*/{ 0xb6, 939 }, + /*II_0F_C0*/{ 0xb2, 946 }, + /*II_0F_C1*/{ 0xb3, 946 }, + /*II_0F_C3*/{ 0xb7, 952 }, + /*II_0F_C8*/{ 0xb8, 960 }, + /*II_0F_C8*/{ 0xb8, 960 }, + /*II_0F_C8*/{ 0xb8, 960 }, + /*II_0F_C8*/{ 0xb8, 960 }, + /*II_0F_C8*/{ 0xb8, 960 }, + /*II_0F_C8*/{ 0xb8, 960 }, + /*II_0F_C8*/{ 0xb8, 960 }, + /*II_0F_C8*/{ 0xb8, 960 }, + /*II_80_00*/{ 0xb9, 11 }, + /*II_80_01*/{ 0xba, 27 }, + /*II_80_02*/{ 0xbb, 31 }, + /*II_80_03*/{ 0xbb, 36 }, + /*II_80_04*/{ 0xbc, 41 }, + /*II_80_05*/{ 0xb9, 51 }, + /*II_80_06*/{ 0xbd, 61 }, + /*II_80_07*/{ 0xbe, 71 }, + /*II_81_00*/{ 0xbf, 11 }, + /*II_81_01*/{ 0xc0, 27 }, + /*II_81_02*/{ 0xc1, 31 }, + /*II_81_03*/{ 0xc1, 36 }, + /*II_81_04*/{ 0xc2, 41 }, + /*II_81_05*/{ 0xbf, 51 }, + /*II_81_06*/{ 0xc3, 61 }, + /*II_81_07*/{ 0xc4, 71 }, + /*II_82_00*/{ 0xc5, 11 }, + /*II_82_01*/{ 0xc6, 27 }, + /*II_82_02*/{ 0xc7, 31 }, + /*II_82_03*/{ 0xc7, 36 }, + /*II_82_04*/{ 0xc8, 41 }, + /*II_82_05*/{ 0xc5, 51 }, + /*II_82_06*/{ 0xc9, 61 }, + /*II_82_07*/{ 0xca, 71 }, + /*II_83_00*/{ 0xcb, 11 }, + /*II_83_01*/{ 0xcc, 27 }, + /*II_83_02*/{ 0xcd, 31 }, + /*II_83_03*/{ 0xcd, 36 }, + /*II_83_04*/{ 0xce, 41 }, + /*II_83_05*/{ 0xcb, 51 }, + /*II_83_06*/{ 0xcf, 61 }, + /*II_83_07*/{ 0xd0, 71 }, + /*II_8F_00*/{ 0xd1, 22 }, + /*II_C0_00*/{ 0xd2, 967 }, + /*II_C0_01*/{ 0xd2, 972 }, + /*II_C0_02*/{ 0xd3, 977 }, + /*II_C0_03*/{ 0xd3, 982 }, + /*II_C0_04*/{ 0xd4, 987 }, + /*II_C0_05*/{ 0xd4, 992 }, + /*II_C0_06*/{ 0xd4, 997 }, + /*II_C0_07*/{ 0xd4, 1002 }, + /*II_C1_00*/{ 0xd5, 967 }, + /*II_C1_01*/{ 0xd5, 972 }, + /*II_C1_02*/{ 0xd6, 977 }, + /*II_C1_03*/{ 0xd6, 982 }, + /*II_C1_04*/{ 0xd7, 987 }, + /*II_C1_05*/{ 0xd7, 992 }, + /*II_C1_06*/{ 0xd7, 997 }, + /*II_C1_07*/{ 0xd7, 1002 }, + /*II_C6_00*/{ 0xd8, 218 }, + /*II_C6_F8*/{ 0xd9, 1007 }, + /*II_C7_00*/{ 0xda, 218 }, + /*II_C7_F8*/{ 0xdb, 1015 }, + /*II_D0_00*/{ 0xdc, 967 }, + /*II_D0_01*/{ 0xdc, 972 }, + /*II_D0_02*/{ 0xdd, 977 }, + /*II_D0_03*/{ 0xdd, 982 }, + /*II_D0_04*/{ 0xde, 987 }, + /*II_D0_05*/{ 0xde, 992 }, + /*II_D0_06*/{ 0xde, 997 }, + /*II_D0_07*/{ 0xde, 1002 }, + /*II_D1_00*/{ 0xdf, 967 }, + /*II_D1_01*/{ 0xdf, 972 }, + /*II_D1_02*/{ 0xe0, 977 }, + /*II_D1_03*/{ 0xe0, 982 }, + /*II_D1_04*/{ 0xe1, 987 }, + /*II_D1_05*/{ 0xe1, 992 }, + /*II_D1_06*/{ 0xe1, 997 }, + /*II_D1_07*/{ 0xe1, 1002 }, + /*II_D2_00*/{ 0xe2, 967 }, + /*II_D2_01*/{ 0xe2, 972 }, + /*II_D2_02*/{ 0xe3, 977 }, + /*II_D2_03*/{ 0xe3, 982 }, + /*II_D2_04*/{ 0xe4, 987 }, + /*II_D2_05*/{ 0xe4, 992 }, + /*II_D2_06*/{ 0xe4, 997 }, + /*II_D2_07*/{ 0xe4, 1002 }, + /*II_D3_00*/{ 0xe5, 967 }, + /*II_D3_01*/{ 0xe5, 972 }, + /*II_D3_02*/{ 0xe6, 977 }, + /*II_D3_03*/{ 0xe6, 982 }, + /*II_D3_04*/{ 0xe7, 987 }, + /*II_D3_05*/{ 0xe7, 992 }, + /*II_D3_06*/{ 0xe7, 997 }, + /*II_D3_07*/{ 0xe7, 1002 }, + /*II_D8_00*/{ 0xe8, 1023 }, + /*II_D8_01*/{ 0xe8, 1029 }, + /*II_D8_02*/{ 0xe8, 1035 }, + /*II_D8_03*/{ 0xe8, 1041 }, + /*II_D8_04*/{ 0xe8, 1048 }, + /*II_D8_05*/{ 0xe8, 1054 }, + /*II_D8_06*/{ 0xe8, 1061 }, + /*II_D8_07*/{ 0xe8, 1067 }, + /*II_D8_C0*/{ 0xe9, 1023 }, + /*II_D8_C0*/{ 0xe9, 1023 }, + /*II_D8_C0*/{ 0xe9, 1023 }, + /*II_D8_C0*/{ 0xe9, 1023 }, + /*II_D8_C0*/{ 0xe9, 1023 }, + /*II_D8_C0*/{ 0xe9, 1023 }, + /*II_D8_C0*/{ 0xe9, 1023 }, + /*II_D8_C0*/{ 0xe9, 1023 }, + /*II_D8_C8*/{ 0xe9, 1029 }, + /*II_D8_C8*/{ 0xe9, 1029 }, + /*II_D8_C8*/{ 0xe9, 1029 }, + /*II_D8_C8*/{ 0xe9, 1029 }, + /*II_D8_C8*/{ 0xe9, 1029 }, + /*II_D8_C8*/{ 0xe9, 1029 }, + /*II_D8_C8*/{ 0xe9, 1029 }, + /*II_D8_C8*/{ 0xe9, 1029 }, + /*II_D8_D0*/{ 0xea, 1035 }, + /*II_D8_D0*/{ 0xea, 1035 }, + /*II_D8_D0*/{ 0xea, 1035 }, + /*II_D8_D0*/{ 0xea, 1035 }, + /*II_D8_D0*/{ 0xea, 1035 }, + /*II_D8_D0*/{ 0xea, 1035 }, + /*II_D8_D0*/{ 0xea, 1035 }, + /*II_D8_D0*/{ 0xea, 1035 }, + /*II_D8_D8*/{ 0xea, 1041 }, + /*II_D8_D9*/{ 0xeb, 1041 }, + /*II_D8_D8*/{ 0xea, 1041 }, + /*II_D8_D8*/{ 0xea, 1041 }, + /*II_D8_D8*/{ 0xea, 1041 }, + /*II_D8_D8*/{ 0xea, 1041 }, + /*II_D8_D8*/{ 0xea, 1041 }, + /*II_D8_D8*/{ 0xea, 1041 }, + /*II_D8_E0*/{ 0xe9, 1048 }, + /*II_D8_E0*/{ 0xe9, 1048 }, + /*II_D8_E0*/{ 0xe9, 1048 }, + /*II_D8_E0*/{ 0xe9, 1048 }, + /*II_D8_E0*/{ 0xe9, 1048 }, + /*II_D8_E0*/{ 0xe9, 1048 }, + /*II_D8_E0*/{ 0xe9, 1048 }, + /*II_D8_E0*/{ 0xe9, 1048 }, + /*II_D8_E8*/{ 0xe9, 1054 }, + /*II_D8_E8*/{ 0xe9, 1054 }, + /*II_D8_E8*/{ 0xe9, 1054 }, + /*II_D8_E8*/{ 0xe9, 1054 }, + /*II_D8_E8*/{ 0xe9, 1054 }, + /*II_D8_E8*/{ 0xe9, 1054 }, + /*II_D8_E8*/{ 0xe9, 1054 }, + /*II_D8_E8*/{ 0xe9, 1054 }, + /*II_D8_F0*/{ 0xe9, 1061 }, + /*II_D8_F0*/{ 0xe9, 1061 }, + /*II_D8_F0*/{ 0xe9, 1061 }, + /*II_D8_F0*/{ 0xe9, 1061 }, + /*II_D8_F0*/{ 0xe9, 1061 }, + /*II_D8_F0*/{ 0xe9, 1061 }, + /*II_D8_F0*/{ 0xe9, 1061 }, + /*II_D8_F0*/{ 0xe9, 1061 }, + /*II_D8_F8*/{ 0xe9, 1067 }, + /*II_D8_F8*/{ 0xe9, 1067 }, + /*II_D8_F8*/{ 0xe9, 1067 }, + /*II_D8_F8*/{ 0xe9, 1067 }, + /*II_D8_F8*/{ 0xe9, 1067 }, + /*II_D8_F8*/{ 0xe9, 1067 }, + /*II_D8_F8*/{ 0xe9, 1067 }, + /*II_D8_F8*/{ 0xe9, 1067 }, + /*II_D9_00*/{ 0xe8, 1074 }, + /*II_D9_02*/{ 0xec, 1079 }, + /*II_D9_03*/{ 0xec, 1084 }, + /*II_D9_04*/{ 0xed, 1090 }, + /*II_D9_05*/{ 0xee, 1098 }, + /*II_D9_C0*/{ 0xea, 1074 }, + /*II_D9_C0*/{ 0xea, 1074 }, + /*II_D9_C0*/{ 0xea, 1074 }, + /*II_D9_C0*/{ 0xea, 1074 }, + /*II_D9_C0*/{ 0xea, 1074 }, + /*II_D9_C0*/{ 0xea, 1074 }, + /*II_D9_C0*/{ 0xea, 1074 }, + /*II_D9_C0*/{ 0xea, 1074 }, + /*II_D9_C8*/{ 0xea, 1105 }, + /*II_D9_C9*/{ 0xeb, 1105 }, + /*II_D9_C8*/{ 0xea, 1105 }, + /*II_D9_C8*/{ 0xea, 1105 }, + /*II_D9_C8*/{ 0xea, 1105 }, + /*II_D9_C8*/{ 0xea, 1105 }, + /*II_D9_C8*/{ 0xea, 1105 }, + /*II_D9_C8*/{ 0xea, 1105 }, + /*II_D9_D0*/{ 0xeb, 1111 }, + /*II_D9_E0*/{ 0xeb, 1117 }, + /*II_D9_E1*/{ 0xeb, 1123 }, + /*II_D9_E4*/{ 0xeb, 1129 }, + /*II_D9_E5*/{ 0xeb, 1135 }, + /*II_D9_E8*/{ 0xeb, 1141 }, + /*II_D9_E9*/{ 0xeb, 1147 }, + /*II_D9_EA*/{ 0xeb, 1155 }, + /*II_D9_EB*/{ 0xeb, 1163 }, + /*II_D9_EC*/{ 0xeb, 1170 }, + /*II_D9_ED*/{ 0xeb, 1178 }, + /*II_D9_EE*/{ 0xeb, 1186 }, + /*II_D9_F0*/{ 0xeb, 1192 }, + /*II_D9_F1*/{ 0xeb, 1199 }, + /*II_D9_F2*/{ 0xeb, 1206 }, + /*II_D9_F3*/{ 0xeb, 1213 }, + /*II_D9_F4*/{ 0xeb, 1221 }, + /*II_D9_F5*/{ 0xeb, 1230 }, + /*II_D9_F6*/{ 0xeb, 1238 }, + /*II_D9_F7*/{ 0xeb, 1247 }, + /*II_D9_F8*/{ 0xeb, 1256 }, + /*II_D9_F9*/{ 0xeb, 1263 }, + /*II_D9_FA*/{ 0xeb, 1272 }, + /*II_D9_FB*/{ 0xeb, 1279 }, + /*II_D9_FC*/{ 0xeb, 1288 }, + /*II_D9_FD*/{ 0xeb, 1297 }, + /*II_D9_FE*/{ 0xeb, 1305 }, + /*II_D9_FF*/{ 0xeb, 1311 }, + /*II_DA_00*/{ 0xe8, 1317 }, + /*II_DA_01*/{ 0xe8, 1324 }, + /*II_DA_02*/{ 0xe8, 1331 }, + /*II_DA_03*/{ 0xe8, 1338 }, + /*II_DA_04*/{ 0xe8, 1346 }, + /*II_DA_05*/{ 0xe8, 1353 }, + /*II_DA_06*/{ 0xe8, 1361 }, + /*II_DA_07*/{ 0xe8, 1368 }, + /*II_DA_C0*/{ 0xef, 1376 }, + /*II_DA_C0*/{ 0xef, 1376 }, + /*II_DA_C0*/{ 0xef, 1376 }, + /*II_DA_C0*/{ 0xef, 1376 }, + /*II_DA_C0*/{ 0xef, 1376 }, + /*II_DA_C0*/{ 0xef, 1376 }, + /*II_DA_C0*/{ 0xef, 1376 }, + /*II_DA_C0*/{ 0xef, 1376 }, + /*II_DA_C8*/{ 0xf0, 1384 }, + /*II_DA_C8*/{ 0xf0, 1384 }, + /*II_DA_C8*/{ 0xf0, 1384 }, + /*II_DA_C8*/{ 0xf0, 1384 }, + /*II_DA_C8*/{ 0xf0, 1384 }, + /*II_DA_C8*/{ 0xf0, 1384 }, + /*II_DA_C8*/{ 0xf0, 1384 }, + /*II_DA_C8*/{ 0xf0, 1384 }, + /*II_DA_D0*/{ 0xf1, 1392 }, + /*II_DA_D0*/{ 0xf1, 1392 }, + /*II_DA_D0*/{ 0xf1, 1392 }, + /*II_DA_D0*/{ 0xf1, 1392 }, + /*II_DA_D0*/{ 0xf1, 1392 }, + /*II_DA_D0*/{ 0xf1, 1392 }, + /*II_DA_D0*/{ 0xf1, 1392 }, + /*II_DA_D0*/{ 0xf1, 1392 }, + /*II_DA_D8*/{ 0xf2, 1401 }, + /*II_DA_D8*/{ 0xf2, 1401 }, + /*II_DA_D8*/{ 0xf2, 1401 }, + /*II_DA_D8*/{ 0xf2, 1401 }, + /*II_DA_D8*/{ 0xf2, 1401 }, + /*II_DA_D8*/{ 0xf2, 1401 }, + /*II_DA_D8*/{ 0xf2, 1401 }, + /*II_DA_D8*/{ 0xf2, 1401 }, + /*II_DA_E9*/{ 0xeb, 1409 }, + /*II_DB_00*/{ 0xe8, 1418 }, + /*II_DB_01*/{ 0xf3, 1424 }, + /*II_DB_02*/{ 0xec, 1432 }, + /*II_DB_03*/{ 0xec, 1438 }, + /*II_DB_05*/{ 0xf4, 1074 }, + /*II_DB_07*/{ 0xf5, 1084 }, + /*II_DB_C0*/{ 0xef, 1445 }, + /*II_DB_C0*/{ 0xef, 1445 }, + /*II_DB_C0*/{ 0xef, 1445 }, + /*II_DB_C0*/{ 0xef, 1445 }, + /*II_DB_C0*/{ 0xef, 1445 }, + /*II_DB_C0*/{ 0xef, 1445 }, + /*II_DB_C0*/{ 0xef, 1445 }, + /*II_DB_C0*/{ 0xef, 1445 }, + /*II_DB_C8*/{ 0xf0, 1454 }, + /*II_DB_C8*/{ 0xf0, 1454 }, + /*II_DB_C8*/{ 0xf0, 1454 }, + /*II_DB_C8*/{ 0xf0, 1454 }, + /*II_DB_C8*/{ 0xf0, 1454 }, + /*II_DB_C8*/{ 0xf0, 1454 }, + /*II_DB_C8*/{ 0xf0, 1454 }, + /*II_DB_C8*/{ 0xf0, 1454 }, + /*II_DB_D0*/{ 0xf1, 1463 }, + /*II_DB_D0*/{ 0xf1, 1463 }, + /*II_DB_D0*/{ 0xf1, 1463 }, + /*II_DB_D0*/{ 0xf1, 1463 }, + /*II_DB_D0*/{ 0xf1, 1463 }, + /*II_DB_D0*/{ 0xf1, 1463 }, + /*II_DB_D0*/{ 0xf1, 1463 }, + /*II_DB_D0*/{ 0xf1, 1463 }, + /*II_DB_D8*/{ 0xf2, 1473 }, + /*II_DB_D8*/{ 0xf2, 1473 }, + /*II_DB_D8*/{ 0xf2, 1473 }, + /*II_DB_D8*/{ 0xf2, 1473 }, + /*II_DB_D8*/{ 0xf2, 1473 }, + /*II_DB_D8*/{ 0xf2, 1473 }, + /*II_DB_D8*/{ 0xf2, 1473 }, + /*II_DB_D8*/{ 0xf2, 1473 }, + /*II_DB_E0*/{ 0xeb, 1482 }, + /*II_DB_E1*/{ 0xeb, 1488 }, + /*II_DB_E4*/{ 0xeb, 1496 }, + /*II_DB_E8*/{ 0xf6, 1504 }, + /*II_DB_E8*/{ 0xf6, 1504 }, + /*II_DB_E8*/{ 0xf6, 1504 }, + /*II_DB_E8*/{ 0xf6, 1504 }, + /*II_DB_E8*/{ 0xf6, 1504 }, + /*II_DB_E8*/{ 0xf6, 1504 }, + /*II_DB_E8*/{ 0xf6, 1504 }, + /*II_DB_E8*/{ 0xf6, 1504 }, + /*II_DB_F0*/{ 0xf7, 1512 }, + /*II_DB_F0*/{ 0xf7, 1512 }, + /*II_DB_F0*/{ 0xf7, 1512 }, + /*II_DB_F0*/{ 0xf7, 1512 }, + /*II_DB_F0*/{ 0xf7, 1512 }, + /*II_DB_F0*/{ 0xf7, 1512 }, + /*II_DB_F0*/{ 0xf7, 1512 }, + /*II_DB_F0*/{ 0xf7, 1512 }, + /*II_DC_00*/{ 0xf8, 1023 }, + /*II_DC_01*/{ 0xf8, 1029 }, + /*II_DC_02*/{ 0xf8, 1035 }, + /*II_DC_03*/{ 0xf8, 1041 }, + /*II_DC_04*/{ 0xf8, 1048 }, + /*II_DC_05*/{ 0xf8, 1054 }, + /*II_DC_06*/{ 0xf8, 1061 }, + /*II_DC_07*/{ 0xf8, 1067 }, + /*II_DC_C0*/{ 0xf9, 1023 }, + /*II_DC_C0*/{ 0xf9, 1023 }, + /*II_DC_C0*/{ 0xf9, 1023 }, + /*II_DC_C0*/{ 0xf9, 1023 }, + /*II_DC_C0*/{ 0xf9, 1023 }, + /*II_DC_C0*/{ 0xf9, 1023 }, + /*II_DC_C0*/{ 0xf9, 1023 }, + /*II_DC_C0*/{ 0xf9, 1023 }, + /*II_DC_C8*/{ 0xf9, 1029 }, + /*II_DC_C8*/{ 0xf9, 1029 }, + /*II_DC_C8*/{ 0xf9, 1029 }, + /*II_DC_C8*/{ 0xf9, 1029 }, + /*II_DC_C8*/{ 0xf9, 1029 }, + /*II_DC_C8*/{ 0xf9, 1029 }, + /*II_DC_C8*/{ 0xf9, 1029 }, + /*II_DC_C8*/{ 0xf9, 1029 }, + /*II_DC_E0*/{ 0xf9, 1054 }, + /*II_DC_E0*/{ 0xf9, 1054 }, + /*II_DC_E0*/{ 0xf9, 1054 }, + /*II_DC_E0*/{ 0xf9, 1054 }, + /*II_DC_E0*/{ 0xf9, 1054 }, + /*II_DC_E0*/{ 0xf9, 1054 }, + /*II_DC_E0*/{ 0xf9, 1054 }, + /*II_DC_E0*/{ 0xf9, 1054 }, + /*II_DC_E8*/{ 0xf9, 1048 }, + /*II_DC_E8*/{ 0xf9, 1048 }, + /*II_DC_E8*/{ 0xf9, 1048 }, + /*II_DC_E8*/{ 0xf9, 1048 }, + /*II_DC_E8*/{ 0xf9, 1048 }, + /*II_DC_E8*/{ 0xf9, 1048 }, + /*II_DC_E8*/{ 0xf9, 1048 }, + /*II_DC_E8*/{ 0xf9, 1048 }, + /*II_DC_F0*/{ 0xf9, 1067 }, + /*II_DC_F0*/{ 0xf9, 1067 }, + /*II_DC_F0*/{ 0xf9, 1067 }, + /*II_DC_F0*/{ 0xf9, 1067 }, + /*II_DC_F0*/{ 0xf9, 1067 }, + /*II_DC_F0*/{ 0xf9, 1067 }, + /*II_DC_F0*/{ 0xf9, 1067 }, + /*II_DC_F0*/{ 0xf9, 1067 }, + /*II_DC_F8*/{ 0xf9, 1061 }, + /*II_DC_F8*/{ 0xf9, 1061 }, + /*II_DC_F8*/{ 0xf9, 1061 }, + /*II_DC_F8*/{ 0xf9, 1061 }, + /*II_DC_F8*/{ 0xf9, 1061 }, + /*II_DC_F8*/{ 0xf9, 1061 }, + /*II_DC_F8*/{ 0xf9, 1061 }, + /*II_DC_F8*/{ 0xf9, 1061 }, + /*II_DD_00*/{ 0xf8, 1074 }, + /*II_DD_01*/{ 0xfa, 1424 }, + /*II_DD_02*/{ 0xfb, 1079 }, + /*II_DD_03*/{ 0xfb, 1084 }, + /*II_DD_04*/{ 0xed, 1519 }, + /*II_DD_C0*/{ 0xea, 1527 }, + /*II_DD_C0*/{ 0xea, 1527 }, + /*II_DD_C0*/{ 0xea, 1527 }, + /*II_DD_C0*/{ 0xea, 1527 }, + /*II_DD_C0*/{ 0xea, 1527 }, + /*II_DD_C0*/{ 0xea, 1527 }, + /*II_DD_C0*/{ 0xea, 1527 }, + /*II_DD_C0*/{ 0xea, 1527 }, + /*II_DD_D0*/{ 0xea, 1079 }, + /*II_DD_D0*/{ 0xea, 1079 }, + /*II_DD_D0*/{ 0xea, 1079 }, + /*II_DD_D0*/{ 0xea, 1079 }, + /*II_DD_D0*/{ 0xea, 1079 }, + /*II_DD_D0*/{ 0xea, 1079 }, + /*II_DD_D0*/{ 0xea, 1079 }, + /*II_DD_D0*/{ 0xea, 1079 }, + /*II_DD_D8*/{ 0xea, 1084 }, + /*II_DD_D8*/{ 0xea, 1084 }, + /*II_DD_D8*/{ 0xea, 1084 }, + /*II_DD_D8*/{ 0xea, 1084 }, + /*II_DD_D8*/{ 0xea, 1084 }, + /*II_DD_D8*/{ 0xea, 1084 }, + /*II_DD_D8*/{ 0xea, 1084 }, + /*II_DD_D8*/{ 0xea, 1084 }, + /*II_DD_E0*/{ 0xf9, 1534 }, + /*II_DD_E1*/{ 0xeb, 1534 }, + /*II_DD_E0*/{ 0xf9, 1534 }, + /*II_DD_E0*/{ 0xf9, 1534 }, + /*II_DD_E0*/{ 0xf9, 1534 }, + /*II_DD_E0*/{ 0xf9, 1534 }, + /*II_DD_E0*/{ 0xf9, 1534 }, + /*II_DD_E0*/{ 0xf9, 1534 }, + /*II_DD_E8*/{ 0xea, 1541 }, + /*II_DD_E9*/{ 0xeb, 1541 }, + /*II_DD_E8*/{ 0xea, 1541 }, + /*II_DD_E8*/{ 0xea, 1541 }, + /*II_DD_E8*/{ 0xea, 1541 }, + /*II_DD_E8*/{ 0xea, 1541 }, + /*II_DD_E8*/{ 0xea, 1541 }, + /*II_DD_E8*/{ 0xea, 1541 }, + /*II_DE_00*/{ 0xee, 1317 }, + /*II_DE_01*/{ 0xee, 1324 }, + /*II_DE_02*/{ 0xee, 1331 }, + /*II_DE_03*/{ 0xee, 1338 }, + /*II_DE_04*/{ 0xee, 1346 }, + /*II_DE_05*/{ 0xee, 1353 }, + /*II_DE_06*/{ 0xee, 1361 }, + /*II_DE_07*/{ 0xee, 1368 }, + /*II_DE_C0*/{ 0xf9, 1549 }, + /*II_DE_C1*/{ 0xeb, 1549 }, + /*II_DE_C0*/{ 0xf9, 1549 }, + /*II_DE_C0*/{ 0xf9, 1549 }, + /*II_DE_C0*/{ 0xf9, 1549 }, + /*II_DE_C0*/{ 0xf9, 1549 }, + /*II_DE_C0*/{ 0xf9, 1549 }, + /*II_DE_C0*/{ 0xf9, 1549 }, + /*II_DE_C8*/{ 0xf9, 1556 }, + /*II_DE_C9*/{ 0xeb, 1556 }, + /*II_DE_C8*/{ 0xf9, 1556 }, + /*II_DE_C8*/{ 0xf9, 1556 }, + /*II_DE_C8*/{ 0xf9, 1556 }, + /*II_DE_C8*/{ 0xf9, 1556 }, + /*II_DE_C8*/{ 0xf9, 1556 }, + /*II_DE_C8*/{ 0xf9, 1556 }, + /*II_DE_D9*/{ 0xeb, 1563 }, + /*II_DE_E0*/{ 0xf9, 1571 }, + /*II_DE_E1*/{ 0xeb, 1571 }, + /*II_DE_E0*/{ 0xf9, 1571 }, + /*II_DE_E0*/{ 0xf9, 1571 }, + /*II_DE_E0*/{ 0xf9, 1571 }, + /*II_DE_E0*/{ 0xf9, 1571 }, + /*II_DE_E0*/{ 0xf9, 1571 }, + /*II_DE_E0*/{ 0xf9, 1571 }, + /*II_DE_E8*/{ 0xf9, 1579 }, + /*II_DE_E9*/{ 0xeb, 1579 }, + /*II_DE_E8*/{ 0xf9, 1579 }, + /*II_DE_E8*/{ 0xf9, 1579 }, + /*II_DE_E8*/{ 0xf9, 1579 }, + /*II_DE_E8*/{ 0xf9, 1579 }, + /*II_DE_E8*/{ 0xf9, 1579 }, + /*II_DE_E8*/{ 0xf9, 1579 }, + /*II_DE_F0*/{ 0xf9, 1586 }, + /*II_DE_F1*/{ 0xeb, 1586 }, + /*II_DE_F0*/{ 0xf9, 1586 }, + /*II_DE_F0*/{ 0xf9, 1586 }, + /*II_DE_F0*/{ 0xf9, 1586 }, + /*II_DE_F0*/{ 0xf9, 1586 }, + /*II_DE_F0*/{ 0xf9, 1586 }, + /*II_DE_F0*/{ 0xf9, 1586 }, + /*II_DE_F8*/{ 0xf9, 1594 }, + /*II_DE_F9*/{ 0xeb, 1594 }, + /*II_DE_F8*/{ 0xf9, 1594 }, + /*II_DE_F8*/{ 0xf9, 1594 }, + /*II_DE_F8*/{ 0xf9, 1594 }, + /*II_DE_F8*/{ 0xf9, 1594 }, + /*II_DE_F8*/{ 0xf9, 1594 }, + /*II_DE_F8*/{ 0xf9, 1594 }, + /*II_DF_00*/{ 0xee, 1418 }, + /*II_DF_01*/{ 0xfc, 1424 }, + /*II_DF_02*/{ 0xfd, 1432 }, + /*II_DF_03*/{ 0xfd, 1438 }, + /*II_DF_04*/{ 0xf4, 1601 }, + /*II_DF_05*/{ 0xf8, 1418 }, + /*II_DF_06*/{ 0xf5, 1607 }, + /*II_DF_07*/{ 0xfb, 1438 }, + /*II_DF_E8*/{ 0xf6, 1614 }, + /*II_DF_E8*/{ 0xf6, 1614 }, + /*II_DF_E8*/{ 0xf6, 1614 }, + /*II_DF_E8*/{ 0xf6, 1614 }, + /*II_DF_E8*/{ 0xf6, 1614 }, + /*II_DF_E8*/{ 0xf6, 1614 }, + /*II_DF_E8*/{ 0xf6, 1614 }, + /*II_DF_E8*/{ 0xf6, 1614 }, + /*II_DF_F0*/{ 0xf6, 1623 }, + /*II_DF_F0*/{ 0xf6, 1623 }, + /*II_DF_F0*/{ 0xf6, 1623 }, + /*II_DF_F0*/{ 0xf6, 1623 }, + /*II_DF_F0*/{ 0xf6, 1623 }, + /*II_DF_F0*/{ 0xf6, 1623 }, + /*II_DF_F0*/{ 0xf6, 1623 }, + /*II_DF_F0*/{ 0xf6, 1623 }, + /*II_F6_00*/{ 0xfe, 206 }, + /*II_F6_02*/{ 0xff, 1631 }, + /*II_F6_03*/{ 0x100, 1636 }, + /*II_F6_04*/{ 0x101, 1641 }, + /*II_F6_05*/{ 0x101, 117 }, + /*II_F6_06*/{ 0x102, 1646 }, + /*II_F6_07*/{ 0x102, 1651 }, + /*II_F7_00*/{ 0x103, 206 }, + /*II_F7_02*/{ 0x104, 1631 }, + /*II_F7_03*/{ 0x105, 1636 }, + /*II_F7_04*/{ 0x106, 1641 }, + /*II_F7_05*/{ 0x106, 117 }, + /*II_F7_06*/{ 0x107, 1646 }, + /*II_F7_07*/{ 0x107, 1651 }, + /*II_FE_00*/{ 0x108, 81 }, + /*II_FE_01*/{ 0x108, 86 }, + /*II_FF_00*/{ 0x109, 81 }, + /*II_FF_01*/{ 0x109, 86 }, + /*II_FF_02*/{ 0x10a, 456 }, + /*II_FF_03*/{ 0x10b, 260 }, + /*II_FF_04*/{ 0x10c, 462 }, + /*II_FF_05*/{ 0x10d, 467 }, + /*II_FF_06*/{ 0x10e, 16 }, + /*II_0F_00_00*/{ 0x10f, 1657 }, + /*II_0F_00_01*/{ 0x110, 1663 }, + /*II_0F_00_02*/{ 0x110, 34436 }, + /*II_0F_00_03*/{ 0x111, 34442 }, + /*II_0F_00_04*/{ 0x112, 1679 }, + /*II_0F_00_05*/{ 0x112, 1685 }, + /*II_0F_01_00*/{ 0x113, 1691 }, + /*II_0F_01_01*/{ 0x113, 1697 }, + /*II_0F_01_02*/{ 0x113, 34471 }, + /*II_0F_01_03*/{ 0x113, 34477 }, + /*II_0F_01_04*/{ 0x114, 1715 }, + /*II_0F_01_06*/{ 0x115, 34489 }, + /*II_0F_01_07*/{ 0x116, 34495 }, + /*II_0F_01_C1*/{ 0x117, 1735 }, + /*II_0F_01_C2*/{ 0x117, 1743 }, + /*II_0F_01_C3*/{ 0x117, 1753 }, + /*II_0F_01_C4*/{ 0x117, 1763 }, + /*II_0F_01_C8*/{ 0x118, 1771 }, + /*II_0F_01_C9*/{ 0x118, 1780 }, + /*II_0F_01_D0*/{ 0x88, 1787 }, + /*II_0F_01_D1*/{ 0x88, 1795 }, + /*II_0F_01_D4*/{ 0x117, 1803 }, + /*II_0F_01_D5*/{ 0x119, 1811 }, + /*II_0F_01_D8*/{ 0x11a, 1817 }, + /*II_0F_01_D9*/{ 0x11b, 1824 }, + /*II_0F_01_DA*/{ 0x11c, 1833 }, + /*II_0F_01_DB*/{ 0x11c, 1841 }, + /*II_0F_01_DC*/{ 0x11b, 1849 }, + /*II_0F_01_DD*/{ 0x11b, 1855 }, + /*II_0F_01_DE*/{ 0x11c, 1861 }, + /*II_0F_01_DF*/{ 0x11d, 1869 }, + /*II_0F_01_F8*/{ 0x11e, 1878 }, + /*II_0F_01_F9*/{ 0x11e, 1886 }, + /*II_0F_0D_00*/{ 0x11f, 1894 }, + /*II_0F_0D_01*/{ 0x11f, 1904 }, + /*II_0F_0F_0C*/{ 0x120, 1915 }, + /*II_0F_0F_0D*/{ 0x121, 1922 }, + /*II_0F_0F_1C*/{ 0x120, 1929 }, + /*II_0F_0F_1D*/{ 0x121, 1936 }, + /*II_0F_0F_8A*/{ 0x120, 1943 }, + /*II_0F_0F_8E*/{ 0x120, 1951 }, + /*II_0F_0F_90*/{ 0x121, 1960 }, + /*II_0F_0F_94*/{ 0x121, 1969 }, + /*II_0F_0F_96*/{ 0x121, 1976 }, + /*II_0F_0F_97*/{ 0x121, 1983 }, + /*II_0F_0F_9A*/{ 0x121, 1992 }, + /*II_0F_0F_9E*/{ 0x121, 1999 }, + /*II_0F_0F_A0*/{ 0x121, 2006 }, + /*II_0F_0F_A4*/{ 0x121, 2015 }, + /*II_0F_0F_A6*/{ 0x121, 2022 }, + /*II_0F_0F_A7*/{ 0x121, 2032 }, + /*II_0F_0F_AA*/{ 0x121, 2042 }, + /*II_0F_0F_AE*/{ 0x121, 2050 }, + /*II_0F_0F_B0*/{ 0x121, 2057 }, + /*II_0F_0F_B4*/{ 0x121, 2066 }, + /*II_0F_0F_B6*/{ 0x121, 2073 }, + /*II_0F_0F_B7*/{ 0x121, 2083 }, + /*II_0F_0F_BB*/{ 0x120, 2092 }, + /*II_0F_0F_BF*/{ 0x121, 2100 }, + /*II_0F_10*/{ 0x122, 2109 }, + /*II_66_0F_10*/{ 0x123, 2117 }, + /*II_F3_0F_10*/{ 0x124, 2125 }, + /*II_F2_0F_10*/{ 0x125, 2132 }, + /*II_0F_11*/{ 0x12a, 2109 }, + /*II_66_0F_11*/{ 0x12b, 2117 }, + /*II_F3_0F_11*/{ 0x12c, 2125 }, + /*II_F2_0F_11*/{ 0x12d, 2132 }, + /*II_66_0F_12*/{ 0x132, 2190 }, + /*II_F3_0F_12*/{ 0x133, 2198 }, + /*II_F2_0F_12*/{ 0x133, 2208 }, + /*II_0F_13*/{ 0x137, 2182 }, + /*II_66_0F_13*/{ 0x138, 2190 }, + /*II_0F_14*/{ 0x13a, 2266 }, + /*II_66_0F_14*/{ 0x13b, 2276 }, + /*II_0F_15*/{ 0x13a, 2308 }, + /*II_66_0F_15*/{ 0x13b, 2318 }, + /*II_66_0F_16*/{ 0x132, 2367 }, + /*II_F3_0F_16*/{ 0x13d, 2375 }, + /*II_0F_17*/{ 0x137, 2359 }, + /*II_66_0F_17*/{ 0x138, 2367 }, + /*II_0F_18_00*/{ 0x13e, 2424 }, + /*II_0F_18_01*/{ 0x13e, 2437 }, + /*II_0F_18_02*/{ 0x13e, 2449 }, + /*II_0F_18_03*/{ 0x13e, 2461 }, + /*II_0F_28*/{ 0x122, 2473 }, + /*II_66_0F_28*/{ 0x123, 2481 }, + /*II_0F_29*/{ 0x12a, 2473 }, + /*II_66_0F_29*/{ 0x12b, 2481 }, + /*II_0F_2A*/{ 0x13f, 2507 }, + /*II_66_0F_2A*/{ 0x140, 2517 }, + /*II_F3_0F_2A*/{ 0x141, 2527 }, + /*II_F2_0F_2A*/{ 0x142, 2537 }, + /*II_0F_2B*/{ 0x143, 2569 }, + /*II_66_0F_2B*/{ 0x144, 2578 }, + /*II_F3_0F_2B*/{ 0x145, 2587 }, + /*II_F2_0F_2B*/{ 0x146, 2596 }, + /*II_0F_2C*/{ 0x148, 2625 }, + /*II_66_0F_2C*/{ 0x149, 2636 }, + /*II_F3_0F_2C*/{ 0x14a, 2647 }, + /*II_F2_0F_2C*/{ 0x14b, 2658 }, + /*II_0F_2D*/{ 0x148, 2693 }, + /*II_66_0F_2D*/{ 0x13b, 2703 }, + /*II_F3_0F_2D*/{ 0x14a, 2713 }, + /*II_F2_0F_2D*/{ 0x14b, 2723 }, + /*II_0F_2E*/{ 0x14d, 2755 }, + /*II_66_0F_2E*/{ 0x14e, 2764 }, + /*II_0F_2F*/{ 0x14d, 2793 }, + /*II_66_0F_2F*/{ 0x14e, 2801 }, + /*II_0F_50*/{ 0x151, 2827 }, + /*II_66_0F_50*/{ 0x152, 2837 }, + /*II_0F_51*/{ 0x13a, 2869 }, + /*II_66_0F_51*/{ 0x13b, 2877 }, + /*II_F3_0F_51*/{ 0x154, 2885 }, + /*II_F2_0F_51*/{ 0x14e, 2893 }, + /*II_0F_52*/{ 0x13a, 2937 }, + /*II_F3_0F_52*/{ 0x154, 2946 }, + /*II_0F_53*/{ 0x13a, 2975 }, + /*II_F3_0F_53*/{ 0x154, 2982 }, + /*II_0F_54*/{ 0x13a, 3005 }, + /*II_66_0F_54*/{ 0x13b, 3012 }, + /*II_0F_55*/{ 0x13a, 3035 }, + /*II_66_0F_55*/{ 0x13b, 3043 }, + /*II_0F_56*/{ 0x13a, 3069 }, + /*II_66_0F_56*/{ 0x13b, 3075 }, + /*II_0F_57*/{ 0x13a, 3095 }, + /*II_66_0F_57*/{ 0x13b, 3102 }, + /*II_0F_58*/{ 0x13a, 3125 }, + /*II_66_0F_58*/{ 0x13b, 3132 }, + /*II_F3_0F_58*/{ 0x154, 3139 }, + /*II_F2_0F_58*/{ 0x14e, 3146 }, + /*II_0F_59*/{ 0x13a, 3185 }, + /*II_66_0F_59*/{ 0x13b, 3192 }, + /*II_F3_0F_59*/{ 0x154, 3199 }, + /*II_F2_0F_59*/{ 0x14e, 3206 }, + /*II_0F_5A*/{ 0x14e, 3245 }, + /*II_66_0F_5A*/{ 0x13b, 3255 }, + /*II_F3_0F_5A*/{ 0x155, 3265 }, + /*II_F2_0F_5A*/{ 0x14e, 3275 }, + /*II_0F_5B*/{ 0x13b, 3329 }, + /*II_66_0F_5B*/{ 0x13b, 3339 }, + /*II_F3_0F_5B*/{ 0x13b, 3349 }, + /*II_0F_5C*/{ 0x13a, 3394 }, + /*II_66_0F_5C*/{ 0x13b, 3401 }, + /*II_F3_0F_5C*/{ 0x154, 3408 }, + /*II_F2_0F_5C*/{ 0x14e, 3415 }, + /*II_0F_5D*/{ 0x13a, 3454 }, + /*II_66_0F_5D*/{ 0x13b, 3461 }, + /*II_F3_0F_5D*/{ 0x154, 3468 }, + /*II_F2_0F_5D*/{ 0x14e, 3475 }, + /*II_0F_5E*/{ 0x13a, 3514 }, + /*II_66_0F_5E*/{ 0x13b, 3521 }, + /*II_F3_0F_5E*/{ 0x154, 3528 }, + /*II_F2_0F_5E*/{ 0x14e, 3535 }, + /*II_0F_5F*/{ 0x13a, 3574 }, + /*II_66_0F_5F*/{ 0x13b, 3581 }, + /*II_F3_0F_5F*/{ 0x154, 3588 }, + /*II_F2_0F_5F*/{ 0x14e, 3595 }, + /*II_0F_60*/{ 0x158, 3634 }, + /*II_66_0F_60*/{ 0x13b, 3634 }, + /*II_0F_61*/{ 0x158, 3657 }, + /*II_66_0F_61*/{ 0x13b, 3657 }, + /*II_0F_62*/{ 0x158, 3680 }, + /*II_66_0F_62*/{ 0x13b, 3680 }, + /*II_0F_63*/{ 0x159, 3703 }, + /*II_66_0F_63*/{ 0x13b, 3703 }, + /*II_0F_64*/{ 0x159, 3724 }, + /*II_66_0F_64*/{ 0x13b, 3724 }, + /*II_0F_65*/{ 0x159, 3743 }, + /*II_66_0F_65*/{ 0x13b, 3743 }, + /*II_0F_66*/{ 0x159, 3762 }, + /*II_66_0F_66*/{ 0x13b, 3762 }, + /*II_0F_67*/{ 0x159, 3781 }, + /*II_66_0F_67*/{ 0x13b, 3781 }, + /*II_0F_68*/{ 0x159, 3802 }, + /*II_66_0F_68*/{ 0x13b, 3802 }, + /*II_0F_69*/{ 0x159, 3825 }, + /*II_66_0F_69*/{ 0x13b, 3825 }, + /*II_0F_6A*/{ 0x159, 3848 }, + /*II_66_0F_6A*/{ 0x13b, 3848 }, + /*II_0F_6B*/{ 0x159, 3871 }, + /*II_66_0F_6B*/{ 0x13b, 3871 }, + /*II_66_0F_6C*/{ 0x13b, 3892 }, + /*II_66_0F_6D*/{ 0x13b, 3917 }, + /*II_0F_6F*/{ 0x15d, 3948 }, + /*II_66_0F_6F*/{ 0x123, 3968 }, + /*II_F3_0F_6F*/{ 0x123, 3976 }, + /*II_0F_74*/{ 0x159, 4065 }, + /*II_66_0F_74*/{ 0x13b, 4065 }, + /*II_0F_75*/{ 0x159, 4084 }, + /*II_66_0F_75*/{ 0x13b, 4084 }, + /*II_0F_76*/{ 0x159, 4103 }, + /*II_66_0F_76*/{ 0x13b, 4103 }, + /*II_0F_77*/{ 0x161, 4122 }, + /*II_0F_78*/{ 0x163, 4150 }, + /*II_0F_79*/{ 0x166, 4174 }, + /*II_66_0F_79*/{ 0x167, 4158 }, + /*II_F2_0F_79*/{ 0x168, 4165 }, + /*II_0F_7A_30*/{ 0x169, 4183 }, + /*II_0F_7A_31*/{ 0x16a, 4193 }, + /*II_66_0F_7C*/{ 0x16b, 4203 }, + /*II_F2_0F_7C*/{ 0x16b, 4211 }, + /*II_66_0F_7D*/{ 0x16b, 4237 }, + /*II_F2_0F_7D*/{ 0x16b, 4245 }, + /*II_F3_0F_7E*/{ 0x125, 3948 }, + /*II_0F_7F*/{ 0x16f, 3948 }, + /*II_66_0F_7F*/{ 0x12b, 3968 }, + /*II_F3_0F_7F*/{ 0x12b, 3976 }, + /*II_F3_0F_B8*/{ 0x173, 4360 }, + /*II_0F_BA_04*/{ 0x174, 872 }, + /*II_0F_BA_05*/{ 0x175, 887 }, + /*II_0F_BA_06*/{ 0x175, 912 }, + /*II_0F_BA_07*/{ 0x175, 934 }, + /*II_0F_BC*/{ 0x176, 4368 }, + /*II_F3_0F_BC*/{ 0x177, 4373 }, + /*II_0F_BD*/{ 0x176, 4380 }, + /*II_F3_0F_BD*/{ 0x178, 4385 }, + /*II_0F_C7_07*/{ 0x188, 6407 }, + /*II_66_0F_D0*/{ 0x16b, 6416 }, + /*II_F2_0F_D0*/{ 0x16b, 6426 }, + /*II_0F_D1*/{ 0x159, 6458 }, + /*II_66_0F_D1*/{ 0x13b, 6458 }, + /*II_0F_D2*/{ 0x159, 6473 }, + /*II_66_0F_D2*/{ 0x13b, 6473 }, + /*II_0F_D3*/{ 0x159, 6488 }, + /*II_66_0F_D3*/{ 0x13b, 6488 }, + /*II_0F_D4*/{ 0x14e, 6503 }, + /*II_66_0F_D4*/{ 0x13b, 6503 }, + /*II_0F_D5*/{ 0x159, 6518 }, + /*II_66_0F_D5*/{ 0x13b, 6518 }, + /*II_66_0F_D6*/{ 0x12d, 3948 }, + /*II_F3_0F_D6*/{ 0x189, 6535 }, + /*II_F2_0F_D6*/{ 0x18a, 6544 }, + /*II_0F_D7*/{ 0x18c, 6553 }, + /*II_66_0F_D7*/{ 0x18d, 6553 }, + /*II_0F_D8*/{ 0x159, 6574 }, + /*II_66_0F_D8*/{ 0x13b, 6574 }, + /*II_0F_D9*/{ 0x159, 6593 }, + /*II_66_0F_D9*/{ 0x13b, 6593 }, + /*II_0F_DA*/{ 0x18f, 6612 }, + /*II_66_0F_DA*/{ 0x13b, 6612 }, + /*II_0F_DB*/{ 0x159, 6629 }, + /*II_66_0F_DB*/{ 0x13b, 6629 }, + /*II_0F_DC*/{ 0x159, 6642 }, + /*II_66_0F_DC*/{ 0x13b, 6642 }, + /*II_0F_DD*/{ 0x159, 6661 }, + /*II_66_0F_DD*/{ 0x13b, 6661 }, + /*II_0F_DE*/{ 0x18f, 6670 }, + /*II_66_0F_DE*/{ 0x13b, 6670 }, + /*II_0F_DF*/{ 0x159, 6687 }, + /*II_66_0F_DF*/{ 0x13b, 6687 }, + /*II_0F_E0*/{ 0x18f, 6702 }, + /*II_66_0F_E0*/{ 0x13b, 6702 }, + /*II_0F_E1*/{ 0x159, 6717 }, + /*II_66_0F_E1*/{ 0x13b, 6717 }, + /*II_0F_E2*/{ 0x159, 6732 }, + /*II_66_0F_E2*/{ 0x13b, 6732 }, + /*II_0F_E3*/{ 0x18f, 6747 }, + /*II_66_0F_E3*/{ 0x13b, 6747 }, + /*II_0F_E4*/{ 0x18f, 6762 }, + /*II_66_0F_E4*/{ 0x13b, 6762 }, + /*II_0F_E5*/{ 0x159, 6781 }, + /*II_66_0F_E5*/{ 0x13b, 6781 }, + /*II_66_0F_E6*/{ 0x13b, 6798 }, + /*II_F3_0F_E6*/{ 0x14e, 6809 }, + /*II_F2_0F_E6*/{ 0x13b, 6819 }, + /*II_0F_E7*/{ 0x190, 6863 }, + /*II_66_0F_E7*/{ 0x144, 6871 }, + /*II_0F_E8*/{ 0x159, 6890 }, + /*II_66_0F_E8*/{ 0x13b, 6890 }, + /*II_0F_E9*/{ 0x159, 6907 }, + /*II_66_0F_E9*/{ 0x13b, 6907 }, + /*II_0F_EA*/{ 0x18f, 6924 }, + /*II_66_0F_EA*/{ 0x13b, 6924 }, + /*II_0F_EB*/{ 0x159, 6941 }, + /*II_66_0F_EB*/{ 0x13b, 6941 }, + /*II_0F_EC*/{ 0x159, 6952 }, + /*II_66_0F_EC*/{ 0x13b, 6952 }, + /*II_0F_ED*/{ 0x159, 6969 }, + /*II_66_0F_ED*/{ 0x13b, 6969 }, + /*II_0F_EE*/{ 0x18f, 6986 }, + /*II_66_0F_EE*/{ 0x13b, 6986 }, + /*II_0F_EF*/{ 0x159, 7003 }, + /*II_66_0F_EF*/{ 0x13b, 7003 }, + /*II_F2_0F_F0*/{ 0x191, 7016 }, + /*II_0F_F1*/{ 0x159, 7031 }, + /*II_66_0F_F1*/{ 0x13b, 7031 }, + /*II_0F_F2*/{ 0x159, 7046 }, + /*II_66_0F_F2*/{ 0x13b, 7046 }, + /*II_0F_F3*/{ 0x159, 7061 }, + /*II_66_0F_F3*/{ 0x13b, 7061 }, + /*II_0F_F4*/{ 0x193, 7076 }, + /*II_66_0F_F4*/{ 0x13b, 7076 }, + /*II_0F_F5*/{ 0x159, 7095 }, + /*II_66_0F_F5*/{ 0x13b, 7095 }, + /*II_0F_F6*/{ 0x18f, 7114 }, + /*II_66_0F_F6*/{ 0x13b, 7114 }, + /*II_0F_F7*/{ 0x194, 7131 }, + /*II_66_0F_F7*/{ 0x195, 7141 }, + /*II_0F_F8*/{ 0x159, 7166 }, + /*II_66_0F_F8*/{ 0x13b, 7166 }, + /*II_0F_F9*/{ 0x159, 7181 }, + /*II_66_0F_F9*/{ 0x13b, 7181 }, + /*II_0F_FA*/{ 0x159, 7196 }, + /*II_66_0F_FA*/{ 0x13b, 7196 }, + /*II_0F_FB*/{ 0x193, 7211 }, + /*II_66_0F_FB*/{ 0x13b, 7211 }, + /*II_0F_FC*/{ 0x159, 7226 }, + /*II_66_0F_FC*/{ 0x13b, 7226 }, + /*II_0F_FD*/{ 0x159, 7241 }, + /*II_66_0F_FD*/{ 0x13b, 7241 }, + /*II_0F_FE*/{ 0x159, 7256 }, + /*II_66_0F_FE*/{ 0x13b, 7256 }, + /*II_D9_06*/{ 0x197, 7271 }, + /*II_9B_D9_06*/{ 0x198, 7280 }, + /*II_D9_07*/{ 0xfd, 7288 }, + /*II_9B_D9_07*/{ 0x199, 7296 }, + /*II_DB_E2*/{ 0xeb, 7303 }, + /*II_9B_DB_E2*/{ 0x19a, 7311 }, + /*II_DB_E3*/{ 0xeb, 7318 }, + /*II_9B_DB_E3*/{ 0x19a, 7326 }, + /*II_DD_06*/{ 0x197, 7333 }, + /*II_9B_DD_06*/{ 0x198, 7341 }, + /*II_DD_07*/{ 0xfd, 7348 }, + /*II_9B_DD_07*/{ 0x199, 7356 }, + /*II_DF_E0*/{ 0x19b, 7348 }, + /*II_9B_DF_E0*/{ 0x19c, 7356 }, + /*II_0F_38_00*/{ 0x19d, 7363 }, + /*II_66_0F_38_00*/{ 0x19e, 7363 }, + /*II_0F_38_01*/{ 0x19d, 7380 }, + /*II_66_0F_38_01*/{ 0x19e, 7380 }, + /*II_0F_38_02*/{ 0x19d, 7397 }, + /*II_66_0F_38_02*/{ 0x19e, 7397 }, + /*II_0F_38_03*/{ 0x19d, 7414 }, + /*II_66_0F_38_03*/{ 0x19e, 7414 }, + /*II_0F_38_04*/{ 0x19d, 7433 }, + /*II_66_0F_38_04*/{ 0x19e, 7433 }, + /*II_0F_38_05*/{ 0x19d, 7456 }, + /*II_66_0F_38_05*/{ 0x19e, 7456 }, + /*II_0F_38_06*/{ 0x19d, 7473 }, + /*II_66_0F_38_06*/{ 0x19e, 7473 }, + /*II_0F_38_07*/{ 0x19d, 7490 }, + /*II_66_0F_38_07*/{ 0x19e, 7490 }, + /*II_0F_38_08*/{ 0x19d, 7509 }, + /*II_66_0F_38_08*/{ 0x19e, 7509 }, + /*II_0F_38_09*/{ 0x19d, 7526 }, + /*II_66_0F_38_09*/{ 0x19e, 7526 }, + /*II_0F_38_0A*/{ 0x19d, 7543 }, + /*II_66_0F_38_0A*/{ 0x19e, 7543 }, + /*II_0F_38_0B*/{ 0x19d, 7560 }, + /*II_66_0F_38_0B*/{ 0x19e, 7560 }, + /*II_66_0F_38_17*/{ 0x1a0, 7651 }, + /*II_0F_38_1C*/{ 0x19d, 7710 }, + /*II_66_0F_38_1C*/{ 0x19e, 7710 }, + /*II_0F_38_1D*/{ 0x19d, 7725 }, + /*II_66_0F_38_1D*/{ 0x19e, 7725 }, + /*II_0F_38_1E*/{ 0x19d, 7740 }, + /*II_66_0F_38_1E*/{ 0x19e, 7740 }, + /*II_66_0F_38_20*/{ 0x1a5, 7755 }, + /*II_66_0F_38_21*/{ 0x1a6, 7776 }, + /*II_66_0F_38_22*/{ 0x1a7, 7797 }, + /*II_66_0F_38_23*/{ 0x1a5, 7818 }, + /*II_66_0F_38_24*/{ 0x1a6, 7839 }, + /*II_66_0F_38_25*/{ 0x1a5, 7860 }, + /*II_66_0F_38_28*/{ 0x1a9, 7881 }, + /*II_66_0F_38_29*/{ 0x1a9, 7898 }, + /*II_66_0F_38_2A*/{ 0x1aa, 7917 }, + /*II_66_0F_38_2B*/{ 0x1a9, 7938 }, + /*II_66_0F_38_30*/{ 0x1a5, 7983 }, + /*II_66_0F_38_31*/{ 0x1a6, 8004 }, + /*II_66_0F_38_32*/{ 0x1a7, 8025 }, + /*II_66_0F_38_33*/{ 0x1a5, 8046 }, + /*II_66_0F_38_34*/{ 0x1a6, 8067 }, + /*II_66_0F_38_35*/{ 0x1a5, 8088 }, + /*II_66_0F_38_37*/{ 0x1a0, 8109 }, + /*II_66_0F_38_38*/{ 0x1a9, 8128 }, + /*II_66_0F_38_39*/{ 0x1a9, 8145 }, + /*II_66_0F_38_3A*/{ 0x1a9, 8162 }, + /*II_66_0F_38_3B*/{ 0x1a9, 8179 }, + /*II_66_0F_38_3C*/{ 0x1a9, 8196 }, + /*II_66_0F_38_3D*/{ 0x1a9, 8213 }, + /*II_66_0F_38_3E*/{ 0x1a9, 8230 }, + /*II_66_0F_38_3F*/{ 0x1a9, 8247 }, + /*II_66_0F_38_40*/{ 0x1a9, 8264 }, + /*II_66_0F_38_41*/{ 0x1a9, 8281 }, + /*II_66_0F_38_80*/{ 0x1ad, 8306 }, + /*II_66_0F_38_81*/{ 0x1ad, 8314 }, + /*II_66_0F_38_82*/{ 0x1ad, 8323 }, + /*II_66_0F_38_DB*/{ 0x1b0, 9172 }, + /*II_66_0F_38_DC*/{ 0x1b0, 9189 }, + /*II_66_0F_38_DD*/{ 0x1b0, 9206 }, + /*II_66_0F_38_DE*/{ 0x1b0, 9231 }, + /*II_66_0F_38_DF*/{ 0x1b0, 9248 }, + /*II_0F_38_F0*/{ 0x1b3, 9273 }, + /*II_F2_0F_38_F0*/{ 0x1b4, 9280 }, + /*II_0F_38_F1*/{ 0x1b5, 9273 }, + /*II_F2_0F_38_F1*/{ 0x1b6, 9280 }, + /*II_0F_71_02*/{ 0x1cd, 6458 }, + /*II_66_0F_71_02*/{ 0x1ce, 6458 }, + /*II_0F_71_04*/{ 0x1cd, 6717 }, + /*II_66_0F_71_04*/{ 0x1ce, 6717 }, + /*II_0F_71_06*/{ 0x1cd, 7031 }, + /*II_66_0F_71_06*/{ 0x1ce, 7031 }, + /*II_0F_72_02*/{ 0x1cd, 6473 }, + /*II_66_0F_72_02*/{ 0x1ce, 6473 }, + /*II_0F_72_04*/{ 0x1cd, 6732 }, + /*II_66_0F_72_04*/{ 0x1ce, 6732 }, + /*II_0F_72_06*/{ 0x1cd, 7046 }, + /*II_66_0F_72_06*/{ 0x1ce, 7046 }, + /*II_0F_73_02*/{ 0x1cd, 6488 }, + /*II_66_0F_73_02*/{ 0x1ce, 6488 }, + /*II_66_0F_73_03*/{ 0x1ce, 9852 }, + /*II_0F_73_06*/{ 0x1cd, 7061 }, + /*II_66_0F_73_06*/{ 0x1ce, 7061 }, + /*II_66_0F_73_07*/{ 0x1ce, 9869 }, + /*II_F3_0F_AE_00*/{ 0x1d0, 9904 }, + /*II_F3_0F_AE_01*/{ 0x1d0, 9934 }, + /*II_0F_AE_02*/{ 0x116, 9944 }, + /*II_F3_0F_AE_02*/{ 0x1d0, 9953 }, + /*II_0F_AE_03*/{ 0x116, 9973 }, + /*II_F3_0F_AE_03*/{ 0x1d0, 9982 }, + /*II_0F_C7_06*/{ 0x1d2, 10002 }, + /*II_66_0F_C7_06*/{ 0x188, 10011 }, + /*II_F3_0F_C7_06*/{ 0x188, 10020 } +}; + +_InstInfoEx InstInfosEx[381] = { + /*II_69*/{ { 0x34, 117 }, 0x0, 3, 0, 0, 0 }, + /*II_6B*/{ { 0x34, 117 }, 0x0, 5, 0, 0, 0 }, + /*II_98*/{ { 0x4e, 228 }, 0x0, 0, 0, 233, 239 }, + /*II_99*/{ { 0x4e, 245 }, 0x0, 0, 0, 250, 255 }, + /*II_E3*/{ { 0x76, 427 }, 0x0, 0, 0, 433, 440 }, + /*II_0F_A4*/{ { 0xac, 876 }, 0x0, 1, 0, 0, 0 }, + /*II_0F_A5*/{ { 0xac, 876 }, 0x0, 52, 0, 0, 0 }, + /*II_0F_AC*/{ { 0xac, 892 }, 0x0, 1, 0, 0, 0 }, + /*II_0F_AD*/{ { 0xac, 892 }, 0x0, 52, 0, 0, 0 }, + /*II_V_0F_10*/{ { 0x126, 2139 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_10*/{ { 0x126, 2148 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_10*/{ { 0x127, 2157 }, 0x20, 69, 0, 0, 0 }, + /*II_V_F2_0F_10*/{ { 0x127, 2165 }, 0x20, 69, 0, 0, 0 }, + /*II_VRR_F3_0F_10*/{ { 0x128, 2157 }, 0x60, 0, 0, 0, 0 }, + /*II_VRR_F2_0F_10*/{ { 0x129, 2165 }, 0x60, 0, 0, 0, 0 }, + /*II_V_0F_11*/{ { 0x12e, 2139 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_11*/{ { 0x12e, 2148 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_11*/{ { 0x127, 2157 }, 0x20, 69, 0, 0, 0 }, + /*II_V_F2_0F_11*/{ { 0x127, 2165 }, 0x20, 69, 0, 0, 0 }, + /*II_VRR_F3_0F_11*/{ { 0x12f, 2157 }, 0x60, 0, 0, 0, 0 }, + /*II_VRR_F2_0F_11*/{ { 0x130, 2165 }, 0x60, 0, 0, 0, 0 }, + /*II_0F_12*/{ { 0x131, 2173 }, 0x0, 0, 0, 2182, 0 }, + /*II_V_0F_12*/{ { 0x134, 2217 }, 0x0, 72, 0, 2227, 0 }, + /*II_V_66_0F_12*/{ { 0x135, 2236 }, 0x0, 46, 0, 0, 0 }, + /*II_V_F3_0F_12*/{ { 0x126, 2245 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F2_0F_12*/{ { 0x136, 2256 }, 0x41, 0, 0, 0, 0 }, + /*II_V_0F_13*/{ { 0x139, 2227 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_13*/{ { 0x139, 2236 }, 0x40, 0, 0, 0, 0 }, + /*II_V_0F_14*/{ { 0x13c, 2286 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_14*/{ { 0x13c, 2297 }, 0x1, 90, 0, 0, 0 }, + /*II_V_0F_15*/{ { 0x13c, 2328 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_15*/{ { 0x13c, 2339 }, 0x1, 90, 0, 0, 0 }, + /*II_0F_16*/{ { 0x131, 2350 }, 0x0, 0, 0, 2359, 0 }, + /*II_V_0F_16*/{ { 0x134, 2385 }, 0x0, 72, 0, 2395, 0 }, + /*II_V_66_0F_16*/{ { 0x135, 2404 }, 0x0, 46, 0, 0, 0 }, + /*II_V_F3_0F_16*/{ { 0x126, 2413 }, 0x41, 0, 0, 0, 0 }, + /*II_V_0F_17*/{ { 0x139, 2395 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_17*/{ { 0x139, 2404 }, 0x40, 0, 0, 0, 0 }, + /*II_V_0F_28*/{ { 0x126, 2489 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_28*/{ { 0x126, 2498 }, 0x41, 0, 0, 0, 0 }, + /*II_V_0F_29*/{ { 0x12e, 2489 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_29*/{ { 0x12e, 2498 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_2A*/{ { 0x135, 2547 }, 0x2, 79, 0, 0, 0 }, + /*II_V_F2_0F_2A*/{ { 0x135, 2558 }, 0x2, 79, 0, 0, 0 }, + /*II_V_0F_2B*/{ { 0x147, 2605 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_2B*/{ { 0x147, 2615 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_2C*/{ { 0x14c, 2669 }, 0x42, 0, 0, 0, 0 }, + /*II_V_F2_0F_2C*/{ { 0x14c, 2681 }, 0x42, 0, 0, 0, 0 }, + /*II_V_F3_0F_2D*/{ { 0x14c, 2733 }, 0x42, 0, 0, 0, 0 }, + /*II_V_F2_0F_2D*/{ { 0x14c, 2744 }, 0x42, 0, 0, 0, 0 }, + /*II_V_0F_2E*/{ { 0x14f, 2773 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_2E*/{ { 0x150, 2783 }, 0x40, 0, 0, 0, 0 }, + /*II_V_0F_2F*/{ { 0x14f, 2809 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_2F*/{ { 0x150, 2818 }, 0x40, 0, 0, 0, 0 }, + /*II_V_0F_50*/{ { 0x153, 2847 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_50*/{ { 0x153, 2858 }, 0x41, 0, 0, 0, 0 }, + /*II_V_0F_51*/{ { 0x126, 2901 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_51*/{ { 0x126, 2910 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_51*/{ { 0x135, 2919 }, 0x0, 71, 0, 0, 0 }, + /*II_V_F2_0F_51*/{ { 0x135, 2928 }, 0x0, 72, 0, 0, 0 }, + /*II_V_0F_52*/{ { 0x126, 2955 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_52*/{ { 0x135, 2965 }, 0x0, 71, 0, 0, 0 }, + /*II_V_0F_53*/{ { 0x126, 2989 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_53*/{ { 0x135, 2997 }, 0x0, 71, 0, 0, 0 }, + /*II_V_0F_54*/{ { 0x13c, 3019 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_54*/{ { 0x13c, 3027 }, 0x1, 90, 0, 0, 0 }, + /*II_V_0F_55*/{ { 0x13c, 3051 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_55*/{ { 0x13c, 3060 }, 0x1, 90, 0, 0, 0 }, + /*II_V_0F_56*/{ { 0x13c, 3081 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_56*/{ { 0x13c, 3088 }, 0x1, 90, 0, 0, 0 }, + /*II_V_0F_57*/{ { 0x13c, 3109 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_57*/{ { 0x13c, 3117 }, 0x1, 90, 0, 0, 0 }, + /*II_V_0F_58*/{ { 0x13c, 3153 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_58*/{ { 0x13c, 3161 }, 0x1, 90, 0, 0, 0 }, + /*II_V_F3_0F_58*/{ { 0x135, 3169 }, 0x0, 71, 0, 0, 0 }, + /*II_V_F2_0F_58*/{ { 0x135, 3177 }, 0x0, 72, 0, 0, 0 }, + /*II_V_0F_59*/{ { 0x13c, 3213 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_59*/{ { 0x13c, 3221 }, 0x1, 90, 0, 0, 0 }, + /*II_V_F3_0F_59*/{ { 0x135, 3229 }, 0x0, 71, 0, 0, 0 }, + /*II_V_F2_0F_59*/{ { 0x135, 3237 }, 0x0, 72, 0, 0, 0 }, + /*II_V_0F_5A*/{ { 0x156, 3285 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_5A*/{ { 0x157, 3296 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_5A*/{ { 0x135, 3307 }, 0x0, 71, 0, 0, 0 }, + /*II_V_F2_0F_5A*/{ { 0x135, 3318 }, 0x0, 72, 0, 0, 0 }, + /*II_V_0F_5B*/{ { 0x126, 3360 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_5B*/{ { 0x126, 3371 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_5B*/{ { 0x126, 3382 }, 0x41, 0, 0, 0, 0 }, + /*II_V_0F_5C*/{ { 0x13c, 3422 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_5C*/{ { 0x13c, 3430 }, 0x1, 90, 0, 0, 0 }, + /*II_V_F3_0F_5C*/{ { 0x135, 3438 }, 0x0, 71, 0, 0, 0 }, + /*II_V_F2_0F_5C*/{ { 0x135, 3446 }, 0x0, 72, 0, 0, 0 }, + /*II_V_0F_5D*/{ { 0x13c, 3482 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_5D*/{ { 0x13c, 3490 }, 0x1, 90, 0, 0, 0 }, + /*II_V_F3_0F_5D*/{ { 0x135, 3498 }, 0x0, 71, 0, 0, 0 }, + /*II_V_F2_0F_5D*/{ { 0x135, 3506 }, 0x0, 72, 0, 0, 0 }, + /*II_V_0F_5E*/{ { 0x13c, 3542 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_5E*/{ { 0x13c, 3550 }, 0x1, 90, 0, 0, 0 }, + /*II_V_F3_0F_5E*/{ { 0x135, 3558 }, 0x0, 71, 0, 0, 0 }, + /*II_V_F2_0F_5E*/{ { 0x135, 3566 }, 0x0, 72, 0, 0, 0 }, + /*II_V_0F_5F*/{ { 0x13c, 3602 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_5F*/{ { 0x13c, 3610 }, 0x1, 90, 0, 0, 0 }, + /*II_V_F3_0F_5F*/{ { 0x135, 3618 }, 0x0, 71, 0, 0, 0 }, + /*II_V_F2_0F_5F*/{ { 0x135, 3626 }, 0x0, 72, 0, 0, 0 }, + /*II_V_66_0F_60*/{ { 0x135, 3645 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_61*/{ { 0x135, 3668 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_62*/{ { 0x135, 3691 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_63*/{ { 0x135, 3713 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_64*/{ { 0x135, 3733 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_65*/{ { 0x135, 3752 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_66*/{ { 0x135, 3771 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_67*/{ { 0x135, 3791 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_68*/{ { 0x135, 3813 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_69*/{ { 0x135, 3836 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_6A*/{ { 0x135, 3859 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_6B*/{ { 0x135, 3881 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_6C*/{ { 0x135, 3904 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_6D*/{ { 0x135, 3929 }, 0x0, 73, 0, 0, 0 }, + /*II_0F_6E*/{ { 0x15a, 3942 }, 0x0, 0, 0, 0, 3948 }, + /*II_66_0F_6E*/{ { 0x15b, 3942 }, 0x0, 0, 0, 0, 3948 }, + /*II_V_66_0F_6E*/{ { 0x15c, 3954 }, 0x46, 0, 0, 3961, 0 }, + /*II_V_66_0F_6F*/{ { 0x126, 3984 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_6F*/{ { 0x126, 3993 }, 0x41, 0, 0, 0, 0 }, + /*II_0F_70*/{ { 0x15e, 4002 }, 0x0, 1, 0, 0, 0 }, + /*II_66_0F_70*/{ { 0x15f, 4010 }, 0x0, 1, 0, 0, 0 }, + /*II_F3_0F_70*/{ { 0x15f, 4018 }, 0x0, 1, 0, 0, 0 }, + /*II_F2_0F_70*/{ { 0x15f, 4027 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_70*/{ { 0x160, 4036 }, 0x40, 1, 0, 0, 0 }, + /*II_V_F3_0F_70*/{ { 0x160, 4045 }, 0x40, 1, 0, 0, 0 }, + /*II_V_F2_0F_70*/{ { 0x160, 4055 }, 0x40, 1, 0, 0, 0 }, + /*II_V_66_0F_74*/{ { 0x135, 4074 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_75*/{ { 0x135, 4093 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_76*/{ { 0x135, 4112 }, 0x0, 73, 0, 0, 0 }, + /*II_V_0F_77*/{ { 0x162, 4128 }, 0x49, 0, 0, 4140, 0 }, + /*II_66_0F_78*/{ { 0x164, 4158 }, 0x0, 8, 0, 0, 0 }, + /*II_F2_0F_78*/{ { 0x165, 4165 }, 0x0, 7, 8, 0, 0 }, + /*II_V_66_0F_7C*/{ { 0x13c, 4219 }, 0x1, 90, 0, 0, 0 }, + /*II_V_F2_0F_7C*/{ { 0x13c, 4228 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_7D*/{ { 0x13c, 4253 }, 0x1, 90, 0, 0, 0 }, + /*II_V_F2_0F_7D*/{ { 0x13c, 4262 }, 0x1, 90, 0, 0, 0 }, + /*II_0F_7E*/{ { 0x16c, 3942 }, 0x0, 0, 0, 0, 3948 }, + /*II_66_0F_7E*/{ { 0x16d, 3942 }, 0x0, 0, 0, 0, 3948 }, + /*II_V_66_0F_7E*/{ { 0x16e, 3954 }, 0x46, 0, 0, 3961, 0 }, + /*II_V_F3_0F_7E*/{ { 0x150, 3961 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_7F*/{ { 0x12e, 3984 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_7F*/{ { 0x12e, 3993 }, 0x41, 0, 0, 0, 0 }, + /*II_0F_AE_04*/{ { 0x170, 4271 }, 0x0, 0, 0, 0, 4278 }, + /*II_0F_AE_05*/{ { 0x171, 4287 }, 0x0, 0, 0, 4295, 4303 }, + /*II_0F_AE_06*/{ { 0x171, 4313 }, 0x0, 0, 0, 4321, 4331 }, + /*II_0F_AE_07*/{ { 0x172, 4343 }, 0x0, 0, 0, 4351, 0 }, + /*II_0F_C2*/{ { 0x179, 4392 }, 0x0, 0, 0, 4401, 4410 }, + /*II_66_0F_C2*/{ { 0x17a, 4471 }, 0x0, 0, 0, 4480, 4489 }, + /*II_F3_0F_C2*/{ { 0x17b, 4550 }, 0x0, 0, 0, 4559, 4568 }, + /*II_F2_0F_C2*/{ { 0x17c, 4629 }, 0x0, 0, 0, 4638, 4647 }, + /*II_V_0F_C2*/{ { 0x17d, 4708 }, 0x1, 90, 0, 4718, 4728 }, + /*II_V_66_0F_C2*/{ { 0x17d, 5110 }, 0x1, 90, 0, 5120, 5130 }, + /*II_V_F3_0F_C2*/{ { 0x17e, 5512 }, 0x0, 71, 0, 5522, 5532 }, + /*II_V_F2_0F_C2*/{ { 0x17e, 5914 }, 0x0, 72, 0, 5924, 5934 }, + /*II_0F_C4*/{ { 0x17f, 6316 }, 0x0, 1, 0, 0, 0 }, + /*II_66_0F_C4*/{ { 0x180, 6316 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_C4*/{ { 0x181, 6324 }, 0x0, 25, 1, 0, 0 }, + /*II_0F_C5*/{ { 0x182, 6333 }, 0x0, 1, 0, 0, 0 }, + /*II_66_0F_C5*/{ { 0x183, 6333 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_C5*/{ { 0x184, 6341 }, 0x40, 1, 0, 0, 0 }, + /*II_0F_C6*/{ { 0x185, 6350 }, 0x0, 1, 0, 0, 0 }, + /*II_66_0F_C6*/{ { 0x15f, 6358 }, 0x0, 1, 0, 0, 0 }, + /*II_V_0F_C6*/{ { 0x186, 6366 }, 0x1, 90, 1, 0, 0 }, + /*II_V_66_0F_C6*/{ { 0x186, 6375 }, 0x1, 90, 1, 0, 0 }, + /*II_0F_C7_01*/{ { 0x187, 6384 }, 0x0, 0, 0, 0, 6395 }, + /*II_V_66_0F_D0*/{ { 0x13c, 6436 }, 0x1, 90, 0, 0, 0 }, + /*II_V_F2_0F_D0*/{ { 0x13c, 6447 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_D1*/{ { 0x135, 6465 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_D2*/{ { 0x135, 6480 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_D3*/{ { 0x135, 6495 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_D4*/{ { 0x135, 6510 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_D5*/{ { 0x135, 6526 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_D6*/{ { 0x18b, 3961 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_D7*/{ { 0x18e, 6563 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_D8*/{ { 0x135, 6583 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_D9*/{ { 0x135, 6602 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_DA*/{ { 0x135, 6620 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_DB*/{ { 0x135, 6635 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_DC*/{ { 0x135, 6651 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_DD*/{ { 0x135, 6651 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_DE*/{ { 0x135, 6678 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_DF*/{ { 0x135, 6694 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_E0*/{ { 0x135, 6709 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_E1*/{ { 0x135, 6724 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_E2*/{ { 0x135, 6739 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_E3*/{ { 0x135, 6754 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_E4*/{ { 0x135, 6771 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_E5*/{ { 0x135, 6789 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_E6*/{ { 0x157, 6829 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F3_0F_E6*/{ { 0x156, 6841 }, 0x41, 0, 0, 0, 0 }, + /*II_V_F2_0F_E6*/{ { 0x157, 6852 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_E7*/{ { 0x147, 6880 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_E8*/{ { 0x135, 6898 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_E9*/{ { 0x135, 6915 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_EA*/{ { 0x135, 6932 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_EB*/{ { 0x135, 6946 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_EC*/{ { 0x135, 6960 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_ED*/{ { 0x135, 6977 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_EE*/{ { 0x135, 6994 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_EF*/{ { 0x135, 7009 }, 0x0, 73, 0, 0, 0 }, + /*II_V_F2_0F_F0*/{ { 0x192, 7023 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_F1*/{ { 0x135, 7038 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_F2*/{ { 0x135, 7053 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_F3*/{ { 0x135, 7068 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_F4*/{ { 0x135, 7085 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_F5*/{ { 0x135, 7104 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_F6*/{ { 0x135, 7122 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_F7*/{ { 0x196, 7153 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_F8*/{ { 0x135, 7173 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_F9*/{ { 0x135, 7188 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_FA*/{ { 0x135, 7203 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_FB*/{ { 0x135, 7218 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_FC*/{ { 0x135, 7233 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_FD*/{ { 0x135, 7248 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_FE*/{ { 0x135, 7263 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_00*/{ { 0x135, 7371 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_01*/{ { 0x135, 7388 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_02*/{ { 0x135, 7405 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_03*/{ { 0x135, 7423 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_04*/{ { 0x135, 7444 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_05*/{ { 0x135, 7464 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_06*/{ { 0x135, 7481 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_07*/{ { 0x135, 7499 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_08*/{ { 0x135, 7517 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_09*/{ { 0x135, 7534 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_0A*/{ { 0x135, 7551 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_0B*/{ { 0x135, 7570 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_0C*/{ { 0x13c, 7581 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_38_0D*/{ { 0x13c, 7592 }, 0x1, 90, 0, 0, 0 }, + /*II_V_66_0F_38_0E*/{ { 0x126, 7603 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_38_0F*/{ { 0x126, 7612 }, 0x41, 0, 0, 0, 0 }, + /*II_66_0F_38_10*/{ { 0x19f, 7621 }, 0x0, 74, 0, 0, 0 }, + /*II_66_0F_38_14*/{ { 0x19f, 7631 }, 0x0, 74, 0, 0, 0 }, + /*II_66_0F_38_15*/{ { 0x19f, 7641 }, 0x0, 74, 0, 0, 0 }, + /*II_V_66_0F_38_17*/{ { 0x126, 7658 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_38_18*/{ { 0x1a1, 7666 }, 0x41, 0, 0, 0, 0 }, + /*II_V_66_0F_38_19*/{ { 0x1a2, 7680 }, 0x50, 0, 0, 0, 0 }, + /*II_V_66_0F_38_1A*/{ { 0x1a3, 7694 }, 0x50, 0, 0, 0, 0 }, + /*II_V_66_0F_38_1C*/{ { 0x1a4, 7717 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_1D*/{ { 0x1a4, 7732 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_1E*/{ { 0x1a4, 7747 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_20*/{ { 0x150, 7765 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_21*/{ { 0x14f, 7786 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_22*/{ { 0x1a8, 7807 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_23*/{ { 0x150, 7828 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_24*/{ { 0x14f, 7849 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_25*/{ { 0x150, 7870 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_28*/{ { 0x135, 7889 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_29*/{ { 0x135, 7907 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_2A*/{ { 0x1ab, 7927 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_2B*/{ { 0x135, 7948 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_2C*/{ { 0x13c, 7959 }, 0x1, 92, 0, 0, 0 }, + /*II_V_66_0F_38_2D*/{ { 0x13c, 7971 }, 0x1, 92, 0, 0, 0 }, + /*II_V_66_0F_38_2E*/{ { 0x1ac, 7959 }, 0x1, 83, 0, 0, 0 }, + /*II_V_66_0F_38_2F*/{ { 0x1ac, 7971 }, 0x1, 83, 0, 0, 0 }, + /*II_V_66_0F_38_30*/{ { 0x150, 7993 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_31*/{ { 0x14f, 8014 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_32*/{ { 0x1a8, 8035 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_33*/{ { 0x150, 8056 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_34*/{ { 0x14f, 8077 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_35*/{ { 0x150, 8098 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_37*/{ { 0x135, 8118 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_38*/{ { 0x135, 8136 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_39*/{ { 0x135, 8153 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_3A*/{ { 0x135, 8170 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_3B*/{ { 0x135, 8187 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_3C*/{ { 0x135, 8204 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_3D*/{ { 0x135, 8221 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_3E*/{ { 0x135, 8238 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_3F*/{ { 0x135, 8255 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_40*/{ { 0x135, 8272 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_41*/{ { 0x1a4, 8293 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_96*/{ { 0x1ae, 8332 }, 0x7, 90, 0, 8348, 0 }, + /*II_V_66_0F_38_97*/{ { 0x1ae, 8364 }, 0x7, 90, 0, 8380, 0 }, + /*II_V_66_0F_38_98*/{ { 0x1ae, 8396 }, 0x7, 90, 0, 8409, 0 }, + /*II_V_66_0F_38_99*/{ { 0x1af, 8422 }, 0x6, 80, 0, 8435, 0 }, + /*II_V_66_0F_38_9A*/{ { 0x1ae, 8448 }, 0x7, 90, 0, 8461, 0 }, + /*II_V_66_0F_38_9B*/{ { 0x1af, 8474 }, 0x6, 80, 0, 8487, 0 }, + /*II_V_66_0F_38_9C*/{ { 0x1ae, 8500 }, 0x7, 90, 0, 8514, 0 }, + /*II_V_66_0F_38_9D*/{ { 0x1af, 8528 }, 0x6, 80, 0, 8542, 0 }, + /*II_V_66_0F_38_9E*/{ { 0x1ae, 8556 }, 0x7, 90, 0, 8570, 0 }, + /*II_V_66_0F_38_9F*/{ { 0x1af, 8584 }, 0x6, 80, 0, 8598, 0 }, + /*II_V_66_0F_38_A6*/{ { 0x1ae, 8612 }, 0x7, 90, 0, 8628, 0 }, + /*II_V_66_0F_38_A7*/{ { 0x1ae, 8644 }, 0x7, 90, 0, 8660, 0 }, + /*II_V_66_0F_38_A8*/{ { 0x1ae, 8676 }, 0x7, 90, 0, 8689, 0 }, + /*II_V_66_0F_38_A9*/{ { 0x1af, 8702 }, 0x6, 80, 0, 8715, 0 }, + /*II_V_66_0F_38_AA*/{ { 0x1ae, 8728 }, 0x7, 90, 0, 8741, 0 }, + /*II_V_66_0F_38_AB*/{ { 0x1af, 8754 }, 0x6, 80, 0, 8767, 0 }, + /*II_V_66_0F_38_AC*/{ { 0x1ae, 8780 }, 0x7, 90, 0, 8794, 0 }, + /*II_V_66_0F_38_AD*/{ { 0x1af, 8808 }, 0x6, 80, 0, 8822, 0 }, + /*II_V_66_0F_38_AE*/{ { 0x1ae, 8836 }, 0x7, 90, 0, 8850, 0 }, + /*II_V_66_0F_38_AF*/{ { 0x1af, 8864 }, 0x6, 80, 0, 8878, 0 }, + /*II_V_66_0F_38_B6*/{ { 0x1ae, 8892 }, 0x7, 90, 0, 8908, 0 }, + /*II_V_66_0F_38_B7*/{ { 0x1ae, 8924 }, 0x7, 90, 0, 8940, 0 }, + /*II_V_66_0F_38_B8*/{ { 0x1ae, 8956 }, 0x7, 90, 0, 8969, 0 }, + /*II_V_66_0F_38_B9*/{ { 0x1af, 8982 }, 0x6, 80, 0, 8995, 0 }, + /*II_V_66_0F_38_BA*/{ { 0x1ae, 9008 }, 0x7, 90, 0, 9021, 0 }, + /*II_V_66_0F_38_BB*/{ { 0x1af, 9034 }, 0x6, 80, 0, 9047, 0 }, + /*II_V_66_0F_38_BC*/{ { 0x1ae, 9060 }, 0x7, 90, 0, 9074, 0 }, + /*II_V_66_0F_38_BD*/{ { 0x1af, 9088 }, 0x6, 80, 0, 9102, 0 }, + /*II_V_66_0F_38_BE*/{ { 0x1ae, 9116 }, 0x7, 90, 0, 9130, 0 }, + /*II_V_66_0F_38_BF*/{ { 0x1af, 9144 }, 0x6, 80, 0, 9158, 0 }, + /*II_V_66_0F_38_DB*/{ { 0x1b1, 9180 }, 0x40, 0, 0, 0, 0 }, + /*II_V_66_0F_38_DC*/{ { 0x1b2, 9197 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_DD*/{ { 0x1b2, 9218 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_DE*/{ { 0x1b2, 9239 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_38_DF*/{ { 0x1b2, 9260 }, 0x0, 73, 0, 0, 0 }, + /*II_V_66_0F_3A_04*/{ { 0x1b7, 7581 }, 0x41, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_05*/{ { 0x1b7, 7592 }, 0x41, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_06*/{ { 0x1b8, 9287 }, 0x10, 86, 1, 0, 0 }, + /*II_66_0F_3A_08*/{ { 0x19f, 9299 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_08*/{ { 0x1b7, 9308 }, 0x41, 1, 0, 0, 0 }, + /*II_66_0F_3A_09*/{ { 0x19f, 9318 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_09*/{ { 0x1b7, 9327 }, 0x41, 1, 0, 0, 0 }, + /*II_66_0F_3A_0A*/{ { 0x1b9, 9337 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_0A*/{ { 0x181, 9346 }, 0x0, 71, 1, 0, 0 }, + /*II_66_0F_3A_0B*/{ { 0x1ba, 9356 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_0B*/{ { 0x181, 9365 }, 0x0, 72, 1, 0, 0 }, + /*II_66_0F_3A_0C*/{ { 0x19f, 9375 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_0C*/{ { 0x186, 9384 }, 0x1, 90, 1, 0, 0 }, + /*II_66_0F_3A_0D*/{ { 0x19f, 9394 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_0D*/{ { 0x186, 9403 }, 0x1, 90, 1, 0, 0 }, + /*II_66_0F_3A_0E*/{ { 0x19f, 9413 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_0E*/{ { 0x181, 9422 }, 0x0, 73, 1, 0, 0 }, + /*II_0F_3A_0F*/{ { 0x1bb, 9432 }, 0x0, 1, 0, 0, 0 }, + /*II_66_0F_3A_0F*/{ { 0x1bc, 9432 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_0F*/{ { 0x181, 9441 }, 0x0, 73, 1, 0, 0 }, + /*II_66_0F_3A_14*/{ { 0x1bd, 9451 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_14*/{ { 0x1be, 9459 }, 0x40, 1, 0, 0, 0 }, + /*II_66_0F_3A_15*/{ { 0x1bf, 6333 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_15*/{ { 0x1c0, 6341 }, 0x40, 1, 0, 0, 0 }, + /*II_66_0F_3A_16*/{ { 0x1c1, 9468 }, 0x0, 1, 0, 0, 9476 }, + /*II_V_66_0F_3A_16*/{ { 0x1c2, 9484 }, 0x46, 1, 0, 9493, 0 }, + /*II_66_0F_3A_17*/{ { 0x1c3, 9502 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_17*/{ { 0x1c4, 9513 }, 0x40, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_18*/{ { 0x1b8, 9525 }, 0x10, 73, 1, 0, 0 }, + /*II_V_66_0F_3A_19*/{ { 0x1c5, 9538 }, 0x50, 1, 0, 0, 0 }, + /*II_66_0F_3A_20*/{ { 0x1c6, 9552 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_20*/{ { 0x181, 9560 }, 0x0, 76, 1, 0, 0 }, + /*II_66_0F_3A_21*/{ { 0x1b9, 9569 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_21*/{ { 0x181, 9579 }, 0x0, 71, 1, 0, 0 }, + /*II_66_0F_3A_22*/{ { 0x1c7, 9590 }, 0x0, 1, 0, 0, 9598 }, + /*II_V_66_0F_3A_22*/{ { 0x181, 9606 }, 0x6, 79, 1, 9615, 0 }, + /*II_66_0F_3A_40*/{ { 0x19f, 9624 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_40*/{ { 0x186, 9630 }, 0x1, 90, 1, 0, 0 }, + /*II_66_0F_3A_41*/{ { 0x19f, 9637 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_41*/{ { 0x181, 9643 }, 0x0, 73, 1, 0, 0 }, + /*II_66_0F_3A_42*/{ { 0x19f, 9650 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_42*/{ { 0x181, 9659 }, 0x0, 73, 1, 0, 0 }, + /*II_66_0F_3A_44*/{ { 0x1c8, 9669 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_44*/{ { 0x1c9, 9680 }, 0x0, 73, 1, 0, 0 }, + /*II_V_66_0F_3A_4A*/{ { 0x186, 9692 }, 0x1, 90, 84, 0, 0 }, + /*II_V_66_0F_3A_4B*/{ { 0x186, 9703 }, 0x1, 90, 84, 0, 0 }, + /*II_V_66_0F_3A_4C*/{ { 0x181, 9714 }, 0x0, 73, 82, 0, 0 }, + /*II_66_0F_3A_60*/{ { 0x1ca, 9725 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_60*/{ { 0x160, 9736 }, 0x40, 1, 0, 0, 0 }, + /*II_66_0F_3A_61*/{ { 0x1ca, 9748 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_61*/{ { 0x160, 9759 }, 0x40, 1, 0, 0, 0 }, + /*II_66_0F_3A_62*/{ { 0x1ca, 9771 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_62*/{ { 0x160, 9782 }, 0x40, 1, 0, 0, 0 }, + /*II_66_0F_3A_63*/{ { 0x1ca, 9794 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_63*/{ { 0x160, 9805 }, 0x40, 1, 0, 0, 0 }, + /*II_66_0F_3A_DF*/{ { 0x1cb, 9817 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_3A_DF*/{ { 0x1cc, 9834 }, 0x40, 1, 0, 0, 0 }, + /*II_V_66_0F_71_02*/{ { 0x1cf, 6465 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_71_04*/{ { 0x1cf, 6724 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_71_06*/{ { 0x1cf, 7038 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_72_02*/{ { 0x1cf, 6480 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_72_04*/{ { 0x1cf, 6739 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_72_06*/{ { 0x1cf, 7053 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_73_02*/{ { 0x1cf, 6495 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_73_03*/{ { 0x1cf, 9860 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_73_06*/{ { 0x1cf, 7068 }, 0x0, 1, 0, 0, 0 }, + /*II_V_66_0F_73_07*/{ { 0x1cf, 9877 }, 0x0, 1, 0, 0, 0 }, + /*II_0F_AE_00*/{ { 0x170, 9886 }, 0x0, 0, 0, 0, 9894 }, + /*II_0F_AE_01*/{ { 0x170, 9914 }, 0x0, 0, 0, 0, 9923 }, + /*II_V_0F_AE_02*/{ { 0x1d1, 9963 }, 0x40, 0, 0, 0, 0 }, + /*II_V_0F_AE_03*/{ { 0x1d1, 9992 }, 0x40, 0, 0, 0, 0 } +}; + +_InstNode InstructionsTree[5688] = { + /* 0 - _00 */ 0x2000, + /* 1 - _01 */ 0x2001, + /* 2 - _02 */ 0x2002, + /* 3 - _03 */ 0x2003, + /* 4 - _04 */ 0x2004, + /* 5 - _05 */ 0x2005, + /* 6 - _06 */ 0x2006, + /* 7 - _07 */ 0x2007, + /* 8 - _08 */ 0x2008, + /* 9 - _09 */ 0x2009, + /* a - _0A */ 0x200a, + /* b - _0B */ 0x200b, + /* c - _0C */ 0x200c, + /* d - _0D */ 0x200d, + /* e - _0E */ 0x200e, + /* f - _0F */ 0x8100, + /* 10 - _10 */ 0x200f, + /* 11 - _11 */ 0x2010, + /* 12 - _12 */ 0x2011, + /* 13 - _13 */ 0x2012, + /* 14 - _14 */ 0x2013, + /* 15 - _15 */ 0x2014, + /* 16 - _16 */ 0x2015, + /* 17 - _17 */ 0x2016, + /* 18 - _18 */ 0x2017, + /* 19 - _19 */ 0x2018, + /* 1a - _1A */ 0x2019, + /* 1b - _1B */ 0x201a, + /* 1c - _1C */ 0x201b, + /* 1d - _1D */ 0x201c, + /* 1e - _1E */ 0x201d, + /* 1f - _1F */ 0x201e, + /* 20 - _20 */ 0x201f, + /* 21 - _21 */ 0x2020, + /* 22 - _22 */ 0x2021, + /* 23 - _23 */ 0x2022, + /* 24 - _24 */ 0x2023, + /* 25 - _25 */ 0x2024, + /* 26 - */ 0, + /* 27 - _27 */ 0x2025, + /* 28 - _28 */ 0x2026, + /* 29 - _29 */ 0x2027, + /* 2a - _2A */ 0x2028, + /* 2b - _2B */ 0x2029, + /* 2c - _2C */ 0x202a, + /* 2d - _2D */ 0x202b, + /* 2e - */ 0, + /* 2f - _2F */ 0x202c, + /* 30 - _30 */ 0x202d, + /* 31 - _31 */ 0x202e, + /* 32 - _32 */ 0x202f, + /* 33 - _33 */ 0x2030, + /* 34 - _34 */ 0x2031, + /* 35 - _35 */ 0x2032, + /* 36 - */ 0, + /* 37 - _37 */ 0x2033, + /* 38 - _38 */ 0x2034, + /* 39 - _39 */ 0x2035, + /* 3a - _3A */ 0x2036, + /* 3b - _3B */ 0x2037, + /* 3c - _3C */ 0x2038, + /* 3d - _3D */ 0x2039, + /* 3e - */ 0, + /* 3f - _3F */ 0x203a, + /* 40 - _40 */ 0x203b, + /* 41 - _40 */ 0x203c, + /* 42 - _40 */ 0x203d, + /* 43 - _40 */ 0x203e, + /* 44 - _40 */ 0x203f, + /* 45 - _40 */ 0x2040, + /* 46 - _40 */ 0x2041, + /* 47 - _40 */ 0x2042, + /* 48 - _48 */ 0x2043, + /* 49 - _48 */ 0x2044, + /* 4a - _48 */ 0x2045, + /* 4b - _48 */ 0x2046, + /* 4c - _48 */ 0x2047, + /* 4d - _48 */ 0x2048, + /* 4e - _48 */ 0x2049, + /* 4f - _48 */ 0x204a, + /* 50 - _50 */ 0x204b, + /* 51 - _50 */ 0x204c, + /* 52 - _50 */ 0x204d, + /* 53 - _50 */ 0x204e, + /* 54 - _50 */ 0x204f, + /* 55 - _50 */ 0x2050, + /* 56 - _50 */ 0x2051, + /* 57 - _50 */ 0x2052, + /* 58 - _58 */ 0x2053, + /* 59 - _58 */ 0x2054, + /* 5a - _58 */ 0x2055, + /* 5b - _58 */ 0x2056, + /* 5c - _58 */ 0x2057, + /* 5d - _58 */ 0x2058, + /* 5e - _58 */ 0x2059, + /* 5f - _58 */ 0x205a, + /* 60 - _60 */ 0x205b, + /* 61 - _61 */ 0x205c, + /* 62 - _62 */ 0x205d, + /* 63 - _63 */ 0x205e, + /* 64 - */ 0, + /* 65 - */ 0, + /* 66 - */ 0, + /* 67 - */ 0, + /* 68 - _68 */ 0x205f, + /* 69 - _69 */ 0x4000, + /* 6a - _6A */ 0x2060, + /* 6b - _6B */ 0x4001, + /* 6c - _6C */ 0x2061, + /* 6d - _6D */ 0x2062, + /* 6e - _6E */ 0x2063, + /* 6f - _6F */ 0x2064, + /* 70 - _70 */ 0x2065, + /* 71 - _71 */ 0x2066, + /* 72 - _72 */ 0x2067, + /* 73 - _73 */ 0x2068, + /* 74 - _74 */ 0x2069, + /* 75 - _75 */ 0x206a, + /* 76 - _76 */ 0x206b, + /* 77 - _77 */ 0x206c, + /* 78 - _78 */ 0x206d, + /* 79 - _79 */ 0x206e, + /* 7a - _7A */ 0x206f, + /* 7b - _7B */ 0x2070, + /* 7c - _7C */ 0x2071, + /* 7d - _7D */ 0x2072, + /* 7e - _7E */ 0x2073, + /* 7f - _7F */ 0x2074, + /* 80 - _80 */ 0x6200, + /* 81 - _81 */ 0x6208, + /* 82 - _82 */ 0x6210, + /* 83 - _83 */ 0x6218, + /* 84 - _84 */ 0x2075, + /* 85 - _85 */ 0x2076, + /* 86 - _86 */ 0x2077, + /* 87 - _87 */ 0x2078, + /* 88 - _88 */ 0x2079, + /* 89 - _89 */ 0x207a, + /* 8a - _8A */ 0x207b, + /* 8b - _8B */ 0x207c, + /* 8c - _8C */ 0x207d, + /* 8d - _8D */ 0x207e, + /* 8e - _8E */ 0x207f, + /* 8f - _8F */ 0x6220, + /* 90 - _90 */ 0x2080, + /* 91 - _91 */ 0x2081, + /* 92 - _92 */ 0x2082, + /* 93 - _93 */ 0x2083, + /* 94 - _94 */ 0x2084, + /* 95 - _95 */ 0x2085, + /* 96 - _96 */ 0x2086, + /* 97 - _97 */ 0x2087, + /* 98 - _98 */ 0x4002, + /* 99 - _99 */ 0x4003, + /* 9a - _9A */ 0x2088, + /* 9b - */ 0, + /* 9c - _9C */ 0x2089, + /* 9d - _9D */ 0x208a, + /* 9e - _9E */ 0x208b, + /* 9f - _9F */ 0x208c, + /* a0 - _A0 */ 0x208d, + /* a1 - _A1 */ 0x208e, + /* a2 - _A2 */ 0x208f, + /* a3 - _A3 */ 0x2090, + /* a4 - _A4 */ 0x2091, + /* a5 - _A5 */ 0x2092, + /* a6 - _A6 */ 0x2093, + /* a7 - _A7 */ 0x2094, + /* a8 - _A8 */ 0x2095, + /* a9 - _A9 */ 0x2096, + /* aa - _AA */ 0x2097, + /* ab - _AB */ 0x2098, + /* ac - _AC */ 0x2099, + /* ad - _AD */ 0x209a, + /* ae - _AE */ 0x209b, + /* af - _AF */ 0x209c, + /* b0 - _B0 */ 0x209d, + /* b1 - _B0 */ 0x209e, + /* b2 - _B0 */ 0x209f, + /* b3 - _B0 */ 0x20a0, + /* b4 - _B0 */ 0x20a1, + /* b5 - _B0 */ 0x20a2, + /* b6 - _B0 */ 0x20a3, + /* b7 - _B0 */ 0x20a4, + /* b8 - _B8 */ 0x20a5, + /* b9 - _B8 */ 0x20a6, + /* ba - _B8 */ 0x20a7, + /* bb - _B8 */ 0x20a8, + /* bc - _B8 */ 0x20a9, + /* bd - _B8 */ 0x20aa, + /* be - _B8 */ 0x20ab, + /* bf - _B8 */ 0x20ac, + /* c0 - _C0 */ 0x6228, + /* c1 - _C1 */ 0x6230, + /* c2 - _C2 */ 0x20ad, + /* c3 - _C3 */ 0x20ae, + /* c4 - _C4 */ 0x20af, + /* c5 - _C5 */ 0x20b0, + /* c6 - _C6 */ 0xa238, + /* c7 - _C7 */ 0xa280, + /* c8 - _C8 */ 0x20b1, + /* c9 - _C9 */ 0x20b2, + /* ca - _CA */ 0x20b3, + /* cb - _CB */ 0x20b4, + /* cc - _CC */ 0x20b5, + /* cd - _CD */ 0x20b6, + /* ce - _CE */ 0x20b7, + /* cf - _CF */ 0x20b8, + /* d0 - _D0 */ 0x62c8, + /* d1 - _D1 */ 0x62d0, + /* d2 - _D2 */ 0x62d8, + /* d3 - _D3 */ 0x62e0, + /* d4 - _D4 */ 0x20b9, + /* d5 - _D5 */ 0x20ba, + /* d6 - _D6 */ 0x20bb, + /* d7 - _D7 */ 0x20bc, + /* d8 - _D8 */ 0xa2e8, + /* d9 - _D9 */ 0xa330, + /* da - _DA */ 0xa378, + /* db - _DB */ 0xa3c0, + /* dc - _DC */ 0xa408, + /* dd - _DD */ 0xa450, + /* de - _DE */ 0xa498, + /* df - _DF */ 0xa4e0, + /* e0 - _E0 */ 0x20bd, + /* e1 - _E1 */ 0x20be, + /* e2 - _E2 */ 0x20bf, + /* e3 - _E3 */ 0x4004, + /* e4 - _E4 */ 0x20c0, + /* e5 - _E5 */ 0x20c1, + /* e6 - _E6 */ 0x20c2, + /* e7 - _E7 */ 0x20c3, + /* e8 - _E8 */ 0x20c4, + /* e9 - _E9 */ 0x20c5, + /* ea - _EA */ 0x20c6, + /* eb - _EB */ 0x20c7, + /* ec - _EC */ 0x20c8, + /* ed - _ED */ 0x20c9, + /* ee - _EE */ 0x20ca, + /* ef - _EF */ 0x20cb, + /* f0 - */ 0, + /* f1 - _F1 */ 0x20cc, + /* f2 - */ 0, + /* f3 - */ 0, + /* f4 - _F4 */ 0x20cd, + /* f5 - _F5 */ 0x20ce, + /* f6 - _F6 */ 0x6528, + /* f7 - _F7 */ 0x6530, + /* f8 - _F8 */ 0x20cf, + /* f9 - _F9 */ 0x20d0, + /* fa - _FA */ 0x20d1, + /* fb - _FB */ 0x20d2, + /* fc - _FC */ 0x20d3, + /* fd - _FD */ 0x20d4, + /* fe - _FE */ 0x6538, + /* ff - _FF */ 0x6540, + /* 100 - _0F_00 */ 0x6548, + /* 101 - _0F_01 */ 0xa550, + /* 102 - _0F_02 */ 0x20d5, + /* 103 - _0F_03 */ 0x20d6, + /* 104 - */ 0, + /* 105 - _0F_05 */ 0x20d7, + /* 106 - _0F_06 */ 0x20d8, + /* 107 - _0F_07 */ 0x20d9, + /* 108 - _0F_08 */ 0x20da, + /* 109 - _0F_09 */ 0x20db, + /* 10a - */ 0, + /* 10b - _0F_0B */ 0x20dc, + /* 10c - */ 0, + /* 10d - _0F_0D */ 0x6598, + /* 10e - _0F_0E */ 0x20dd, + /* 10f - _0F_0F */ 0x85a0, + /* 110 - _0F_10 */ 0xc6a0, + /* 111 - _0F_11 */ 0xc6ac, + /* 112 - _0F_12 */ 0xc6b8, + /* 113 - _0F_13 */ 0xc6c4, + /* 114 - _0F_14 */ 0xc6d0, + /* 115 - _0F_15 */ 0xc6dc, + /* 116 - _0F_16 */ 0xc6e8, + /* 117 - _0F_17 */ 0xc6f4, + /* 118 - _0F_18 */ 0x6700, + /* 119 - */ 0, + /* 11a - */ 0, + /* 11b - */ 0, + /* 11c - */ 0, + /* 11d - */ 0, + /* 11e - */ 0, + /* 11f - _0F_1F */ 0x20de, + /* 120 - _0F_20 */ 0x20df, + /* 121 - _0F_21 */ 0x20e0, + /* 122 - _0F_22 */ 0x20e1, + /* 123 - _0F_23 */ 0x20e2, + /* 124 - */ 0, + /* 125 - */ 0, + /* 126 - */ 0, + /* 127 - */ 0, + /* 128 - _0F_28 */ 0xc708, + /* 129 - _0F_29 */ 0xc714, + /* 12a - _0F_2A */ 0xc720, + /* 12b - _0F_2B */ 0xc72c, + /* 12c - _0F_2C */ 0xc738, + /* 12d - _0F_2D */ 0xc744, + /* 12e - _0F_2E */ 0xc750, + /* 12f - _0F_2F */ 0xc75c, + /* 130 - _0F_30 */ 0x20e3, + /* 131 - _0F_31 */ 0x20e4, + /* 132 - _0F_32 */ 0x20e5, + /* 133 - _0F_33 */ 0x20e6, + /* 134 - _0F_34 */ 0x20e7, + /* 135 - _0F_35 */ 0x20e8, + /* 136 - */ 0, + /* 137 - _0F_37 */ 0x20e9, + /* 138 - _0F_38 */ 0x8768, + /* 139 - */ 0, + /* 13a - _0F_3A */ 0x8868, + /* 13b - */ 0, + /* 13c - */ 0, + /* 13d - */ 0, + /* 13e - */ 0, + /* 13f - */ 0, + /* 140 - _0F_40 */ 0x20ea, + /* 141 - _0F_41 */ 0x20eb, + /* 142 - _0F_42 */ 0x20ec, + /* 143 - _0F_43 */ 0x20ed, + /* 144 - _0F_44 */ 0x20ee, + /* 145 - _0F_45 */ 0x20ef, + /* 146 - _0F_46 */ 0x20f0, + /* 147 - _0F_47 */ 0x20f1, + /* 148 - _0F_48 */ 0x20f2, + /* 149 - _0F_49 */ 0x20f3, + /* 14a - _0F_4A */ 0x20f4, + /* 14b - _0F_4B */ 0x20f5, + /* 14c - _0F_4C */ 0x20f6, + /* 14d - _0F_4D */ 0x20f7, + /* 14e - _0F_4E */ 0x20f8, + /* 14f - _0F_4F */ 0x20f9, + /* 150 - _0F_50 */ 0xc968, + /* 151 - _0F_51 */ 0xc974, + /* 152 - _0F_52 */ 0xc980, + /* 153 - _0F_53 */ 0xc98c, + /* 154 - _0F_54 */ 0xc998, + /* 155 - _0F_55 */ 0xc9a4, + /* 156 - _0F_56 */ 0xc9b0, + /* 157 - _0F_57 */ 0xc9bc, + /* 158 - _0F_58 */ 0xc9c8, + /* 159 - _0F_59 */ 0xc9d4, + /* 15a - _0F_5A */ 0xc9e0, + /* 15b - _0F_5B */ 0xc9ec, + /* 15c - _0F_5C */ 0xc9f8, + /* 15d - _0F_5D */ 0xca04, + /* 15e - _0F_5E */ 0xca10, + /* 15f - _0F_5F */ 0xca1c, + /* 160 - _0F_60 */ 0xca28, + /* 161 - _0F_61 */ 0xca34, + /* 162 - _0F_62 */ 0xca40, + /* 163 - _0F_63 */ 0xca4c, + /* 164 - _0F_64 */ 0xca58, + /* 165 - _0F_65 */ 0xca64, + /* 166 - _0F_66 */ 0xca70, + /* 167 - _0F_67 */ 0xca7c, + /* 168 - _0F_68 */ 0xca88, + /* 169 - _0F_69 */ 0xca94, + /* 16a - _0F_6A */ 0xcaa0, + /* 16b - _0F_6B */ 0xcaac, + /* 16c - _0F_6C */ 0xcab8, + /* 16d - _0F_6D */ 0xcac4, + /* 16e - _0F_6E */ 0xcad0, + /* 16f - _0F_6F */ 0xcadc, + /* 170 - _0F_70 */ 0xcae8, + /* 171 - _0F_71 */ 0x6af4, + /* 172 - _0F_72 */ 0x6afc, + /* 173 - _0F_73 */ 0x6b04, + /* 174 - _0F_74 */ 0xcb0c, + /* 175 - _0F_75 */ 0xcb18, + /* 176 - _0F_76 */ 0xcb24, + /* 177 - _0F_77 */ 0xcb30, + /* 178 - _0F_78 */ 0xcb3c, + /* 179 - _0F_79 */ 0xcb48, + /* 17a - _0F_7A */ 0x8b54, + /* 17b - */ 0, + /* 17c - _0F_7C */ 0xcc54, + /* 17d - _0F_7D */ 0xcc60, + /* 17e - _0F_7E */ 0xcc6c, + /* 17f - _0F_7F */ 0xcc78, + /* 180 - _0F_80 */ 0x20fa, + /* 181 - _0F_81 */ 0x20fb, + /* 182 - _0F_82 */ 0x20fc, + /* 183 - _0F_83 */ 0x20fd, + /* 184 - _0F_84 */ 0x20fe, + /* 185 - _0F_85 */ 0x20ff, + /* 186 - _0F_86 */ 0x2100, + /* 187 - _0F_87 */ 0x2101, + /* 188 - _0F_88 */ 0x2102, + /* 189 - _0F_89 */ 0x2103, + /* 18a - _0F_8A */ 0x2104, + /* 18b - _0F_8B */ 0x2105, + /* 18c - _0F_8C */ 0x2106, + /* 18d - _0F_8D */ 0x2107, + /* 18e - _0F_8E */ 0x2108, + /* 18f - _0F_8F */ 0x2109, + /* 190 - _0F_90 */ 0x210a, + /* 191 - _0F_91 */ 0x210b, + /* 192 - _0F_92 */ 0x210c, + /* 193 - _0F_93 */ 0x210d, + /* 194 - _0F_94 */ 0x210e, + /* 195 - _0F_95 */ 0x210f, + /* 196 - _0F_96 */ 0x2110, + /* 197 - _0F_97 */ 0x2111, + /* 198 - _0F_98 */ 0x2112, + /* 199 - _0F_99 */ 0x2113, + /* 19a - _0F_9A */ 0x2114, + /* 19b - _0F_9B */ 0x2115, + /* 19c - _0F_9C */ 0x2116, + /* 19d - _0F_9D */ 0x2117, + /* 19e - _0F_9E */ 0x2118, + /* 19f - _0F_9F */ 0x2119, + /* 1a0 - _0F_A0 */ 0x211a, + /* 1a1 - _0F_A1 */ 0x211b, + /* 1a2 - _0F_A2 */ 0x211c, + /* 1a3 - _0F_A3 */ 0x211d, + /* 1a4 - _0F_A4 */ 0x4005, + /* 1a5 - _0F_A5 */ 0x4006, + /* 1a6 - */ 0, + /* 1a7 - */ 0, + /* 1a8 - _0F_A8 */ 0x211e, + /* 1a9 - _0F_A9 */ 0x211f, + /* 1aa - _0F_AA */ 0x2120, + /* 1ab - _0F_AB */ 0x2121, + /* 1ac - _0F_AC */ 0x4007, + /* 1ad - _0F_AD */ 0x4008, + /* 1ae - _0F_AE */ 0x6c84, + /* 1af - _0F_AF */ 0x2122, + /* 1b0 - _0F_B0 */ 0x2123, + /* 1b1 - _0F_B1 */ 0x2124, + /* 1b2 - _0F_B2 */ 0x2125, + /* 1b3 - _0F_B3 */ 0x2126, + /* 1b4 - _0F_B4 */ 0x2127, + /* 1b5 - _0F_B5 */ 0x2128, + /* 1b6 - _0F_B6 */ 0x2129, + /* 1b7 - _0F_B7 */ 0x212a, + /* 1b8 - _0F_B8 */ 0xcc8c, + /* 1b9 - _0F_B9 */ 0x212b, + /* 1ba - _0F_BA */ 0x6c98, + /* 1bb - _0F_BB */ 0x212c, + /* 1bc - _0F_BC */ 0xcca0, + /* 1bd - _0F_BD */ 0xccac, + /* 1be - _0F_BE */ 0x212d, + /* 1bf - _0F_BF */ 0x212e, + /* 1c0 - _0F_C0 */ 0x212f, + /* 1c1 - _0F_C1 */ 0x2130, + /* 1c2 - _0F_C2 */ 0xccb8, + /* 1c3 - _0F_C3 */ 0x2131, + /* 1c4 - _0F_C4 */ 0xccc4, + /* 1c5 - _0F_C5 */ 0xccd0, + /* 1c6 - _0F_C6 */ 0xccdc, + /* 1c7 - _0F_C7 */ 0x6ce8, + /* 1c8 - _0F_C8 */ 0x2132, + /* 1c9 - _0F_C8 */ 0x2133, + /* 1ca - _0F_C8 */ 0x2134, + /* 1cb - _0F_C8 */ 0x2135, + /* 1cc - _0F_C8 */ 0x2136, + /* 1cd - _0F_C8 */ 0x2137, + /* 1ce - _0F_C8 */ 0x2138, + /* 1cf - _0F_C8 */ 0x2139, + /* 1d0 - _0F_D0 */ 0xccf0, + /* 1d1 - _0F_D1 */ 0xccfc, + /* 1d2 - _0F_D2 */ 0xcd08, + /* 1d3 - _0F_D3 */ 0xcd14, + /* 1d4 - _0F_D4 */ 0xcd20, + /* 1d5 - _0F_D5 */ 0xcd2c, + /* 1d6 - _0F_D6 */ 0xcd38, + /* 1d7 - _0F_D7 */ 0xcd44, + /* 1d8 - _0F_D8 */ 0xcd50, + /* 1d9 - _0F_D9 */ 0xcd5c, + /* 1da - _0F_DA */ 0xcd68, + /* 1db - _0F_DB */ 0xcd74, + /* 1dc - _0F_DC */ 0xcd80, + /* 1dd - _0F_DD */ 0xcd8c, + /* 1de - _0F_DE */ 0xcd98, + /* 1df - _0F_DF */ 0xcda4, + /* 1e0 - _0F_E0 */ 0xcdb0, + /* 1e1 - _0F_E1 */ 0xcdbc, + /* 1e2 - _0F_E2 */ 0xcdc8, + /* 1e3 - _0F_E3 */ 0xcdd4, + /* 1e4 - _0F_E4 */ 0xcde0, + /* 1e5 - _0F_E5 */ 0xcdec, + /* 1e6 - _0F_E6 */ 0xcdf8, + /* 1e7 - _0F_E7 */ 0xce04, + /* 1e8 - _0F_E8 */ 0xce10, + /* 1e9 - _0F_E9 */ 0xce1c, + /* 1ea - _0F_EA */ 0xce28, + /* 1eb - _0F_EB */ 0xce34, + /* 1ec - _0F_EC */ 0xce40, + /* 1ed - _0F_ED */ 0xce4c, + /* 1ee - _0F_EE */ 0xce58, + /* 1ef - _0F_EF */ 0xce64, + /* 1f0 - _0F_F0 */ 0xce70, + /* 1f1 - _0F_F1 */ 0xce7c, + /* 1f2 - _0F_F2 */ 0xce88, + /* 1f3 - _0F_F3 */ 0xce94, + /* 1f4 - _0F_F4 */ 0xcea0, + /* 1f5 - _0F_F5 */ 0xceac, + /* 1f6 - _0F_F6 */ 0xceb8, + /* 1f7 - _0F_F7 */ 0xcec4, + /* 1f8 - _0F_F8 */ 0xced0, + /* 1f9 - _0F_F9 */ 0xcedc, + /* 1fa - _0F_FA */ 0xcee8, + /* 1fb - _0F_FB */ 0xcef4, + /* 1fc - _0F_FC */ 0xcf00, + /* 1fd - _0F_FD */ 0xcf0c, + /* 1fe - _0F_FE */ 0xcf18, + /* 1ff - */ 0, + /* 200 - _80_00 */ 0x213a, + /* 201 - _80_01 */ 0x213b, + /* 202 - _80_02 */ 0x213c, + /* 203 - _80_03 */ 0x213d, + /* 204 - _80_04 */ 0x213e, + /* 205 - _80_05 */ 0x213f, + /* 206 - _80_06 */ 0x2140, + /* 207 - _80_07 */ 0x2141, + /* 208 - _81_00 */ 0x2142, + /* 209 - _81_01 */ 0x2143, + /* 20a - _81_02 */ 0x2144, + /* 20b - _81_03 */ 0x2145, + /* 20c - _81_04 */ 0x2146, + /* 20d - _81_05 */ 0x2147, + /* 20e - _81_06 */ 0x2148, + /* 20f - _81_07 */ 0x2149, + /* 210 - _82_00 */ 0x214a, + /* 211 - _82_01 */ 0x214b, + /* 212 - _82_02 */ 0x214c, + /* 213 - _82_03 */ 0x214d, + /* 214 - _82_04 */ 0x214e, + /* 215 - _82_05 */ 0x214f, + /* 216 - _82_06 */ 0x2150, + /* 217 - _82_07 */ 0x2151, + /* 218 - _83_00 */ 0x2152, + /* 219 - _83_01 */ 0x2153, + /* 21a - _83_02 */ 0x2154, + /* 21b - _83_03 */ 0x2155, + /* 21c - _83_04 */ 0x2156, + /* 21d - _83_05 */ 0x2157, + /* 21e - _83_06 */ 0x2158, + /* 21f - _83_07 */ 0x2159, + /* 220 - _8F_00 */ 0x215a, + /* 221 - */ 0, + /* 222 - */ 0, + /* 223 - */ 0, + /* 224 - */ 0, + /* 225 - */ 0, + /* 226 - */ 0, + /* 227 - */ 0, + /* 228 - _C0_00 */ 0x215b, + /* 229 - _C0_01 */ 0x215c, + /* 22a - _C0_02 */ 0x215d, + /* 22b - _C0_03 */ 0x215e, + /* 22c - _C0_04 */ 0x215f, + /* 22d - _C0_05 */ 0x2160, + /* 22e - _C0_06 */ 0x2161, + /* 22f - _C0_07 */ 0x2162, + /* 230 - _C1_00 */ 0x2163, + /* 231 - _C1_01 */ 0x2164, + /* 232 - _C1_02 */ 0x2165, + /* 233 - _C1_03 */ 0x2166, + /* 234 - _C1_04 */ 0x2167, + /* 235 - _C1_05 */ 0x2168, + /* 236 - _C1_06 */ 0x2169, + /* 237 - _C1_07 */ 0x216a, + /* 238 - _C6_00 */ 0x216b, + /* 239 - */ 0, + /* 23a - */ 0, + /* 23b - */ 0, + /* 23c - */ 0, + /* 23d - */ 0, + /* 23e - */ 0, + /* 23f - */ 0, + /* 240 - */ 0, + /* 241 - */ 0, + /* 242 - */ 0, + /* 243 - */ 0, + /* 244 - */ 0, + /* 245 - */ 0, + /* 246 - */ 0, + /* 247 - */ 0, + /* 248 - */ 0, + /* 249 - */ 0, + /* 24a - */ 0, + /* 24b - */ 0, + /* 24c - */ 0, + /* 24d - */ 0, + /* 24e - */ 0, + /* 24f - */ 0, + /* 250 - */ 0, + /* 251 - */ 0, + /* 252 - */ 0, + /* 253 - */ 0, + /* 254 - */ 0, + /* 255 - */ 0, + /* 256 - */ 0, + /* 257 - */ 0, + /* 258 - */ 0, + /* 259 - */ 0, + /* 25a - */ 0, + /* 25b - */ 0, + /* 25c - */ 0, + /* 25d - */ 0, + /* 25e - */ 0, + /* 25f - */ 0, + /* 260 - */ 0, + /* 261 - */ 0, + /* 262 - */ 0, + /* 263 - */ 0, + /* 264 - */ 0, + /* 265 - */ 0, + /* 266 - */ 0, + /* 267 - */ 0, + /* 268 - */ 0, + /* 269 - */ 0, + /* 26a - */ 0, + /* 26b - */ 0, + /* 26c - */ 0, + /* 26d - */ 0, + /* 26e - */ 0, + /* 26f - */ 0, + /* 270 - */ 0, + /* 271 - */ 0, + /* 272 - */ 0, + /* 273 - */ 0, + /* 274 - */ 0, + /* 275 - */ 0, + /* 276 - */ 0, + /* 277 - */ 0, + /* 278 - _C6_F8 */ 0x216c, + /* 279 - */ 0, + /* 27a - */ 0, + /* 27b - */ 0, + /* 27c - */ 0, + /* 27d - */ 0, + /* 27e - */ 0, + /* 27f - */ 0, + /* 280 - _C7_00 */ 0x216d, + /* 281 - */ 0, + /* 282 - */ 0, + /* 283 - */ 0, + /* 284 - */ 0, + /* 285 - */ 0, + /* 286 - */ 0, + /* 287 - */ 0, + /* 288 - */ 0, + /* 289 - */ 0, + /* 28a - */ 0, + /* 28b - */ 0, + /* 28c - */ 0, + /* 28d - */ 0, + /* 28e - */ 0, + /* 28f - */ 0, + /* 290 - */ 0, + /* 291 - */ 0, + /* 292 - */ 0, + /* 293 - */ 0, + /* 294 - */ 0, + /* 295 - */ 0, + /* 296 - */ 0, + /* 297 - */ 0, + /* 298 - */ 0, + /* 299 - */ 0, + /* 29a - */ 0, + /* 29b - */ 0, + /* 29c - */ 0, + /* 29d - */ 0, + /* 29e - */ 0, + /* 29f - */ 0, + /* 2a0 - */ 0, + /* 2a1 - */ 0, + /* 2a2 - */ 0, + /* 2a3 - */ 0, + /* 2a4 - */ 0, + /* 2a5 - */ 0, + /* 2a6 - */ 0, + /* 2a7 - */ 0, + /* 2a8 - */ 0, + /* 2a9 - */ 0, + /* 2aa - */ 0, + /* 2ab - */ 0, + /* 2ac - */ 0, + /* 2ad - */ 0, + /* 2ae - */ 0, + /* 2af - */ 0, + /* 2b0 - */ 0, + /* 2b1 - */ 0, + /* 2b2 - */ 0, + /* 2b3 - */ 0, + /* 2b4 - */ 0, + /* 2b5 - */ 0, + /* 2b6 - */ 0, + /* 2b7 - */ 0, + /* 2b8 - */ 0, + /* 2b9 - */ 0, + /* 2ba - */ 0, + /* 2bb - */ 0, + /* 2bc - */ 0, + /* 2bd - */ 0, + /* 2be - */ 0, + /* 2bf - */ 0, + /* 2c0 - _C7_F8 */ 0x216e, + /* 2c1 - */ 0, + /* 2c2 - */ 0, + /* 2c3 - */ 0, + /* 2c4 - */ 0, + /* 2c5 - */ 0, + /* 2c6 - */ 0, + /* 2c7 - */ 0, + /* 2c8 - _D0_00 */ 0x216f, + /* 2c9 - _D0_01 */ 0x2170, + /* 2ca - _D0_02 */ 0x2171, + /* 2cb - _D0_03 */ 0x2172, + /* 2cc - _D0_04 */ 0x2173, + /* 2cd - _D0_05 */ 0x2174, + /* 2ce - _D0_06 */ 0x2175, + /* 2cf - _D0_07 */ 0x2176, + /* 2d0 - _D1_00 */ 0x2177, + /* 2d1 - _D1_01 */ 0x2178, + /* 2d2 - _D1_02 */ 0x2179, + /* 2d3 - _D1_03 */ 0x217a, + /* 2d4 - _D1_04 */ 0x217b, + /* 2d5 - _D1_05 */ 0x217c, + /* 2d6 - _D1_06 */ 0x217d, + /* 2d7 - _D1_07 */ 0x217e, + /* 2d8 - _D2_00 */ 0x217f, + /* 2d9 - _D2_01 */ 0x2180, + /* 2da - _D2_02 */ 0x2181, + /* 2db - _D2_03 */ 0x2182, + /* 2dc - _D2_04 */ 0x2183, + /* 2dd - _D2_05 */ 0x2184, + /* 2de - _D2_06 */ 0x2185, + /* 2df - _D2_07 */ 0x2186, + /* 2e0 - _D3_00 */ 0x2187, + /* 2e1 - _D3_01 */ 0x2188, + /* 2e2 - _D3_02 */ 0x2189, + /* 2e3 - _D3_03 */ 0x218a, + /* 2e4 - _D3_04 */ 0x218b, + /* 2e5 - _D3_05 */ 0x218c, + /* 2e6 - _D3_06 */ 0x218d, + /* 2e7 - _D3_07 */ 0x218e, + /* 2e8 - _D8_00 */ 0x218f, + /* 2e9 - _D8_01 */ 0x2190, + /* 2ea - _D8_02 */ 0x2191, + /* 2eb - _D8_03 */ 0x2192, + /* 2ec - _D8_04 */ 0x2193, + /* 2ed - _D8_05 */ 0x2194, + /* 2ee - _D8_06 */ 0x2195, + /* 2ef - _D8_07 */ 0x2196, + /* 2f0 - _D8_C0 */ 0x2197, + /* 2f1 - _D8_C0 */ 0x2198, + /* 2f2 - _D8_C0 */ 0x2199, + /* 2f3 - _D8_C0 */ 0x219a, + /* 2f4 - _D8_C0 */ 0x219b, + /* 2f5 - _D8_C0 */ 0x219c, + /* 2f6 - _D8_C0 */ 0x219d, + /* 2f7 - _D8_C0 */ 0x219e, + /* 2f8 - _D8_C8 */ 0x219f, + /* 2f9 - _D8_C8 */ 0x21a0, + /* 2fa - _D8_C8 */ 0x21a1, + /* 2fb - _D8_C8 */ 0x21a2, + /* 2fc - _D8_C8 */ 0x21a3, + /* 2fd - _D8_C8 */ 0x21a4, + /* 2fe - _D8_C8 */ 0x21a5, + /* 2ff - _D8_C8 */ 0x21a6, + /* 300 - _D8_D0 */ 0x21a7, + /* 301 - _D8_D0 */ 0x21a8, + /* 302 - _D8_D0 */ 0x21a9, + /* 303 - _D8_D0 */ 0x21aa, + /* 304 - _D8_D0 */ 0x21ab, + /* 305 - _D8_D0 */ 0x21ac, + /* 306 - _D8_D0 */ 0x21ad, + /* 307 - _D8_D0 */ 0x21ae, + /* 308 - _D8_D8 */ 0x21af, + /* 309 - _D8_D9 */ 0x21b0, + /* 30a - _D8_D8 */ 0x21b1, + /* 30b - _D8_D8 */ 0x21b2, + /* 30c - _D8_D8 */ 0x21b3, + /* 30d - _D8_D8 */ 0x21b4, + /* 30e - _D8_D8 */ 0x21b5, + /* 30f - _D8_D8 */ 0x21b6, + /* 310 - _D8_E0 */ 0x21b7, + /* 311 - _D8_E0 */ 0x21b8, + /* 312 - _D8_E0 */ 0x21b9, + /* 313 - _D8_E0 */ 0x21ba, + /* 314 - _D8_E0 */ 0x21bb, + /* 315 - _D8_E0 */ 0x21bc, + /* 316 - _D8_E0 */ 0x21bd, + /* 317 - _D8_E0 */ 0x21be, + /* 318 - _D8_E8 */ 0x21bf, + /* 319 - _D8_E8 */ 0x21c0, + /* 31a - _D8_E8 */ 0x21c1, + /* 31b - _D8_E8 */ 0x21c2, + /* 31c - _D8_E8 */ 0x21c3, + /* 31d - _D8_E8 */ 0x21c4, + /* 31e - _D8_E8 */ 0x21c5, + /* 31f - _D8_E8 */ 0x21c6, + /* 320 - _D8_F0 */ 0x21c7, + /* 321 - _D8_F0 */ 0x21c8, + /* 322 - _D8_F0 */ 0x21c9, + /* 323 - _D8_F0 */ 0x21ca, + /* 324 - _D8_F0 */ 0x21cb, + /* 325 - _D8_F0 */ 0x21cc, + /* 326 - _D8_F0 */ 0x21cd, + /* 327 - _D8_F0 */ 0x21ce, + /* 328 - _D8_F8 */ 0x21cf, + /* 329 - _D8_F8 */ 0x21d0, + /* 32a - _D8_F8 */ 0x21d1, + /* 32b - _D8_F8 */ 0x21d2, + /* 32c - _D8_F8 */ 0x21d3, + /* 32d - _D8_F8 */ 0x21d4, + /* 32e - _D8_F8 */ 0x21d5, + /* 32f - _D8_F8 */ 0x21d6, + /* 330 - _D9_00 */ 0x21d7, + /* 331 - */ 0, + /* 332 - _D9_02 */ 0x21d8, + /* 333 - _D9_03 */ 0x21d9, + /* 334 - _D9_04 */ 0x21da, + /* 335 - _D9_05 */ 0x21db, + /* 336 - _D9_06 */ 0xcf24, + /* 337 - _D9_07 */ 0xcf30, + /* 338 - _D9_C0 */ 0x21dc, + /* 339 - _D9_C0 */ 0x21dd, + /* 33a - _D9_C0 */ 0x21de, + /* 33b - _D9_C0 */ 0x21df, + /* 33c - _D9_C0 */ 0x21e0, + /* 33d - _D9_C0 */ 0x21e1, + /* 33e - _D9_C0 */ 0x21e2, + /* 33f - _D9_C0 */ 0x21e3, + /* 340 - _D9_C8 */ 0x21e4, + /* 341 - _D9_C9 */ 0x21e5, + /* 342 - _D9_C8 */ 0x21e6, + /* 343 - _D9_C8 */ 0x21e7, + /* 344 - _D9_C8 */ 0x21e8, + /* 345 - _D9_C8 */ 0x21e9, + /* 346 - _D9_C8 */ 0x21ea, + /* 347 - _D9_C8 */ 0x21eb, + /* 348 - _D9_D0 */ 0x21ec, + /* 349 - */ 0, + /* 34a - */ 0, + /* 34b - */ 0, + /* 34c - */ 0, + /* 34d - */ 0, + /* 34e - */ 0, + /* 34f - */ 0, + /* 350 - */ 0, + /* 351 - */ 0, + /* 352 - */ 0, + /* 353 - */ 0, + /* 354 - */ 0, + /* 355 - */ 0, + /* 356 - */ 0, + /* 357 - */ 0, + /* 358 - _D9_E0 */ 0x21ed, + /* 359 - _D9_E1 */ 0x21ee, + /* 35a - */ 0, + /* 35b - */ 0, + /* 35c - _D9_E4 */ 0x21ef, + /* 35d - _D9_E5 */ 0x21f0, + /* 35e - */ 0, + /* 35f - */ 0, + /* 360 - _D9_E8 */ 0x21f1, + /* 361 - _D9_E9 */ 0x21f2, + /* 362 - _D9_EA */ 0x21f3, + /* 363 - _D9_EB */ 0x21f4, + /* 364 - _D9_EC */ 0x21f5, + /* 365 - _D9_ED */ 0x21f6, + /* 366 - _D9_EE */ 0x21f7, + /* 367 - */ 0, + /* 368 - _D9_F0 */ 0x21f8, + /* 369 - _D9_F1 */ 0x21f9, + /* 36a - _D9_F2 */ 0x21fa, + /* 36b - _D9_F3 */ 0x21fb, + /* 36c - _D9_F4 */ 0x21fc, + /* 36d - _D9_F5 */ 0x21fd, + /* 36e - _D9_F6 */ 0x21fe, + /* 36f - _D9_F7 */ 0x21ff, + /* 370 - _D9_F8 */ 0x2200, + /* 371 - _D9_F9 */ 0x2201, + /* 372 - _D9_FA */ 0x2202, + /* 373 - _D9_FB */ 0x2203, + /* 374 - _D9_FC */ 0x2204, + /* 375 - _D9_FD */ 0x2205, + /* 376 - _D9_FE */ 0x2206, + /* 377 - _D9_FF */ 0x2207, + /* 378 - _DA_00 */ 0x2208, + /* 379 - _DA_01 */ 0x2209, + /* 37a - _DA_02 */ 0x220a, + /* 37b - _DA_03 */ 0x220b, + /* 37c - _DA_04 */ 0x220c, + /* 37d - _DA_05 */ 0x220d, + /* 37e - _DA_06 */ 0x220e, + /* 37f - _DA_07 */ 0x220f, + /* 380 - _DA_C0 */ 0x2210, + /* 381 - _DA_C0 */ 0x2211, + /* 382 - _DA_C0 */ 0x2212, + /* 383 - _DA_C0 */ 0x2213, + /* 384 - _DA_C0 */ 0x2214, + /* 385 - _DA_C0 */ 0x2215, + /* 386 - _DA_C0 */ 0x2216, + /* 387 - _DA_C0 */ 0x2217, + /* 388 - _DA_C8 */ 0x2218, + /* 389 - _DA_C8 */ 0x2219, + /* 38a - _DA_C8 */ 0x221a, + /* 38b - _DA_C8 */ 0x221b, + /* 38c - _DA_C8 */ 0x221c, + /* 38d - _DA_C8 */ 0x221d, + /* 38e - _DA_C8 */ 0x221e, + /* 38f - _DA_C8 */ 0x221f, + /* 390 - _DA_D0 */ 0x2220, + /* 391 - _DA_D0 */ 0x2221, + /* 392 - _DA_D0 */ 0x2222, + /* 393 - _DA_D0 */ 0x2223, + /* 394 - _DA_D0 */ 0x2224, + /* 395 - _DA_D0 */ 0x2225, + /* 396 - _DA_D0 */ 0x2226, + /* 397 - _DA_D0 */ 0x2227, + /* 398 - _DA_D8 */ 0x2228, + /* 399 - _DA_D8 */ 0x2229, + /* 39a - _DA_D8 */ 0x222a, + /* 39b - _DA_D8 */ 0x222b, + /* 39c - _DA_D8 */ 0x222c, + /* 39d - _DA_D8 */ 0x222d, + /* 39e - _DA_D8 */ 0x222e, + /* 39f - _DA_D8 */ 0x222f, + /* 3a0 - */ 0, + /* 3a1 - */ 0, + /* 3a2 - */ 0, + /* 3a3 - */ 0, + /* 3a4 - */ 0, + /* 3a5 - */ 0, + /* 3a6 - */ 0, + /* 3a7 - */ 0, + /* 3a8 - */ 0, + /* 3a9 - _DA_E9 */ 0x2230, + /* 3aa - */ 0, + /* 3ab - */ 0, + /* 3ac - */ 0, + /* 3ad - */ 0, + /* 3ae - */ 0, + /* 3af - */ 0, + /* 3b0 - */ 0, + /* 3b1 - */ 0, + /* 3b2 - */ 0, + /* 3b3 - */ 0, + /* 3b4 - */ 0, + /* 3b5 - */ 0, + /* 3b6 - */ 0, + /* 3b7 - */ 0, + /* 3b8 - */ 0, + /* 3b9 - */ 0, + /* 3ba - */ 0, + /* 3bb - */ 0, + /* 3bc - */ 0, + /* 3bd - */ 0, + /* 3be - */ 0, + /* 3bf - */ 0, + /* 3c0 - _DB_00 */ 0x2231, + /* 3c1 - _DB_01 */ 0x2232, + /* 3c2 - _DB_02 */ 0x2233, + /* 3c3 - _DB_03 */ 0x2234, + /* 3c4 - */ 0, + /* 3c5 - _DB_05 */ 0x2235, + /* 3c6 - */ 0, + /* 3c7 - _DB_07 */ 0x2236, + /* 3c8 - _DB_C0 */ 0x2237, + /* 3c9 - _DB_C0 */ 0x2238, + /* 3ca - _DB_C0 */ 0x2239, + /* 3cb - _DB_C0 */ 0x223a, + /* 3cc - _DB_C0 */ 0x223b, + /* 3cd - _DB_C0 */ 0x223c, + /* 3ce - _DB_C0 */ 0x223d, + /* 3cf - _DB_C0 */ 0x223e, + /* 3d0 - _DB_C8 */ 0x223f, + /* 3d1 - _DB_C8 */ 0x2240, + /* 3d2 - _DB_C8 */ 0x2241, + /* 3d3 - _DB_C8 */ 0x2242, + /* 3d4 - _DB_C8 */ 0x2243, + /* 3d5 - _DB_C8 */ 0x2244, + /* 3d6 - _DB_C8 */ 0x2245, + /* 3d7 - _DB_C8 */ 0x2246, + /* 3d8 - _DB_D0 */ 0x2247, + /* 3d9 - _DB_D0 */ 0x2248, + /* 3da - _DB_D0 */ 0x2249, + /* 3db - _DB_D0 */ 0x224a, + /* 3dc - _DB_D0 */ 0x224b, + /* 3dd - _DB_D0 */ 0x224c, + /* 3de - _DB_D0 */ 0x224d, + /* 3df - _DB_D0 */ 0x224e, + /* 3e0 - _DB_D8 */ 0x224f, + /* 3e1 - _DB_D8 */ 0x2250, + /* 3e2 - _DB_D8 */ 0x2251, + /* 3e3 - _DB_D8 */ 0x2252, + /* 3e4 - _DB_D8 */ 0x2253, + /* 3e5 - _DB_D8 */ 0x2254, + /* 3e6 - _DB_D8 */ 0x2255, + /* 3e7 - _DB_D8 */ 0x2256, + /* 3e8 - _DB_E0 */ 0x2257, + /* 3e9 - _DB_E1 */ 0x2258, + /* 3ea - _DB_E2 */ 0xcf3c, + /* 3eb - _DB_E3 */ 0xcf48, + /* 3ec - _DB_E4 */ 0x2259, + /* 3ed - */ 0, + /* 3ee - */ 0, + /* 3ef - */ 0, + /* 3f0 - _DB_E8 */ 0x225a, + /* 3f1 - _DB_E8 */ 0x225b, + /* 3f2 - _DB_E8 */ 0x225c, + /* 3f3 - _DB_E8 */ 0x225d, + /* 3f4 - _DB_E8 */ 0x225e, + /* 3f5 - _DB_E8 */ 0x225f, + /* 3f6 - _DB_E8 */ 0x2260, + /* 3f7 - _DB_E8 */ 0x2261, + /* 3f8 - _DB_F0 */ 0x2262, + /* 3f9 - _DB_F0 */ 0x2263, + /* 3fa - _DB_F0 */ 0x2264, + /* 3fb - _DB_F0 */ 0x2265, + /* 3fc - _DB_F0 */ 0x2266, + /* 3fd - _DB_F0 */ 0x2267, + /* 3fe - _DB_F0 */ 0x2268, + /* 3ff - _DB_F0 */ 0x2269, + /* 400 - */ 0, + /* 401 - */ 0, + /* 402 - */ 0, + /* 403 - */ 0, + /* 404 - */ 0, + /* 405 - */ 0, + /* 406 - */ 0, + /* 407 - */ 0, + /* 408 - _DC_00 */ 0x226a, + /* 409 - _DC_01 */ 0x226b, + /* 40a - _DC_02 */ 0x226c, + /* 40b - _DC_03 */ 0x226d, + /* 40c - _DC_04 */ 0x226e, + /* 40d - _DC_05 */ 0x226f, + /* 40e - _DC_06 */ 0x2270, + /* 40f - _DC_07 */ 0x2271, + /* 410 - _DC_C0 */ 0x2272, + /* 411 - _DC_C0 */ 0x2273, + /* 412 - _DC_C0 */ 0x2274, + /* 413 - _DC_C0 */ 0x2275, + /* 414 - _DC_C0 */ 0x2276, + /* 415 - _DC_C0 */ 0x2277, + /* 416 - _DC_C0 */ 0x2278, + /* 417 - _DC_C0 */ 0x2279, + /* 418 - _DC_C8 */ 0x227a, + /* 419 - _DC_C8 */ 0x227b, + /* 41a - _DC_C8 */ 0x227c, + /* 41b - _DC_C8 */ 0x227d, + /* 41c - _DC_C8 */ 0x227e, + /* 41d - _DC_C8 */ 0x227f, + /* 41e - _DC_C8 */ 0x2280, + /* 41f - _DC_C8 */ 0x2281, + /* 420 - */ 0, + /* 421 - */ 0, + /* 422 - */ 0, + /* 423 - */ 0, + /* 424 - */ 0, + /* 425 - */ 0, + /* 426 - */ 0, + /* 427 - */ 0, + /* 428 - */ 0, + /* 429 - */ 0, + /* 42a - */ 0, + /* 42b - */ 0, + /* 42c - */ 0, + /* 42d - */ 0, + /* 42e - */ 0, + /* 42f - */ 0, + /* 430 - _DC_E0 */ 0x2282, + /* 431 - _DC_E0 */ 0x2283, + /* 432 - _DC_E0 */ 0x2284, + /* 433 - _DC_E0 */ 0x2285, + /* 434 - _DC_E0 */ 0x2286, + /* 435 - _DC_E0 */ 0x2287, + /* 436 - _DC_E0 */ 0x2288, + /* 437 - _DC_E0 */ 0x2289, + /* 438 - _DC_E8 */ 0x228a, + /* 439 - _DC_E8 */ 0x228b, + /* 43a - _DC_E8 */ 0x228c, + /* 43b - _DC_E8 */ 0x228d, + /* 43c - _DC_E8 */ 0x228e, + /* 43d - _DC_E8 */ 0x228f, + /* 43e - _DC_E8 */ 0x2290, + /* 43f - _DC_E8 */ 0x2291, + /* 440 - _DC_F0 */ 0x2292, + /* 441 - _DC_F0 */ 0x2293, + /* 442 - _DC_F0 */ 0x2294, + /* 443 - _DC_F0 */ 0x2295, + /* 444 - _DC_F0 */ 0x2296, + /* 445 - _DC_F0 */ 0x2297, + /* 446 - _DC_F0 */ 0x2298, + /* 447 - _DC_F0 */ 0x2299, + /* 448 - _DC_F8 */ 0x229a, + /* 449 - _DC_F8 */ 0x229b, + /* 44a - _DC_F8 */ 0x229c, + /* 44b - _DC_F8 */ 0x229d, + /* 44c - _DC_F8 */ 0x229e, + /* 44d - _DC_F8 */ 0x229f, + /* 44e - _DC_F8 */ 0x22a0, + /* 44f - _DC_F8 */ 0x22a1, + /* 450 - _DD_00 */ 0x22a2, + /* 451 - _DD_01 */ 0x22a3, + /* 452 - _DD_02 */ 0x22a4, + /* 453 - _DD_03 */ 0x22a5, + /* 454 - _DD_04 */ 0x22a6, + /* 455 - */ 0, + /* 456 - _DD_06 */ 0xcf54, + /* 457 - _DD_07 */ 0xcf60, + /* 458 - _DD_C0 */ 0x22a7, + /* 459 - _DD_C0 */ 0x22a8, + /* 45a - _DD_C0 */ 0x22a9, + /* 45b - _DD_C0 */ 0x22aa, + /* 45c - _DD_C0 */ 0x22ab, + /* 45d - _DD_C0 */ 0x22ac, + /* 45e - _DD_C0 */ 0x22ad, + /* 45f - _DD_C0 */ 0x22ae, + /* 460 - */ 0, + /* 461 - */ 0, + /* 462 - */ 0, + /* 463 - */ 0, + /* 464 - */ 0, + /* 465 - */ 0, + /* 466 - */ 0, + /* 467 - */ 0, + /* 468 - _DD_D0 */ 0x22af, + /* 469 - _DD_D0 */ 0x22b0, + /* 46a - _DD_D0 */ 0x22b1, + /* 46b - _DD_D0 */ 0x22b2, + /* 46c - _DD_D0 */ 0x22b3, + /* 46d - _DD_D0 */ 0x22b4, + /* 46e - _DD_D0 */ 0x22b5, + /* 46f - _DD_D0 */ 0x22b6, + /* 470 - _DD_D8 */ 0x22b7, + /* 471 - _DD_D8 */ 0x22b8, + /* 472 - _DD_D8 */ 0x22b9, + /* 473 - _DD_D8 */ 0x22ba, + /* 474 - _DD_D8 */ 0x22bb, + /* 475 - _DD_D8 */ 0x22bc, + /* 476 - _DD_D8 */ 0x22bd, + /* 477 - _DD_D8 */ 0x22be, + /* 478 - _DD_E0 */ 0x22bf, + /* 479 - _DD_E1 */ 0x22c0, + /* 47a - _DD_E0 */ 0x22c1, + /* 47b - _DD_E0 */ 0x22c2, + /* 47c - _DD_E0 */ 0x22c3, + /* 47d - _DD_E0 */ 0x22c4, + /* 47e - _DD_E0 */ 0x22c5, + /* 47f - _DD_E0 */ 0x22c6, + /* 480 - _DD_E8 */ 0x22c7, + /* 481 - _DD_E9 */ 0x22c8, + /* 482 - _DD_E8 */ 0x22c9, + /* 483 - _DD_E8 */ 0x22ca, + /* 484 - _DD_E8 */ 0x22cb, + /* 485 - _DD_E8 */ 0x22cc, + /* 486 - _DD_E8 */ 0x22cd, + /* 487 - _DD_E8 */ 0x22ce, + /* 488 - */ 0, + /* 489 - */ 0, + /* 48a - */ 0, + /* 48b - */ 0, + /* 48c - */ 0, + /* 48d - */ 0, + /* 48e - */ 0, + /* 48f - */ 0, + /* 490 - */ 0, + /* 491 - */ 0, + /* 492 - */ 0, + /* 493 - */ 0, + /* 494 - */ 0, + /* 495 - */ 0, + /* 496 - */ 0, + /* 497 - */ 0, + /* 498 - _DE_00 */ 0x22cf, + /* 499 - _DE_01 */ 0x22d0, + /* 49a - _DE_02 */ 0x22d1, + /* 49b - _DE_03 */ 0x22d2, + /* 49c - _DE_04 */ 0x22d3, + /* 49d - _DE_05 */ 0x22d4, + /* 49e - _DE_06 */ 0x22d5, + /* 49f - _DE_07 */ 0x22d6, + /* 4a0 - _DE_C0 */ 0x22d7, + /* 4a1 - _DE_C1 */ 0x22d8, + /* 4a2 - _DE_C0 */ 0x22d9, + /* 4a3 - _DE_C0 */ 0x22da, + /* 4a4 - _DE_C0 */ 0x22db, + /* 4a5 - _DE_C0 */ 0x22dc, + /* 4a6 - _DE_C0 */ 0x22dd, + /* 4a7 - _DE_C0 */ 0x22de, + /* 4a8 - _DE_C8 */ 0x22df, + /* 4a9 - _DE_C9 */ 0x22e0, + /* 4aa - _DE_C8 */ 0x22e1, + /* 4ab - _DE_C8 */ 0x22e2, + /* 4ac - _DE_C8 */ 0x22e3, + /* 4ad - _DE_C8 */ 0x22e4, + /* 4ae - _DE_C8 */ 0x22e5, + /* 4af - _DE_C8 */ 0x22e6, + /* 4b0 - */ 0, + /* 4b1 - */ 0, + /* 4b2 - */ 0, + /* 4b3 - */ 0, + /* 4b4 - */ 0, + /* 4b5 - */ 0, + /* 4b6 - */ 0, + /* 4b7 - */ 0, + /* 4b8 - */ 0, + /* 4b9 - _DE_D9 */ 0x22e7, + /* 4ba - */ 0, + /* 4bb - */ 0, + /* 4bc - */ 0, + /* 4bd - */ 0, + /* 4be - */ 0, + /* 4bf - */ 0, + /* 4c0 - _DE_E0 */ 0x22e8, + /* 4c1 - _DE_E1 */ 0x22e9, + /* 4c2 - _DE_E0 */ 0x22ea, + /* 4c3 - _DE_E0 */ 0x22eb, + /* 4c4 - _DE_E0 */ 0x22ec, + /* 4c5 - _DE_E0 */ 0x22ed, + /* 4c6 - _DE_E0 */ 0x22ee, + /* 4c7 - _DE_E0 */ 0x22ef, + /* 4c8 - _DE_E8 */ 0x22f0, + /* 4c9 - _DE_E9 */ 0x22f1, + /* 4ca - _DE_E8 */ 0x22f2, + /* 4cb - _DE_E8 */ 0x22f3, + /* 4cc - _DE_E8 */ 0x22f4, + /* 4cd - _DE_E8 */ 0x22f5, + /* 4ce - _DE_E8 */ 0x22f6, + /* 4cf - _DE_E8 */ 0x22f7, + /* 4d0 - _DE_F0 */ 0x22f8, + /* 4d1 - _DE_F1 */ 0x22f9, + /* 4d2 - _DE_F0 */ 0x22fa, + /* 4d3 - _DE_F0 */ 0x22fb, + /* 4d4 - _DE_F0 */ 0x22fc, + /* 4d5 - _DE_F0 */ 0x22fd, + /* 4d6 - _DE_F0 */ 0x22fe, + /* 4d7 - _DE_F0 */ 0x22ff, + /* 4d8 - _DE_F8 */ 0x2300, + /* 4d9 - _DE_F9 */ 0x2301, + /* 4da - _DE_F8 */ 0x2302, + /* 4db - _DE_F8 */ 0x2303, + /* 4dc - _DE_F8 */ 0x2304, + /* 4dd - _DE_F8 */ 0x2305, + /* 4de - _DE_F8 */ 0x2306, + /* 4df - _DE_F8 */ 0x2307, + /* 4e0 - _DF_00 */ 0x2308, + /* 4e1 - _DF_01 */ 0x2309, + /* 4e2 - _DF_02 */ 0x230a, + /* 4e3 - _DF_03 */ 0x230b, + /* 4e4 - _DF_04 */ 0x230c, + /* 4e5 - _DF_05 */ 0x230d, + /* 4e6 - _DF_06 */ 0x230e, + /* 4e7 - _DF_07 */ 0x230f, + /* 4e8 - */ 0, + /* 4e9 - */ 0, + /* 4ea - */ 0, + /* 4eb - */ 0, + /* 4ec - */ 0, + /* 4ed - */ 0, + /* 4ee - */ 0, + /* 4ef - */ 0, + /* 4f0 - */ 0, + /* 4f1 - */ 0, + /* 4f2 - */ 0, + /* 4f3 - */ 0, + /* 4f4 - */ 0, + /* 4f5 - */ 0, + /* 4f6 - */ 0, + /* 4f7 - */ 0, + /* 4f8 - */ 0, + /* 4f9 - */ 0, + /* 4fa - */ 0, + /* 4fb - */ 0, + /* 4fc - */ 0, + /* 4fd - */ 0, + /* 4fe - */ 0, + /* 4ff - */ 0, + /* 500 - */ 0, + /* 501 - */ 0, + /* 502 - */ 0, + /* 503 - */ 0, + /* 504 - */ 0, + /* 505 - */ 0, + /* 506 - */ 0, + /* 507 - */ 0, + /* 508 - _DF_E0 */ 0xcf6c, + /* 509 - */ 0, + /* 50a - */ 0, + /* 50b - */ 0, + /* 50c - */ 0, + /* 50d - */ 0, + /* 50e - */ 0, + /* 50f - */ 0, + /* 510 - _DF_E8 */ 0x2310, + /* 511 - _DF_E8 */ 0x2311, + /* 512 - _DF_E8 */ 0x2312, + /* 513 - _DF_E8 */ 0x2313, + /* 514 - _DF_E8 */ 0x2314, + /* 515 - _DF_E8 */ 0x2315, + /* 516 - _DF_E8 */ 0x2316, + /* 517 - _DF_E8 */ 0x2317, + /* 518 - _DF_F0 */ 0x2318, + /* 519 - _DF_F0 */ 0x2319, + /* 51a - _DF_F0 */ 0x231a, + /* 51b - _DF_F0 */ 0x231b, + /* 51c - _DF_F0 */ 0x231c, + /* 51d - _DF_F0 */ 0x231d, + /* 51e - _DF_F0 */ 0x231e, + /* 51f - _DF_F0 */ 0x231f, + /* 520 - */ 0, + /* 521 - */ 0, + /* 522 - */ 0, + /* 523 - */ 0, + /* 524 - */ 0, + /* 525 - */ 0, + /* 526 - */ 0, + /* 527 - */ 0, + /* 528 - _F6_00 */ 0x2320, + /* 529 - */ 0, + /* 52a - _F6_02 */ 0x2321, + /* 52b - _F6_03 */ 0x2322, + /* 52c - _F6_04 */ 0x2323, + /* 52d - _F6_05 */ 0x2324, + /* 52e - _F6_06 */ 0x2325, + /* 52f - _F6_07 */ 0x2326, + /* 530 - _F7_00 */ 0x2327, + /* 531 - */ 0, + /* 532 - _F7_02 */ 0x2328, + /* 533 - _F7_03 */ 0x2329, + /* 534 - _F7_04 */ 0x232a, + /* 535 - _F7_05 */ 0x232b, + /* 536 - _F7_06 */ 0x232c, + /* 537 - _F7_07 */ 0x232d, + /* 538 - _FE_00 */ 0x232e, + /* 539 - _FE_01 */ 0x232f, + /* 53a - */ 0, + /* 53b - */ 0, + /* 53c - */ 0, + /* 53d - */ 0, + /* 53e - */ 0, + /* 53f - */ 0, + /* 540 - _FF_00 */ 0x2330, + /* 541 - _FF_01 */ 0x2331, + /* 542 - _FF_02 */ 0x2332, + /* 543 - _FF_03 */ 0x2333, + /* 544 - _FF_04 */ 0x2334, + /* 545 - _FF_05 */ 0x2335, + /* 546 - _FF_06 */ 0x2336, + /* 547 - */ 0, + /* 548 - _0F_00_00 */ 0x2337, + /* 549 - _0F_00_01 */ 0x2338, + /* 54a - _0F_00_02 */ 0x2339, + /* 54b - _0F_00_03 */ 0x233a, + /* 54c - _0F_00_04 */ 0x233b, + /* 54d - _0F_00_05 */ 0x233c, + /* 54e - */ 0, + /* 54f - */ 0, + /* 550 - _0F_01_00 */ 0x233d, + /* 551 - _0F_01_01 */ 0x233e, + /* 552 - _0F_01_02 */ 0x233f, + /* 553 - _0F_01_03 */ 0x2340, + /* 554 - _0F_01_04 */ 0x2341, + /* 555 - */ 0, + /* 556 - _0F_01_06 */ 0x2342, + /* 557 - _0F_01_07 */ 0x2343, + /* 558 - */ 0, + /* 559 - _0F_01_C1 */ 0x2344, + /* 55a - _0F_01_C2 */ 0x2345, + /* 55b - _0F_01_C3 */ 0x2346, + /* 55c - _0F_01_C4 */ 0x2347, + /* 55d - */ 0, + /* 55e - */ 0, + /* 55f - */ 0, + /* 560 - _0F_01_C8 */ 0x2348, + /* 561 - _0F_01_C9 */ 0x2349, + /* 562 - */ 0, + /* 563 - */ 0, + /* 564 - */ 0, + /* 565 - */ 0, + /* 566 - */ 0, + /* 567 - */ 0, + /* 568 - _0F_01_D0 */ 0x234a, + /* 569 - _0F_01_D1 */ 0x234b, + /* 56a - */ 0, + /* 56b - */ 0, + /* 56c - _0F_01_D4 */ 0x234c, + /* 56d - _0F_01_D5 */ 0x234d, + /* 56e - */ 0, + /* 56f - */ 0, + /* 570 - _0F_01_D8 */ 0x234e, + /* 571 - _0F_01_D9 */ 0x234f, + /* 572 - _0F_01_DA */ 0x2350, + /* 573 - _0F_01_DB */ 0x2351, + /* 574 - _0F_01_DC */ 0x2352, + /* 575 - _0F_01_DD */ 0x2353, + /* 576 - _0F_01_DE */ 0x2354, + /* 577 - _0F_01_DF */ 0x2355, + /* 578 - */ 0, + /* 579 - */ 0, + /* 57a - */ 0, + /* 57b - */ 0, + /* 57c - */ 0, + /* 57d - */ 0, + /* 57e - */ 0, + /* 57f - */ 0, + /* 580 - */ 0, + /* 581 - */ 0, + /* 582 - */ 0, + /* 583 - */ 0, + /* 584 - */ 0, + /* 585 - */ 0, + /* 586 - */ 0, + /* 587 - */ 0, + /* 588 - */ 0, + /* 589 - */ 0, + /* 58a - */ 0, + /* 58b - */ 0, + /* 58c - */ 0, + /* 58d - */ 0, + /* 58e - */ 0, + /* 58f - */ 0, + /* 590 - _0F_01_F8 */ 0x2356, + /* 591 - _0F_01_F9 */ 0x2357, + /* 592 - */ 0, + /* 593 - */ 0, + /* 594 - */ 0, + /* 595 - */ 0, + /* 596 - */ 0, + /* 597 - */ 0, + /* 598 - _0F_0D_00 */ 0x2358, + /* 599 - _0F_0D_01 */ 0x2359, + /* 59a - */ 0, + /* 59b - */ 0, + /* 59c - */ 0, + /* 59d - */ 0, + /* 59e - */ 0, + /* 59f - */ 0, + /* 5a0 - */ 0, + /* 5a1 - */ 0, + /* 5a2 - */ 0, + /* 5a3 - */ 0, + /* 5a4 - */ 0, + /* 5a5 - */ 0, + /* 5a6 - */ 0, + /* 5a7 - */ 0, + /* 5a8 - */ 0, + /* 5a9 - */ 0, + /* 5aa - */ 0, + /* 5ab - */ 0, + /* 5ac - _0F_0F_0C */ 0x235a, + /* 5ad - _0F_0F_0D */ 0x235b, + /* 5ae - */ 0, + /* 5af - */ 0, + /* 5b0 - */ 0, + /* 5b1 - */ 0, + /* 5b2 - */ 0, + /* 5b3 - */ 0, + /* 5b4 - */ 0, + /* 5b5 - */ 0, + /* 5b6 - */ 0, + /* 5b7 - */ 0, + /* 5b8 - */ 0, + /* 5b9 - */ 0, + /* 5ba - */ 0, + /* 5bb - */ 0, + /* 5bc - _0F_0F_1C */ 0x235c, + /* 5bd - _0F_0F_1D */ 0x235d, + /* 5be - */ 0, + /* 5bf - */ 0, + /* 5c0 - */ 0, + /* 5c1 - */ 0, + /* 5c2 - */ 0, + /* 5c3 - */ 0, + /* 5c4 - */ 0, + /* 5c5 - */ 0, + /* 5c6 - */ 0, + /* 5c7 - */ 0, + /* 5c8 - */ 0, + /* 5c9 - */ 0, + /* 5ca - */ 0, + /* 5cb - */ 0, + /* 5cc - */ 0, + /* 5cd - */ 0, + /* 5ce - */ 0, + /* 5cf - */ 0, + /* 5d0 - */ 0, + /* 5d1 - */ 0, + /* 5d2 - */ 0, + /* 5d3 - */ 0, + /* 5d4 - */ 0, + /* 5d5 - */ 0, + /* 5d6 - */ 0, + /* 5d7 - */ 0, + /* 5d8 - */ 0, + /* 5d9 - */ 0, + /* 5da - */ 0, + /* 5db - */ 0, + /* 5dc - */ 0, + /* 5dd - */ 0, + /* 5de - */ 0, + /* 5df - */ 0, + /* 5e0 - */ 0, + /* 5e1 - */ 0, + /* 5e2 - */ 0, + /* 5e3 - */ 0, + /* 5e4 - */ 0, + /* 5e5 - */ 0, + /* 5e6 - */ 0, + /* 5e7 - */ 0, + /* 5e8 - */ 0, + /* 5e9 - */ 0, + /* 5ea - */ 0, + /* 5eb - */ 0, + /* 5ec - */ 0, + /* 5ed - */ 0, + /* 5ee - */ 0, + /* 5ef - */ 0, + /* 5f0 - */ 0, + /* 5f1 - */ 0, + /* 5f2 - */ 0, + /* 5f3 - */ 0, + /* 5f4 - */ 0, + /* 5f5 - */ 0, + /* 5f6 - */ 0, + /* 5f7 - */ 0, + /* 5f8 - */ 0, + /* 5f9 - */ 0, + /* 5fa - */ 0, + /* 5fb - */ 0, + /* 5fc - */ 0, + /* 5fd - */ 0, + /* 5fe - */ 0, + /* 5ff - */ 0, + /* 600 - */ 0, + /* 601 - */ 0, + /* 602 - */ 0, + /* 603 - */ 0, + /* 604 - */ 0, + /* 605 - */ 0, + /* 606 - */ 0, + /* 607 - */ 0, + /* 608 - */ 0, + /* 609 - */ 0, + /* 60a - */ 0, + /* 60b - */ 0, + /* 60c - */ 0, + /* 60d - */ 0, + /* 60e - */ 0, + /* 60f - */ 0, + /* 610 - */ 0, + /* 611 - */ 0, + /* 612 - */ 0, + /* 613 - */ 0, + /* 614 - */ 0, + /* 615 - */ 0, + /* 616 - */ 0, + /* 617 - */ 0, + /* 618 - */ 0, + /* 619 - */ 0, + /* 61a - */ 0, + /* 61b - */ 0, + /* 61c - */ 0, + /* 61d - */ 0, + /* 61e - */ 0, + /* 61f - */ 0, + /* 620 - */ 0, + /* 621 - */ 0, + /* 622 - */ 0, + /* 623 - */ 0, + /* 624 - */ 0, + /* 625 - */ 0, + /* 626 - */ 0, + /* 627 - */ 0, + /* 628 - */ 0, + /* 629 - */ 0, + /* 62a - _0F_0F_8A */ 0x235e, + /* 62b - */ 0, + /* 62c - */ 0, + /* 62d - */ 0, + /* 62e - _0F_0F_8E */ 0x235f, + /* 62f - */ 0, + /* 630 - _0F_0F_90 */ 0x2360, + /* 631 - */ 0, + /* 632 - */ 0, + /* 633 - */ 0, + /* 634 - _0F_0F_94 */ 0x2361, + /* 635 - */ 0, + /* 636 - _0F_0F_96 */ 0x2362, + /* 637 - _0F_0F_97 */ 0x2363, + /* 638 - */ 0, + /* 639 - */ 0, + /* 63a - _0F_0F_9A */ 0x2364, + /* 63b - */ 0, + /* 63c - */ 0, + /* 63d - */ 0, + /* 63e - _0F_0F_9E */ 0x2365, + /* 63f - */ 0, + /* 640 - _0F_0F_A0 */ 0x2366, + /* 641 - */ 0, + /* 642 - */ 0, + /* 643 - */ 0, + /* 644 - _0F_0F_A4 */ 0x2367, + /* 645 - */ 0, + /* 646 - _0F_0F_A6 */ 0x2368, + /* 647 - _0F_0F_A7 */ 0x2369, + /* 648 - */ 0, + /* 649 - */ 0, + /* 64a - _0F_0F_AA */ 0x236a, + /* 64b - */ 0, + /* 64c - */ 0, + /* 64d - */ 0, + /* 64e - _0F_0F_AE */ 0x236b, + /* 64f - */ 0, + /* 650 - _0F_0F_B0 */ 0x236c, + /* 651 - */ 0, + /* 652 - */ 0, + /* 653 - */ 0, + /* 654 - _0F_0F_B4 */ 0x236d, + /* 655 - */ 0, + /* 656 - _0F_0F_B6 */ 0x236e, + /* 657 - _0F_0F_B7 */ 0x236f, + /* 658 - */ 0, + /* 659 - */ 0, + /* 65a - */ 0, + /* 65b - _0F_0F_BB */ 0x2370, + /* 65c - */ 0, + /* 65d - */ 0, + /* 65e - */ 0, + /* 65f - _0F_0F_BF */ 0x2371, + /* 660 - */ 0, + /* 661 - */ 0, + /* 662 - */ 0, + /* 663 - */ 0, + /* 664 - */ 0, + /* 665 - */ 0, + /* 666 - */ 0, + /* 667 - */ 0, + /* 668 - */ 0, + /* 669 - */ 0, + /* 66a - */ 0, + /* 66b - */ 0, + /* 66c - */ 0, + /* 66d - */ 0, + /* 66e - */ 0, + /* 66f - */ 0, + /* 670 - */ 0, + /* 671 - */ 0, + /* 672 - */ 0, + /* 673 - */ 0, + /* 674 - */ 0, + /* 675 - */ 0, + /* 676 - */ 0, + /* 677 - */ 0, + /* 678 - */ 0, + /* 679 - */ 0, + /* 67a - */ 0, + /* 67b - */ 0, + /* 67c - */ 0, + /* 67d - */ 0, + /* 67e - */ 0, + /* 67f - */ 0, + /* 680 - */ 0, + /* 681 - */ 0, + /* 682 - */ 0, + /* 683 - */ 0, + /* 684 - */ 0, + /* 685 - */ 0, + /* 686 - */ 0, + /* 687 - */ 0, + /* 688 - */ 0, + /* 689 - */ 0, + /* 68a - */ 0, + /* 68b - */ 0, + /* 68c - */ 0, + /* 68d - */ 0, + /* 68e - */ 0, + /* 68f - */ 0, + /* 690 - */ 0, + /* 691 - */ 0, + /* 692 - */ 0, + /* 693 - */ 0, + /* 694 - */ 0, + /* 695 - */ 0, + /* 696 - */ 0, + /* 697 - */ 0, + /* 698 - */ 0, + /* 699 - */ 0, + /* 69a - */ 0, + /* 69b - */ 0, + /* 69c - */ 0, + /* 69d - */ 0, + /* 69e - */ 0, + /* 69f - */ 0, + /* 6a0 - _0F_10 */ 0x2372, + /* 6a1 - _66_0F_10 */ 0x2373, + /* 6a2 - _F3_0F_10 */ 0x2374, + /* 6a3 - _F2_0F_10 */ 0x2375, + /* 6a4 - _V_0F_10 */ 0x4009, + /* 6a5 - _V_66_0F_10 */ 0x400a, + /* 6a6 - _V_F3_0F_10 */ 0x400b, + /* 6a7 - _V_F2_0F_10 */ 0x400c, + /* 6a8 - */ 0, + /* 6a9 - */ 0, + /* 6aa - _VRR_F3_0F_10 */ 0x400d, + /* 6ab - _VRR_F2_0F_10 */ 0x400e, + /* 6ac - _0F_11 */ 0x2376, + /* 6ad - _66_0F_11 */ 0x2377, + /* 6ae - _F3_0F_11 */ 0x2378, + /* 6af - _F2_0F_11 */ 0x2379, + /* 6b0 - _V_0F_11 */ 0x400f, + /* 6b1 - _V_66_0F_11 */ 0x4010, + /* 6b2 - _V_F3_0F_11 */ 0x4011, + /* 6b3 - _V_F2_0F_11 */ 0x4012, + /* 6b4 - */ 0, + /* 6b5 - */ 0, + /* 6b6 - _VRR_F3_0F_11 */ 0x4013, + /* 6b7 - _VRR_F2_0F_11 */ 0x4014, + /* 6b8 - _0F_12 */ 0x4015, + /* 6b9 - _66_0F_12 */ 0x237a, + /* 6ba - _F3_0F_12 */ 0x237b, + /* 6bb - _F2_0F_12 */ 0x237c, + /* 6bc - _V_0F_12 */ 0x4016, + /* 6bd - _V_66_0F_12 */ 0x4017, + /* 6be - _V_F3_0F_12 */ 0x4018, + /* 6bf - _V_F2_0F_12 */ 0x4019, + /* 6c0 - */ 0, + /* 6c1 - */ 0, + /* 6c2 - */ 0, + /* 6c3 - */ 0, + /* 6c4 - _0F_13 */ 0x237d, + /* 6c5 - _66_0F_13 */ 0x237e, + /* 6c6 - */ 0, + /* 6c7 - */ 0, + /* 6c8 - _V_0F_13 */ 0x401a, + /* 6c9 - _V_66_0F_13 */ 0x401b, + /* 6ca - */ 0, + /* 6cb - */ 0, + /* 6cc - */ 0, + /* 6cd - */ 0, + /* 6ce - */ 0, + /* 6cf - */ 0, + /* 6d0 - _0F_14 */ 0x237f, + /* 6d1 - _66_0F_14 */ 0x2380, + /* 6d2 - */ 0, + /* 6d3 - */ 0, + /* 6d4 - _V_0F_14 */ 0x401c, + /* 6d5 - _V_66_0F_14 */ 0x401d, + /* 6d6 - */ 0, + /* 6d7 - */ 0, + /* 6d8 - */ 0, + /* 6d9 - */ 0, + /* 6da - */ 0, + /* 6db - */ 0, + /* 6dc - _0F_15 */ 0x2381, + /* 6dd - _66_0F_15 */ 0x2382, + /* 6de - */ 0, + /* 6df - */ 0, + /* 6e0 - _V_0F_15 */ 0x401e, + /* 6e1 - _V_66_0F_15 */ 0x401f, + /* 6e2 - */ 0, + /* 6e3 - */ 0, + /* 6e4 - */ 0, + /* 6e5 - */ 0, + /* 6e6 - */ 0, + /* 6e7 - */ 0, + /* 6e8 - _0F_16 */ 0x4020, + /* 6e9 - _66_0F_16 */ 0x2383, + /* 6ea - _F3_0F_16 */ 0x2384, + /* 6eb - */ 0, + /* 6ec - _V_0F_16 */ 0x4021, + /* 6ed - _V_66_0F_16 */ 0x4022, + /* 6ee - _V_F3_0F_16 */ 0x4023, + /* 6ef - */ 0, + /* 6f0 - */ 0, + /* 6f1 - */ 0, + /* 6f2 - */ 0, + /* 6f3 - */ 0, + /* 6f4 - _0F_17 */ 0x2385, + /* 6f5 - _66_0F_17 */ 0x2386, + /* 6f6 - */ 0, + /* 6f7 - */ 0, + /* 6f8 - _V_0F_17 */ 0x4024, + /* 6f9 - _V_66_0F_17 */ 0x4025, + /* 6fa - */ 0, + /* 6fb - */ 0, + /* 6fc - */ 0, + /* 6fd - */ 0, + /* 6fe - */ 0, + /* 6ff - */ 0, + /* 700 - _0F_18_00 */ 0x2387, + /* 701 - _0F_18_01 */ 0x2388, + /* 702 - _0F_18_02 */ 0x2389, + /* 703 - _0F_18_03 */ 0x238a, + /* 704 - */ 0, + /* 705 - */ 0, + /* 706 - */ 0, + /* 707 - */ 0, + /* 708 - _0F_28 */ 0x238b, + /* 709 - _66_0F_28 */ 0x238c, + /* 70a - */ 0, + /* 70b - */ 0, + /* 70c - _V_0F_28 */ 0x4026, + /* 70d - _V_66_0F_28 */ 0x4027, + /* 70e - */ 0, + /* 70f - */ 0, + /* 710 - */ 0, + /* 711 - */ 0, + /* 712 - */ 0, + /* 713 - */ 0, + /* 714 - _0F_29 */ 0x238d, + /* 715 - _66_0F_29 */ 0x238e, + /* 716 - */ 0, + /* 717 - */ 0, + /* 718 - _V_0F_29 */ 0x4028, + /* 719 - _V_66_0F_29 */ 0x4029, + /* 71a - */ 0, + /* 71b - */ 0, + /* 71c - */ 0, + /* 71d - */ 0, + /* 71e - */ 0, + /* 71f - */ 0, + /* 720 - _0F_2A */ 0x238f, + /* 721 - _66_0F_2A */ 0x2390, + /* 722 - _F3_0F_2A */ 0x2391, + /* 723 - _F2_0F_2A */ 0x2392, + /* 724 - */ 0, + /* 725 - */ 0, + /* 726 - _V_F3_0F_2A */ 0x402a, + /* 727 - _V_F2_0F_2A */ 0x402b, + /* 728 - */ 0, + /* 729 - */ 0, + /* 72a - */ 0, + /* 72b - */ 0, + /* 72c - _0F_2B */ 0x2393, + /* 72d - _66_0F_2B */ 0x2394, + /* 72e - _F3_0F_2B */ 0x2395, + /* 72f - _F2_0F_2B */ 0x2396, + /* 730 - _V_0F_2B */ 0x402c, + /* 731 - _V_66_0F_2B */ 0x402d, + /* 732 - */ 0, + /* 733 - */ 0, + /* 734 - */ 0, + /* 735 - */ 0, + /* 736 - */ 0, + /* 737 - */ 0, + /* 738 - _0F_2C */ 0x2397, + /* 739 - _66_0F_2C */ 0x2398, + /* 73a - _F3_0F_2C */ 0x2399, + /* 73b - _F2_0F_2C */ 0x239a, + /* 73c - */ 0, + /* 73d - */ 0, + /* 73e - _V_F3_0F_2C */ 0x402e, + /* 73f - _V_F2_0F_2C */ 0x402f, + /* 740 - */ 0, + /* 741 - */ 0, + /* 742 - */ 0, + /* 743 - */ 0, + /* 744 - _0F_2D */ 0x239b, + /* 745 - _66_0F_2D */ 0x239c, + /* 746 - _F3_0F_2D */ 0x239d, + /* 747 - _F2_0F_2D */ 0x239e, + /* 748 - */ 0, + /* 749 - */ 0, + /* 74a - _V_F3_0F_2D */ 0x4030, + /* 74b - _V_F2_0F_2D */ 0x4031, + /* 74c - */ 0, + /* 74d - */ 0, + /* 74e - */ 0, + /* 74f - */ 0, + /* 750 - _0F_2E */ 0x239f, + /* 751 - _66_0F_2E */ 0x23a0, + /* 752 - */ 0, + /* 753 - */ 0, + /* 754 - _V_0F_2E */ 0x4032, + /* 755 - _V_66_0F_2E */ 0x4033, + /* 756 - */ 0, + /* 757 - */ 0, + /* 758 - */ 0, + /* 759 - */ 0, + /* 75a - */ 0, + /* 75b - */ 0, + /* 75c - _0F_2F */ 0x23a1, + /* 75d - _66_0F_2F */ 0x23a2, + /* 75e - */ 0, + /* 75f - */ 0, + /* 760 - _V_0F_2F */ 0x4034, + /* 761 - _V_66_0F_2F */ 0x4035, + /* 762 - */ 0, + /* 763 - */ 0, + /* 764 - */ 0, + /* 765 - */ 0, + /* 766 - */ 0, + /* 767 - */ 0, + /* 768 - _0F_38_00 */ 0xcf78, + /* 769 - _0F_38_01 */ 0xcf84, + /* 76a - _0F_38_02 */ 0xcf90, + /* 76b - _0F_38_03 */ 0xcf9c, + /* 76c - _0F_38_04 */ 0xcfa8, + /* 76d - _0F_38_05 */ 0xcfb4, + /* 76e - _0F_38_06 */ 0xcfc0, + /* 76f - _0F_38_07 */ 0xcfcc, + /* 770 - _0F_38_08 */ 0xcfd8, + /* 771 - _0F_38_09 */ 0xcfe4, + /* 772 - _0F_38_0A */ 0xcff0, + /* 773 - _0F_38_0B */ 0xcffc, + /* 774 - _0F_38_0C */ 0xd008, + /* 775 - _0F_38_0D */ 0xd014, + /* 776 - _0F_38_0E */ 0xd020, + /* 777 - _0F_38_0F */ 0xd02c, + /* 778 - _0F_38_10 */ 0xd038, + /* 779 - */ 0, + /* 77a - */ 0, + /* 77b - */ 0, + /* 77c - _0F_38_14 */ 0xd044, + /* 77d - _0F_38_15 */ 0xd050, + /* 77e - */ 0, + /* 77f - _0F_38_17 */ 0xd05c, + /* 780 - _0F_38_18 */ 0xd068, + /* 781 - _0F_38_19 */ 0xd074, + /* 782 - _0F_38_1A */ 0xd080, + /* 783 - */ 0, + /* 784 - _0F_38_1C */ 0xd08c, + /* 785 - _0F_38_1D */ 0xd098, + /* 786 - _0F_38_1E */ 0xd0a4, + /* 787 - */ 0, + /* 788 - _0F_38_20 */ 0xd0b0, + /* 789 - _0F_38_21 */ 0xd0bc, + /* 78a - _0F_38_22 */ 0xd0c8, + /* 78b - _0F_38_23 */ 0xd0d4, + /* 78c - _0F_38_24 */ 0xd0e0, + /* 78d - _0F_38_25 */ 0xd0ec, + /* 78e - */ 0, + /* 78f - */ 0, + /* 790 - _0F_38_28 */ 0xd0f8, + /* 791 - _0F_38_29 */ 0xd104, + /* 792 - _0F_38_2A */ 0xd110, + /* 793 - _0F_38_2B */ 0xd11c, + /* 794 - _0F_38_2C */ 0xd128, + /* 795 - _0F_38_2D */ 0xd134, + /* 796 - _0F_38_2E */ 0xd140, + /* 797 - _0F_38_2F */ 0xd14c, + /* 798 - _0F_38_30 */ 0xd158, + /* 799 - _0F_38_31 */ 0xd164, + /* 79a - _0F_38_32 */ 0xd170, + /* 79b - _0F_38_33 */ 0xd17c, + /* 79c - _0F_38_34 */ 0xd188, + /* 79d - _0F_38_35 */ 0xd194, + /* 79e - */ 0, + /* 79f - _0F_38_37 */ 0xd1a0, + /* 7a0 - _0F_38_38 */ 0xd1ac, + /* 7a1 - _0F_38_39 */ 0xd1b8, + /* 7a2 - _0F_38_3A */ 0xd1c4, + /* 7a3 - _0F_38_3B */ 0xd1d0, + /* 7a4 - _0F_38_3C */ 0xd1dc, + /* 7a5 - _0F_38_3D */ 0xd1e8, + /* 7a6 - _0F_38_3E */ 0xd1f4, + /* 7a7 - _0F_38_3F */ 0xd200, + /* 7a8 - _0F_38_40 */ 0xd20c, + /* 7a9 - _0F_38_41 */ 0xd218, + /* 7aa - */ 0, + /* 7ab - */ 0, + /* 7ac - */ 0, + /* 7ad - */ 0, + /* 7ae - */ 0, + /* 7af - */ 0, + /* 7b0 - */ 0, + /* 7b1 - */ 0, + /* 7b2 - */ 0, + /* 7b3 - */ 0, + /* 7b4 - */ 0, + /* 7b5 - */ 0, + /* 7b6 - */ 0, + /* 7b7 - */ 0, + /* 7b8 - */ 0, + /* 7b9 - */ 0, + /* 7ba - */ 0, + /* 7bb - */ 0, + /* 7bc - */ 0, + /* 7bd - */ 0, + /* 7be - */ 0, + /* 7bf - */ 0, + /* 7c0 - */ 0, + /* 7c1 - */ 0, + /* 7c2 - */ 0, + /* 7c3 - */ 0, + /* 7c4 - */ 0, + /* 7c5 - */ 0, + /* 7c6 - */ 0, + /* 7c7 - */ 0, + /* 7c8 - */ 0, + /* 7c9 - */ 0, + /* 7ca - */ 0, + /* 7cb - */ 0, + /* 7cc - */ 0, + /* 7cd - */ 0, + /* 7ce - */ 0, + /* 7cf - */ 0, + /* 7d0 - */ 0, + /* 7d1 - */ 0, + /* 7d2 - */ 0, + /* 7d3 - */ 0, + /* 7d4 - */ 0, + /* 7d5 - */ 0, + /* 7d6 - */ 0, + /* 7d7 - */ 0, + /* 7d8 - */ 0, + /* 7d9 - */ 0, + /* 7da - */ 0, + /* 7db - */ 0, + /* 7dc - */ 0, + /* 7dd - */ 0, + /* 7de - */ 0, + /* 7df - */ 0, + /* 7e0 - */ 0, + /* 7e1 - */ 0, + /* 7e2 - */ 0, + /* 7e3 - */ 0, + /* 7e4 - */ 0, + /* 7e5 - */ 0, + /* 7e6 - */ 0, + /* 7e7 - */ 0, + /* 7e8 - _0F_38_80 */ 0xd224, + /* 7e9 - _0F_38_81 */ 0xd230, + /* 7ea - _0F_38_82 */ 0xd23c, + /* 7eb - */ 0, + /* 7ec - */ 0, + /* 7ed - */ 0, + /* 7ee - */ 0, + /* 7ef - */ 0, + /* 7f0 - */ 0, + /* 7f1 - */ 0, + /* 7f2 - */ 0, + /* 7f3 - */ 0, + /* 7f4 - */ 0, + /* 7f5 - */ 0, + /* 7f6 - */ 0, + /* 7f7 - */ 0, + /* 7f8 - */ 0, + /* 7f9 - */ 0, + /* 7fa - */ 0, + /* 7fb - */ 0, + /* 7fc - */ 0, + /* 7fd - */ 0, + /* 7fe - _0F_38_96 */ 0xd248, + /* 7ff - _0F_38_97 */ 0xd254, + /* 800 - _0F_38_98 */ 0xd260, + /* 801 - _0F_38_99 */ 0xd26c, + /* 802 - _0F_38_9A */ 0xd278, + /* 803 - _0F_38_9B */ 0xd284, + /* 804 - _0F_38_9C */ 0xd290, + /* 805 - _0F_38_9D */ 0xd29c, + /* 806 - _0F_38_9E */ 0xd2a8, + /* 807 - _0F_38_9F */ 0xd2b4, + /* 808 - */ 0, + /* 809 - */ 0, + /* 80a - */ 0, + /* 80b - */ 0, + /* 80c - */ 0, + /* 80d - */ 0, + /* 80e - _0F_38_A6 */ 0xd2c0, + /* 80f - _0F_38_A7 */ 0xd2cc, + /* 810 - _0F_38_A8 */ 0xd2d8, + /* 811 - _0F_38_A9 */ 0xd2e4, + /* 812 - _0F_38_AA */ 0xd2f0, + /* 813 - _0F_38_AB */ 0xd2fc, + /* 814 - _0F_38_AC */ 0xd308, + /* 815 - _0F_38_AD */ 0xd314, + /* 816 - _0F_38_AE */ 0xd320, + /* 817 - _0F_38_AF */ 0xd32c, + /* 818 - */ 0, + /* 819 - */ 0, + /* 81a - */ 0, + /* 81b - */ 0, + /* 81c - */ 0, + /* 81d - */ 0, + /* 81e - _0F_38_B6 */ 0xd338, + /* 81f - _0F_38_B7 */ 0xd344, + /* 820 - _0F_38_B8 */ 0xd350, + /* 821 - _0F_38_B9 */ 0xd35c, + /* 822 - _0F_38_BA */ 0xd368, + /* 823 - _0F_38_BB */ 0xd374, + /* 824 - _0F_38_BC */ 0xd380, + /* 825 - _0F_38_BD */ 0xd38c, + /* 826 - _0F_38_BE */ 0xd398, + /* 827 - _0F_38_BF */ 0xd3a4, + /* 828 - */ 0, + /* 829 - */ 0, + /* 82a - */ 0, + /* 82b - */ 0, + /* 82c - */ 0, + /* 82d - */ 0, + /* 82e - */ 0, + /* 82f - */ 0, + /* 830 - */ 0, + /* 831 - */ 0, + /* 832 - */ 0, + /* 833 - */ 0, + /* 834 - */ 0, + /* 835 - */ 0, + /* 836 - */ 0, + /* 837 - */ 0, + /* 838 - */ 0, + /* 839 - */ 0, + /* 83a - */ 0, + /* 83b - */ 0, + /* 83c - */ 0, + /* 83d - */ 0, + /* 83e - */ 0, + /* 83f - */ 0, + /* 840 - */ 0, + /* 841 - */ 0, + /* 842 - */ 0, + /* 843 - _0F_38_DB */ 0xd3b0, + /* 844 - _0F_38_DC */ 0xd3bc, + /* 845 - _0F_38_DD */ 0xd3c8, + /* 846 - _0F_38_DE */ 0xd3d4, + /* 847 - _0F_38_DF */ 0xd3e0, + /* 848 - */ 0, + /* 849 - */ 0, + /* 84a - */ 0, + /* 84b - */ 0, + /* 84c - */ 0, + /* 84d - */ 0, + /* 84e - */ 0, + /* 84f - */ 0, + /* 850 - */ 0, + /* 851 - */ 0, + /* 852 - */ 0, + /* 853 - */ 0, + /* 854 - */ 0, + /* 855 - */ 0, + /* 856 - */ 0, + /* 857 - */ 0, + /* 858 - _0F_38_F0 */ 0xd3ec, + /* 859 - _0F_38_F1 */ 0xd3f8, + /* 85a - */ 0, + /* 85b - */ 0, + /* 85c - */ 0, + /* 85d - */ 0, + /* 85e - */ 0, + /* 85f - */ 0, + /* 860 - */ 0, + /* 861 - */ 0, + /* 862 - */ 0, + /* 863 - */ 0, + /* 864 - */ 0, + /* 865 - */ 0, + /* 866 - */ 0, + /* 867 - */ 0, + /* 868 - */ 0, + /* 869 - */ 0, + /* 86a - */ 0, + /* 86b - */ 0, + /* 86c - _0F_3A_04 */ 0xd404, + /* 86d - _0F_3A_05 */ 0xd410, + /* 86e - _0F_3A_06 */ 0xd41c, + /* 86f - */ 0, + /* 870 - _0F_3A_08 */ 0xd428, + /* 871 - _0F_3A_09 */ 0xd434, + /* 872 - _0F_3A_0A */ 0xd440, + /* 873 - _0F_3A_0B */ 0xd44c, + /* 874 - _0F_3A_0C */ 0xd458, + /* 875 - _0F_3A_0D */ 0xd464, + /* 876 - _0F_3A_0E */ 0xd470, + /* 877 - _0F_3A_0F */ 0xd47c, + /* 878 - */ 0, + /* 879 - */ 0, + /* 87a - */ 0, + /* 87b - */ 0, + /* 87c - _0F_3A_14 */ 0xd488, + /* 87d - _0F_3A_15 */ 0xd494, + /* 87e - _0F_3A_16 */ 0xd4a0, + /* 87f - _0F_3A_17 */ 0xd4ac, + /* 880 - _0F_3A_18 */ 0xd4b8, + /* 881 - _0F_3A_19 */ 0xd4c4, + /* 882 - */ 0, + /* 883 - */ 0, + /* 884 - */ 0, + /* 885 - */ 0, + /* 886 - */ 0, + /* 887 - */ 0, + /* 888 - _0F_3A_20 */ 0xd4d0, + /* 889 - _0F_3A_21 */ 0xd4dc, + /* 88a - _0F_3A_22 */ 0xd4e8, + /* 88b - */ 0, + /* 88c - */ 0, + /* 88d - */ 0, + /* 88e - */ 0, + /* 88f - */ 0, + /* 890 - */ 0, + /* 891 - */ 0, + /* 892 - */ 0, + /* 893 - */ 0, + /* 894 - */ 0, + /* 895 - */ 0, + /* 896 - */ 0, + /* 897 - */ 0, + /* 898 - */ 0, + /* 899 - */ 0, + /* 89a - */ 0, + /* 89b - */ 0, + /* 89c - */ 0, + /* 89d - */ 0, + /* 89e - */ 0, + /* 89f - */ 0, + /* 8a0 - */ 0, + /* 8a1 - */ 0, + /* 8a2 - */ 0, + /* 8a3 - */ 0, + /* 8a4 - */ 0, + /* 8a5 - */ 0, + /* 8a6 - */ 0, + /* 8a7 - */ 0, + /* 8a8 - _0F_3A_40 */ 0xd4f4, + /* 8a9 - _0F_3A_41 */ 0xd500, + /* 8aa - _0F_3A_42 */ 0xd50c, + /* 8ab - */ 0, + /* 8ac - _0F_3A_44 */ 0xd518, + /* 8ad - */ 0, + /* 8ae - */ 0, + /* 8af - */ 0, + /* 8b0 - */ 0, + /* 8b1 - */ 0, + /* 8b2 - _0F_3A_4A */ 0xd524, + /* 8b3 - _0F_3A_4B */ 0xd530, + /* 8b4 - _0F_3A_4C */ 0xd53c, + /* 8b5 - */ 0, + /* 8b6 - */ 0, + /* 8b7 - */ 0, + /* 8b8 - */ 0, + /* 8b9 - */ 0, + /* 8ba - */ 0, + /* 8bb - */ 0, + /* 8bc - */ 0, + /* 8bd - */ 0, + /* 8be - */ 0, + /* 8bf - */ 0, + /* 8c0 - */ 0, + /* 8c1 - */ 0, + /* 8c2 - */ 0, + /* 8c3 - */ 0, + /* 8c4 - */ 0, + /* 8c5 - */ 0, + /* 8c6 - */ 0, + /* 8c7 - */ 0, + /* 8c8 - _0F_3A_60 */ 0xd548, + /* 8c9 - _0F_3A_61 */ 0xd554, + /* 8ca - _0F_3A_62 */ 0xd560, + /* 8cb - _0F_3A_63 */ 0xd56c, + /* 8cc - */ 0, + /* 8cd - */ 0, + /* 8ce - */ 0, + /* 8cf - */ 0, + /* 8d0 - */ 0, + /* 8d1 - */ 0, + /* 8d2 - */ 0, + /* 8d3 - */ 0, + /* 8d4 - */ 0, + /* 8d5 - */ 0, + /* 8d6 - */ 0, + /* 8d7 - */ 0, + /* 8d8 - */ 0, + /* 8d9 - */ 0, + /* 8da - */ 0, + /* 8db - */ 0, + /* 8dc - */ 0, + /* 8dd - */ 0, + /* 8de - */ 0, + /* 8df - */ 0, + /* 8e0 - */ 0, + /* 8e1 - */ 0, + /* 8e2 - */ 0, + /* 8e3 - */ 0, + /* 8e4 - */ 0, + /* 8e5 - */ 0, + /* 8e6 - */ 0, + /* 8e7 - */ 0, + /* 8e8 - */ 0, + /* 8e9 - */ 0, + /* 8ea - */ 0, + /* 8eb - */ 0, + /* 8ec - */ 0, + /* 8ed - */ 0, + /* 8ee - */ 0, + /* 8ef - */ 0, + /* 8f0 - */ 0, + /* 8f1 - */ 0, + /* 8f2 - */ 0, + /* 8f3 - */ 0, + /* 8f4 - */ 0, + /* 8f5 - */ 0, + /* 8f6 - */ 0, + /* 8f7 - */ 0, + /* 8f8 - */ 0, + /* 8f9 - */ 0, + /* 8fa - */ 0, + /* 8fb - */ 0, + /* 8fc - */ 0, + /* 8fd - */ 0, + /* 8fe - */ 0, + /* 8ff - */ 0, + /* 900 - */ 0, + /* 901 - */ 0, + /* 902 - */ 0, + /* 903 - */ 0, + /* 904 - */ 0, + /* 905 - */ 0, + /* 906 - */ 0, + /* 907 - */ 0, + /* 908 - */ 0, + /* 909 - */ 0, + /* 90a - */ 0, + /* 90b - */ 0, + /* 90c - */ 0, + /* 90d - */ 0, + /* 90e - */ 0, + /* 90f - */ 0, + /* 910 - */ 0, + /* 911 - */ 0, + /* 912 - */ 0, + /* 913 - */ 0, + /* 914 - */ 0, + /* 915 - */ 0, + /* 916 - */ 0, + /* 917 - */ 0, + /* 918 - */ 0, + /* 919 - */ 0, + /* 91a - */ 0, + /* 91b - */ 0, + /* 91c - */ 0, + /* 91d - */ 0, + /* 91e - */ 0, + /* 91f - */ 0, + /* 920 - */ 0, + /* 921 - */ 0, + /* 922 - */ 0, + /* 923 - */ 0, + /* 924 - */ 0, + /* 925 - */ 0, + /* 926 - */ 0, + /* 927 - */ 0, + /* 928 - */ 0, + /* 929 - */ 0, + /* 92a - */ 0, + /* 92b - */ 0, + /* 92c - */ 0, + /* 92d - */ 0, + /* 92e - */ 0, + /* 92f - */ 0, + /* 930 - */ 0, + /* 931 - */ 0, + /* 932 - */ 0, + /* 933 - */ 0, + /* 934 - */ 0, + /* 935 - */ 0, + /* 936 - */ 0, + /* 937 - */ 0, + /* 938 - */ 0, + /* 939 - */ 0, + /* 93a - */ 0, + /* 93b - */ 0, + /* 93c - */ 0, + /* 93d - */ 0, + /* 93e - */ 0, + /* 93f - */ 0, + /* 940 - */ 0, + /* 941 - */ 0, + /* 942 - */ 0, + /* 943 - */ 0, + /* 944 - */ 0, + /* 945 - */ 0, + /* 946 - */ 0, + /* 947 - _0F_3A_DF */ 0xd578, + /* 948 - */ 0, + /* 949 - */ 0, + /* 94a - */ 0, + /* 94b - */ 0, + /* 94c - */ 0, + /* 94d - */ 0, + /* 94e - */ 0, + /* 94f - */ 0, + /* 950 - */ 0, + /* 951 - */ 0, + /* 952 - */ 0, + /* 953 - */ 0, + /* 954 - */ 0, + /* 955 - */ 0, + /* 956 - */ 0, + /* 957 - */ 0, + /* 958 - */ 0, + /* 959 - */ 0, + /* 95a - */ 0, + /* 95b - */ 0, + /* 95c - */ 0, + /* 95d - */ 0, + /* 95e - */ 0, + /* 95f - */ 0, + /* 960 - */ 0, + /* 961 - */ 0, + /* 962 - */ 0, + /* 963 - */ 0, + /* 964 - */ 0, + /* 965 - */ 0, + /* 966 - */ 0, + /* 967 - */ 0, + /* 968 - _0F_50 */ 0x23a3, + /* 969 - _66_0F_50 */ 0x23a4, + /* 96a - */ 0, + /* 96b - */ 0, + /* 96c - _V_0F_50 */ 0x4036, + /* 96d - _V_66_0F_50 */ 0x4037, + /* 96e - */ 0, + /* 96f - */ 0, + /* 970 - */ 0, + /* 971 - */ 0, + /* 972 - */ 0, + /* 973 - */ 0, + /* 974 - _0F_51 */ 0x23a5, + /* 975 - _66_0F_51 */ 0x23a6, + /* 976 - _F3_0F_51 */ 0x23a7, + /* 977 - _F2_0F_51 */ 0x23a8, + /* 978 - _V_0F_51 */ 0x4038, + /* 979 - _V_66_0F_51 */ 0x4039, + /* 97a - _V_F3_0F_51 */ 0x403a, + /* 97b - _V_F2_0F_51 */ 0x403b, + /* 97c - */ 0, + /* 97d - */ 0, + /* 97e - */ 0, + /* 97f - */ 0, + /* 980 - _0F_52 */ 0x23a9, + /* 981 - */ 0, + /* 982 - _F3_0F_52 */ 0x23aa, + /* 983 - */ 0, + /* 984 - _V_0F_52 */ 0x403c, + /* 985 - */ 0, + /* 986 - _V_F3_0F_52 */ 0x403d, + /* 987 - */ 0, + /* 988 - */ 0, + /* 989 - */ 0, + /* 98a - */ 0, + /* 98b - */ 0, + /* 98c - _0F_53 */ 0x23ab, + /* 98d - */ 0, + /* 98e - _F3_0F_53 */ 0x23ac, + /* 98f - */ 0, + /* 990 - _V_0F_53 */ 0x403e, + /* 991 - */ 0, + /* 992 - _V_F3_0F_53 */ 0x403f, + /* 993 - */ 0, + /* 994 - */ 0, + /* 995 - */ 0, + /* 996 - */ 0, + /* 997 - */ 0, + /* 998 - _0F_54 */ 0x23ad, + /* 999 - _66_0F_54 */ 0x23ae, + /* 99a - */ 0, + /* 99b - */ 0, + /* 99c - _V_0F_54 */ 0x4040, + /* 99d - _V_66_0F_54 */ 0x4041, + /* 99e - */ 0, + /* 99f - */ 0, + /* 9a0 - */ 0, + /* 9a1 - */ 0, + /* 9a2 - */ 0, + /* 9a3 - */ 0, + /* 9a4 - _0F_55 */ 0x23af, + /* 9a5 - _66_0F_55 */ 0x23b0, + /* 9a6 - */ 0, + /* 9a7 - */ 0, + /* 9a8 - _V_0F_55 */ 0x4042, + /* 9a9 - _V_66_0F_55 */ 0x4043, + /* 9aa - */ 0, + /* 9ab - */ 0, + /* 9ac - */ 0, + /* 9ad - */ 0, + /* 9ae - */ 0, + /* 9af - */ 0, + /* 9b0 - _0F_56 */ 0x23b1, + /* 9b1 - _66_0F_56 */ 0x23b2, + /* 9b2 - */ 0, + /* 9b3 - */ 0, + /* 9b4 - _V_0F_56 */ 0x4044, + /* 9b5 - _V_66_0F_56 */ 0x4045, + /* 9b6 - */ 0, + /* 9b7 - */ 0, + /* 9b8 - */ 0, + /* 9b9 - */ 0, + /* 9ba - */ 0, + /* 9bb - */ 0, + /* 9bc - _0F_57 */ 0x23b3, + /* 9bd - _66_0F_57 */ 0x23b4, + /* 9be - */ 0, + /* 9bf - */ 0, + /* 9c0 - _V_0F_57 */ 0x4046, + /* 9c1 - _V_66_0F_57 */ 0x4047, + /* 9c2 - */ 0, + /* 9c3 - */ 0, + /* 9c4 - */ 0, + /* 9c5 - */ 0, + /* 9c6 - */ 0, + /* 9c7 - */ 0, + /* 9c8 - _0F_58 */ 0x23b5, + /* 9c9 - _66_0F_58 */ 0x23b6, + /* 9ca - _F3_0F_58 */ 0x23b7, + /* 9cb - _F2_0F_58 */ 0x23b8, + /* 9cc - _V_0F_58 */ 0x4048, + /* 9cd - _V_66_0F_58 */ 0x4049, + /* 9ce - _V_F3_0F_58 */ 0x404a, + /* 9cf - _V_F2_0F_58 */ 0x404b, + /* 9d0 - */ 0, + /* 9d1 - */ 0, + /* 9d2 - */ 0, + /* 9d3 - */ 0, + /* 9d4 - _0F_59 */ 0x23b9, + /* 9d5 - _66_0F_59 */ 0x23ba, + /* 9d6 - _F3_0F_59 */ 0x23bb, + /* 9d7 - _F2_0F_59 */ 0x23bc, + /* 9d8 - _V_0F_59 */ 0x404c, + /* 9d9 - _V_66_0F_59 */ 0x404d, + /* 9da - _V_F3_0F_59 */ 0x404e, + /* 9db - _V_F2_0F_59 */ 0x404f, + /* 9dc - */ 0, + /* 9dd - */ 0, + /* 9de - */ 0, + /* 9df - */ 0, + /* 9e0 - _0F_5A */ 0x23bd, + /* 9e1 - _66_0F_5A */ 0x23be, + /* 9e2 - _F3_0F_5A */ 0x23bf, + /* 9e3 - _F2_0F_5A */ 0x23c0, + /* 9e4 - _V_0F_5A */ 0x4050, + /* 9e5 - _V_66_0F_5A */ 0x4051, + /* 9e6 - _V_F3_0F_5A */ 0x4052, + /* 9e7 - _V_F2_0F_5A */ 0x4053, + /* 9e8 - */ 0, + /* 9e9 - */ 0, + /* 9ea - */ 0, + /* 9eb - */ 0, + /* 9ec - _0F_5B */ 0x23c1, + /* 9ed - _66_0F_5B */ 0x23c2, + /* 9ee - _F3_0F_5B */ 0x23c3, + /* 9ef - */ 0, + /* 9f0 - _V_0F_5B */ 0x4054, + /* 9f1 - _V_66_0F_5B */ 0x4055, + /* 9f2 - _V_F3_0F_5B */ 0x4056, + /* 9f3 - */ 0, + /* 9f4 - */ 0, + /* 9f5 - */ 0, + /* 9f6 - */ 0, + /* 9f7 - */ 0, + /* 9f8 - _0F_5C */ 0x23c4, + /* 9f9 - _66_0F_5C */ 0x23c5, + /* 9fa - _F3_0F_5C */ 0x23c6, + /* 9fb - _F2_0F_5C */ 0x23c7, + /* 9fc - _V_0F_5C */ 0x4057, + /* 9fd - _V_66_0F_5C */ 0x4058, + /* 9fe - _V_F3_0F_5C */ 0x4059, + /* 9ff - _V_F2_0F_5C */ 0x405a, + /* a00 - */ 0, + /* a01 - */ 0, + /* a02 - */ 0, + /* a03 - */ 0, + /* a04 - _0F_5D */ 0x23c8, + /* a05 - _66_0F_5D */ 0x23c9, + /* a06 - _F3_0F_5D */ 0x23ca, + /* a07 - _F2_0F_5D */ 0x23cb, + /* a08 - _V_0F_5D */ 0x405b, + /* a09 - _V_66_0F_5D */ 0x405c, + /* a0a - _V_F3_0F_5D */ 0x405d, + /* a0b - _V_F2_0F_5D */ 0x405e, + /* a0c - */ 0, + /* a0d - */ 0, + /* a0e - */ 0, + /* a0f - */ 0, + /* a10 - _0F_5E */ 0x23cc, + /* a11 - _66_0F_5E */ 0x23cd, + /* a12 - _F3_0F_5E */ 0x23ce, + /* a13 - _F2_0F_5E */ 0x23cf, + /* a14 - _V_0F_5E */ 0x405f, + /* a15 - _V_66_0F_5E */ 0x4060, + /* a16 - _V_F3_0F_5E */ 0x4061, + /* a17 - _V_F2_0F_5E */ 0x4062, + /* a18 - */ 0, + /* a19 - */ 0, + /* a1a - */ 0, + /* a1b - */ 0, + /* a1c - _0F_5F */ 0x23d0, + /* a1d - _66_0F_5F */ 0x23d1, + /* a1e - _F3_0F_5F */ 0x23d2, + /* a1f - _F2_0F_5F */ 0x23d3, + /* a20 - _V_0F_5F */ 0x4063, + /* a21 - _V_66_0F_5F */ 0x4064, + /* a22 - _V_F3_0F_5F */ 0x4065, + /* a23 - _V_F2_0F_5F */ 0x4066, + /* a24 - */ 0, + /* a25 - */ 0, + /* a26 - */ 0, + /* a27 - */ 0, + /* a28 - _0F_60 */ 0x23d4, + /* a29 - _66_0F_60 */ 0x23d5, + /* a2a - */ 0, + /* a2b - */ 0, + /* a2c - */ 0, + /* a2d - _V_66_0F_60 */ 0x4067, + /* a2e - */ 0, + /* a2f - */ 0, + /* a30 - */ 0, + /* a31 - */ 0, + /* a32 - */ 0, + /* a33 - */ 0, + /* a34 - _0F_61 */ 0x23d6, + /* a35 - _66_0F_61 */ 0x23d7, + /* a36 - */ 0, + /* a37 - */ 0, + /* a38 - */ 0, + /* a39 - _V_66_0F_61 */ 0x4068, + /* a3a - */ 0, + /* a3b - */ 0, + /* a3c - */ 0, + /* a3d - */ 0, + /* a3e - */ 0, + /* a3f - */ 0, + /* a40 - _0F_62 */ 0x23d8, + /* a41 - _66_0F_62 */ 0x23d9, + /* a42 - */ 0, + /* a43 - */ 0, + /* a44 - */ 0, + /* a45 - _V_66_0F_62 */ 0x4069, + /* a46 - */ 0, + /* a47 - */ 0, + /* a48 - */ 0, + /* a49 - */ 0, + /* a4a - */ 0, + /* a4b - */ 0, + /* a4c - _0F_63 */ 0x23da, + /* a4d - _66_0F_63 */ 0x23db, + /* a4e - */ 0, + /* a4f - */ 0, + /* a50 - */ 0, + /* a51 - _V_66_0F_63 */ 0x406a, + /* a52 - */ 0, + /* a53 - */ 0, + /* a54 - */ 0, + /* a55 - */ 0, + /* a56 - */ 0, + /* a57 - */ 0, + /* a58 - _0F_64 */ 0x23dc, + /* a59 - _66_0F_64 */ 0x23dd, + /* a5a - */ 0, + /* a5b - */ 0, + /* a5c - */ 0, + /* a5d - _V_66_0F_64 */ 0x406b, + /* a5e - */ 0, + /* a5f - */ 0, + /* a60 - */ 0, + /* a61 - */ 0, + /* a62 - */ 0, + /* a63 - */ 0, + /* a64 - _0F_65 */ 0x23de, + /* a65 - _66_0F_65 */ 0x23df, + /* a66 - */ 0, + /* a67 - */ 0, + /* a68 - */ 0, + /* a69 - _V_66_0F_65 */ 0x406c, + /* a6a - */ 0, + /* a6b - */ 0, + /* a6c - */ 0, + /* a6d - */ 0, + /* a6e - */ 0, + /* a6f - */ 0, + /* a70 - _0F_66 */ 0x23e0, + /* a71 - _66_0F_66 */ 0x23e1, + /* a72 - */ 0, + /* a73 - */ 0, + /* a74 - */ 0, + /* a75 - _V_66_0F_66 */ 0x406d, + /* a76 - */ 0, + /* a77 - */ 0, + /* a78 - */ 0, + /* a79 - */ 0, + /* a7a - */ 0, + /* a7b - */ 0, + /* a7c - _0F_67 */ 0x23e2, + /* a7d - _66_0F_67 */ 0x23e3, + /* a7e - */ 0, + /* a7f - */ 0, + /* a80 - */ 0, + /* a81 - _V_66_0F_67 */ 0x406e, + /* a82 - */ 0, + /* a83 - */ 0, + /* a84 - */ 0, + /* a85 - */ 0, + /* a86 - */ 0, + /* a87 - */ 0, + /* a88 - _0F_68 */ 0x23e4, + /* a89 - _66_0F_68 */ 0x23e5, + /* a8a - */ 0, + /* a8b - */ 0, + /* a8c - */ 0, + /* a8d - _V_66_0F_68 */ 0x406f, + /* a8e - */ 0, + /* a8f - */ 0, + /* a90 - */ 0, + /* a91 - */ 0, + /* a92 - */ 0, + /* a93 - */ 0, + /* a94 - _0F_69 */ 0x23e6, + /* a95 - _66_0F_69 */ 0x23e7, + /* a96 - */ 0, + /* a97 - */ 0, + /* a98 - */ 0, + /* a99 - _V_66_0F_69 */ 0x4070, + /* a9a - */ 0, + /* a9b - */ 0, + /* a9c - */ 0, + /* a9d - */ 0, + /* a9e - */ 0, + /* a9f - */ 0, + /* aa0 - _0F_6A */ 0x23e8, + /* aa1 - _66_0F_6A */ 0x23e9, + /* aa2 - */ 0, + /* aa3 - */ 0, + /* aa4 - */ 0, + /* aa5 - _V_66_0F_6A */ 0x4071, + /* aa6 - */ 0, + /* aa7 - */ 0, + /* aa8 - */ 0, + /* aa9 - */ 0, + /* aaa - */ 0, + /* aab - */ 0, + /* aac - _0F_6B */ 0x23ea, + /* aad - _66_0F_6B */ 0x23eb, + /* aae - */ 0, + /* aaf - */ 0, + /* ab0 - */ 0, + /* ab1 - _V_66_0F_6B */ 0x4072, + /* ab2 - */ 0, + /* ab3 - */ 0, + /* ab4 - */ 0, + /* ab5 - */ 0, + /* ab6 - */ 0, + /* ab7 - */ 0, + /* ab8 - */ 0, + /* ab9 - _66_0F_6C */ 0x23ec, + /* aba - */ 0, + /* abb - */ 0, + /* abc - */ 0, + /* abd - _V_66_0F_6C */ 0x4073, + /* abe - */ 0, + /* abf - */ 0, + /* ac0 - */ 0, + /* ac1 - */ 0, + /* ac2 - */ 0, + /* ac3 - */ 0, + /* ac4 - */ 0, + /* ac5 - _66_0F_6D */ 0x23ed, + /* ac6 - */ 0, + /* ac7 - */ 0, + /* ac8 - */ 0, + /* ac9 - _V_66_0F_6D */ 0x4074, + /* aca - */ 0, + /* acb - */ 0, + /* acc - */ 0, + /* acd - */ 0, + /* ace - */ 0, + /* acf - */ 0, + /* ad0 - _0F_6E */ 0x4075, + /* ad1 - _66_0F_6E */ 0x4076, + /* ad2 - */ 0, + /* ad3 - */ 0, + /* ad4 - */ 0, + /* ad5 - _V_66_0F_6E */ 0x4077, + /* ad6 - */ 0, + /* ad7 - */ 0, + /* ad8 - */ 0, + /* ad9 - */ 0, + /* ada - */ 0, + /* adb - */ 0, + /* adc - _0F_6F */ 0x23ee, + /* add - _66_0F_6F */ 0x23ef, + /* ade - _F3_0F_6F */ 0x23f0, + /* adf - */ 0, + /* ae0 - */ 0, + /* ae1 - _V_66_0F_6F */ 0x4078, + /* ae2 - _V_F3_0F_6F */ 0x4079, + /* ae3 - */ 0, + /* ae4 - */ 0, + /* ae5 - */ 0, + /* ae6 - */ 0, + /* ae7 - */ 0, + /* ae8 - _0F_70 */ 0x407a, + /* ae9 - _66_0F_70 */ 0x407b, + /* aea - _F3_0F_70 */ 0x407c, + /* aeb - _F2_0F_70 */ 0x407d, + /* aec - */ 0, + /* aed - _V_66_0F_70 */ 0x407e, + /* aee - _V_F3_0F_70 */ 0x407f, + /* aef - _V_F2_0F_70 */ 0x4080, + /* af0 - */ 0, + /* af1 - */ 0, + /* af2 - */ 0, + /* af3 - */ 0, + /* af4 - */ 0, + /* af5 - */ 0, + /* af6 - _0F_71_02 */ 0xd584, + /* af7 - */ 0, + /* af8 - _0F_71_04 */ 0xd590, + /* af9 - */ 0, + /* afa - _0F_71_06 */ 0xd59c, + /* afb - */ 0, + /* afc - */ 0, + /* afd - */ 0, + /* afe - _0F_72_02 */ 0xd5a8, + /* aff - */ 0, + /* b00 - _0F_72_04 */ 0xd5b4, + /* b01 - */ 0, + /* b02 - _0F_72_06 */ 0xd5c0, + /* b03 - */ 0, + /* b04 - */ 0, + /* b05 - */ 0, + /* b06 - _0F_73_02 */ 0xd5cc, + /* b07 - _0F_73_03 */ 0xd5d8, + /* b08 - */ 0, + /* b09 - */ 0, + /* b0a - _0F_73_06 */ 0xd5e4, + /* b0b - _0F_73_07 */ 0xd5f0, + /* b0c - _0F_74 */ 0x23f1, + /* b0d - _66_0F_74 */ 0x23f2, + /* b0e - */ 0, + /* b0f - */ 0, + /* b10 - */ 0, + /* b11 - _V_66_0F_74 */ 0x4081, + /* b12 - */ 0, + /* b13 - */ 0, + /* b14 - */ 0, + /* b15 - */ 0, + /* b16 - */ 0, + /* b17 - */ 0, + /* b18 - _0F_75 */ 0x23f3, + /* b19 - _66_0F_75 */ 0x23f4, + /* b1a - */ 0, + /* b1b - */ 0, + /* b1c - */ 0, + /* b1d - _V_66_0F_75 */ 0x4082, + /* b1e - */ 0, + /* b1f - */ 0, + /* b20 - */ 0, + /* b21 - */ 0, + /* b22 - */ 0, + /* b23 - */ 0, + /* b24 - _0F_76 */ 0x23f5, + /* b25 - _66_0F_76 */ 0x23f6, + /* b26 - */ 0, + /* b27 - */ 0, + /* b28 - */ 0, + /* b29 - _V_66_0F_76 */ 0x4083, + /* b2a - */ 0, + /* b2b - */ 0, + /* b2c - */ 0, + /* b2d - */ 0, + /* b2e - */ 0, + /* b2f - */ 0, + /* b30 - _0F_77 */ 0x23f7, + /* b31 - */ 0, + /* b32 - */ 0, + /* b33 - */ 0, + /* b34 - _V_0F_77 */ 0x4084, + /* b35 - */ 0, + /* b36 - */ 0, + /* b37 - */ 0, + /* b38 - */ 0, + /* b39 - */ 0, + /* b3a - */ 0, + /* b3b - */ 0, + /* b3c - _0F_78 */ 0x23f8, + /* b3d - _66_0F_78 */ 0x4085, + /* b3e - */ 0, + /* b3f - _F2_0F_78 */ 0x4086, + /* b40 - */ 0, + /* b41 - */ 0, + /* b42 - */ 0, + /* b43 - */ 0, + /* b44 - */ 0, + /* b45 - */ 0, + /* b46 - */ 0, + /* b47 - */ 0, + /* b48 - _0F_79 */ 0x23f9, + /* b49 - _66_0F_79 */ 0x23fa, + /* b4a - */ 0, + /* b4b - _F2_0F_79 */ 0x23fb, + /* b4c - */ 0, + /* b4d - */ 0, + /* b4e - */ 0, + /* b4f - */ 0, + /* b50 - */ 0, + /* b51 - */ 0, + /* b52 - */ 0, + /* b53 - */ 0, + /* b54 - */ 0, + /* b55 - */ 0, + /* b56 - */ 0, + /* b57 - */ 0, + /* b58 - */ 0, + /* b59 - */ 0, + /* b5a - */ 0, + /* b5b - */ 0, + /* b5c - */ 0, + /* b5d - */ 0, + /* b5e - */ 0, + /* b5f - */ 0, + /* b60 - */ 0, + /* b61 - */ 0, + /* b62 - */ 0, + /* b63 - */ 0, + /* b64 - */ 0, + /* b65 - */ 0, + /* b66 - */ 0, + /* b67 - */ 0, + /* b68 - */ 0, + /* b69 - */ 0, + /* b6a - */ 0, + /* b6b - */ 0, + /* b6c - */ 0, + /* b6d - */ 0, + /* b6e - */ 0, + /* b6f - */ 0, + /* b70 - */ 0, + /* b71 - */ 0, + /* b72 - */ 0, + /* b73 - */ 0, + /* b74 - */ 0, + /* b75 - */ 0, + /* b76 - */ 0, + /* b77 - */ 0, + /* b78 - */ 0, + /* b79 - */ 0, + /* b7a - */ 0, + /* b7b - */ 0, + /* b7c - */ 0, + /* b7d - */ 0, + /* b7e - */ 0, + /* b7f - */ 0, + /* b80 - */ 0, + /* b81 - */ 0, + /* b82 - */ 0, + /* b83 - */ 0, + /* b84 - _0F_7A_30 */ 0x23fc, + /* b85 - _0F_7A_31 */ 0x23fd, + /* b86 - */ 0, + /* b87 - */ 0, + /* b88 - */ 0, + /* b89 - */ 0, + /* b8a - */ 0, + /* b8b - */ 0, + /* b8c - */ 0, + /* b8d - */ 0, + /* b8e - */ 0, + /* b8f - */ 0, + /* b90 - */ 0, + /* b91 - */ 0, + /* b92 - */ 0, + /* b93 - */ 0, + /* b94 - */ 0, + /* b95 - */ 0, + /* b96 - */ 0, + /* b97 - */ 0, + /* b98 - */ 0, + /* b99 - */ 0, + /* b9a - */ 0, + /* b9b - */ 0, + /* b9c - */ 0, + /* b9d - */ 0, + /* b9e - */ 0, + /* b9f - */ 0, + /* ba0 - */ 0, + /* ba1 - */ 0, + /* ba2 - */ 0, + /* ba3 - */ 0, + /* ba4 - */ 0, + /* ba5 - */ 0, + /* ba6 - */ 0, + /* ba7 - */ 0, + /* ba8 - */ 0, + /* ba9 - */ 0, + /* baa - */ 0, + /* bab - */ 0, + /* bac - */ 0, + /* bad - */ 0, + /* bae - */ 0, + /* baf - */ 0, + /* bb0 - */ 0, + /* bb1 - */ 0, + /* bb2 - */ 0, + /* bb3 - */ 0, + /* bb4 - */ 0, + /* bb5 - */ 0, + /* bb6 - */ 0, + /* bb7 - */ 0, + /* bb8 - */ 0, + /* bb9 - */ 0, + /* bba - */ 0, + /* bbb - */ 0, + /* bbc - */ 0, + /* bbd - */ 0, + /* bbe - */ 0, + /* bbf - */ 0, + /* bc0 - */ 0, + /* bc1 - */ 0, + /* bc2 - */ 0, + /* bc3 - */ 0, + /* bc4 - */ 0, + /* bc5 - */ 0, + /* bc6 - */ 0, + /* bc7 - */ 0, + /* bc8 - */ 0, + /* bc9 - */ 0, + /* bca - */ 0, + /* bcb - */ 0, + /* bcc - */ 0, + /* bcd - */ 0, + /* bce - */ 0, + /* bcf - */ 0, + /* bd0 - */ 0, + /* bd1 - */ 0, + /* bd2 - */ 0, + /* bd3 - */ 0, + /* bd4 - */ 0, + /* bd5 - */ 0, + /* bd6 - */ 0, + /* bd7 - */ 0, + /* bd8 - */ 0, + /* bd9 - */ 0, + /* bda - */ 0, + /* bdb - */ 0, + /* bdc - */ 0, + /* bdd - */ 0, + /* bde - */ 0, + /* bdf - */ 0, + /* be0 - */ 0, + /* be1 - */ 0, + /* be2 - */ 0, + /* be3 - */ 0, + /* be4 - */ 0, + /* be5 - */ 0, + /* be6 - */ 0, + /* be7 - */ 0, + /* be8 - */ 0, + /* be9 - */ 0, + /* bea - */ 0, + /* beb - */ 0, + /* bec - */ 0, + /* bed - */ 0, + /* bee - */ 0, + /* bef - */ 0, + /* bf0 - */ 0, + /* bf1 - */ 0, + /* bf2 - */ 0, + /* bf3 - */ 0, + /* bf4 - */ 0, + /* bf5 - */ 0, + /* bf6 - */ 0, + /* bf7 - */ 0, + /* bf8 - */ 0, + /* bf9 - */ 0, + /* bfa - */ 0, + /* bfb - */ 0, + /* bfc - */ 0, + /* bfd - */ 0, + /* bfe - */ 0, + /* bff - */ 0, + /* c00 - */ 0, + /* c01 - */ 0, + /* c02 - */ 0, + /* c03 - */ 0, + /* c04 - */ 0, + /* c05 - */ 0, + /* c06 - */ 0, + /* c07 - */ 0, + /* c08 - */ 0, + /* c09 - */ 0, + /* c0a - */ 0, + /* c0b - */ 0, + /* c0c - */ 0, + /* c0d - */ 0, + /* c0e - */ 0, + /* c0f - */ 0, + /* c10 - */ 0, + /* c11 - */ 0, + /* c12 - */ 0, + /* c13 - */ 0, + /* c14 - */ 0, + /* c15 - */ 0, + /* c16 - */ 0, + /* c17 - */ 0, + /* c18 - */ 0, + /* c19 - */ 0, + /* c1a - */ 0, + /* c1b - */ 0, + /* c1c - */ 0, + /* c1d - */ 0, + /* c1e - */ 0, + /* c1f - */ 0, + /* c20 - */ 0, + /* c21 - */ 0, + /* c22 - */ 0, + /* c23 - */ 0, + /* c24 - */ 0, + /* c25 - */ 0, + /* c26 - */ 0, + /* c27 - */ 0, + /* c28 - */ 0, + /* c29 - */ 0, + /* c2a - */ 0, + /* c2b - */ 0, + /* c2c - */ 0, + /* c2d - */ 0, + /* c2e - */ 0, + /* c2f - */ 0, + /* c30 - */ 0, + /* c31 - */ 0, + /* c32 - */ 0, + /* c33 - */ 0, + /* c34 - */ 0, + /* c35 - */ 0, + /* c36 - */ 0, + /* c37 - */ 0, + /* c38 - */ 0, + /* c39 - */ 0, + /* c3a - */ 0, + /* c3b - */ 0, + /* c3c - */ 0, + /* c3d - */ 0, + /* c3e - */ 0, + /* c3f - */ 0, + /* c40 - */ 0, + /* c41 - */ 0, + /* c42 - */ 0, + /* c43 - */ 0, + /* c44 - */ 0, + /* c45 - */ 0, + /* c46 - */ 0, + /* c47 - */ 0, + /* c48 - */ 0, + /* c49 - */ 0, + /* c4a - */ 0, + /* c4b - */ 0, + /* c4c - */ 0, + /* c4d - */ 0, + /* c4e - */ 0, + /* c4f - */ 0, + /* c50 - */ 0, + /* c51 - */ 0, + /* c52 - */ 0, + /* c53 - */ 0, + /* c54 - */ 0, + /* c55 - _66_0F_7C */ 0x23fe, + /* c56 - */ 0, + /* c57 - _F2_0F_7C */ 0x23ff, + /* c58 - */ 0, + /* c59 - _V_66_0F_7C */ 0x4087, + /* c5a - */ 0, + /* c5b - _V_F2_0F_7C */ 0x4088, + /* c5c - */ 0, + /* c5d - */ 0, + /* c5e - */ 0, + /* c5f - */ 0, + /* c60 - */ 0, + /* c61 - _66_0F_7D */ 0x2400, + /* c62 - */ 0, + /* c63 - _F2_0F_7D */ 0x2401, + /* c64 - */ 0, + /* c65 - _V_66_0F_7D */ 0x4089, + /* c66 - */ 0, + /* c67 - _V_F2_0F_7D */ 0x408a, + /* c68 - */ 0, + /* c69 - */ 0, + /* c6a - */ 0, + /* c6b - */ 0, + /* c6c - _0F_7E */ 0x408b, + /* c6d - _66_0F_7E */ 0x408c, + /* c6e - _F3_0F_7E */ 0x2402, + /* c6f - */ 0, + /* c70 - */ 0, + /* c71 - _V_66_0F_7E */ 0x408d, + /* c72 - _V_F3_0F_7E */ 0x408e, + /* c73 - */ 0, + /* c74 - */ 0, + /* c75 - */ 0, + /* c76 - */ 0, + /* c77 - */ 0, + /* c78 - _0F_7F */ 0x2403, + /* c79 - _66_0F_7F */ 0x2404, + /* c7a - _F3_0F_7F */ 0x2405, + /* c7b - */ 0, + /* c7c - */ 0, + /* c7d - _V_66_0F_7F */ 0x408f, + /* c7e - _V_F3_0F_7F */ 0x4090, + /* c7f - */ 0, + /* c80 - */ 0, + /* c81 - */ 0, + /* c82 - */ 0, + /* c83 - */ 0, + /* c84 - _0F_AE_00 */ 0xd5fc, + /* c85 - _0F_AE_01 */ 0xd608, + /* c86 - _0F_AE_02 */ 0xd614, + /* c87 - _0F_AE_03 */ 0xd620, + /* c88 - _0F_AE_04 */ 0x4091, + /* c89 - _0F_AE_05 */ 0x4092, + /* c8a - _0F_AE_06 */ 0x4093, + /* c8b - _0F_AE_07 */ 0x4094, + /* c8c - */ 0, + /* c8d - */ 0, + /* c8e - _F3_0F_B8 */ 0x2406, + /* c8f - */ 0, + /* c90 - */ 0, + /* c91 - */ 0, + /* c92 - */ 0, + /* c93 - */ 0, + /* c94 - */ 0, + /* c95 - */ 0, + /* c96 - */ 0, + /* c97 - */ 0, + /* c98 - */ 0, + /* c99 - */ 0, + /* c9a - */ 0, + /* c9b - */ 0, + /* c9c - _0F_BA_04 */ 0x2407, + /* c9d - _0F_BA_05 */ 0x2408, + /* c9e - _0F_BA_06 */ 0x2409, + /* c9f - _0F_BA_07 */ 0x240a, + /* ca0 - _0F_BC */ 0x240b, + /* ca1 - */ 0, + /* ca2 - _F3_0F_BC */ 0x240c, + /* ca3 - */ 0, + /* ca4 - */ 0, + /* ca5 - */ 0, + /* ca6 - */ 0, + /* ca7 - */ 0, + /* ca8 - */ 0, + /* ca9 - */ 0, + /* caa - */ 0, + /* cab - */ 0, + /* cac - _0F_BD */ 0x240d, + /* cad - */ 0, + /* cae - _F3_0F_BD */ 0x240e, + /* caf - */ 0, + /* cb0 - */ 0, + /* cb1 - */ 0, + /* cb2 - */ 0, + /* cb3 - */ 0, + /* cb4 - */ 0, + /* cb5 - */ 0, + /* cb6 - */ 0, + /* cb7 - */ 0, + /* cb8 - _0F_C2 */ 0x4095, + /* cb9 - _66_0F_C2 */ 0x4096, + /* cba - _F3_0F_C2 */ 0x4097, + /* cbb - _F2_0F_C2 */ 0x4098, + /* cbc - _V_0F_C2 */ 0x4099, + /* cbd - _V_66_0F_C2 */ 0x409a, + /* cbe - _V_F3_0F_C2 */ 0x409b, + /* cbf - _V_F2_0F_C2 */ 0x409c, + /* cc0 - */ 0, + /* cc1 - */ 0, + /* cc2 - */ 0, + /* cc3 - */ 0, + /* cc4 - _0F_C4 */ 0x409d, + /* cc5 - _66_0F_C4 */ 0x409e, + /* cc6 - */ 0, + /* cc7 - */ 0, + /* cc8 - */ 0, + /* cc9 - _V_66_0F_C4 */ 0x409f, + /* cca - */ 0, + /* ccb - */ 0, + /* ccc - */ 0, + /* ccd - */ 0, + /* cce - */ 0, + /* ccf - */ 0, + /* cd0 - _0F_C5 */ 0x40a0, + /* cd1 - _66_0F_C5 */ 0x40a1, + /* cd2 - */ 0, + /* cd3 - */ 0, + /* cd4 - */ 0, + /* cd5 - _V_66_0F_C5 */ 0x40a2, + /* cd6 - */ 0, + /* cd7 - */ 0, + /* cd8 - */ 0, + /* cd9 - */ 0, + /* cda - */ 0, + /* cdb - */ 0, + /* cdc - _0F_C6 */ 0x40a3, + /* cdd - _66_0F_C6 */ 0x40a4, + /* cde - */ 0, + /* cdf - */ 0, + /* ce0 - _V_0F_C6 */ 0x40a5, + /* ce1 - _V_66_0F_C6 */ 0x40a6, + /* ce2 - */ 0, + /* ce3 - */ 0, + /* ce4 - */ 0, + /* ce5 - */ 0, + /* ce6 - */ 0, + /* ce7 - */ 0, + /* ce8 - */ 0, + /* ce9 - _0F_C7_01 */ 0x40a7, + /* cea - */ 0, + /* ceb - */ 0, + /* cec - */ 0, + /* ced - */ 0, + /* cee - _0F_C7_06 */ 0xd62c, + /* cef - _0F_C7_07 */ 0x240f, + /* cf0 - */ 0, + /* cf1 - _66_0F_D0 */ 0x2410, + /* cf2 - */ 0, + /* cf3 - _F2_0F_D0 */ 0x2411, + /* cf4 - */ 0, + /* cf5 - _V_66_0F_D0 */ 0x40a8, + /* cf6 - */ 0, + /* cf7 - _V_F2_0F_D0 */ 0x40a9, + /* cf8 - */ 0, + /* cf9 - */ 0, + /* cfa - */ 0, + /* cfb - */ 0, + /* cfc - _0F_D1 */ 0x2412, + /* cfd - _66_0F_D1 */ 0x2413, + /* cfe - */ 0, + /* cff - */ 0, + /* d00 - */ 0, + /* d01 - _V_66_0F_D1 */ 0x40aa, + /* d02 - */ 0, + /* d03 - */ 0, + /* d04 - */ 0, + /* d05 - */ 0, + /* d06 - */ 0, + /* d07 - */ 0, + /* d08 - _0F_D2 */ 0x2414, + /* d09 - _66_0F_D2 */ 0x2415, + /* d0a - */ 0, + /* d0b - */ 0, + /* d0c - */ 0, + /* d0d - _V_66_0F_D2 */ 0x40ab, + /* d0e - */ 0, + /* d0f - */ 0, + /* d10 - */ 0, + /* d11 - */ 0, + /* d12 - */ 0, + /* d13 - */ 0, + /* d14 - _0F_D3 */ 0x2416, + /* d15 - _66_0F_D3 */ 0x2417, + /* d16 - */ 0, + /* d17 - */ 0, + /* d18 - */ 0, + /* d19 - _V_66_0F_D3 */ 0x40ac, + /* d1a - */ 0, + /* d1b - */ 0, + /* d1c - */ 0, + /* d1d - */ 0, + /* d1e - */ 0, + /* d1f - */ 0, + /* d20 - _0F_D4 */ 0x2418, + /* d21 - _66_0F_D4 */ 0x2419, + /* d22 - */ 0, + /* d23 - */ 0, + /* d24 - */ 0, + /* d25 - _V_66_0F_D4 */ 0x40ad, + /* d26 - */ 0, + /* d27 - */ 0, + /* d28 - */ 0, + /* d29 - */ 0, + /* d2a - */ 0, + /* d2b - */ 0, + /* d2c - _0F_D5 */ 0x241a, + /* d2d - _66_0F_D5 */ 0x241b, + /* d2e - */ 0, + /* d2f - */ 0, + /* d30 - */ 0, + /* d31 - _V_66_0F_D5 */ 0x40ae, + /* d32 - */ 0, + /* d33 - */ 0, + /* d34 - */ 0, + /* d35 - */ 0, + /* d36 - */ 0, + /* d37 - */ 0, + /* d38 - */ 0, + /* d39 - _66_0F_D6 */ 0x241c, + /* d3a - _F3_0F_D6 */ 0x241d, + /* d3b - _F2_0F_D6 */ 0x241e, + /* d3c - */ 0, + /* d3d - _V_66_0F_D6 */ 0x40af, + /* d3e - */ 0, + /* d3f - */ 0, + /* d40 - */ 0, + /* d41 - */ 0, + /* d42 - */ 0, + /* d43 - */ 0, + /* d44 - _0F_D7 */ 0x241f, + /* d45 - _66_0F_D7 */ 0x2420, + /* d46 - */ 0, + /* d47 - */ 0, + /* d48 - */ 0, + /* d49 - _V_66_0F_D7 */ 0x40b0, + /* d4a - */ 0, + /* d4b - */ 0, + /* d4c - */ 0, + /* d4d - */ 0, + /* d4e - */ 0, + /* d4f - */ 0, + /* d50 - _0F_D8 */ 0x2421, + /* d51 - _66_0F_D8 */ 0x2422, + /* d52 - */ 0, + /* d53 - */ 0, + /* d54 - */ 0, + /* d55 - _V_66_0F_D8 */ 0x40b1, + /* d56 - */ 0, + /* d57 - */ 0, + /* d58 - */ 0, + /* d59 - */ 0, + /* d5a - */ 0, + /* d5b - */ 0, + /* d5c - _0F_D9 */ 0x2423, + /* d5d - _66_0F_D9 */ 0x2424, + /* d5e - */ 0, + /* d5f - */ 0, + /* d60 - */ 0, + /* d61 - _V_66_0F_D9 */ 0x40b2, + /* d62 - */ 0, + /* d63 - */ 0, + /* d64 - */ 0, + /* d65 - */ 0, + /* d66 - */ 0, + /* d67 - */ 0, + /* d68 - _0F_DA */ 0x2425, + /* d69 - _66_0F_DA */ 0x2426, + /* d6a - */ 0, + /* d6b - */ 0, + /* d6c - */ 0, + /* d6d - _V_66_0F_DA */ 0x40b3, + /* d6e - */ 0, + /* d6f - */ 0, + /* d70 - */ 0, + /* d71 - */ 0, + /* d72 - */ 0, + /* d73 - */ 0, + /* d74 - _0F_DB */ 0x2427, + /* d75 - _66_0F_DB */ 0x2428, + /* d76 - */ 0, + /* d77 - */ 0, + /* d78 - */ 0, + /* d79 - _V_66_0F_DB */ 0x40b4, + /* d7a - */ 0, + /* d7b - */ 0, + /* d7c - */ 0, + /* d7d - */ 0, + /* d7e - */ 0, + /* d7f - */ 0, + /* d80 - _0F_DC */ 0x2429, + /* d81 - _66_0F_DC */ 0x242a, + /* d82 - */ 0, + /* d83 - */ 0, + /* d84 - */ 0, + /* d85 - _V_66_0F_DC */ 0x40b5, + /* d86 - */ 0, + /* d87 - */ 0, + /* d88 - */ 0, + /* d89 - */ 0, + /* d8a - */ 0, + /* d8b - */ 0, + /* d8c - _0F_DD */ 0x242b, + /* d8d - _66_0F_DD */ 0x242c, + /* d8e - */ 0, + /* d8f - */ 0, + /* d90 - */ 0, + /* d91 - _V_66_0F_DD */ 0x40b6, + /* d92 - */ 0, + /* d93 - */ 0, + /* d94 - */ 0, + /* d95 - */ 0, + /* d96 - */ 0, + /* d97 - */ 0, + /* d98 - _0F_DE */ 0x242d, + /* d99 - _66_0F_DE */ 0x242e, + /* d9a - */ 0, + /* d9b - */ 0, + /* d9c - */ 0, + /* d9d - _V_66_0F_DE */ 0x40b7, + /* d9e - */ 0, + /* d9f - */ 0, + /* da0 - */ 0, + /* da1 - */ 0, + /* da2 - */ 0, + /* da3 - */ 0, + /* da4 - _0F_DF */ 0x242f, + /* da5 - _66_0F_DF */ 0x2430, + /* da6 - */ 0, + /* da7 - */ 0, + /* da8 - */ 0, + /* da9 - _V_66_0F_DF */ 0x40b8, + /* daa - */ 0, + /* dab - */ 0, + /* dac - */ 0, + /* dad - */ 0, + /* dae - */ 0, + /* daf - */ 0, + /* db0 - _0F_E0 */ 0x2431, + /* db1 - _66_0F_E0 */ 0x2432, + /* db2 - */ 0, + /* db3 - */ 0, + /* db4 - */ 0, + /* db5 - _V_66_0F_E0 */ 0x40b9, + /* db6 - */ 0, + /* db7 - */ 0, + /* db8 - */ 0, + /* db9 - */ 0, + /* dba - */ 0, + /* dbb - */ 0, + /* dbc - _0F_E1 */ 0x2433, + /* dbd - _66_0F_E1 */ 0x2434, + /* dbe - */ 0, + /* dbf - */ 0, + /* dc0 - */ 0, + /* dc1 - _V_66_0F_E1 */ 0x40ba, + /* dc2 - */ 0, + /* dc3 - */ 0, + /* dc4 - */ 0, + /* dc5 - */ 0, + /* dc6 - */ 0, + /* dc7 - */ 0, + /* dc8 - _0F_E2 */ 0x2435, + /* dc9 - _66_0F_E2 */ 0x2436, + /* dca - */ 0, + /* dcb - */ 0, + /* dcc - */ 0, + /* dcd - _V_66_0F_E2 */ 0x40bb, + /* dce - */ 0, + /* dcf - */ 0, + /* dd0 - */ 0, + /* dd1 - */ 0, + /* dd2 - */ 0, + /* dd3 - */ 0, + /* dd4 - _0F_E3 */ 0x2437, + /* dd5 - _66_0F_E3 */ 0x2438, + /* dd6 - */ 0, + /* dd7 - */ 0, + /* dd8 - */ 0, + /* dd9 - _V_66_0F_E3 */ 0x40bc, + /* dda - */ 0, + /* ddb - */ 0, + /* ddc - */ 0, + /* ddd - */ 0, + /* dde - */ 0, + /* ddf - */ 0, + /* de0 - _0F_E4 */ 0x2439, + /* de1 - _66_0F_E4 */ 0x243a, + /* de2 - */ 0, + /* de3 - */ 0, + /* de4 - */ 0, + /* de5 - _V_66_0F_E4 */ 0x40bd, + /* de6 - */ 0, + /* de7 - */ 0, + /* de8 - */ 0, + /* de9 - */ 0, + /* dea - */ 0, + /* deb - */ 0, + /* dec - _0F_E5 */ 0x243b, + /* ded - _66_0F_E5 */ 0x243c, + /* dee - */ 0, + /* def - */ 0, + /* df0 - */ 0, + /* df1 - _V_66_0F_E5 */ 0x40be, + /* df2 - */ 0, + /* df3 - */ 0, + /* df4 - */ 0, + /* df5 - */ 0, + /* df6 - */ 0, + /* df7 - */ 0, + /* df8 - */ 0, + /* df9 - _66_0F_E6 */ 0x243d, + /* dfa - _F3_0F_E6 */ 0x243e, + /* dfb - _F2_0F_E6 */ 0x243f, + /* dfc - */ 0, + /* dfd - _V_66_0F_E6 */ 0x40bf, + /* dfe - _V_F3_0F_E6 */ 0x40c0, + /* dff - _V_F2_0F_E6 */ 0x40c1, + /* e00 - */ 0, + /* e01 - */ 0, + /* e02 - */ 0, + /* e03 - */ 0, + /* e04 - _0F_E7 */ 0x2440, + /* e05 - _66_0F_E7 */ 0x2441, + /* e06 - */ 0, + /* e07 - */ 0, + /* e08 - */ 0, + /* e09 - _V_66_0F_E7 */ 0x40c2, + /* e0a - */ 0, + /* e0b - */ 0, + /* e0c - */ 0, + /* e0d - */ 0, + /* e0e - */ 0, + /* e0f - */ 0, + /* e10 - _0F_E8 */ 0x2442, + /* e11 - _66_0F_E8 */ 0x2443, + /* e12 - */ 0, + /* e13 - */ 0, + /* e14 - */ 0, + /* e15 - _V_66_0F_E8 */ 0x40c3, + /* e16 - */ 0, + /* e17 - */ 0, + /* e18 - */ 0, + /* e19 - */ 0, + /* e1a - */ 0, + /* e1b - */ 0, + /* e1c - _0F_E9 */ 0x2444, + /* e1d - _66_0F_E9 */ 0x2445, + /* e1e - */ 0, + /* e1f - */ 0, + /* e20 - */ 0, + /* e21 - _V_66_0F_E9 */ 0x40c4, + /* e22 - */ 0, + /* e23 - */ 0, + /* e24 - */ 0, + /* e25 - */ 0, + /* e26 - */ 0, + /* e27 - */ 0, + /* e28 - _0F_EA */ 0x2446, + /* e29 - _66_0F_EA */ 0x2447, + /* e2a - */ 0, + /* e2b - */ 0, + /* e2c - */ 0, + /* e2d - _V_66_0F_EA */ 0x40c5, + /* e2e - */ 0, + /* e2f - */ 0, + /* e30 - */ 0, + /* e31 - */ 0, + /* e32 - */ 0, + /* e33 - */ 0, + /* e34 - _0F_EB */ 0x2448, + /* e35 - _66_0F_EB */ 0x2449, + /* e36 - */ 0, + /* e37 - */ 0, + /* e38 - */ 0, + /* e39 - _V_66_0F_EB */ 0x40c6, + /* e3a - */ 0, + /* e3b - */ 0, + /* e3c - */ 0, + /* e3d - */ 0, + /* e3e - */ 0, + /* e3f - */ 0, + /* e40 - _0F_EC */ 0x244a, + /* e41 - _66_0F_EC */ 0x244b, + /* e42 - */ 0, + /* e43 - */ 0, + /* e44 - */ 0, + /* e45 - _V_66_0F_EC */ 0x40c7, + /* e46 - */ 0, + /* e47 - */ 0, + /* e48 - */ 0, + /* e49 - */ 0, + /* e4a - */ 0, + /* e4b - */ 0, + /* e4c - _0F_ED */ 0x244c, + /* e4d - _66_0F_ED */ 0x244d, + /* e4e - */ 0, + /* e4f - */ 0, + /* e50 - */ 0, + /* e51 - _V_66_0F_ED */ 0x40c8, + /* e52 - */ 0, + /* e53 - */ 0, + /* e54 - */ 0, + /* e55 - */ 0, + /* e56 - */ 0, + /* e57 - */ 0, + /* e58 - _0F_EE */ 0x244e, + /* e59 - _66_0F_EE */ 0x244f, + /* e5a - */ 0, + /* e5b - */ 0, + /* e5c - */ 0, + /* e5d - _V_66_0F_EE */ 0x40c9, + /* e5e - */ 0, + /* e5f - */ 0, + /* e60 - */ 0, + /* e61 - */ 0, + /* e62 - */ 0, + /* e63 - */ 0, + /* e64 - _0F_EF */ 0x2450, + /* e65 - _66_0F_EF */ 0x2451, + /* e66 - */ 0, + /* e67 - */ 0, + /* e68 - */ 0, + /* e69 - _V_66_0F_EF */ 0x40ca, + /* e6a - */ 0, + /* e6b - */ 0, + /* e6c - */ 0, + /* e6d - */ 0, + /* e6e - */ 0, + /* e6f - */ 0, + /* e70 - */ 0, + /* e71 - */ 0, + /* e72 - */ 0, + /* e73 - _F2_0F_F0 */ 0x2452, + /* e74 - */ 0, + /* e75 - */ 0, + /* e76 - */ 0, + /* e77 - _V_F2_0F_F0 */ 0x40cb, + /* e78 - */ 0, + /* e79 - */ 0, + /* e7a - */ 0, + /* e7b - */ 0, + /* e7c - _0F_F1 */ 0x2453, + /* e7d - _66_0F_F1 */ 0x2454, + /* e7e - */ 0, + /* e7f - */ 0, + /* e80 - */ 0, + /* e81 - _V_66_0F_F1 */ 0x40cc, + /* e82 - */ 0, + /* e83 - */ 0, + /* e84 - */ 0, + /* e85 - */ 0, + /* e86 - */ 0, + /* e87 - */ 0, + /* e88 - _0F_F2 */ 0x2455, + /* e89 - _66_0F_F2 */ 0x2456, + /* e8a - */ 0, + /* e8b - */ 0, + /* e8c - */ 0, + /* e8d - _V_66_0F_F2 */ 0x40cd, + /* e8e - */ 0, + /* e8f - */ 0, + /* e90 - */ 0, + /* e91 - */ 0, + /* e92 - */ 0, + /* e93 - */ 0, + /* e94 - _0F_F3 */ 0x2457, + /* e95 - _66_0F_F3 */ 0x2458, + /* e96 - */ 0, + /* e97 - */ 0, + /* e98 - */ 0, + /* e99 - _V_66_0F_F3 */ 0x40ce, + /* e9a - */ 0, + /* e9b - */ 0, + /* e9c - */ 0, + /* e9d - */ 0, + /* e9e - */ 0, + /* e9f - */ 0, + /* ea0 - _0F_F4 */ 0x2459, + /* ea1 - _66_0F_F4 */ 0x245a, + /* ea2 - */ 0, + /* ea3 - */ 0, + /* ea4 - */ 0, + /* ea5 - _V_66_0F_F4 */ 0x40cf, + /* ea6 - */ 0, + /* ea7 - */ 0, + /* ea8 - */ 0, + /* ea9 - */ 0, + /* eaa - */ 0, + /* eab - */ 0, + /* eac - _0F_F5 */ 0x245b, + /* ead - _66_0F_F5 */ 0x245c, + /* eae - */ 0, + /* eaf - */ 0, + /* eb0 - */ 0, + /* eb1 - _V_66_0F_F5 */ 0x40d0, + /* eb2 - */ 0, + /* eb3 - */ 0, + /* eb4 - */ 0, + /* eb5 - */ 0, + /* eb6 - */ 0, + /* eb7 - */ 0, + /* eb8 - _0F_F6 */ 0x245d, + /* eb9 - _66_0F_F6 */ 0x245e, + /* eba - */ 0, + /* ebb - */ 0, + /* ebc - */ 0, + /* ebd - _V_66_0F_F6 */ 0x40d1, + /* ebe - */ 0, + /* ebf - */ 0, + /* ec0 - */ 0, + /* ec1 - */ 0, + /* ec2 - */ 0, + /* ec3 - */ 0, + /* ec4 - _0F_F7 */ 0x245f, + /* ec5 - _66_0F_F7 */ 0x2460, + /* ec6 - */ 0, + /* ec7 - */ 0, + /* ec8 - */ 0, + /* ec9 - _V_66_0F_F7 */ 0x40d2, + /* eca - */ 0, + /* ecb - */ 0, + /* ecc - */ 0, + /* ecd - */ 0, + /* ece - */ 0, + /* ecf - */ 0, + /* ed0 - _0F_F8 */ 0x2461, + /* ed1 - _66_0F_F8 */ 0x2462, + /* ed2 - */ 0, + /* ed3 - */ 0, + /* ed4 - */ 0, + /* ed5 - _V_66_0F_F8 */ 0x40d3, + /* ed6 - */ 0, + /* ed7 - */ 0, + /* ed8 - */ 0, + /* ed9 - */ 0, + /* eda - */ 0, + /* edb - */ 0, + /* edc - _0F_F9 */ 0x2463, + /* edd - _66_0F_F9 */ 0x2464, + /* ede - */ 0, + /* edf - */ 0, + /* ee0 - */ 0, + /* ee1 - _V_66_0F_F9 */ 0x40d4, + /* ee2 - */ 0, + /* ee3 - */ 0, + /* ee4 - */ 0, + /* ee5 - */ 0, + /* ee6 - */ 0, + /* ee7 - */ 0, + /* ee8 - _0F_FA */ 0x2465, + /* ee9 - _66_0F_FA */ 0x2466, + /* eea - */ 0, + /* eeb - */ 0, + /* eec - */ 0, + /* eed - _V_66_0F_FA */ 0x40d5, + /* eee - */ 0, + /* eef - */ 0, + /* ef0 - */ 0, + /* ef1 - */ 0, + /* ef2 - */ 0, + /* ef3 - */ 0, + /* ef4 - _0F_FB */ 0x2467, + /* ef5 - _66_0F_FB */ 0x2468, + /* ef6 - */ 0, + /* ef7 - */ 0, + /* ef8 - */ 0, + /* ef9 - _V_66_0F_FB */ 0x40d6, + /* efa - */ 0, + /* efb - */ 0, + /* efc - */ 0, + /* efd - */ 0, + /* efe - */ 0, + /* eff - */ 0, + /* f00 - _0F_FC */ 0x2469, + /* f01 - _66_0F_FC */ 0x246a, + /* f02 - */ 0, + /* f03 - */ 0, + /* f04 - */ 0, + /* f05 - _V_66_0F_FC */ 0x40d7, + /* f06 - */ 0, + /* f07 - */ 0, + /* f08 - */ 0, + /* f09 - */ 0, + /* f0a - */ 0, + /* f0b - */ 0, + /* f0c - _0F_FD */ 0x246b, + /* f0d - _66_0F_FD */ 0x246c, + /* f0e - */ 0, + /* f0f - */ 0, + /* f10 - */ 0, + /* f11 - _V_66_0F_FD */ 0x40d8, + /* f12 - */ 0, + /* f13 - */ 0, + /* f14 - */ 0, + /* f15 - */ 0, + /* f16 - */ 0, + /* f17 - */ 0, + /* f18 - _0F_FE */ 0x246d, + /* f19 - _66_0F_FE */ 0x246e, + /* f1a - */ 0, + /* f1b - */ 0, + /* f1c - */ 0, + /* f1d - _V_66_0F_FE */ 0x40d9, + /* f1e - */ 0, + /* f1f - */ 0, + /* f20 - */ 0, + /* f21 - */ 0, + /* f22 - */ 0, + /* f23 - */ 0, + /* f24 - _D9_06 */ 0x246f, + /* f25 - _9B_D9_06 */ 0x2470, + /* f26 - */ 0, + /* f27 - */ 0, + /* f28 - */ 0, + /* f29 - */ 0, + /* f2a - */ 0, + /* f2b - */ 0, + /* f2c - */ 0, + /* f2d - */ 0, + /* f2e - */ 0, + /* f2f - */ 0, + /* f30 - _D9_07 */ 0x2471, + /* f31 - _9B_D9_07 */ 0x2472, + /* f32 - */ 0, + /* f33 - */ 0, + /* f34 - */ 0, + /* f35 - */ 0, + /* f36 - */ 0, + /* f37 - */ 0, + /* f38 - */ 0, + /* f39 - */ 0, + /* f3a - */ 0, + /* f3b - */ 0, + /* f3c - _DB_E2 */ 0x2473, + /* f3d - _9B_DB_E2 */ 0x2474, + /* f3e - */ 0, + /* f3f - */ 0, + /* f40 - */ 0, + /* f41 - */ 0, + /* f42 - */ 0, + /* f43 - */ 0, + /* f44 - */ 0, + /* f45 - */ 0, + /* f46 - */ 0, + /* f47 - */ 0, + /* f48 - _DB_E3 */ 0x2475, + /* f49 - _9B_DB_E3 */ 0x2476, + /* f4a - */ 0, + /* f4b - */ 0, + /* f4c - */ 0, + /* f4d - */ 0, + /* f4e - */ 0, + /* f4f - */ 0, + /* f50 - */ 0, + /* f51 - */ 0, + /* f52 - */ 0, + /* f53 - */ 0, + /* f54 - _DD_06 */ 0x2477, + /* f55 - _9B_DD_06 */ 0x2478, + /* f56 - */ 0, + /* f57 - */ 0, + /* f58 - */ 0, + /* f59 - */ 0, + /* f5a - */ 0, + /* f5b - */ 0, + /* f5c - */ 0, + /* f5d - */ 0, + /* f5e - */ 0, + /* f5f - */ 0, + /* f60 - _DD_07 */ 0x2479, + /* f61 - _9B_DD_07 */ 0x247a, + /* f62 - */ 0, + /* f63 - */ 0, + /* f64 - */ 0, + /* f65 - */ 0, + /* f66 - */ 0, + /* f67 - */ 0, + /* f68 - */ 0, + /* f69 - */ 0, + /* f6a - */ 0, + /* f6b - */ 0, + /* f6c - _DF_E0 */ 0x247b, + /* f6d - _9B_DF_E0 */ 0x247c, + /* f6e - */ 0, + /* f6f - */ 0, + /* f70 - */ 0, + /* f71 - */ 0, + /* f72 - */ 0, + /* f73 - */ 0, + /* f74 - */ 0, + /* f75 - */ 0, + /* f76 - */ 0, + /* f77 - */ 0, + /* f78 - _0F_38_00 */ 0x247d, + /* f79 - _66_0F_38_00 */ 0x247e, + /* f7a - */ 0, + /* f7b - */ 0, + /* f7c - */ 0, + /* f7d - _V_66_0F_38_00 */ 0x40da, + /* f7e - */ 0, + /* f7f - */ 0, + /* f80 - */ 0, + /* f81 - */ 0, + /* f82 - */ 0, + /* f83 - */ 0, + /* f84 - _0F_38_01 */ 0x247f, + /* f85 - _66_0F_38_01 */ 0x2480, + /* f86 - */ 0, + /* f87 - */ 0, + /* f88 - */ 0, + /* f89 - _V_66_0F_38_01 */ 0x40db, + /* f8a - */ 0, + /* f8b - */ 0, + /* f8c - */ 0, + /* f8d - */ 0, + /* f8e - */ 0, + /* f8f - */ 0, + /* f90 - _0F_38_02 */ 0x2481, + /* f91 - _66_0F_38_02 */ 0x2482, + /* f92 - */ 0, + /* f93 - */ 0, + /* f94 - */ 0, + /* f95 - _V_66_0F_38_02 */ 0x40dc, + /* f96 - */ 0, + /* f97 - */ 0, + /* f98 - */ 0, + /* f99 - */ 0, + /* f9a - */ 0, + /* f9b - */ 0, + /* f9c - _0F_38_03 */ 0x2483, + /* f9d - _66_0F_38_03 */ 0x2484, + /* f9e - */ 0, + /* f9f - */ 0, + /* fa0 - */ 0, + /* fa1 - _V_66_0F_38_03 */ 0x40dd, + /* fa2 - */ 0, + /* fa3 - */ 0, + /* fa4 - */ 0, + /* fa5 - */ 0, + /* fa6 - */ 0, + /* fa7 - */ 0, + /* fa8 - _0F_38_04 */ 0x2485, + /* fa9 - _66_0F_38_04 */ 0x2486, + /* faa - */ 0, + /* fab - */ 0, + /* fac - */ 0, + /* fad - _V_66_0F_38_04 */ 0x40de, + /* fae - */ 0, + /* faf - */ 0, + /* fb0 - */ 0, + /* fb1 - */ 0, + /* fb2 - */ 0, + /* fb3 - */ 0, + /* fb4 - _0F_38_05 */ 0x2487, + /* fb5 - _66_0F_38_05 */ 0x2488, + /* fb6 - */ 0, + /* fb7 - */ 0, + /* fb8 - */ 0, + /* fb9 - _V_66_0F_38_05 */ 0x40df, + /* fba - */ 0, + /* fbb - */ 0, + /* fbc - */ 0, + /* fbd - */ 0, + /* fbe - */ 0, + /* fbf - */ 0, + /* fc0 - _0F_38_06 */ 0x2489, + /* fc1 - _66_0F_38_06 */ 0x248a, + /* fc2 - */ 0, + /* fc3 - */ 0, + /* fc4 - */ 0, + /* fc5 - _V_66_0F_38_06 */ 0x40e0, + /* fc6 - */ 0, + /* fc7 - */ 0, + /* fc8 - */ 0, + /* fc9 - */ 0, + /* fca - */ 0, + /* fcb - */ 0, + /* fcc - _0F_38_07 */ 0x248b, + /* fcd - _66_0F_38_07 */ 0x248c, + /* fce - */ 0, + /* fcf - */ 0, + /* fd0 - */ 0, + /* fd1 - _V_66_0F_38_07 */ 0x40e1, + /* fd2 - */ 0, + /* fd3 - */ 0, + /* fd4 - */ 0, + /* fd5 - */ 0, + /* fd6 - */ 0, + /* fd7 - */ 0, + /* fd8 - _0F_38_08 */ 0x248d, + /* fd9 - _66_0F_38_08 */ 0x248e, + /* fda - */ 0, + /* fdb - */ 0, + /* fdc - */ 0, + /* fdd - _V_66_0F_38_08 */ 0x40e2, + /* fde - */ 0, + /* fdf - */ 0, + /* fe0 - */ 0, + /* fe1 - */ 0, + /* fe2 - */ 0, + /* fe3 - */ 0, + /* fe4 - _0F_38_09 */ 0x248f, + /* fe5 - _66_0F_38_09 */ 0x2490, + /* fe6 - */ 0, + /* fe7 - */ 0, + /* fe8 - */ 0, + /* fe9 - _V_66_0F_38_09 */ 0x40e3, + /* fea - */ 0, + /* feb - */ 0, + /* fec - */ 0, + /* fed - */ 0, + /* fee - */ 0, + /* fef - */ 0, + /* ff0 - _0F_38_0A */ 0x2491, + /* ff1 - _66_0F_38_0A */ 0x2492, + /* ff2 - */ 0, + /* ff3 - */ 0, + /* ff4 - */ 0, + /* ff5 - _V_66_0F_38_0A */ 0x40e4, + /* ff6 - */ 0, + /* ff7 - */ 0, + /* ff8 - */ 0, + /* ff9 - */ 0, + /* ffa - */ 0, + /* ffb - */ 0, + /* ffc - _0F_38_0B */ 0x2493, + /* ffd - _66_0F_38_0B */ 0x2494, + /* ffe - */ 0, + /* fff - */ 0, + /* 1000 - */ 0, + /* 1001 - _V_66_0F_38_0B */ 0x40e5, + /* 1002 - */ 0, + /* 1003 - */ 0, + /* 1004 - */ 0, + /* 1005 - */ 0, + /* 1006 - */ 0, + /* 1007 - */ 0, + /* 1008 - */ 0, + /* 1009 - */ 0, + /* 100a - */ 0, + /* 100b - */ 0, + /* 100c - */ 0, + /* 100d - _V_66_0F_38_0C */ 0x40e6, + /* 100e - */ 0, + /* 100f - */ 0, + /* 1010 - */ 0, + /* 1011 - */ 0, + /* 1012 - */ 0, + /* 1013 - */ 0, + /* 1014 - */ 0, + /* 1015 - */ 0, + /* 1016 - */ 0, + /* 1017 - */ 0, + /* 1018 - */ 0, + /* 1019 - _V_66_0F_38_0D */ 0x40e7, + /* 101a - */ 0, + /* 101b - */ 0, + /* 101c - */ 0, + /* 101d - */ 0, + /* 101e - */ 0, + /* 101f - */ 0, + /* 1020 - */ 0, + /* 1021 - */ 0, + /* 1022 - */ 0, + /* 1023 - */ 0, + /* 1024 - */ 0, + /* 1025 - _V_66_0F_38_0E */ 0x40e8, + /* 1026 - */ 0, + /* 1027 - */ 0, + /* 1028 - */ 0, + /* 1029 - */ 0, + /* 102a - */ 0, + /* 102b - */ 0, + /* 102c - */ 0, + /* 102d - */ 0, + /* 102e - */ 0, + /* 102f - */ 0, + /* 1030 - */ 0, + /* 1031 - _V_66_0F_38_0F */ 0x40e9, + /* 1032 - */ 0, + /* 1033 - */ 0, + /* 1034 - */ 0, + /* 1035 - */ 0, + /* 1036 - */ 0, + /* 1037 - */ 0, + /* 1038 - */ 0, + /* 1039 - _66_0F_38_10 */ 0x40ea, + /* 103a - */ 0, + /* 103b - */ 0, + /* 103c - */ 0, + /* 103d - */ 0, + /* 103e - */ 0, + /* 103f - */ 0, + /* 1040 - */ 0, + /* 1041 - */ 0, + /* 1042 - */ 0, + /* 1043 - */ 0, + /* 1044 - */ 0, + /* 1045 - _66_0F_38_14 */ 0x40eb, + /* 1046 - */ 0, + /* 1047 - */ 0, + /* 1048 - */ 0, + /* 1049 - */ 0, + /* 104a - */ 0, + /* 104b - */ 0, + /* 104c - */ 0, + /* 104d - */ 0, + /* 104e - */ 0, + /* 104f - */ 0, + /* 1050 - */ 0, + /* 1051 - _66_0F_38_15 */ 0x40ec, + /* 1052 - */ 0, + /* 1053 - */ 0, + /* 1054 - */ 0, + /* 1055 - */ 0, + /* 1056 - */ 0, + /* 1057 - */ 0, + /* 1058 - */ 0, + /* 1059 - */ 0, + /* 105a - */ 0, + /* 105b - */ 0, + /* 105c - */ 0, + /* 105d - _66_0F_38_17 */ 0x2495, + /* 105e - */ 0, + /* 105f - */ 0, + /* 1060 - */ 0, + /* 1061 - _V_66_0F_38_17 */ 0x40ed, + /* 1062 - */ 0, + /* 1063 - */ 0, + /* 1064 - */ 0, + /* 1065 - */ 0, + /* 1066 - */ 0, + /* 1067 - */ 0, + /* 1068 - */ 0, + /* 1069 - */ 0, + /* 106a - */ 0, + /* 106b - */ 0, + /* 106c - */ 0, + /* 106d - _V_66_0F_38_18 */ 0x40ee, + /* 106e - */ 0, + /* 106f - */ 0, + /* 1070 - */ 0, + /* 1071 - */ 0, + /* 1072 - */ 0, + /* 1073 - */ 0, + /* 1074 - */ 0, + /* 1075 - */ 0, + /* 1076 - */ 0, + /* 1077 - */ 0, + /* 1078 - */ 0, + /* 1079 - _V_66_0F_38_19 */ 0x40ef, + /* 107a - */ 0, + /* 107b - */ 0, + /* 107c - */ 0, + /* 107d - */ 0, + /* 107e - */ 0, + /* 107f - */ 0, + /* 1080 - */ 0, + /* 1081 - */ 0, + /* 1082 - */ 0, + /* 1083 - */ 0, + /* 1084 - */ 0, + /* 1085 - _V_66_0F_38_1A */ 0x40f0, + /* 1086 - */ 0, + /* 1087 - */ 0, + /* 1088 - */ 0, + /* 1089 - */ 0, + /* 108a - */ 0, + /* 108b - */ 0, + /* 108c - _0F_38_1C */ 0x2496, + /* 108d - _66_0F_38_1C */ 0x2497, + /* 108e - */ 0, + /* 108f - */ 0, + /* 1090 - */ 0, + /* 1091 - _V_66_0F_38_1C */ 0x40f1, + /* 1092 - */ 0, + /* 1093 - */ 0, + /* 1094 - */ 0, + /* 1095 - */ 0, + /* 1096 - */ 0, + /* 1097 - */ 0, + /* 1098 - _0F_38_1D */ 0x2498, + /* 1099 - _66_0F_38_1D */ 0x2499, + /* 109a - */ 0, + /* 109b - */ 0, + /* 109c - */ 0, + /* 109d - _V_66_0F_38_1D */ 0x40f2, + /* 109e - */ 0, + /* 109f - */ 0, + /* 10a0 - */ 0, + /* 10a1 - */ 0, + /* 10a2 - */ 0, + /* 10a3 - */ 0, + /* 10a4 - _0F_38_1E */ 0x249a, + /* 10a5 - _66_0F_38_1E */ 0x249b, + /* 10a6 - */ 0, + /* 10a7 - */ 0, + /* 10a8 - */ 0, + /* 10a9 - _V_66_0F_38_1E */ 0x40f3, + /* 10aa - */ 0, + /* 10ab - */ 0, + /* 10ac - */ 0, + /* 10ad - */ 0, + /* 10ae - */ 0, + /* 10af - */ 0, + /* 10b0 - */ 0, + /* 10b1 - _66_0F_38_20 */ 0x249c, + /* 10b2 - */ 0, + /* 10b3 - */ 0, + /* 10b4 - */ 0, + /* 10b5 - _V_66_0F_38_20 */ 0x40f4, + /* 10b6 - */ 0, + /* 10b7 - */ 0, + /* 10b8 - */ 0, + /* 10b9 - */ 0, + /* 10ba - */ 0, + /* 10bb - */ 0, + /* 10bc - */ 0, + /* 10bd - _66_0F_38_21 */ 0x249d, + /* 10be - */ 0, + /* 10bf - */ 0, + /* 10c0 - */ 0, + /* 10c1 - _V_66_0F_38_21 */ 0x40f5, + /* 10c2 - */ 0, + /* 10c3 - */ 0, + /* 10c4 - */ 0, + /* 10c5 - */ 0, + /* 10c6 - */ 0, + /* 10c7 - */ 0, + /* 10c8 - */ 0, + /* 10c9 - _66_0F_38_22 */ 0x249e, + /* 10ca - */ 0, + /* 10cb - */ 0, + /* 10cc - */ 0, + /* 10cd - _V_66_0F_38_22 */ 0x40f6, + /* 10ce - */ 0, + /* 10cf - */ 0, + /* 10d0 - */ 0, + /* 10d1 - */ 0, + /* 10d2 - */ 0, + /* 10d3 - */ 0, + /* 10d4 - */ 0, + /* 10d5 - _66_0F_38_23 */ 0x249f, + /* 10d6 - */ 0, + /* 10d7 - */ 0, + /* 10d8 - */ 0, + /* 10d9 - _V_66_0F_38_23 */ 0x40f7, + /* 10da - */ 0, + /* 10db - */ 0, + /* 10dc - */ 0, + /* 10dd - */ 0, + /* 10de - */ 0, + /* 10df - */ 0, + /* 10e0 - */ 0, + /* 10e1 - _66_0F_38_24 */ 0x24a0, + /* 10e2 - */ 0, + /* 10e3 - */ 0, + /* 10e4 - */ 0, + /* 10e5 - _V_66_0F_38_24 */ 0x40f8, + /* 10e6 - */ 0, + /* 10e7 - */ 0, + /* 10e8 - */ 0, + /* 10e9 - */ 0, + /* 10ea - */ 0, + /* 10eb - */ 0, + /* 10ec - */ 0, + /* 10ed - _66_0F_38_25 */ 0x24a1, + /* 10ee - */ 0, + /* 10ef - */ 0, + /* 10f0 - */ 0, + /* 10f1 - _V_66_0F_38_25 */ 0x40f9, + /* 10f2 - */ 0, + /* 10f3 - */ 0, + /* 10f4 - */ 0, + /* 10f5 - */ 0, + /* 10f6 - */ 0, + /* 10f7 - */ 0, + /* 10f8 - */ 0, + /* 10f9 - _66_0F_38_28 */ 0x24a2, + /* 10fa - */ 0, + /* 10fb - */ 0, + /* 10fc - */ 0, + /* 10fd - _V_66_0F_38_28 */ 0x40fa, + /* 10fe - */ 0, + /* 10ff - */ 0, + /* 1100 - */ 0, + /* 1101 - */ 0, + /* 1102 - */ 0, + /* 1103 - */ 0, + /* 1104 - */ 0, + /* 1105 - _66_0F_38_29 */ 0x24a3, + /* 1106 - */ 0, + /* 1107 - */ 0, + /* 1108 - */ 0, + /* 1109 - _V_66_0F_38_29 */ 0x40fb, + /* 110a - */ 0, + /* 110b - */ 0, + /* 110c - */ 0, + /* 110d - */ 0, + /* 110e - */ 0, + /* 110f - */ 0, + /* 1110 - */ 0, + /* 1111 - _66_0F_38_2A */ 0x24a4, + /* 1112 - */ 0, + /* 1113 - */ 0, + /* 1114 - */ 0, + /* 1115 - _V_66_0F_38_2A */ 0x40fc, + /* 1116 - */ 0, + /* 1117 - */ 0, + /* 1118 - */ 0, + /* 1119 - */ 0, + /* 111a - */ 0, + /* 111b - */ 0, + /* 111c - */ 0, + /* 111d - _66_0F_38_2B */ 0x24a5, + /* 111e - */ 0, + /* 111f - */ 0, + /* 1120 - */ 0, + /* 1121 - _V_66_0F_38_2B */ 0x40fd, + /* 1122 - */ 0, + /* 1123 - */ 0, + /* 1124 - */ 0, + /* 1125 - */ 0, + /* 1126 - */ 0, + /* 1127 - */ 0, + /* 1128 - */ 0, + /* 1129 - */ 0, + /* 112a - */ 0, + /* 112b - */ 0, + /* 112c - */ 0, + /* 112d - _V_66_0F_38_2C */ 0x40fe, + /* 112e - */ 0, + /* 112f - */ 0, + /* 1130 - */ 0, + /* 1131 - */ 0, + /* 1132 - */ 0, + /* 1133 - */ 0, + /* 1134 - */ 0, + /* 1135 - */ 0, + /* 1136 - */ 0, + /* 1137 - */ 0, + /* 1138 - */ 0, + /* 1139 - _V_66_0F_38_2D */ 0x40ff, + /* 113a - */ 0, + /* 113b - */ 0, + /* 113c - */ 0, + /* 113d - */ 0, + /* 113e - */ 0, + /* 113f - */ 0, + /* 1140 - */ 0, + /* 1141 - */ 0, + /* 1142 - */ 0, + /* 1143 - */ 0, + /* 1144 - */ 0, + /* 1145 - _V_66_0F_38_2E */ 0x4100, + /* 1146 - */ 0, + /* 1147 - */ 0, + /* 1148 - */ 0, + /* 1149 - */ 0, + /* 114a - */ 0, + /* 114b - */ 0, + /* 114c - */ 0, + /* 114d - */ 0, + /* 114e - */ 0, + /* 114f - */ 0, + /* 1150 - */ 0, + /* 1151 - _V_66_0F_38_2F */ 0x4101, + /* 1152 - */ 0, + /* 1153 - */ 0, + /* 1154 - */ 0, + /* 1155 - */ 0, + /* 1156 - */ 0, + /* 1157 - */ 0, + /* 1158 - */ 0, + /* 1159 - _66_0F_38_30 */ 0x24a6, + /* 115a - */ 0, + /* 115b - */ 0, + /* 115c - */ 0, + /* 115d - _V_66_0F_38_30 */ 0x4102, + /* 115e - */ 0, + /* 115f - */ 0, + /* 1160 - */ 0, + /* 1161 - */ 0, + /* 1162 - */ 0, + /* 1163 - */ 0, + /* 1164 - */ 0, + /* 1165 - _66_0F_38_31 */ 0x24a7, + /* 1166 - */ 0, + /* 1167 - */ 0, + /* 1168 - */ 0, + /* 1169 - _V_66_0F_38_31 */ 0x4103, + /* 116a - */ 0, + /* 116b - */ 0, + /* 116c - */ 0, + /* 116d - */ 0, + /* 116e - */ 0, + /* 116f - */ 0, + /* 1170 - */ 0, + /* 1171 - _66_0F_38_32 */ 0x24a8, + /* 1172 - */ 0, + /* 1173 - */ 0, + /* 1174 - */ 0, + /* 1175 - _V_66_0F_38_32 */ 0x4104, + /* 1176 - */ 0, + /* 1177 - */ 0, + /* 1178 - */ 0, + /* 1179 - */ 0, + /* 117a - */ 0, + /* 117b - */ 0, + /* 117c - */ 0, + /* 117d - _66_0F_38_33 */ 0x24a9, + /* 117e - */ 0, + /* 117f - */ 0, + /* 1180 - */ 0, + /* 1181 - _V_66_0F_38_33 */ 0x4105, + /* 1182 - */ 0, + /* 1183 - */ 0, + /* 1184 - */ 0, + /* 1185 - */ 0, + /* 1186 - */ 0, + /* 1187 - */ 0, + /* 1188 - */ 0, + /* 1189 - _66_0F_38_34 */ 0x24aa, + /* 118a - */ 0, + /* 118b - */ 0, + /* 118c - */ 0, + /* 118d - _V_66_0F_38_34 */ 0x4106, + /* 118e - */ 0, + /* 118f - */ 0, + /* 1190 - */ 0, + /* 1191 - */ 0, + /* 1192 - */ 0, + /* 1193 - */ 0, + /* 1194 - */ 0, + /* 1195 - _66_0F_38_35 */ 0x24ab, + /* 1196 - */ 0, + /* 1197 - */ 0, + /* 1198 - */ 0, + /* 1199 - _V_66_0F_38_35 */ 0x4107, + /* 119a - */ 0, + /* 119b - */ 0, + /* 119c - */ 0, + /* 119d - */ 0, + /* 119e - */ 0, + /* 119f - */ 0, + /* 11a0 - */ 0, + /* 11a1 - _66_0F_38_37 */ 0x24ac, + /* 11a2 - */ 0, + /* 11a3 - */ 0, + /* 11a4 - */ 0, + /* 11a5 - _V_66_0F_38_37 */ 0x4108, + /* 11a6 - */ 0, + /* 11a7 - */ 0, + /* 11a8 - */ 0, + /* 11a9 - */ 0, + /* 11aa - */ 0, + /* 11ab - */ 0, + /* 11ac - */ 0, + /* 11ad - _66_0F_38_38 */ 0x24ad, + /* 11ae - */ 0, + /* 11af - */ 0, + /* 11b0 - */ 0, + /* 11b1 - _V_66_0F_38_38 */ 0x4109, + /* 11b2 - */ 0, + /* 11b3 - */ 0, + /* 11b4 - */ 0, + /* 11b5 - */ 0, + /* 11b6 - */ 0, + /* 11b7 - */ 0, + /* 11b8 - */ 0, + /* 11b9 - _66_0F_38_39 */ 0x24ae, + /* 11ba - */ 0, + /* 11bb - */ 0, + /* 11bc - */ 0, + /* 11bd - _V_66_0F_38_39 */ 0x410a, + /* 11be - */ 0, + /* 11bf - */ 0, + /* 11c0 - */ 0, + /* 11c1 - */ 0, + /* 11c2 - */ 0, + /* 11c3 - */ 0, + /* 11c4 - */ 0, + /* 11c5 - _66_0F_38_3A */ 0x24af, + /* 11c6 - */ 0, + /* 11c7 - */ 0, + /* 11c8 - */ 0, + /* 11c9 - _V_66_0F_38_3A */ 0x410b, + /* 11ca - */ 0, + /* 11cb - */ 0, + /* 11cc - */ 0, + /* 11cd - */ 0, + /* 11ce - */ 0, + /* 11cf - */ 0, + /* 11d0 - */ 0, + /* 11d1 - _66_0F_38_3B */ 0x24b0, + /* 11d2 - */ 0, + /* 11d3 - */ 0, + /* 11d4 - */ 0, + /* 11d5 - _V_66_0F_38_3B */ 0x410c, + /* 11d6 - */ 0, + /* 11d7 - */ 0, + /* 11d8 - */ 0, + /* 11d9 - */ 0, + /* 11da - */ 0, + /* 11db - */ 0, + /* 11dc - */ 0, + /* 11dd - _66_0F_38_3C */ 0x24b1, + /* 11de - */ 0, + /* 11df - */ 0, + /* 11e0 - */ 0, + /* 11e1 - _V_66_0F_38_3C */ 0x410d, + /* 11e2 - */ 0, + /* 11e3 - */ 0, + /* 11e4 - */ 0, + /* 11e5 - */ 0, + /* 11e6 - */ 0, + /* 11e7 - */ 0, + /* 11e8 - */ 0, + /* 11e9 - _66_0F_38_3D */ 0x24b2, + /* 11ea - */ 0, + /* 11eb - */ 0, + /* 11ec - */ 0, + /* 11ed - _V_66_0F_38_3D */ 0x410e, + /* 11ee - */ 0, + /* 11ef - */ 0, + /* 11f0 - */ 0, + /* 11f1 - */ 0, + /* 11f2 - */ 0, + /* 11f3 - */ 0, + /* 11f4 - */ 0, + /* 11f5 - _66_0F_38_3E */ 0x24b3, + /* 11f6 - */ 0, + /* 11f7 - */ 0, + /* 11f8 - */ 0, + /* 11f9 - _V_66_0F_38_3E */ 0x410f, + /* 11fa - */ 0, + /* 11fb - */ 0, + /* 11fc - */ 0, + /* 11fd - */ 0, + /* 11fe - */ 0, + /* 11ff - */ 0, + /* 1200 - */ 0, + /* 1201 - _66_0F_38_3F */ 0x24b4, + /* 1202 - */ 0, + /* 1203 - */ 0, + /* 1204 - */ 0, + /* 1205 - _V_66_0F_38_3F */ 0x4110, + /* 1206 - */ 0, + /* 1207 - */ 0, + /* 1208 - */ 0, + /* 1209 - */ 0, + /* 120a - */ 0, + /* 120b - */ 0, + /* 120c - */ 0, + /* 120d - _66_0F_38_40 */ 0x24b5, + /* 120e - */ 0, + /* 120f - */ 0, + /* 1210 - */ 0, + /* 1211 - _V_66_0F_38_40 */ 0x4111, + /* 1212 - */ 0, + /* 1213 - */ 0, + /* 1214 - */ 0, + /* 1215 - */ 0, + /* 1216 - */ 0, + /* 1217 - */ 0, + /* 1218 - */ 0, + /* 1219 - _66_0F_38_41 */ 0x24b6, + /* 121a - */ 0, + /* 121b - */ 0, + /* 121c - */ 0, + /* 121d - _V_66_0F_38_41 */ 0x4112, + /* 121e - */ 0, + /* 121f - */ 0, + /* 1220 - */ 0, + /* 1221 - */ 0, + /* 1222 - */ 0, + /* 1223 - */ 0, + /* 1224 - */ 0, + /* 1225 - _66_0F_38_80 */ 0x24b7, + /* 1226 - */ 0, + /* 1227 - */ 0, + /* 1228 - */ 0, + /* 1229 - */ 0, + /* 122a - */ 0, + /* 122b - */ 0, + /* 122c - */ 0, + /* 122d - */ 0, + /* 122e - */ 0, + /* 122f - */ 0, + /* 1230 - */ 0, + /* 1231 - _66_0F_38_81 */ 0x24b8, + /* 1232 - */ 0, + /* 1233 - */ 0, + /* 1234 - */ 0, + /* 1235 - */ 0, + /* 1236 - */ 0, + /* 1237 - */ 0, + /* 1238 - */ 0, + /* 1239 - */ 0, + /* 123a - */ 0, + /* 123b - */ 0, + /* 123c - */ 0, + /* 123d - _66_0F_38_82 */ 0x24b9, + /* 123e - */ 0, + /* 123f - */ 0, + /* 1240 - */ 0, + /* 1241 - */ 0, + /* 1242 - */ 0, + /* 1243 - */ 0, + /* 1244 - */ 0, + /* 1245 - */ 0, + /* 1246 - */ 0, + /* 1247 - */ 0, + /* 1248 - */ 0, + /* 1249 - */ 0, + /* 124a - */ 0, + /* 124b - */ 0, + /* 124c - */ 0, + /* 124d - _V_66_0F_38_96 */ 0x4113, + /* 124e - */ 0, + /* 124f - */ 0, + /* 1250 - */ 0, + /* 1251 - */ 0, + /* 1252 - */ 0, + /* 1253 - */ 0, + /* 1254 - */ 0, + /* 1255 - */ 0, + /* 1256 - */ 0, + /* 1257 - */ 0, + /* 1258 - */ 0, + /* 1259 - _V_66_0F_38_97 */ 0x4114, + /* 125a - */ 0, + /* 125b - */ 0, + /* 125c - */ 0, + /* 125d - */ 0, + /* 125e - */ 0, + /* 125f - */ 0, + /* 1260 - */ 0, + /* 1261 - */ 0, + /* 1262 - */ 0, + /* 1263 - */ 0, + /* 1264 - */ 0, + /* 1265 - _V_66_0F_38_98 */ 0x4115, + /* 1266 - */ 0, + /* 1267 - */ 0, + /* 1268 - */ 0, + /* 1269 - */ 0, + /* 126a - */ 0, + /* 126b - */ 0, + /* 126c - */ 0, + /* 126d - */ 0, + /* 126e - */ 0, + /* 126f - */ 0, + /* 1270 - */ 0, + /* 1271 - _V_66_0F_38_99 */ 0x4116, + /* 1272 - */ 0, + /* 1273 - */ 0, + /* 1274 - */ 0, + /* 1275 - */ 0, + /* 1276 - */ 0, + /* 1277 - */ 0, + /* 1278 - */ 0, + /* 1279 - */ 0, + /* 127a - */ 0, + /* 127b - */ 0, + /* 127c - */ 0, + /* 127d - _V_66_0F_38_9A */ 0x4117, + /* 127e - */ 0, + /* 127f - */ 0, + /* 1280 - */ 0, + /* 1281 - */ 0, + /* 1282 - */ 0, + /* 1283 - */ 0, + /* 1284 - */ 0, + /* 1285 - */ 0, + /* 1286 - */ 0, + /* 1287 - */ 0, + /* 1288 - */ 0, + /* 1289 - _V_66_0F_38_9B */ 0x4118, + /* 128a - */ 0, + /* 128b - */ 0, + /* 128c - */ 0, + /* 128d - */ 0, + /* 128e - */ 0, + /* 128f - */ 0, + /* 1290 - */ 0, + /* 1291 - */ 0, + /* 1292 - */ 0, + /* 1293 - */ 0, + /* 1294 - */ 0, + /* 1295 - _V_66_0F_38_9C */ 0x4119, + /* 1296 - */ 0, + /* 1297 - */ 0, + /* 1298 - */ 0, + /* 1299 - */ 0, + /* 129a - */ 0, + /* 129b - */ 0, + /* 129c - */ 0, + /* 129d - */ 0, + /* 129e - */ 0, + /* 129f - */ 0, + /* 12a0 - */ 0, + /* 12a1 - _V_66_0F_38_9D */ 0x411a, + /* 12a2 - */ 0, + /* 12a3 - */ 0, + /* 12a4 - */ 0, + /* 12a5 - */ 0, + /* 12a6 - */ 0, + /* 12a7 - */ 0, + /* 12a8 - */ 0, + /* 12a9 - */ 0, + /* 12aa - */ 0, + /* 12ab - */ 0, + /* 12ac - */ 0, + /* 12ad - _V_66_0F_38_9E */ 0x411b, + /* 12ae - */ 0, + /* 12af - */ 0, + /* 12b0 - */ 0, + /* 12b1 - */ 0, + /* 12b2 - */ 0, + /* 12b3 - */ 0, + /* 12b4 - */ 0, + /* 12b5 - */ 0, + /* 12b6 - */ 0, + /* 12b7 - */ 0, + /* 12b8 - */ 0, + /* 12b9 - _V_66_0F_38_9F */ 0x411c, + /* 12ba - */ 0, + /* 12bb - */ 0, + /* 12bc - */ 0, + /* 12bd - */ 0, + /* 12be - */ 0, + /* 12bf - */ 0, + /* 12c0 - */ 0, + /* 12c1 - */ 0, + /* 12c2 - */ 0, + /* 12c3 - */ 0, + /* 12c4 - */ 0, + /* 12c5 - _V_66_0F_38_A6 */ 0x411d, + /* 12c6 - */ 0, + /* 12c7 - */ 0, + /* 12c8 - */ 0, + /* 12c9 - */ 0, + /* 12ca - */ 0, + /* 12cb - */ 0, + /* 12cc - */ 0, + /* 12cd - */ 0, + /* 12ce - */ 0, + /* 12cf - */ 0, + /* 12d0 - */ 0, + /* 12d1 - _V_66_0F_38_A7 */ 0x411e, + /* 12d2 - */ 0, + /* 12d3 - */ 0, + /* 12d4 - */ 0, + /* 12d5 - */ 0, + /* 12d6 - */ 0, + /* 12d7 - */ 0, + /* 12d8 - */ 0, + /* 12d9 - */ 0, + /* 12da - */ 0, + /* 12db - */ 0, + /* 12dc - */ 0, + /* 12dd - _V_66_0F_38_A8 */ 0x411f, + /* 12de - */ 0, + /* 12df - */ 0, + /* 12e0 - */ 0, + /* 12e1 - */ 0, + /* 12e2 - */ 0, + /* 12e3 - */ 0, + /* 12e4 - */ 0, + /* 12e5 - */ 0, + /* 12e6 - */ 0, + /* 12e7 - */ 0, + /* 12e8 - */ 0, + /* 12e9 - _V_66_0F_38_A9 */ 0x4120, + /* 12ea - */ 0, + /* 12eb - */ 0, + /* 12ec - */ 0, + /* 12ed - */ 0, + /* 12ee - */ 0, + /* 12ef - */ 0, + /* 12f0 - */ 0, + /* 12f1 - */ 0, + /* 12f2 - */ 0, + /* 12f3 - */ 0, + /* 12f4 - */ 0, + /* 12f5 - _V_66_0F_38_AA */ 0x4121, + /* 12f6 - */ 0, + /* 12f7 - */ 0, + /* 12f8 - */ 0, + /* 12f9 - */ 0, + /* 12fa - */ 0, + /* 12fb - */ 0, + /* 12fc - */ 0, + /* 12fd - */ 0, + /* 12fe - */ 0, + /* 12ff - */ 0, + /* 1300 - */ 0, + /* 1301 - _V_66_0F_38_AB */ 0x4122, + /* 1302 - */ 0, + /* 1303 - */ 0, + /* 1304 - */ 0, + /* 1305 - */ 0, + /* 1306 - */ 0, + /* 1307 - */ 0, + /* 1308 - */ 0, + /* 1309 - */ 0, + /* 130a - */ 0, + /* 130b - */ 0, + /* 130c - */ 0, + /* 130d - _V_66_0F_38_AC */ 0x4123, + /* 130e - */ 0, + /* 130f - */ 0, + /* 1310 - */ 0, + /* 1311 - */ 0, + /* 1312 - */ 0, + /* 1313 - */ 0, + /* 1314 - */ 0, + /* 1315 - */ 0, + /* 1316 - */ 0, + /* 1317 - */ 0, + /* 1318 - */ 0, + /* 1319 - _V_66_0F_38_AD */ 0x4124, + /* 131a - */ 0, + /* 131b - */ 0, + /* 131c - */ 0, + /* 131d - */ 0, + /* 131e - */ 0, + /* 131f - */ 0, + /* 1320 - */ 0, + /* 1321 - */ 0, + /* 1322 - */ 0, + /* 1323 - */ 0, + /* 1324 - */ 0, + /* 1325 - _V_66_0F_38_AE */ 0x4125, + /* 1326 - */ 0, + /* 1327 - */ 0, + /* 1328 - */ 0, + /* 1329 - */ 0, + /* 132a - */ 0, + /* 132b - */ 0, + /* 132c - */ 0, + /* 132d - */ 0, + /* 132e - */ 0, + /* 132f - */ 0, + /* 1330 - */ 0, + /* 1331 - _V_66_0F_38_AF */ 0x4126, + /* 1332 - */ 0, + /* 1333 - */ 0, + /* 1334 - */ 0, + /* 1335 - */ 0, + /* 1336 - */ 0, + /* 1337 - */ 0, + /* 1338 - */ 0, + /* 1339 - */ 0, + /* 133a - */ 0, + /* 133b - */ 0, + /* 133c - */ 0, + /* 133d - _V_66_0F_38_B6 */ 0x4127, + /* 133e - */ 0, + /* 133f - */ 0, + /* 1340 - */ 0, + /* 1341 - */ 0, + /* 1342 - */ 0, + /* 1343 - */ 0, + /* 1344 - */ 0, + /* 1345 - */ 0, + /* 1346 - */ 0, + /* 1347 - */ 0, + /* 1348 - */ 0, + /* 1349 - _V_66_0F_38_B7 */ 0x4128, + /* 134a - */ 0, + /* 134b - */ 0, + /* 134c - */ 0, + /* 134d - */ 0, + /* 134e - */ 0, + /* 134f - */ 0, + /* 1350 - */ 0, + /* 1351 - */ 0, + /* 1352 - */ 0, + /* 1353 - */ 0, + /* 1354 - */ 0, + /* 1355 - _V_66_0F_38_B8 */ 0x4129, + /* 1356 - */ 0, + /* 1357 - */ 0, + /* 1358 - */ 0, + /* 1359 - */ 0, + /* 135a - */ 0, + /* 135b - */ 0, + /* 135c - */ 0, + /* 135d - */ 0, + /* 135e - */ 0, + /* 135f - */ 0, + /* 1360 - */ 0, + /* 1361 - _V_66_0F_38_B9 */ 0x412a, + /* 1362 - */ 0, + /* 1363 - */ 0, + /* 1364 - */ 0, + /* 1365 - */ 0, + /* 1366 - */ 0, + /* 1367 - */ 0, + /* 1368 - */ 0, + /* 1369 - */ 0, + /* 136a - */ 0, + /* 136b - */ 0, + /* 136c - */ 0, + /* 136d - _V_66_0F_38_BA */ 0x412b, + /* 136e - */ 0, + /* 136f - */ 0, + /* 1370 - */ 0, + /* 1371 - */ 0, + /* 1372 - */ 0, + /* 1373 - */ 0, + /* 1374 - */ 0, + /* 1375 - */ 0, + /* 1376 - */ 0, + /* 1377 - */ 0, + /* 1378 - */ 0, + /* 1379 - _V_66_0F_38_BB */ 0x412c, + /* 137a - */ 0, + /* 137b - */ 0, + /* 137c - */ 0, + /* 137d - */ 0, + /* 137e - */ 0, + /* 137f - */ 0, + /* 1380 - */ 0, + /* 1381 - */ 0, + /* 1382 - */ 0, + /* 1383 - */ 0, + /* 1384 - */ 0, + /* 1385 - _V_66_0F_38_BC */ 0x412d, + /* 1386 - */ 0, + /* 1387 - */ 0, + /* 1388 - */ 0, + /* 1389 - */ 0, + /* 138a - */ 0, + /* 138b - */ 0, + /* 138c - */ 0, + /* 138d - */ 0, + /* 138e - */ 0, + /* 138f - */ 0, + /* 1390 - */ 0, + /* 1391 - _V_66_0F_38_BD */ 0x412e, + /* 1392 - */ 0, + /* 1393 - */ 0, + /* 1394 - */ 0, + /* 1395 - */ 0, + /* 1396 - */ 0, + /* 1397 - */ 0, + /* 1398 - */ 0, + /* 1399 - */ 0, + /* 139a - */ 0, + /* 139b - */ 0, + /* 139c - */ 0, + /* 139d - _V_66_0F_38_BE */ 0x412f, + /* 139e - */ 0, + /* 139f - */ 0, + /* 13a0 - */ 0, + /* 13a1 - */ 0, + /* 13a2 - */ 0, + /* 13a3 - */ 0, + /* 13a4 - */ 0, + /* 13a5 - */ 0, + /* 13a6 - */ 0, + /* 13a7 - */ 0, + /* 13a8 - */ 0, + /* 13a9 - _V_66_0F_38_BF */ 0x4130, + /* 13aa - */ 0, + /* 13ab - */ 0, + /* 13ac - */ 0, + /* 13ad - */ 0, + /* 13ae - */ 0, + /* 13af - */ 0, + /* 13b0 - */ 0, + /* 13b1 - _66_0F_38_DB */ 0x24ba, + /* 13b2 - */ 0, + /* 13b3 - */ 0, + /* 13b4 - */ 0, + /* 13b5 - _V_66_0F_38_DB */ 0x4131, + /* 13b6 - */ 0, + /* 13b7 - */ 0, + /* 13b8 - */ 0, + /* 13b9 - */ 0, + /* 13ba - */ 0, + /* 13bb - */ 0, + /* 13bc - */ 0, + /* 13bd - _66_0F_38_DC */ 0x24bb, + /* 13be - */ 0, + /* 13bf - */ 0, + /* 13c0 - */ 0, + /* 13c1 - _V_66_0F_38_DC */ 0x4132, + /* 13c2 - */ 0, + /* 13c3 - */ 0, + /* 13c4 - */ 0, + /* 13c5 - */ 0, + /* 13c6 - */ 0, + /* 13c7 - */ 0, + /* 13c8 - */ 0, + /* 13c9 - _66_0F_38_DD */ 0x24bc, + /* 13ca - */ 0, + /* 13cb - */ 0, + /* 13cc - */ 0, + /* 13cd - _V_66_0F_38_DD */ 0x4133, + /* 13ce - */ 0, + /* 13cf - */ 0, + /* 13d0 - */ 0, + /* 13d1 - */ 0, + /* 13d2 - */ 0, + /* 13d3 - */ 0, + /* 13d4 - */ 0, + /* 13d5 - _66_0F_38_DE */ 0x24bd, + /* 13d6 - */ 0, + /* 13d7 - */ 0, + /* 13d8 - */ 0, + /* 13d9 - _V_66_0F_38_DE */ 0x4134, + /* 13da - */ 0, + /* 13db - */ 0, + /* 13dc - */ 0, + /* 13dd - */ 0, + /* 13de - */ 0, + /* 13df - */ 0, + /* 13e0 - */ 0, + /* 13e1 - _66_0F_38_DF */ 0x24be, + /* 13e2 - */ 0, + /* 13e3 - */ 0, + /* 13e4 - */ 0, + /* 13e5 - _V_66_0F_38_DF */ 0x4135, + /* 13e6 - */ 0, + /* 13e7 - */ 0, + /* 13e8 - */ 0, + /* 13e9 - */ 0, + /* 13ea - */ 0, + /* 13eb - */ 0, + /* 13ec - _0F_38_F0 */ 0x24bf, + /* 13ed - */ 0, + /* 13ee - */ 0, + /* 13ef - _F2_0F_38_F0 */ 0x24c0, + /* 13f0 - */ 0, + /* 13f1 - */ 0, + /* 13f2 - */ 0, + /* 13f3 - */ 0, + /* 13f4 - */ 0, + /* 13f5 - */ 0, + /* 13f6 - */ 0, + /* 13f7 - */ 0, + /* 13f8 - _0F_38_F1 */ 0x24c1, + /* 13f9 - */ 0, + /* 13fa - */ 0, + /* 13fb - _F2_0F_38_F1 */ 0x24c2, + /* 13fc - */ 0, + /* 13fd - */ 0, + /* 13fe - */ 0, + /* 13ff - */ 0, + /* 1400 - */ 0, + /* 1401 - */ 0, + /* 1402 - */ 0, + /* 1403 - */ 0, + /* 1404 - */ 0, + /* 1405 - */ 0, + /* 1406 - */ 0, + /* 1407 - */ 0, + /* 1408 - */ 0, + /* 1409 - _V_66_0F_3A_04 */ 0x4136, + /* 140a - */ 0, + /* 140b - */ 0, + /* 140c - */ 0, + /* 140d - */ 0, + /* 140e - */ 0, + /* 140f - */ 0, + /* 1410 - */ 0, + /* 1411 - */ 0, + /* 1412 - */ 0, + /* 1413 - */ 0, + /* 1414 - */ 0, + /* 1415 - _V_66_0F_3A_05 */ 0x4137, + /* 1416 - */ 0, + /* 1417 - */ 0, + /* 1418 - */ 0, + /* 1419 - */ 0, + /* 141a - */ 0, + /* 141b - */ 0, + /* 141c - */ 0, + /* 141d - */ 0, + /* 141e - */ 0, + /* 141f - */ 0, + /* 1420 - */ 0, + /* 1421 - _V_66_0F_3A_06 */ 0x4138, + /* 1422 - */ 0, + /* 1423 - */ 0, + /* 1424 - */ 0, + /* 1425 - */ 0, + /* 1426 - */ 0, + /* 1427 - */ 0, + /* 1428 - */ 0, + /* 1429 - _66_0F_3A_08 */ 0x4139, + /* 142a - */ 0, + /* 142b - */ 0, + /* 142c - */ 0, + /* 142d - _V_66_0F_3A_08 */ 0x413a, + /* 142e - */ 0, + /* 142f - */ 0, + /* 1430 - */ 0, + /* 1431 - */ 0, + /* 1432 - */ 0, + /* 1433 - */ 0, + /* 1434 - */ 0, + /* 1435 - _66_0F_3A_09 */ 0x413b, + /* 1436 - */ 0, + /* 1437 - */ 0, + /* 1438 - */ 0, + /* 1439 - _V_66_0F_3A_09 */ 0x413c, + /* 143a - */ 0, + /* 143b - */ 0, + /* 143c - */ 0, + /* 143d - */ 0, + /* 143e - */ 0, + /* 143f - */ 0, + /* 1440 - */ 0, + /* 1441 - _66_0F_3A_0A */ 0x413d, + /* 1442 - */ 0, + /* 1443 - */ 0, + /* 1444 - */ 0, + /* 1445 - _V_66_0F_3A_0A */ 0x413e, + /* 1446 - */ 0, + /* 1447 - */ 0, + /* 1448 - */ 0, + /* 1449 - */ 0, + /* 144a - */ 0, + /* 144b - */ 0, + /* 144c - */ 0, + /* 144d - _66_0F_3A_0B */ 0x413f, + /* 144e - */ 0, + /* 144f - */ 0, + /* 1450 - */ 0, + /* 1451 - _V_66_0F_3A_0B */ 0x4140, + /* 1452 - */ 0, + /* 1453 - */ 0, + /* 1454 - */ 0, + /* 1455 - */ 0, + /* 1456 - */ 0, + /* 1457 - */ 0, + /* 1458 - */ 0, + /* 1459 - _66_0F_3A_0C */ 0x4141, + /* 145a - */ 0, + /* 145b - */ 0, + /* 145c - */ 0, + /* 145d - _V_66_0F_3A_0C */ 0x4142, + /* 145e - */ 0, + /* 145f - */ 0, + /* 1460 - */ 0, + /* 1461 - */ 0, + /* 1462 - */ 0, + /* 1463 - */ 0, + /* 1464 - */ 0, + /* 1465 - _66_0F_3A_0D */ 0x4143, + /* 1466 - */ 0, + /* 1467 - */ 0, + /* 1468 - */ 0, + /* 1469 - _V_66_0F_3A_0D */ 0x4144, + /* 146a - */ 0, + /* 146b - */ 0, + /* 146c - */ 0, + /* 146d - */ 0, + /* 146e - */ 0, + /* 146f - */ 0, + /* 1470 - */ 0, + /* 1471 - _66_0F_3A_0E */ 0x4145, + /* 1472 - */ 0, + /* 1473 - */ 0, + /* 1474 - */ 0, + /* 1475 - _V_66_0F_3A_0E */ 0x4146, + /* 1476 - */ 0, + /* 1477 - */ 0, + /* 1478 - */ 0, + /* 1479 - */ 0, + /* 147a - */ 0, + /* 147b - */ 0, + /* 147c - _0F_3A_0F */ 0x4147, + /* 147d - _66_0F_3A_0F */ 0x4148, + /* 147e - */ 0, + /* 147f - */ 0, + /* 1480 - */ 0, + /* 1481 - _V_66_0F_3A_0F */ 0x4149, + /* 1482 - */ 0, + /* 1483 - */ 0, + /* 1484 - */ 0, + /* 1485 - */ 0, + /* 1486 - */ 0, + /* 1487 - */ 0, + /* 1488 - */ 0, + /* 1489 - _66_0F_3A_14 */ 0x414a, + /* 148a - */ 0, + /* 148b - */ 0, + /* 148c - */ 0, + /* 148d - _V_66_0F_3A_14 */ 0x414b, + /* 148e - */ 0, + /* 148f - */ 0, + /* 1490 - */ 0, + /* 1491 - */ 0, + /* 1492 - */ 0, + /* 1493 - */ 0, + /* 1494 - */ 0, + /* 1495 - _66_0F_3A_15 */ 0x414c, + /* 1496 - */ 0, + /* 1497 - */ 0, + /* 1498 - */ 0, + /* 1499 - _V_66_0F_3A_15 */ 0x414d, + /* 149a - */ 0, + /* 149b - */ 0, + /* 149c - */ 0, + /* 149d - */ 0, + /* 149e - */ 0, + /* 149f - */ 0, + /* 14a0 - */ 0, + /* 14a1 - _66_0F_3A_16 */ 0x414e, + /* 14a2 - */ 0, + /* 14a3 - */ 0, + /* 14a4 - */ 0, + /* 14a5 - _V_66_0F_3A_16 */ 0x414f, + /* 14a6 - */ 0, + /* 14a7 - */ 0, + /* 14a8 - */ 0, + /* 14a9 - */ 0, + /* 14aa - */ 0, + /* 14ab - */ 0, + /* 14ac - */ 0, + /* 14ad - _66_0F_3A_17 */ 0x4150, + /* 14ae - */ 0, + /* 14af - */ 0, + /* 14b0 - */ 0, + /* 14b1 - _V_66_0F_3A_17 */ 0x4151, + /* 14b2 - */ 0, + /* 14b3 - */ 0, + /* 14b4 - */ 0, + /* 14b5 - */ 0, + /* 14b6 - */ 0, + /* 14b7 - */ 0, + /* 14b8 - */ 0, + /* 14b9 - */ 0, + /* 14ba - */ 0, + /* 14bb - */ 0, + /* 14bc - */ 0, + /* 14bd - _V_66_0F_3A_18 */ 0x4152, + /* 14be - */ 0, + /* 14bf - */ 0, + /* 14c0 - */ 0, + /* 14c1 - */ 0, + /* 14c2 - */ 0, + /* 14c3 - */ 0, + /* 14c4 - */ 0, + /* 14c5 - */ 0, + /* 14c6 - */ 0, + /* 14c7 - */ 0, + /* 14c8 - */ 0, + /* 14c9 - _V_66_0F_3A_19 */ 0x4153, + /* 14ca - */ 0, + /* 14cb - */ 0, + /* 14cc - */ 0, + /* 14cd - */ 0, + /* 14ce - */ 0, + /* 14cf - */ 0, + /* 14d0 - */ 0, + /* 14d1 - _66_0F_3A_20 */ 0x4154, + /* 14d2 - */ 0, + /* 14d3 - */ 0, + /* 14d4 - */ 0, + /* 14d5 - _V_66_0F_3A_20 */ 0x4155, + /* 14d6 - */ 0, + /* 14d7 - */ 0, + /* 14d8 - */ 0, + /* 14d9 - */ 0, + /* 14da - */ 0, + /* 14db - */ 0, + /* 14dc - */ 0, + /* 14dd - _66_0F_3A_21 */ 0x4156, + /* 14de - */ 0, + /* 14df - */ 0, + /* 14e0 - */ 0, + /* 14e1 - _V_66_0F_3A_21 */ 0x4157, + /* 14e2 - */ 0, + /* 14e3 - */ 0, + /* 14e4 - */ 0, + /* 14e5 - */ 0, + /* 14e6 - */ 0, + /* 14e7 - */ 0, + /* 14e8 - */ 0, + /* 14e9 - _66_0F_3A_22 */ 0x4158, + /* 14ea - */ 0, + /* 14eb - */ 0, + /* 14ec - */ 0, + /* 14ed - _V_66_0F_3A_22 */ 0x4159, + /* 14ee - */ 0, + /* 14ef - */ 0, + /* 14f0 - */ 0, + /* 14f1 - */ 0, + /* 14f2 - */ 0, + /* 14f3 - */ 0, + /* 14f4 - */ 0, + /* 14f5 - _66_0F_3A_40 */ 0x415a, + /* 14f6 - */ 0, + /* 14f7 - */ 0, + /* 14f8 - */ 0, + /* 14f9 - _V_66_0F_3A_40 */ 0x415b, + /* 14fa - */ 0, + /* 14fb - */ 0, + /* 14fc - */ 0, + /* 14fd - */ 0, + /* 14fe - */ 0, + /* 14ff - */ 0, + /* 1500 - */ 0, + /* 1501 - _66_0F_3A_41 */ 0x415c, + /* 1502 - */ 0, + /* 1503 - */ 0, + /* 1504 - */ 0, + /* 1505 - _V_66_0F_3A_41 */ 0x415d, + /* 1506 - */ 0, + /* 1507 - */ 0, + /* 1508 - */ 0, + /* 1509 - */ 0, + /* 150a - */ 0, + /* 150b - */ 0, + /* 150c - */ 0, + /* 150d - _66_0F_3A_42 */ 0x415e, + /* 150e - */ 0, + /* 150f - */ 0, + /* 1510 - */ 0, + /* 1511 - _V_66_0F_3A_42 */ 0x415f, + /* 1512 - */ 0, + /* 1513 - */ 0, + /* 1514 - */ 0, + /* 1515 - */ 0, + /* 1516 - */ 0, + /* 1517 - */ 0, + /* 1518 - */ 0, + /* 1519 - _66_0F_3A_44 */ 0x4160, + /* 151a - */ 0, + /* 151b - */ 0, + /* 151c - */ 0, + /* 151d - _V_66_0F_3A_44 */ 0x4161, + /* 151e - */ 0, + /* 151f - */ 0, + /* 1520 - */ 0, + /* 1521 - */ 0, + /* 1522 - */ 0, + /* 1523 - */ 0, + /* 1524 - */ 0, + /* 1525 - */ 0, + /* 1526 - */ 0, + /* 1527 - */ 0, + /* 1528 - */ 0, + /* 1529 - _V_66_0F_3A_4A */ 0x4162, + /* 152a - */ 0, + /* 152b - */ 0, + /* 152c - */ 0, + /* 152d - */ 0, + /* 152e - */ 0, + /* 152f - */ 0, + /* 1530 - */ 0, + /* 1531 - */ 0, + /* 1532 - */ 0, + /* 1533 - */ 0, + /* 1534 - */ 0, + /* 1535 - _V_66_0F_3A_4B */ 0x4163, + /* 1536 - */ 0, + /* 1537 - */ 0, + /* 1538 - */ 0, + /* 1539 - */ 0, + /* 153a - */ 0, + /* 153b - */ 0, + /* 153c - */ 0, + /* 153d - */ 0, + /* 153e - */ 0, + /* 153f - */ 0, + /* 1540 - */ 0, + /* 1541 - _V_66_0F_3A_4C */ 0x4164, + /* 1542 - */ 0, + /* 1543 - */ 0, + /* 1544 - */ 0, + /* 1545 - */ 0, + /* 1546 - */ 0, + /* 1547 - */ 0, + /* 1548 - */ 0, + /* 1549 - _66_0F_3A_60 */ 0x4165, + /* 154a - */ 0, + /* 154b - */ 0, + /* 154c - */ 0, + /* 154d - _V_66_0F_3A_60 */ 0x4166, + /* 154e - */ 0, + /* 154f - */ 0, + /* 1550 - */ 0, + /* 1551 - */ 0, + /* 1552 - */ 0, + /* 1553 - */ 0, + /* 1554 - */ 0, + /* 1555 - _66_0F_3A_61 */ 0x4167, + /* 1556 - */ 0, + /* 1557 - */ 0, + /* 1558 - */ 0, + /* 1559 - _V_66_0F_3A_61 */ 0x4168, + /* 155a - */ 0, + /* 155b - */ 0, + /* 155c - */ 0, + /* 155d - */ 0, + /* 155e - */ 0, + /* 155f - */ 0, + /* 1560 - */ 0, + /* 1561 - _66_0F_3A_62 */ 0x4169, + /* 1562 - */ 0, + /* 1563 - */ 0, + /* 1564 - */ 0, + /* 1565 - _V_66_0F_3A_62 */ 0x416a, + /* 1566 - */ 0, + /* 1567 - */ 0, + /* 1568 - */ 0, + /* 1569 - */ 0, + /* 156a - */ 0, + /* 156b - */ 0, + /* 156c - */ 0, + /* 156d - _66_0F_3A_63 */ 0x416b, + /* 156e - */ 0, + /* 156f - */ 0, + /* 1570 - */ 0, + /* 1571 - _V_66_0F_3A_63 */ 0x416c, + /* 1572 - */ 0, + /* 1573 - */ 0, + /* 1574 - */ 0, + /* 1575 - */ 0, + /* 1576 - */ 0, + /* 1577 - */ 0, + /* 1578 - */ 0, + /* 1579 - _66_0F_3A_DF */ 0x416d, + /* 157a - */ 0, + /* 157b - */ 0, + /* 157c - */ 0, + /* 157d - _V_66_0F_3A_DF */ 0x416e, + /* 157e - */ 0, + /* 157f - */ 0, + /* 1580 - */ 0, + /* 1581 - */ 0, + /* 1582 - */ 0, + /* 1583 - */ 0, + /* 1584 - _0F_71_02 */ 0x24c3, + /* 1585 - _66_0F_71_02 */ 0x24c4, + /* 1586 - */ 0, + /* 1587 - */ 0, + /* 1588 - */ 0, + /* 1589 - _V_66_0F_71_02 */ 0x416f, + /* 158a - */ 0, + /* 158b - */ 0, + /* 158c - */ 0, + /* 158d - */ 0, + /* 158e - */ 0, + /* 158f - */ 0, + /* 1590 - _0F_71_04 */ 0x24c5, + /* 1591 - _66_0F_71_04 */ 0x24c6, + /* 1592 - */ 0, + /* 1593 - */ 0, + /* 1594 - */ 0, + /* 1595 - _V_66_0F_71_04 */ 0x4170, + /* 1596 - */ 0, + /* 1597 - */ 0, + /* 1598 - */ 0, + /* 1599 - */ 0, + /* 159a - */ 0, + /* 159b - */ 0, + /* 159c - _0F_71_06 */ 0x24c7, + /* 159d - _66_0F_71_06 */ 0x24c8, + /* 159e - */ 0, + /* 159f - */ 0, + /* 15a0 - */ 0, + /* 15a1 - _V_66_0F_71_06 */ 0x4171, + /* 15a2 - */ 0, + /* 15a3 - */ 0, + /* 15a4 - */ 0, + /* 15a5 - */ 0, + /* 15a6 - */ 0, + /* 15a7 - */ 0, + /* 15a8 - _0F_72_02 */ 0x24c9, + /* 15a9 - _66_0F_72_02 */ 0x24ca, + /* 15aa - */ 0, + /* 15ab - */ 0, + /* 15ac - */ 0, + /* 15ad - _V_66_0F_72_02 */ 0x4172, + /* 15ae - */ 0, + /* 15af - */ 0, + /* 15b0 - */ 0, + /* 15b1 - */ 0, + /* 15b2 - */ 0, + /* 15b3 - */ 0, + /* 15b4 - _0F_72_04 */ 0x24cb, + /* 15b5 - _66_0F_72_04 */ 0x24cc, + /* 15b6 - */ 0, + /* 15b7 - */ 0, + /* 15b8 - */ 0, + /* 15b9 - _V_66_0F_72_04 */ 0x4173, + /* 15ba - */ 0, + /* 15bb - */ 0, + /* 15bc - */ 0, + /* 15bd - */ 0, + /* 15be - */ 0, + /* 15bf - */ 0, + /* 15c0 - _0F_72_06 */ 0x24cd, + /* 15c1 - _66_0F_72_06 */ 0x24ce, + /* 15c2 - */ 0, + /* 15c3 - */ 0, + /* 15c4 - */ 0, + /* 15c5 - _V_66_0F_72_06 */ 0x4174, + /* 15c6 - */ 0, + /* 15c7 - */ 0, + /* 15c8 - */ 0, + /* 15c9 - */ 0, + /* 15ca - */ 0, + /* 15cb - */ 0, + /* 15cc - _0F_73_02 */ 0x24cf, + /* 15cd - _66_0F_73_02 */ 0x24d0, + /* 15ce - */ 0, + /* 15cf - */ 0, + /* 15d0 - */ 0, + /* 15d1 - _V_66_0F_73_02 */ 0x4175, + /* 15d2 - */ 0, + /* 15d3 - */ 0, + /* 15d4 - */ 0, + /* 15d5 - */ 0, + /* 15d6 - */ 0, + /* 15d7 - */ 0, + /* 15d8 - */ 0, + /* 15d9 - _66_0F_73_03 */ 0x24d1, + /* 15da - */ 0, + /* 15db - */ 0, + /* 15dc - */ 0, + /* 15dd - _V_66_0F_73_03 */ 0x4176, + /* 15de - */ 0, + /* 15df - */ 0, + /* 15e0 - */ 0, + /* 15e1 - */ 0, + /* 15e2 - */ 0, + /* 15e3 - */ 0, + /* 15e4 - _0F_73_06 */ 0x24d2, + /* 15e5 - _66_0F_73_06 */ 0x24d3, + /* 15e6 - */ 0, + /* 15e7 - */ 0, + /* 15e8 - */ 0, + /* 15e9 - _V_66_0F_73_06 */ 0x4177, + /* 15ea - */ 0, + /* 15eb - */ 0, + /* 15ec - */ 0, + /* 15ed - */ 0, + /* 15ee - */ 0, + /* 15ef - */ 0, + /* 15f0 - */ 0, + /* 15f1 - _66_0F_73_07 */ 0x24d4, + /* 15f2 - */ 0, + /* 15f3 - */ 0, + /* 15f4 - */ 0, + /* 15f5 - _V_66_0F_73_07 */ 0x4178, + /* 15f6 - */ 0, + /* 15f7 - */ 0, + /* 15f8 - */ 0, + /* 15f9 - */ 0, + /* 15fa - */ 0, + /* 15fb - */ 0, + /* 15fc - _0F_AE_00 */ 0x4179, + /* 15fd - */ 0, + /* 15fe - _F3_0F_AE_00 */ 0x24d5, + /* 15ff - */ 0, + /* 1600 - */ 0, + /* 1601 - */ 0, + /* 1602 - */ 0, + /* 1603 - */ 0, + /* 1604 - */ 0, + /* 1605 - */ 0, + /* 1606 - */ 0, + /* 1607 - */ 0, + /* 1608 - _0F_AE_01 */ 0x417a, + /* 1609 - */ 0, + /* 160a - _F3_0F_AE_01 */ 0x24d6, + /* 160b - */ 0, + /* 160c - */ 0, + /* 160d - */ 0, + /* 160e - */ 0, + /* 160f - */ 0, + /* 1610 - */ 0, + /* 1611 - */ 0, + /* 1612 - */ 0, + /* 1613 - */ 0, + /* 1614 - _0F_AE_02 */ 0x24d7, + /* 1615 - */ 0, + /* 1616 - _F3_0F_AE_02 */ 0x24d8, + /* 1617 - */ 0, + /* 1618 - _V_0F_AE_02 */ 0x417b, + /* 1619 - */ 0, + /* 161a - */ 0, + /* 161b - */ 0, + /* 161c - */ 0, + /* 161d - */ 0, + /* 161e - */ 0, + /* 161f - */ 0, + /* 1620 - _0F_AE_03 */ 0x24d9, + /* 1621 - */ 0, + /* 1622 - _F3_0F_AE_03 */ 0x24da, + /* 1623 - */ 0, + /* 1624 - _V_0F_AE_03 */ 0x417c, + /* 1625 - */ 0, + /* 1626 - */ 0, + /* 1627 - */ 0, + /* 1628 - */ 0, + /* 1629 - */ 0, + /* 162a - */ 0, + /* 162b - */ 0, + /* 162c - _0F_C7_06 */ 0x24db, + /* 162d - _66_0F_C7_06 */ 0x24dc, + /* 162e - _F3_0F_C7_06 */ 0x24dd, + /* 162f - */ 0, + /* 1630 - */ 0, + /* 1631 - */ 0, + /* 1632 - */ 0, + /* 1633 - */ 0, + /* 1634 - */ 0, + /* 1635 - */ 0, + /* 1636 - */ 0, + /* 1637 - */ 0 +}; + +_InstSharedInfo InstSharedInfoTable[470] = { + { 0, 9, 15, 8, 245, 0, 0 }, + { 0, 11, 17, 8, 245, 0, 0 }, + { 0, 15, 9, 8, 245, 0, 0 }, + { 0, 17, 11, 8, 245, 0, 0 }, + { 1, 1, 33, 8, 245, 0, 0 }, + { 1, 3, 35, 8, 245, 0, 0 }, + { 2, 0, 32, 8, 0, 0, 0 }, + { 3, 0, 32, 8, 0, 0, 0 }, + { 0, 9, 15, 8, 196, 16, 0 }, + { 0, 11, 17, 8, 196, 16, 0 }, + { 0, 15, 9, 8, 196, 16, 0 }, + { 0, 17, 11, 8, 196, 16, 0 }, + { 1, 1, 33, 8, 196, 16, 0 }, + { 1, 3, 35, 8, 196, 16, 0 }, + { 4, 0, 32, 8, 0, 0, 0 }, + { 0, 9, 15, 8, 245, 1, 0 }, + { 0, 11, 17, 8, 245, 1, 0 }, + { 0, 15, 9, 8, 245, 1, 0 }, + { 0, 17, 11, 8, 245, 1, 0 }, + { 1, 1, 33, 8, 245, 1, 0 }, + { 1, 3, 35, 8, 245, 1, 0 }, + { 5, 0, 32, 8, 0, 0, 0 }, + { 6, 0, 32, 8, 0, 0, 0 }, + { 7, 0, 32, 8, 0, 0, 0 }, + { 8, 0, 32, 8, 0, 0, 0 }, + { 0, 9, 15, 8, 229, 0, 16 }, + { 0, 11, 17, 8, 229, 0, 16 }, + { 0, 15, 9, 8, 229, 0, 16 }, + { 0, 17, 11, 8, 229, 0, 16 }, + { 1, 1, 33, 8, 229, 0, 16 }, + { 1, 3, 35, 8, 229, 0, 16 }, + { 9, 0, 0, 8, 213, 17, 32 }, + { 0, 9, 15, 8, 196, 0, 16 }, + { 0, 11, 17, 8, 196, 0, 16 }, + { 0, 15, 9, 8, 196, 0, 16 }, + { 0, 17, 11, 8, 196, 0, 16 }, + { 1, 1, 33, 8, 196, 0, 16 }, + { 1, 3, 35, 8, 196, 0, 16 }, + { 9, 0, 0, 8, 17, 16, 228 }, + { 10, 9, 15, 8, 245, 0, 0 }, + { 10, 11, 17, 8, 245, 0, 0 }, + { 10, 15, 9, 8, 245, 0, 0 }, + { 10, 17, 11, 8, 245, 0, 0 }, + { 11, 1, 33, 8, 245, 0, 0 }, + { 11, 3, 35, 8, 245, 0, 0 }, + { 12, 0, 54, 8, 244, 0, 0 }, + { 13, 0, 54, 8, 0, 0, 0 }, + { 14, 0, 54, 8, 0, 0, 0 }, + { 15, 0, 0, 8, 0, 0, 0 }, + { 16, 42, 11, 8, 0, 0, 0 }, + { 10, 10, 16, 8, 64, 0, 0 }, + { 13, 0, 3, 8, 0, 0, 0 }, + { 17, 17, 11, 8, 33, 0, 212 }, + { 18, 0, 5, 8, 0, 0, 0 }, + { 19, 59, 56, 8, 0, 8, 0 }, + { 20, 59, 56, 8, 0, 8, 0 }, + { 19, 55, 59, 8, 0, 8, 0 }, + { 20, 55, 59, 8, 0, 8, 0 }, + { 13, 0, 40, 13, 0, 32, 0 }, + { 13, 0, 40, 13, 0, 1, 0 }, + { 13, 0, 40, 13, 0, 64, 0 }, + { 13, 0, 40, 13, 0, 65, 0 }, + { 13, 0, 40, 13, 0, 128, 0 }, + { 13, 0, 40, 13, 0, 4, 0 }, + { 13, 0, 40, 13, 0, 160, 0 }, + { 13, 0, 40, 13, 0, 224, 0 }, + { 10, 9, 15, 8, 196, 0, 16 }, + { 10, 11, 17, 8, 196, 0, 16 }, + { 0, 9, 15, 8, 0, 0, 0 }, + { 0, 11, 17, 8, 0, 0, 0 }, + { 21, 9, 15, 8, 0, 0, 0 }, + { 21, 11, 17, 8, 0, 0, 0 }, + { 21, 15, 9, 8, 0, 0, 0 }, + { 21, 17, 11, 8, 0, 0, 0 }, + { 21, 31, 28, 8, 0, 0, 0 }, + { 21, 42, 11, 8, 0, 0, 0 }, + { 21, 28, 31, 8, 0, 0, 0 }, + { 1, 35, 54, 8, 0, 0, 0 }, + { 22, 0, 0, 8, 0, 0, 0 }, + { 9, 0, 38, 9, 0, 0, 0 }, + { 23, 0, 0, 8, 0, 0, 0 }, + { 23, 0, 0, 8, 255, 0, 0 }, + { 11, 0, 0, 8, 213, 0, 0 }, + { 11, 0, 0, 8, 0, 0, 0 }, + { 1, 49, 33, 8, 0, 0, 0 }, + { 1, 50, 35, 8, 0, 0, 0 }, + { 1, 33, 49, 8, 0, 0, 0 }, + { 1, 35, 50, 8, 0, 0, 0 }, + { 24, 55, 56, 8, 0, 8, 0 }, + { 25, 55, 56, 8, 0, 8, 0 }, + { 19, 56, 55, 8, 245, 8, 0 }, + { 26, 56, 55, 8, 245, 8, 0 }, + { 11, 1, 33, 8, 196, 0, 16 }, + { 11, 3, 35, 8, 196, 0, 16 }, + { 19, 33, 56, 8, 0, 8, 0 }, + { 26, 35, 56, 8, 0, 8, 0 }, + { 19, 55, 33, 8, 0, 8, 0 }, + { 26, 55, 35, 8, 0, 8, 0 }, + { 19, 33, 56, 8, 245, 8, 0 }, + { 26, 35, 56, 8, 245, 8, 0 }, + { 1, 1, 53, 8, 0, 0, 0 }, + { 27, 3, 54, 8, 0, 0, 0 }, + { 13, 0, 2, 10, 0, 0, 0 }, + { 13, 0, 0, 10, 0, 0, 0 }, + { 16, 37, 11, 8, 0, 0, 0 }, + { 13, 8, 6, 8, 0, 0, 0 }, + { 13, 0, 0, 8, 0, 0, 0 }, + { 28, 0, 2, 10, 0, 0, 0 }, + { 28, 0, 0, 10, 0, 0, 0 }, + { 11, 0, 0, 14, 0, 0, 0 }, + { 11, 0, 1, 14, 0, 0, 0 }, + { 9, 0, 0, 14, 0, 0, 0 }, + { 28, 0, 0, 10, 255, 0, 0 }, + { 9, 0, 1, 8, 196, 0, 49 }, + { 9, 0, 0, 8, 0, 0, 0 }, + { 29, 0, 57, 8, 0, 0, 0 }, + { 30, 0, 40, 13, 0, 64, 0 }, + { 30, 0, 40, 13, 0, 0, 0 }, + { 31, 0, 40, 13, 0, 0, 0 }, + { 1, 1, 33, 8, 0, 0, 0 }, + { 1, 1, 36, 8, 0, 0, 0 }, + { 11, 33, 1, 8, 0, 0, 0 }, + { 11, 36, 1, 8, 0, 0, 0 }, + { 13, 0, 41, 9, 0, 0, 0 }, + { 13, 0, 41, 12, 0, 0, 0 }, + { 9, 0, 38, 12, 0, 0, 0 }, + { 13, 0, 40, 12, 0, 0, 0 }, + { 1, 59, 33, 8, 0, 0, 0 }, + { 1, 59, 36, 8, 0, 0, 0 }, + { 11, 33, 59, 8, 0, 0, 0 }, + { 11, 36, 59, 8, 0, 0, 0 }, + { 11, 0, 0, 8, 1, 0, 0 }, + { 11, 0, 0, 8, 2, 0, 0 }, + { 11, 0, 0, 8, 8, 0, 0 }, + { 10, 16, 11, 8, 64, 0, 0 }, + { 32, 0, 0, 27, 0, 0, 0 }, + { 32, 0, 0, 8, 0, 0, 0 }, + { 32, 0, 0, 14, 0, 0, 0 }, + { 11, 0, 0, 96, 0, 0, 0 }, + { 10, 0, 17, 8, 0, 0, 0 }, + { 33, 29, 14, 8, 0, 0, 0 }, + { 33, 30, 14, 8, 0, 0, 0 }, + { 33, 14, 29, 8, 0, 0, 0 }, + { 33, 14, 30, 8, 0, 0, 0 }, + { 34, 0, 0, 8, 0, 0, 0 }, + { 35, 17, 11, 31, 0, 32, 0 }, + { 35, 17, 11, 31, 0, 1, 0 }, + { 35, 17, 11, 31, 0, 64, 0 }, + { 35, 17, 11, 31, 0, 65, 0 }, + { 35, 17, 11, 31, 0, 128, 0 }, + { 35, 17, 11, 31, 0, 4, 0 }, + { 35, 17, 11, 31, 0, 160, 0 }, + { 35, 17, 11, 31, 0, 224, 0 }, + { 32, 0, 41, 13, 0, 32, 0 }, + { 32, 0, 41, 13, 0, 1, 0 }, + { 32, 0, 41, 13, 0, 64, 0 }, + { 32, 0, 41, 13, 0, 65, 0 }, + { 32, 0, 41, 13, 0, 128, 0 }, + { 32, 0, 41, 13, 0, 4, 0 }, + { 32, 0, 41, 13, 0, 160, 0 }, + { 32, 0, 41, 13, 0, 224, 0 }, + { 35, 0, 15, 8, 0, 32, 0 }, + { 35, 0, 15, 8, 0, 1, 0 }, + { 35, 0, 15, 8, 0, 64, 0 }, + { 35, 0, 15, 8, 0, 65, 0 }, + { 35, 0, 15, 8, 0, 128, 0 }, + { 35, 0, 15, 8, 0, 4, 0 }, + { 35, 0, 15, 8, 0, 160, 0 }, + { 35, 0, 15, 8, 0, 224, 0 }, + { 36, 0, 32, 8, 0, 0, 0 }, + { 37, 0, 32, 8, 0, 0, 0 }, + { 35, 11, 17, 8, 1, 0, 244 }, + { 38, 11, 17, 8, 197, 0, 48 }, + { 39, 0, 32, 8, 0, 0, 0 }, + { 40, 0, 32, 8, 0, 0, 0 }, + { 32, 0, 0, 8, 255, 0, 0 }, + { 41, 11, 17, 8, 1, 0, 244 }, + { 35, 17, 11, 8, 33, 0, 212 }, + { 41, 9, 15, 8, 245, 0, 0 }, + { 41, 11, 17, 8, 245, 0, 0 }, + { 42, 37, 11, 8, 0, 0, 0 }, + { 35, 15, 11, 8, 0, 0, 0 }, + { 43, 16, 11, 8, 0, 0, 0 }, + { 43, 13, 45, 48, 0, 0, 0 }, + { 44, 0, 54, 8, 0, 0, 0 }, + { 45, 1, 15, 8, 245, 0, 0 }, + { 45, 1, 15, 8, 196, 16, 0 }, + { 45, 1, 15, 8, 245, 1, 0 }, + { 45, 1, 15, 8, 229, 0, 16 }, + { 45, 1, 15, 8, 196, 0, 16 }, + { 46, 1, 15, 8, 245, 0, 0 }, + { 45, 3, 17, 8, 245, 0, 0 }, + { 45, 3, 17, 8, 196, 16, 0 }, + { 45, 3, 17, 8, 245, 1, 0 }, + { 45, 3, 17, 8, 229, 0, 16 }, + { 45, 3, 17, 8, 196, 0, 16 }, + { 46, 3, 17, 8, 245, 0, 0 }, + { 47, 1, 15, 8, 245, 0, 0 }, + { 47, 1, 15, 8, 196, 16, 0 }, + { 47, 1, 15, 8, 245, 1, 0 }, + { 47, 1, 15, 8, 229, 0, 16 }, + { 47, 1, 15, 8, 196, 0, 16 }, + { 48, 1, 15, 8, 245, 0, 0 }, + { 45, 5, 17, 8, 245, 0, 0 }, + { 49, 5, 17, 8, 196, 16, 0 }, + { 45, 5, 17, 8, 245, 1, 0 }, + { 49, 5, 17, 8, 229, 0, 16 }, + { 49, 5, 17, 8, 196, 0, 16 }, + { 46, 5, 17, 8, 245, 0, 0 }, + { 50, 0, 17, 8, 0, 0, 0 }, + { 51, 1, 15, 8, 1, 0, 32 }, + { 51, 1, 15, 8, 1, 1, 32 }, + { 51, 1, 15, 8, 197, 0, 48 }, + { 51, 1, 17, 8, 1, 0, 32 }, + { 51, 1, 17, 8, 1, 1, 32 }, + { 51, 1, 17, 8, 197, 0, 48 }, + { 52, 1, 15, 8, 0, 0, 0 }, + { 53, 0, 1, 24, 0, 0, 0 }, + { 52, 3, 17, 8, 0, 0, 0 }, + { 53, 0, 41, 24, 0, 0, 0 }, + { 51, 51, 15, 8, 33, 0, 0 }, + { 51, 51, 15, 8, 33, 1, 0 }, + { 51, 51, 15, 8, 229, 0, 16 }, + { 51, 51, 17, 8, 33, 0, 0 }, + { 51, 51, 17, 8, 33, 1, 0 }, + { 51, 51, 17, 8, 229, 0, 16 }, + { 51, 52, 15, 8, 1, 0, 32 }, + { 51, 52, 15, 8, 1, 1, 32 }, + { 51, 52, 15, 8, 197, 0, 48 }, + { 51, 52, 17, 8, 1, 0, 32 }, + { 51, 52, 17, 8, 1, 1, 32 }, + { 51, 52, 17, 8, 197, 0, 48 }, + { 46, 0, 21, 16, 0, 0, 0 }, + { 54, 0, 62, 16, 0, 0, 0 }, + { 54, 0, 61, 16, 0, 0, 0 }, + { 54, 0, 0, 16, 0, 0, 0 }, + { 51, 0, 21, 16, 0, 0, 0 }, + { 46, 0, 42, 16, 0, 0, 0 }, + { 46, 0, 20, 16, 0, 0, 0 }, + { 55, 0, 62, 24, 0, 1, 0 }, + { 55, 0, 62, 24, 0, 64, 0 }, + { 55, 0, 62, 24, 0, 65, 0 }, + { 55, 0, 62, 24, 0, 4, 0 }, + { 56, 0, 21, 56, 0, 0, 0 }, + { 46, 0, 23, 16, 0, 0, 0 }, + { 51, 0, 23, 16, 0, 0, 0 }, + { 55, 0, 62, 16, 69, 0, 0 }, + { 55, 0, 62, 24, 69, 0, 0 }, + { 46, 0, 22, 16, 0, 0, 0 }, + { 54, 0, 63, 16, 0, 0, 0 }, + { 56, 0, 22, 56, 0, 0, 0 }, + { 51, 0, 22, 16, 0, 0, 0 }, + { 56, 0, 20, 56, 0, 0, 0 }, + { 51, 0, 20, 16, 0, 0, 0 }, + { 46, 1, 15, 8, 196, 0, 16 }, + { 45, 0, 15, 8, 0, 0, 0 }, + { 45, 0, 15, 8, 245, 0, 0 }, + { 51, 0, 15, 8, 33, 0, 212 }, + { 51, 0, 15, 8, 0, 0, 245 }, + { 46, 3, 17, 8, 196, 0, 16 }, + { 45, 0, 17, 8, 0, 0, 0 }, + { 45, 0, 17, 8, 245, 0, 0 }, + { 51, 0, 17, 8, 33, 0, 212 }, + { 51, 0, 17, 8, 0, 0, 245 }, + { 45, 0, 15, 8, 244, 0, 0 }, + { 45, 0, 17, 8, 244, 0, 0 }, + { 57, 0, 17, 9, 0, 0, 0 }, + { 58, 0, 37, 9, 0, 0, 0 }, + { 57, 0, 17, 12, 0, 0, 0 }, + { 58, 0, 37, 12, 0, 0, 0 }, + { 57, 0, 17, 8, 0, 0, 0 }, + { 46, 0, 17, 8, 0, 0, 0 }, + { 46, 0, 16, 8, 0, 0, 0 }, + { 56, 0, 16, 8, 0, 0, 0 }, + { 46, 0, 16, 8, 64, 0, 0 }, + { 57, 0, 39, 8, 0, 0, 0 }, + { 52, 0, 28, 8, 0, 0, 0 }, + { 59, 0, 16, 8, 0, 0, 0 }, + { 56, 0, 42, 8, 0, 0, 0 }, + { 55, 0, 0, 112, 0, 0, 0 }, + { 55, 0, 0, 8, 0, 0, 0 }, + { 13, 0, 0, 24, 0, 0, 0 }, + { 56, 0, 58, 120, 0, 0, 0 }, + { 55, 0, 0, 120, 0, 0, 0 }, + { 55, 0, 58, 120, 0, 0, 0 }, + { 55, 60, 58, 120, 0, 0, 0 }, + { 60, 0, 0, 8, 0, 0, 0 }, + { 56, 0, 42, 96, 0, 0, 0 }, + { 61, 67, 64, 104, 0, 0, 0 }, + { 61, 67, 64, 96, 0, 0, 0 }, + { 35, 73, 68, 40, 0, 0, 0 }, + { 35, 73, 68, 48, 0, 0, 0 }, + { 35, 71, 68, 40, 0, 0, 0 }, + { 35, 72, 68, 48, 0, 0, 0 }, + { 62, 90, 83, 128, 0, 0, 0 }, + { 63, 81, 68, 128, 0, 0, 0 }, + { 64, 44, 68, 128, 0, 0, 0 }, + { 64, 46, 68, 128, 0, 0, 0 }, + { 35, 68, 73, 40, 0, 0, 0 }, + { 35, 68, 73, 48, 0, 0, 0 }, + { 35, 68, 71, 40, 0, 0, 0 }, + { 35, 68, 72, 48, 0, 0, 0 }, + { 62, 83, 90, 128, 0, 0, 0 }, + { 64, 68, 44, 128, 0, 0, 0 }, + { 64, 68, 46, 128, 0, 0, 0 }, + { 65, 72, 68, 40, 0, 0, 0 }, + { 35, 46, 68, 48, 0, 0, 0 }, + { 35, 72, 68, 56, 0, 0, 0 }, + { 66, 81, 68, 128, 0, 0, 0 }, + { 67, 81, 68, 128, 0, 0, 0 }, + { 62, 89, 83, 128, 0, 0, 0 }, + { 35, 68, 46, 40, 0, 0, 0 }, + { 35, 68, 46, 48, 0, 0, 0 }, + { 62, 68, 46, 128, 0, 0, 0 }, + { 34, 73, 68, 40, 0, 0, 0 }, + { 34, 73, 68, 48, 0, 0, 0 }, + { 67, 88, 83, 128, 0, 0, 0 }, + { 35, 73, 68, 56, 0, 0, 0 }, + { 56, 0, 42, 40, 0, 0, 0 }, + { 34, 67, 68, 40, 0, 0, 0 }, + { 34, 67, 68, 48, 0, 0, 0 }, + { 42, 18, 68, 40, 0, 0, 0 }, + { 42, 18, 68, 48, 0, 0, 0 }, + { 35, 68, 47, 40, 0, 0, 0 }, + { 35, 68, 47, 48, 0, 0, 0 }, + { 35, 68, 44, 88, 0, 0, 0 }, + { 35, 68, 46, 88, 0, 0, 0 }, + { 62, 83, 92, 128, 0, 0, 0 }, + { 34, 72, 64, 40, 0, 0, 0 }, + { 34, 73, 64, 48, 0, 0, 0 }, + { 42, 71, 13, 40, 0, 0, 0 }, + { 42, 72, 13, 48, 0, 0, 0 }, + { 62, 80, 78, 128, 0, 0, 0 }, + { 34, 71, 68, 40, 69, 0, 0 }, + { 34, 72, 68, 48, 0, 0, 0 }, + { 62, 71, 68, 128, 0, 0, 0 }, + { 62, 72, 68, 128, 0, 0, 0 }, + { 68, 69, 12, 40, 0, 0, 0 }, + { 68, 69, 12, 48, 0, 0, 0 }, + { 69, 83, 13, 128, 0, 0, 0 }, + { 34, 71, 68, 40, 0, 0, 0 }, + { 34, 71, 68, 48, 0, 0, 0 }, + { 62, 91, 83, 128, 0, 0, 0 }, + { 62, 90, 68, 128, 0, 0, 0 }, + { 34, 66, 64, 32, 0, 0, 0 }, + { 34, 67, 64, 32, 0, 0, 0 }, + { 70, 18, 64, 32, 0, 0, 0 }, + { 70, 18, 68, 48, 0, 0, 0 }, + { 62, 79, 68, 128, 0, 0, 0 }, + { 35, 67, 64, 32, 0, 0, 0 }, + { 71, 67, 64, 40, 0, 0, 0 }, + { 71, 73, 68, 48, 0, 0, 0 }, + { 67, 73, 68, 128, 0, 0, 0 }, + { 32, 0, 0, 32, 0, 0, 0 }, + { 72, 0, 0, 128, 0, 0, 0 }, + { 73, 13, 18, 112, 0, 0, 0 }, + { 74, 7, 69, 88, 0, 0, 0 }, + { 75, 69, 68, 88, 0, 0, 0 }, + { 73, 18, 13, 112, 0, 0, 0 }, + { 34, 69, 68, 88, 0, 0, 0 }, + { 76, 69, 68, 88, 0, 0, 0 }, + { 32, 72, 68, 112, 0, 0, 0 }, + { 32, 68, 72, 112, 0, 0, 0 }, + { 34, 73, 68, 56, 0, 0, 0 }, + { 70, 64, 18, 32, 0, 0, 0 }, + { 70, 68, 18, 48, 0, 0, 0 }, + { 62, 68, 79, 128, 0, 0, 0 }, + { 35, 64, 67, 32, 0, 0, 0 }, + { 77, 0, 42, 8, 0, 0, 0 }, + { 78, 0, 43, 8, 0, 0, 0 }, + { 79, 0, 43, 8, 0, 0, 0 }, + { 80, 17, 11, 80, 64, 0, 0 }, + { 81, 1, 17, 8, 1, 0, 244 }, + { 49, 1, 17, 8, 1, 0, 244 }, + { 34, 17, 11, 8, 64, 0, 245 }, + { 82, 17, 11, 112, 0, 0, 0 }, + { 83, 17, 11, 8, 65, 0, 180 }, + { 84, 73, 68, 40, 0, 0, 0 }, + { 84, 73, 68, 48, 0, 0, 0 }, + { 84, 71, 68, 40, 0, 0, 0 }, + { 84, 72, 68, 48, 0, 0, 0 }, + { 85, 88, 83, 128, 0, 0, 0 }, + { 85, 81, 68, 128, 0, 0, 0 }, + { 71, 25, 64, 40, 0, 0, 0 }, + { 71, 25, 68, 48, 0, 0, 0 }, + { 86, 81, 68, 128, 0, 0, 0 }, + { 87, 65, 12, 40, 0, 0, 0 }, + { 71, 69, 12, 48, 0, 0, 0 }, + { 88, 68, 13, 128, 0, 0, 0 }, + { 71, 73, 68, 40, 0, 0, 0 }, + { 86, 88, 83, 128, 0, 0, 0 }, + { 89, 0, 48, 8, 64, 0, 0 }, + { 56, 0, 46, 112, 0, 0, 0 }, + { 68, 65, 68, 48, 0, 0, 0 }, + { 68, 69, 64, 48, 0, 0, 0 }, + { 62, 68, 72, 128, 0, 0, 0 }, + { 76, 65, 12, 40, 0, 0, 0 }, + { 76, 69, 12, 48, 0, 0, 0 }, + { 69, 68, 13, 128, 0, 0, 0 }, + { 34, 67, 64, 40, 0, 0, 0 }, + { 35, 64, 46, 40, 0, 0, 0 }, + { 34, 42, 68, 56, 0, 0, 0 }, + { 62, 92, 83, 128, 0, 0, 0 }, + { 34, 67, 64, 48, 0, 0, 0 }, + { 76, 65, 64, 40, 0, 0, 0 }, + { 76, 69, 68, 48, 0, 0, 0 }, + { 90, 69, 68, 128, 0, 0, 0 }, + { 51, 0, 42, 16, 0, 0, 0 }, + { 91, 0, 42, 16, 0, 0, 0 }, + { 91, 0, 20, 16, 0, 0, 0 }, + { 92, 0, 0, 16, 0, 0, 0 }, + { 93, 0, 34, 16, 0, 0, 0 }, + { 94, 0, 34, 16, 0, 0, 0 }, + { 34, 67, 64, 64, 0, 0, 0 }, + { 34, 73, 68, 64, 0, 0, 0 }, + { 71, 73, 68, 72, 0, 0, 0 }, + { 34, 73, 68, 80, 0, 0, 0 }, + { 62, 44, 83, 128, 0, 0, 0 }, + { 62, 46, 85, 128, 0, 0, 0 }, + { 62, 47, 85, 128, 0, 0, 0 }, + { 62, 73, 68, 128, 0, 0, 0 }, + { 34, 72, 68, 72, 0, 0, 0 }, + { 34, 71, 68, 72, 0, 0, 0 }, + { 34, 70, 68, 72, 0, 0, 0 }, + { 62, 70, 68, 128, 0, 0, 0 }, + { 34, 73, 68, 72, 0, 0, 0 }, + { 35, 47, 68, 72, 0, 0, 0 }, + { 62, 47, 68, 128, 0, 0, 0 }, + { 67, 88, 92, 128, 0, 0, 0 }, + { 73, 47, 13, 112, 0, 0, 0 }, + { 67, 88, 83, 136, 0, 0, 0 }, + { 67, 81, 68, 136, 0, 0, 0 }, + { 34, 73, 68, 152, 0, 0, 0 }, + { 62, 73, 68, 152, 0, 0, 0 }, + { 67, 81, 68, 152, 0, 0, 0 }, + { 35, 17, 11, 8, 0, 0, 0 }, + { 35, 15, 13, 80, 0, 0, 0 }, + { 35, 11, 17, 8, 0, 0, 0 }, + { 35, 17, 13, 80, 0, 0, 0 }, + { 67, 90, 83, 128, 0, 0, 0 }, + { 86, 87, 85, 128, 0, 0, 0 }, + { 71, 71, 68, 72, 0, 0, 0 }, + { 71, 72, 68, 72, 0, 0, 0 }, + { 71, 67, 64, 64, 0, 0, 0 }, + { 71, 73, 68, 64, 0, 0, 0 }, + { 71, 68, 26, 72, 0, 0, 0 }, + { 88, 68, 76, 128, 0, 0, 0 }, + { 71, 68, 27, 72, 0, 0, 0 }, + { 88, 68, 77, 128, 0, 0, 0 }, + { 95, 68, 18, 72, 0, 0, 0 }, + { 67, 68, 79, 128, 0, 0, 0 }, + { 71, 68, 18, 72, 0, 0, 0 }, + { 67, 68, 75, 128, 0, 0, 0 }, + { 67, 85, 73, 128, 0, 0, 0 }, + { 71, 24, 68, 72, 0, 0, 0 }, + { 95, 18, 68, 72, 0, 0, 0 }, + { 71, 73, 68, 144, 0, 0, 0 }, + { 86, 81, 68, 144, 0, 0, 0 }, + { 71, 73, 68, 80, 0, 0, 0 }, + { 71, 73, 68, 152, 0, 0, 0 }, + { 67, 73, 68, 152, 0, 0, 0 }, + { 96, 1, 65, 32, 0, 0, 0 }, + { 56, 1, 69, 48, 0, 0, 0 }, + { 97, 69, 81, 128, 0, 0, 0 }, + { 98, 0, 13, 112, 0, 0, 0 }, + { 64, 0, 44, 128, 0, 0, 0 }, + { 56, 0, 42, 112, 0, 0, 0 }, + { 99, 75, 13, 8, 0, 0, 0 }, + { 98, 0, 17, 8, 0, 0, 0 }, + { 100, 67, 64, 96, 0, 0, 0 } +}; + +uint16_t CmpMnemonicOffsets[8] = { + 0, 9, 18, 27, 39, 49, 59, 69 +}; +uint16_t VCmpMnemonicOffsets[32] = { + 0, 10, 20, 30, 43, 54, 65, 76, 87, 100, 111, 122, 135, 149, 159, 169, 181, 194, 207, 220, 235, 249, 263, 277, 290, 303, 317, 331, 347, 361, 374, 387 +}; diff --git a/distorm/src/insts.h b/distorm/src/insts.h new file mode 100644 index 0000000..946cacd --- /dev/null +++ b/distorm/src/insts.h @@ -0,0 +1,64 @@ +/* +insts.h + +diStorm3 - Powerful disassembler for X86/AMD64 +http://ragestorm.net/distorm/ +distorm at gmail dot com +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. +*/ + + +#ifndef INSTS_H +#define INSTS_H + +#include "instructions.h" + + +/* Flags Table */ +extern _iflags FlagsTable[]; + +/* Root Trie DB */ +extern _InstSharedInfo InstSharedInfoTable[]; +extern _InstInfo InstInfos[]; +extern _InstInfoEx InstInfosEx[]; +extern _InstNode InstructionsTree[]; + +/* 3DNow! Trie DB */ +extern _InstNode Table_0F_0F; +/* AVX related: */ +extern _InstNode Table_0F, Table_0F_38, Table_0F_3A; + +/* + * The inst_lookup will return on of these two instructions according to the specified decoding mode. + * ARPL or MOVSXD on 64 bits is one byte instruction at index 0x63. + */ +extern _InstInfo II_MOVSXD; + +/* + * The NOP instruction can be prefixed by REX in 64bits, therefore we have to decide in runtime whether it's an XCHG or NOP instruction. + * If 0x90 is prefixed by a usable REX it will become XCHG, otherwise it will become a NOP. + * Also note that if it's prefixed by 0xf3, it becomes a Pause. + */ +extern _InstInfo II_NOP; +extern _InstInfo II_PAUSE; + +/* + * RDRAND and VMPTRLD share same 2.3 bytes opcode, and then alternates on the MOD bits, + * RDRAND is OT_FULL_REG while VMPTRLD is OT_MEM, and there's no such mixed type. + * So a hack into the inst_lookup was added for this decision, the DB isn't flexible enough. :( + */ +extern _InstInfo II_RDRAND; + +/* + * Used for letting the extract operand know the type of operands without knowing the + * instruction itself yet, because of the way those instructions work. + * See function instructions.c!inst_lookup_3dnow. + */ +extern _InstInfo II_3DNOW; + +/* Helper tables for pseudo compare mnemonics. */ +extern uint16_t CmpMnemonicOffsets[8]; /* SSE */ +extern uint16_t VCmpMnemonicOffsets[32]; /* AVX */ + +#endif /* INSTS_H */ diff --git a/distorm3.2-package/src/mnemonics.c b/distorm/src/mnemonics.c similarity index 68% rename from distorm3.2-package/src/mnemonics.c rename to distorm/src/mnemonics.c index 0c39a21..ff00ac5 100644 --- a/distorm3.2-package/src/mnemonics.c +++ b/distorm/src/mnemonics.c @@ -4,20 +4,8 @@ mnemonics.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ @@ -59,65 +47,66 @@ const unsigned char _MNEMONICS[] = "\x03" "LFS\0" "\x03" "LGS\0" "\x05" "MOVZX\0" "\x03" "BTC\0" "\x05" "MOVSX\0" \ "\x04" "XADD\0" "\x06" "MOVNTI\0" "\x05" "BSWAP\0" "\x03" "ROL\0" "\x03" "ROR\0" \ "\x03" "RCL\0" "\x03" "RCR\0" "\x03" "SHL\0" "\x03" "SHR\0" "\x03" "SAL\0" \ -"\x03" "SAR\0" "\x04" "FADD\0" "\x04" "FMUL\0" "\x04" "FCOM\0" "\x05" "FCOMP\0" \ -"\x04" "FSUB\0" "\x05" "FSUBR\0" "\x04" "FDIV\0" "\x05" "FDIVR\0" "\x03" "FLD\0" \ -"\x03" "FST\0" "\x04" "FSTP\0" "\x06" "FLDENV\0" "\x05" "FLDCW\0" "\x04" "FXCH\0" \ -"\x04" "FNOP\0" "\x04" "FCHS\0" "\x04" "FABS\0" "\x04" "FTST\0" "\x04" "FXAM\0" \ -"\x04" "FLD1\0" "\x06" "FLDL2T\0" "\x06" "FLDL2E\0" "\x05" "FLDPI\0" "\x06" "FLDLG2\0" \ -"\x06" "FLDLN2\0" "\x04" "FLDZ\0" "\x05" "F2XM1\0" "\x05" "FYL2X\0" "\x05" "FPTAN\0" \ -"\x06" "FPATAN\0" "\x07" "FXTRACT\0" "\x06" "FPREM1\0" "\x07" "FDECSTP\0" "\x07" "FINCSTP\0" \ -"\x05" "FPREM\0" "\x07" "FYL2XP1\0" "\x05" "FSQRT\0" "\x07" "FSINCOS\0" "\x07" "FRNDINT\0" \ -"\x06" "FSCALE\0" "\x04" "FSIN\0" "\x04" "FCOS\0" "\x05" "FIADD\0" "\x05" "FIMUL\0" \ -"\x05" "FICOM\0" "\x06" "FICOMP\0" "\x05" "FISUB\0" "\x06" "FISUBR\0" "\x05" "FIDIV\0" \ -"\x06" "FIDIVR\0" "\x06" "FCMOVB\0" "\x06" "FCMOVE\0" "\x07" "FCMOVBE\0" "\x06" "FCMOVU\0" \ -"\x07" "FUCOMPP\0" "\x04" "FILD\0" "\x06" "FISTTP\0" "\x04" "FIST\0" "\x05" "FISTP\0" \ -"\x07" "FCMOVNB\0" "\x07" "FCMOVNE\0" "\x08" "FCMOVNBE\0" "\x07" "FCMOVNU\0" \ -"\x04" "FENI\0" "\x06" "FEDISI\0" "\x06" "FSETPM\0" "\x06" "FUCOMI\0" "\x05" "FCOMI\0" \ -"\x06" "FRSTOR\0" "\x05" "FFREE\0" "\x05" "FUCOM\0" "\x06" "FUCOMP\0" "\x05" "FADDP\0" \ -"\x05" "FMULP\0" "\x06" "FCOMPP\0" "\x06" "FSUBRP\0" "\x05" "FSUBP\0" "\x06" "FDIVRP\0" \ -"\x05" "FDIVP\0" "\x04" "FBLD\0" "\x05" "FBSTP\0" "\x07" "FUCOMIP\0" "\x06" "FCOMIP\0" \ -"\x03" "NOT\0" "\x03" "NEG\0" "\x03" "MUL\0" "\x03" "DIV\0" "\x04" "IDIV\0" \ -"\x04" "SLDT\0" "\x03" "STR\0" "\x04" "LLDT\0" "\x03" "LTR\0" "\x04" "VERR\0" \ -"\x04" "VERW\0" "\x04" "SGDT\0" "\x04" "SIDT\0" "\x04" "LGDT\0" "\x04" "LIDT\0" \ -"\x04" "SMSW\0" "\x04" "LMSW\0" "\x06" "INVLPG\0" "\x06" "VMCALL\0" "\x08" "VMLAUNCH\0" \ -"\x08" "VMRESUME\0" "\x06" "VMXOFF\0" "\x07" "MONITOR\0" "\x05" "MWAIT\0" "\x06" "XGETBV\0" \ -"\x06" "XSETBV\0" "\x06" "VMFUNC\0" "\x05" "VMRUN\0" "\x07" "VMMCALL\0" "\x06" "VMLOAD\0" \ -"\x06" "VMSAVE\0" "\x04" "STGI\0" "\x04" "CLGI\0" "\x06" "SKINIT\0" "\x07" "INVLPGA\0" \ -"\x06" "SWAPGS\0" "\x06" "RDTSCP\0" "\x08" "PREFETCH\0" "\x09" "PREFETCHW\0" \ -"\x05" "PI2FW\0" "\x05" "PI2FD\0" "\x05" "PF2IW\0" "\x05" "PF2ID\0" "\x06" "PFNACC\0" \ -"\x07" "PFPNACC\0" "\x07" "PFCMPGE\0" "\x05" "PFMIN\0" "\x05" "PFRCP\0" "\x07" "PFRSQRT\0" \ -"\x05" "PFSUB\0" "\x05" "PFADD\0" "\x07" "PFCMPGT\0" "\x05" "PFMAX\0" "\x08" "PFRCPIT1\0" \ -"\x08" "PFRSQIT1\0" "\x06" "PFSUBR\0" "\x05" "PFACC\0" "\x07" "PFCMPEQ\0" "\x05" "PFMUL\0" \ -"\x08" "PFRCPIT2\0" "\x07" "PMULHRW\0" "\x06" "PSWAPD\0" "\x07" "PAVGUSB\0" \ -"\x06" "MOVUPS\0" "\x06" "MOVUPD\0" "\x05" "MOVSS\0" "\x05" "MOVSD\0" "\x07" "VMOVUPS\0" \ -"\x07" "VMOVUPD\0" "\x06" "VMOVSS\0" "\x06" "VMOVSD\0" "\x07" "MOVHLPS\0" "\x06" "MOVLPS\0" \ -"\x06" "MOVLPD\0" "\x08" "MOVSLDUP\0" "\x07" "MOVDDUP\0" "\x08" "VMOVHLPS\0" \ -"\x07" "VMOVLPS\0" "\x07" "VMOVLPD\0" "\x09" "VMOVSLDUP\0" "\x08" "VMOVDDUP\0" \ -"\x08" "UNPCKLPS\0" "\x08" "UNPCKLPD\0" "\x09" "VUNPCKLPS\0" "\x09" "VUNPCKLPD\0" \ -"\x08" "UNPCKHPS\0" "\x08" "UNPCKHPD\0" "\x09" "VUNPCKHPS\0" "\x09" "VUNPCKHPD\0" \ -"\x07" "MOVLHPS\0" "\x06" "MOVHPS\0" "\x06" "MOVHPD\0" "\x08" "MOVSHDUP\0" \ -"\x08" "VMOVLHPS\0" "\x07" "VMOVHPS\0" "\x07" "VMOVHPD\0" "\x09" "VMOVSHDUP\0" \ -"\x0b" "PREFETCHNTA\0" "\x0a" "PREFETCHT0\0" "\x0a" "PREFETCHT1\0" "\x0a" "PREFETCHT2\0" \ -"\x06" "MOVAPS\0" "\x06" "MOVAPD\0" "\x07" "VMOVAPS\0" "\x07" "VMOVAPD\0" "\x08" "CVTPI2PS\0" \ -"\x08" "CVTPI2PD\0" "\x08" "CVTSI2SS\0" "\x08" "CVTSI2SD\0" "\x09" "VCVTSI2SS\0" \ -"\x09" "VCVTSI2SD\0" "\x07" "MOVNTPS\0" "\x07" "MOVNTPD\0" "\x07" "MOVNTSS\0" \ -"\x07" "MOVNTSD\0" "\x08" "VMOVNTPS\0" "\x08" "VMOVNTPD\0" "\x09" "CVTTPS2PI\0" \ -"\x09" "CVTTPD2PI\0" "\x09" "CVTTSS2SI\0" "\x09" "CVTTSD2SI\0" "\x0a" "VCVTTSS2SI\0" \ -"\x0a" "VCVTTSD2SI\0" "\x08" "CVTPS2PI\0" "\x08" "CVTPD2PI\0" "\x08" "CVTSS2SI\0" \ -"\x08" "CVTSD2SI\0" "\x09" "VCVTSS2SI\0" "\x09" "VCVTSD2SI\0" "\x07" "UCOMISS\0" \ -"\x07" "UCOMISD\0" "\x08" "VUCOMISS\0" "\x08" "VUCOMISD\0" "\x06" "COMISS\0" \ -"\x06" "COMISD\0" "\x07" "VCOMISS\0" "\x07" "VCOMISD\0" "\x08" "MOVMSKPS\0" \ -"\x08" "MOVMSKPD\0" "\x09" "VMOVMSKPS\0" "\x09" "VMOVMSKPD\0" "\x06" "SQRTPS\0" \ -"\x06" "SQRTPD\0" "\x06" "SQRTSS\0" "\x06" "SQRTSD\0" "\x07" "VSQRTPS\0" "\x07" "VSQRTPD\0" \ -"\x07" "VSQRTSS\0" "\x07" "VSQRTSD\0" "\x07" "RSQRTPS\0" "\x07" "RSQRTSS\0" \ -"\x08" "VRSQRTPS\0" "\x08" "VRSQRTSS\0" "\x05" "RCPPS\0" "\x05" "RCPSS\0" "\x06" "VRCPPS\0" \ -"\x06" "VRCPSS\0" "\x05" "ANDPS\0" "\x05" "ANDPD\0" "\x06" "VANDPS\0" "\x06" "VANDPD\0" \ -"\x06" "ANDNPS\0" "\x06" "ANDNPD\0" "\x07" "VANDNPS\0" "\x07" "VANDNPD\0" "\x04" "ORPS\0" \ -"\x04" "ORPD\0" "\x05" "VORPS\0" "\x05" "VORPD\0" "\x05" "XORPS\0" "\x05" "XORPD\0" \ -"\x06" "VXORPS\0" "\x06" "VXORPD\0" "\x05" "ADDPS\0" "\x05" "ADDPD\0" "\x05" "ADDSS\0" \ -"\x05" "ADDSD\0" "\x06" "VADDPS\0" "\x06" "VADDPD\0" "\x06" "VADDSS\0" "\x06" "VADDSD\0" \ -"\x05" "MULPS\0" "\x05" "MULPD\0" "\x05" "MULSS\0" "\x05" "MULSD\0" "\x06" "VMULPS\0" \ -"\x06" "VMULPD\0" "\x06" "VMULSS\0" "\x06" "VMULSD\0" "\x08" "CVTPS2PD\0" "\x08" "CVTPD2PS\0" \ +"\x03" "SAR\0" "\x06" "XABORT\0" "\x06" "XBEGIN\0" "\x04" "FADD\0" "\x04" "FMUL\0" \ +"\x04" "FCOM\0" "\x05" "FCOMP\0" "\x04" "FSUB\0" "\x05" "FSUBR\0" "\x04" "FDIV\0" \ +"\x05" "FDIVR\0" "\x03" "FLD\0" "\x03" "FST\0" "\x04" "FSTP\0" "\x06" "FLDENV\0" \ +"\x05" "FLDCW\0" "\x04" "FXCH\0" "\x04" "FNOP\0" "\x04" "FCHS\0" "\x04" "FABS\0" \ +"\x04" "FTST\0" "\x04" "FXAM\0" "\x04" "FLD1\0" "\x06" "FLDL2T\0" "\x06" "FLDL2E\0" \ +"\x05" "FLDPI\0" "\x06" "FLDLG2\0" "\x06" "FLDLN2\0" "\x04" "FLDZ\0" "\x05" "F2XM1\0" \ +"\x05" "FYL2X\0" "\x05" "FPTAN\0" "\x06" "FPATAN\0" "\x07" "FXTRACT\0" "\x06" "FPREM1\0" \ +"\x07" "FDECSTP\0" "\x07" "FINCSTP\0" "\x05" "FPREM\0" "\x07" "FYL2XP1\0" "\x05" "FSQRT\0" \ +"\x07" "FSINCOS\0" "\x07" "FRNDINT\0" "\x06" "FSCALE\0" "\x04" "FSIN\0" "\x04" "FCOS\0" \ +"\x05" "FIADD\0" "\x05" "FIMUL\0" "\x05" "FICOM\0" "\x06" "FICOMP\0" "\x05" "FISUB\0" \ +"\x06" "FISUBR\0" "\x05" "FIDIV\0" "\x06" "FIDIVR\0" "\x06" "FCMOVB\0" "\x06" "FCMOVE\0" \ +"\x07" "FCMOVBE\0" "\x06" "FCMOVU\0" "\x07" "FUCOMPP\0" "\x04" "FILD\0" "\x06" "FISTTP\0" \ +"\x04" "FIST\0" "\x05" "FISTP\0" "\x07" "FCMOVNB\0" "\x07" "FCMOVNE\0" "\x08" "FCMOVNBE\0" \ +"\x07" "FCMOVNU\0" "\x04" "FENI\0" "\x06" "FEDISI\0" "\x06" "FSETPM\0" "\x06" "FUCOMI\0" \ +"\x05" "FCOMI\0" "\x06" "FRSTOR\0" "\x05" "FFREE\0" "\x05" "FUCOM\0" "\x06" "FUCOMP\0" \ +"\x05" "FADDP\0" "\x05" "FMULP\0" "\x06" "FCOMPP\0" "\x06" "FSUBRP\0" "\x05" "FSUBP\0" \ +"\x06" "FDIVRP\0" "\x05" "FDIVP\0" "\x04" "FBLD\0" "\x05" "FBSTP\0" "\x07" "FUCOMIP\0" \ +"\x06" "FCOMIP\0" "\x03" "NOT\0" "\x03" "NEG\0" "\x03" "MUL\0" "\x03" "DIV\0" \ +"\x04" "IDIV\0" "\x04" "SLDT\0" "\x03" "STR\0" "\x04" "LLDT\0" "\x03" "LTR\0" \ +"\x04" "VERR\0" "\x04" "VERW\0" "\x04" "SGDT\0" "\x04" "SIDT\0" "\x04" "LGDT\0" \ +"\x04" "LIDT\0" "\x04" "SMSW\0" "\x04" "LMSW\0" "\x06" "INVLPG\0" "\x06" "VMCALL\0" \ +"\x08" "VMLAUNCH\0" "\x08" "VMRESUME\0" "\x06" "VMXOFF\0" "\x07" "MONITOR\0" \ +"\x05" "MWAIT\0" "\x06" "XGETBV\0" "\x06" "XSETBV\0" "\x06" "VMFUNC\0" "\x04" "XEND\0" \ +"\x05" "VMRUN\0" "\x07" "VMMCALL\0" "\x06" "VMLOAD\0" "\x06" "VMSAVE\0" "\x04" "STGI\0" \ +"\x04" "CLGI\0" "\x06" "SKINIT\0" "\x07" "INVLPGA\0" "\x06" "SWAPGS\0" "\x06" "RDTSCP\0" \ +"\x08" "PREFETCH\0" "\x09" "PREFETCHW\0" "\x05" "PI2FW\0" "\x05" "PI2FD\0" \ +"\x05" "PF2IW\0" "\x05" "PF2ID\0" "\x06" "PFNACC\0" "\x07" "PFPNACC\0" "\x07" "PFCMPGE\0" \ +"\x05" "PFMIN\0" "\x05" "PFRCP\0" "\x07" "PFRSQRT\0" "\x05" "PFSUB\0" "\x05" "PFADD\0" \ +"\x07" "PFCMPGT\0" "\x05" "PFMAX\0" "\x08" "PFRCPIT1\0" "\x08" "PFRSQIT1\0" \ +"\x06" "PFSUBR\0" "\x05" "PFACC\0" "\x07" "PFCMPEQ\0" "\x05" "PFMUL\0" "\x08" "PFRCPIT2\0" \ +"\x07" "PMULHRW\0" "\x06" "PSWAPD\0" "\x07" "PAVGUSB\0" "\x06" "MOVUPS\0" "\x06" "MOVUPD\0" \ +"\x05" "MOVSS\0" "\x05" "MOVSD\0" "\x07" "VMOVUPS\0" "\x07" "VMOVUPD\0" "\x06" "VMOVSS\0" \ +"\x06" "VMOVSD\0" "\x07" "MOVHLPS\0" "\x06" "MOVLPS\0" "\x06" "MOVLPD\0" "\x08" "MOVSLDUP\0" \ +"\x07" "MOVDDUP\0" "\x08" "VMOVHLPS\0" "\x07" "VMOVLPS\0" "\x07" "VMOVLPD\0" \ +"\x09" "VMOVSLDUP\0" "\x08" "VMOVDDUP\0" "\x08" "UNPCKLPS\0" "\x08" "UNPCKLPD\0" \ +"\x09" "VUNPCKLPS\0" "\x09" "VUNPCKLPD\0" "\x08" "UNPCKHPS\0" "\x08" "UNPCKHPD\0" \ +"\x09" "VUNPCKHPS\0" "\x09" "VUNPCKHPD\0" "\x07" "MOVLHPS\0" "\x06" "MOVHPS\0" \ +"\x06" "MOVHPD\0" "\x08" "MOVSHDUP\0" "\x08" "VMOVLHPS\0" "\x07" "VMOVHPS\0" \ +"\x07" "VMOVHPD\0" "\x09" "VMOVSHDUP\0" "\x0b" "PREFETCHNTA\0" "\x0a" "PREFETCHT0\0" \ +"\x0a" "PREFETCHT1\0" "\x0a" "PREFETCHT2\0" "\x06" "MOVAPS\0" "\x06" "MOVAPD\0" \ +"\x07" "VMOVAPS\0" "\x07" "VMOVAPD\0" "\x08" "CVTPI2PS\0" "\x08" "CVTPI2PD\0" \ +"\x08" "CVTSI2SS\0" "\x08" "CVTSI2SD\0" "\x09" "VCVTSI2SS\0" "\x09" "VCVTSI2SD\0" \ +"\x07" "MOVNTPS\0" "\x07" "MOVNTPD\0" "\x07" "MOVNTSS\0" "\x07" "MOVNTSD\0" \ +"\x08" "VMOVNTPS\0" "\x08" "VMOVNTPD\0" "\x09" "CVTTPS2PI\0" "\x09" "CVTTPD2PI\0" \ +"\x09" "CVTTSS2SI\0" "\x09" "CVTTSD2SI\0" "\x0a" "VCVTTSS2SI\0" "\x0a" "VCVTTSD2SI\0" \ +"\x08" "CVTPS2PI\0" "\x08" "CVTPD2PI\0" "\x08" "CVTSS2SI\0" "\x08" "CVTSD2SI\0" \ +"\x09" "VCVTSS2SI\0" "\x09" "VCVTSD2SI\0" "\x07" "UCOMISS\0" "\x07" "UCOMISD\0" \ +"\x08" "VUCOMISS\0" "\x08" "VUCOMISD\0" "\x06" "COMISS\0" "\x06" "COMISD\0" \ +"\x07" "VCOMISS\0" "\x07" "VCOMISD\0" "\x08" "MOVMSKPS\0" "\x08" "MOVMSKPD\0" \ +"\x09" "VMOVMSKPS\0" "\x09" "VMOVMSKPD\0" "\x06" "SQRTPS\0" "\x06" "SQRTPD\0" \ +"\x06" "SQRTSS\0" "\x06" "SQRTSD\0" "\x07" "VSQRTPS\0" "\x07" "VSQRTPD\0" "\x07" "VSQRTSS\0" \ +"\x07" "VSQRTSD\0" "\x07" "RSQRTPS\0" "\x07" "RSQRTSS\0" "\x08" "VRSQRTPS\0" \ +"\x08" "VRSQRTSS\0" "\x05" "RCPPS\0" "\x05" "RCPSS\0" "\x06" "VRCPPS\0" "\x06" "VRCPSS\0" \ +"\x05" "ANDPS\0" "\x05" "ANDPD\0" "\x06" "VANDPS\0" "\x06" "VANDPD\0" "\x06" "ANDNPS\0" \ +"\x06" "ANDNPD\0" "\x07" "VANDNPS\0" "\x07" "VANDNPD\0" "\x04" "ORPS\0" "\x04" "ORPD\0" \ +"\x05" "VORPS\0" "\x05" "VORPD\0" "\x05" "XORPS\0" "\x05" "XORPD\0" "\x06" "VXORPS\0" \ +"\x06" "VXORPD\0" "\x05" "ADDPS\0" "\x05" "ADDPD\0" "\x05" "ADDSS\0" "\x05" "ADDSD\0" \ +"\x06" "VADDPS\0" "\x06" "VADDPD\0" "\x06" "VADDSS\0" "\x06" "VADDSD\0" "\x05" "MULPS\0" \ +"\x05" "MULPD\0" "\x05" "MULSS\0" "\x05" "MULSD\0" "\x06" "VMULPS\0" "\x06" "VMULPD\0" \ +"\x06" "VMULSS\0" "\x06" "VMULSD\0" "\x08" "CVTPS2PD\0" "\x08" "CVTPD2PS\0" \ "\x08" "CVTSS2SD\0" "\x08" "CVTSD2SS\0" "\x09" "VCVTPS2PD\0" "\x09" "VCVTPD2PS\0" \ "\x09" "VCVTSS2SD\0" "\x09" "VCVTSD2SS\0" "\x08" "CVTDQ2PS\0" "\x08" "CVTPS2DQ\0" \ "\x09" "CVTTPS2DQ\0" "\x09" "VCVTDQ2PS\0" "\x09" "VCVTPS2DQ\0" "\x0a" "VCVTTPS2DQ\0" \ @@ -272,23 +261,24 @@ const unsigned char _MNEMONICS[] = "\x06" "PSLLDQ\0" "\x07" "VPSLLDQ\0" "\x06" "FXSAVE\0" "\x08" "FXSAVE64\0" \ "\x08" "RDFSBASE\0" "\x07" "FXRSTOR\0" "\x09" "FXRSTOR64\0" "\x08" "RDGSBASE\0" \ "\x07" "LDMXCSR\0" "\x08" "WRFSBASE\0" "\x08" "VLDMXCSR\0" "\x07" "STMXCSR\0" \ -"\x08" "WRGSBASE\0" "\x08" "VSTMXCSR\0" "\x06" "RDRAND\0" "\x07" "VMPTRLD\0" \ -"\x07" "VMCLEAR\0" "\x05" "VMXON\0" "\x04" "WAIT\0" "\x06" "MOVSXD\0" "\x05" "PAUSE\0"; +"\x08" "WRGSBASE\0" "\x08" "VSTMXCSR\0" "\x07" "VMPTRLD\0" "\x07" "VMCLEAR\0" \ +"\x05" "VMXON\0" "\x06" "MOVSXD\0" "\x05" "PAUSE\0" "\x04" "WAIT\0" "\x06" "RDRAND\0" \ +"\x06" "_3DNOW\0"; const _WRegister _REGISTERS[] = { - {3, "RAX"}, {3, "RCX"}, {3, "RDX"}, {3, "RBX"}, {3, "RSP"}, {3, "RBP"}, {3, "RSI"}, {3, "RDI"}, {2, "R8"}, {2, "R9"}, {3, "R10"}, {3, "R11"}, {3, "R12"}, {3, "R13"}, {3, "R14"}, {3, "R15"}, - {3, "EAX"}, {3, "ECX"}, {3, "EDX"}, {3, "EBX"}, {3, "ESP"}, {3, "EBP"}, {3, "ESI"}, {3, "EDI"}, {3, "R8D"}, {3, "R9D"}, {4, "R10D"}, {4, "R11D"}, {4, "R12D"}, {4, "R13D"}, {4, "R14D"}, {4, "R15D"}, - {2, "AX"}, {2, "CX"}, {2, "DX"}, {2, "BX"}, {2, "SP"}, {2, "BP"}, {2, "SI"}, {2, "DI"}, {3, "R8W"}, {3, "R9W"}, {4, "R10W"}, {4, "R11W"}, {4, "R12W"}, {4, "R13W"}, {4, "R14W"}, {4, "R15W"}, - {2, "AL"}, {2, "CL"}, {2, "DL"}, {2, "BL"}, {2, "AH"}, {2, "CH"}, {2, "DH"}, {2, "BH"}, {3, "R8B"}, {3, "R9B"}, {4, "R10B"}, {4, "R11B"}, {4, "R12B"}, {4, "R13B"}, {4, "R14B"}, {4, "R15B"}, - {3, "SPL"}, {3, "BPL"}, {3, "SIL"}, {3, "DIL"}, - {2, "ES"}, {2, "CS"}, {2, "SS"}, {2, "DS"}, {2, "FS"}, {2, "GS"}, - {3, "RIP"}, - {3, "ST0"}, {3, "ST1"}, {3, "ST2"}, {3, "ST3"}, {3, "ST4"}, {3, "ST5"}, {3, "ST6"}, {3, "ST7"}, - {3, "MM0"}, {3, "MM1"}, {3, "MM2"}, {3, "MM3"}, {3, "MM4"}, {3, "MM5"}, {3, "MM6"}, {3, "MM7"}, - {4, "XMM0"}, {4, "XMM1"}, {4, "XMM2"}, {4, "XMM3"}, {4, "XMM4"}, {4, "XMM5"}, {4, "XMM6"}, {4, "XMM7"}, {4, "XMM8"}, {4, "XMM9"}, {5, "XMM10"}, {5, "XMM11"}, {5, "XMM12"}, {5, "XMM13"}, {5, "XMM14"}, {5, "XMM15"}, - {4, "YMM0"}, {4, "YMM1"}, {4, "YMM2"}, {4, "YMM3"}, {4, "YMM4"}, {4, "YMM5"}, {4, "YMM6"}, {4, "YMM7"}, {4, "YMM8"}, {4, "YMM9"}, {5, "YMM10"}, {5, "YMM11"}, {5, "YMM12"}, {5, "YMM13"}, {5, "YMM14"}, {5, "YMM15"}, - {3, "CR0"}, {0, ""}, {3, "CR2"}, {3, "CR3"}, {3, "CR4"}, {0, ""}, {0, ""}, {0, ""}, {3, "CR8"}, - {3, "DR0"}, {3, "DR1"}, {3, "DR2"}, {3, "DR3"}, {0, ""}, {0, ""}, {3, "DR6"}, {3, "DR7"} + { 3, "RAX" }, { 3, "RCX" }, { 3, "RDX" }, { 3, "RBX" }, { 3, "RSP" }, { 3, "RBP" }, { 3, "RSI" }, { 3, "RDI" }, { 2, "R8" }, { 2, "R9" }, { 3, "R10" }, { 3, "R11" }, { 3, "R12" }, { 3, "R13" }, { 3, "R14" }, { 3, "R15" }, + { 3, "EAX" }, { 3, "ECX" }, { 3, "EDX" }, { 3, "EBX" }, { 3, "ESP" }, { 3, "EBP" }, { 3, "ESI" }, { 3, "EDI" }, { 3, "R8D" }, { 3, "R9D" }, { 4, "R10D" }, { 4, "R11D" }, { 4, "R12D" }, { 4, "R13D" }, { 4, "R14D" }, { 4, "R15D" }, + { 2, "AX" }, { 2, "CX" }, { 2, "DX" }, { 2, "BX" }, { 2, "SP" }, { 2, "BP" }, { 2, "SI" }, { 2, "DI" }, { 3, "R8W" }, { 3, "R9W" }, { 4, "R10W" }, { 4, "R11W" }, { 4, "R12W" }, { 4, "R13W" }, { 4, "R14W" }, { 4, "R15W" }, + { 2, "AL" }, { 2, "CL" }, { 2, "DL" }, { 2, "BL" }, { 2, "AH" }, { 2, "CH" }, { 2, "DH" }, { 2, "BH" }, { 3, "R8B" }, { 3, "R9B" }, { 4, "R10B" }, { 4, "R11B" }, { 4, "R12B" }, { 4, "R13B" }, { 4, "R14B" }, { 4, "R15B" }, + { 3, "SPL" }, { 3, "BPL" }, { 3, "SIL" }, { 3, "DIL" }, + { 2, "ES" }, { 2, "CS" }, { 2, "SS" }, { 2, "DS" }, { 2, "FS" }, { 2, "GS" }, + { 3, "RIP" }, + { 3, "ST0" }, { 3, "ST1" }, { 3, "ST2" }, { 3, "ST3" }, { 3, "ST4" }, { 3, "ST5" }, { 3, "ST6" }, { 3, "ST7" }, + { 3, "MM0" }, { 3, "MM1" }, { 3, "MM2" }, { 3, "MM3" }, { 3, "MM4" }, { 3, "MM5" }, { 3, "MM6" }, { 3, "MM7" }, + { 4, "XMM0" }, { 4, "XMM1" }, { 4, "XMM2" }, { 4, "XMM3" }, { 4, "XMM4" }, { 4, "XMM5" }, { 4, "XMM6" }, { 4, "XMM7" }, { 4, "XMM8" }, { 4, "XMM9" }, { 5, "XMM10" }, { 5, "XMM11" }, { 5, "XMM12" }, { 5, "XMM13" }, { 5, "XMM14" }, { 5, "XMM15" }, + { 4, "YMM0" }, { 4, "YMM1" }, { 4, "YMM2" }, { 4, "YMM3" }, { 4, "YMM4" }, { 4, "YMM5" }, { 4, "YMM6" }, { 4, "YMM7" }, { 4, "YMM8" }, { 4, "YMM9" }, { 5, "YMM10" }, { 5, "YMM11" }, { 5, "YMM12" }, { 5, "YMM13" }, { 5, "YMM14" }, { 5, "YMM15" }, + { 3, "CR0" }, { 0, "" }, { 3, "CR2" }, { 3, "CR3" }, { 3, "CR4" }, { 0, "" }, { 0, "" }, { 0, "" }, { 3, "CR8" }, + { 3, "DR0" }, { 3, "DR1" }, { 3, "DR2" }, { 3, "DR3" }, { 0, "" }, { 0, "" }, { 3, "DR6" }, { 3, "DR7" } }; #endif /* DISTORM_LIGHT */ diff --git a/distorm3.2-package/src/operands.c b/distorm/src/operands.c similarity index 97% rename from distorm3.2-package/src/operands.c rename to distorm/src/operands.c index 817a06e..03a0c66 100644 --- a/distorm3.2-package/src/operands.c +++ b/distorm/src/operands.c @@ -4,20 +4,8 @@ operands.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ @@ -29,11 +17,11 @@ along with this program. If not, see /* Maps a register to its register-class mask. */ -uint16_t _REGISTERTORCLASS[] = /* Based on _RegisterType enumeration! */ -{RM_AX, RM_CX, RM_DX, RM_BX, RM_SP, RM_BP, RM_SI, RM_DI, 0, 0, 0, 0, 0, 0, 0, 0, - RM_AX, RM_CX, RM_DX, RM_BX, RM_SP, RM_BP, RM_SI, RM_DI, 0, 0, 0, 0, 0, 0, 0, 0, - RM_AX, RM_CX, RM_DX, RM_BX, RM_SP, RM_BP, RM_SI, RM_DI, 0, 0, 0, 0, 0, 0, 0, 0, - RM_AX, RM_CX, RM_DX, RM_BX, RM_AX, RM_CX, RM_DX, RM_BX, 0, 0, 0, 0, 0, 0, 0, 0, +uint32_t _REGISTERTORCLASS[] = /* Based on _RegisterType enumeration! */ +{RM_AX, RM_CX, RM_DX, RM_BX, RM_SP, RM_BP, RM_SI, RM_DI, RM_R8, RM_R9, RM_R10, RM_R11, RM_R12, RM_R13, RM_R14, RM_R15, + RM_AX, RM_CX, RM_DX, RM_BX, RM_SP, RM_BP, RM_SI, RM_DI, RM_R8, RM_R9, RM_R10, RM_R11, RM_R12, RM_R13, RM_R14, RM_R15, + RM_AX, RM_CX, RM_DX, RM_BX, RM_SP, RM_BP, RM_SI, RM_DI, RM_R8, RM_R9, RM_R10, RM_R11, RM_R12, RM_R13, RM_R14, RM_R15, + RM_AX, RM_CX, RM_DX, RM_BX, RM_AX, RM_CX, RM_DX, RM_BX, RM_R8, RM_R9, RM_R10, RM_R11, RM_R12, RM_R13, RM_R14, RM_R15, RM_SP, RM_BP, RM_SI, RM_DI, 0, 0, 0, 0, 0, 0, 0, @@ -501,14 +489,13 @@ static int operands_extract_modrm(_CodeInfo* ci, */ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, - _OpType type, _OperandNumberType opNum, + _iflags instFlags, _OpType type, _OperandNumberType opNum, unsigned int modrm, _PrefixState* ps, _DecodeType effOpSz, _DecodeType effAdrSz, int* lockableInstruction) { int ret = 0; unsigned int mod = 0, reg = 0, rm = 0, vexV = ps->vexV; unsigned int vrex = ps->vrex, typeHandled = TRUE; - _iflags instFlags = INST_INFO_FLAGS(ii); _Operand* op = &di->ops[opNum]; /* Used to indicate the size of the MEMORY INDIRECTION only. */ @@ -733,8 +720,12 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, op->type = O_IMM; di->imm_encoded_size = 4; if (ci->dt == Decode64Bits) { - /* Imm32 is sign extended to 64 bits! */ - op->size = 64; + /* + * Imm32 is sign extended to 64 bits! + * Originally the op size was 64, but later was changed to reflect real size of imm. + */ + op->size = 32; + /* Use this as an indicator that it should be signed extended. */ di->flags |= FLAG_IMM_SIGNED; if (!read_stream_safe_sint(ci, &di->imm.sqword, sizeof(int32_t))) return FALSE; } else { @@ -788,7 +779,7 @@ int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, if (ps->prefixExtType) { /* * If REX prefix is valid then we will have to use low bytes. - * This is a PASSIVE behaviour changer of REX prefix, it affects operands even if its value is 0x40 ! + * This is a PASSIVE behavior changer of REX prefix, it affects operands even if its value is 0x40 ! */ ps->usedPrefixes |= INST_PRE_REX; op->index = (uint8_t)operands_fix_8bit_rex_base(reg + ((vrex & PREFIX_EX_R) ? EX_GPR_BASE : 0)); diff --git a/distorm/src/operands.h b/distorm/src/operands.h new file mode 100644 index 0000000..883d59b --- /dev/null +++ b/distorm/src/operands.h @@ -0,0 +1,28 @@ +/* +operands.h + +diStorm3 - Powerful disassembler for X86/AMD64 +http://ragestorm.net/distorm/ +distorm at gmail dot com +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. +*/ + + +#ifndef OPERANDS_H +#define OPERANDS_H + +#include "config.h" +#include "decoder.h" +#include "prefix.h" +#include "instructions.h" + + +extern uint32_t _REGISTERTORCLASS[]; + +int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, + _iflags instFlags, _OpType type, _OperandNumberType opNum, + unsigned int modrm, _PrefixState* ps, _DecodeType effOpSz, + _DecodeType effAdrSz, int* lockableInstruction); + +#endif /* OPERANDS_H */ diff --git a/distorm3.2-package/src/prefix.c b/distorm/src/prefix.c similarity index 94% rename from distorm3.2-package/src/prefix.c rename to distorm/src/prefix.c index 53f09b6..21a67f7 100644 --- a/distorm3.2-package/src/prefix.c +++ b/distorm/src/prefix.c @@ -4,20 +4,8 @@ prefix.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ diff --git a/distorm3.2-package/src/prefix.h b/distorm/src/prefix.h similarity index 77% rename from distorm3.2-package/src/prefix.h rename to distorm/src/prefix.h index 673aa50..f1f53c4 100644 --- a/distorm3.2-package/src/prefix.h +++ b/distorm/src/prefix.h @@ -4,20 +4,8 @@ prefix.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ diff --git a/distorm3.2-package/src/textdefs.c b/distorm/src/textdefs.c similarity index 90% rename from distorm3.2-package/src/textdefs.c rename to distorm/src/textdefs.c index eec26f1..d8cd75a 100644 --- a/distorm3.2-package/src/textdefs.c +++ b/distorm/src/textdefs.c @@ -4,20 +4,8 @@ textdefs.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ diff --git a/distorm3.2-package/src/textdefs.h b/distorm/src/textdefs.h similarity index 64% rename from distorm3.2-package/src/textdefs.h rename to distorm/src/textdefs.h index 275cf88..05cf8d7 100644 --- a/distorm3.2-package/src/textdefs.h +++ b/distorm/src/textdefs.h @@ -4,20 +4,8 @@ textdefs.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ @@ -55,8 +43,6 @@ Naming Convention: * all numbers are in HEX. */ -extern int8_t TextBTable[256][4]; - void _FASTCALL_ str_hex_b(_WString* s, unsigned int x); void _FASTCALL_ str_code_hb(_WString* s, unsigned int x); void _FASTCALL_ str_code_hdw(_WString* s, uint32_t x); diff --git a/distorm3.2-package/src/wstring.c b/distorm/src/wstring.c similarity index 54% rename from distorm3.2-package/src/wstring.c rename to distorm/src/wstring.c index 26b2260..5edce8f 100644 --- a/distorm3.2-package/src/wstring.c +++ b/distorm/src/wstring.c @@ -4,20 +4,8 @@ wstring.c diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ diff --git a/distorm3.2-package/src/wstring.h b/distorm/src/wstring.h similarity index 58% rename from distorm3.2-package/src/wstring.h rename to distorm/src/wstring.h index 6ff9ccf..1dbaa2f 100644 --- a/distorm3.2-package/src/wstring.h +++ b/distorm/src/wstring.h @@ -4,20 +4,8 @@ wstring.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ diff --git a/distorm3.2-package/src/x86defs.h b/distorm/src/x86defs.h similarity index 54% rename from distorm3.2-package/src/x86defs.h rename to distorm/src/x86defs.h index f35ff42..36fea6d 100644 --- a/distorm3.2-package/src/x86defs.h +++ b/distorm/src/x86defs.h @@ -4,29 +4,14 @@ x86defs.h diStorm3 - Powerful disassembler for X86/AMD64 http://ragestorm.net/distorm/ distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see +Copyright (C) 2003-2016 Gil Dabah +This library is licensed under the BSD license. See the file COPYING. */ #ifndef X86DEFS_H #define X86DEFS_H -#include "config.h" -#include "instructions.h" - #define SEG_REGS_MAX (6) #define CREGS_MAX (9) @@ -47,6 +32,12 @@ along with this program. If not, see /* Lea instruction byte code. */ #define INST_LEA_INDEX (0x8d) +/* NOP/XCHG instruction byte code. */ +#define INST_NOP_INDEX (0x90) + +/* ARPL/MOVSXD instruction byte code. */ +#define INST_ARPL_INDEX (0x63) + /* * Minimal MODR/M value of divided instructions. * It's 0xc0, two MSBs set, which indicates a general purpose register is used too. @@ -88,28 +79,4 @@ along with this program. If not, see /* Vector Lengh */ #define PREFIX_EX_L (0x10) -/* - * The inst_lookup will return on of these two instructions according to the specified decoding mode. - * ARPL or MOVSXD on 64 bits is one byte instruction at index 0x63. - */ -#define INST_ARPL_INDEX (0x63) -extern _InstInfo II_arpl; -extern _InstInfo II_movsxd; - -/* - * The NOP instruction can be prefixed by REX in 64bits, therefore we have to decide in runtime whether it's an XCHG or NOP instruction. - * If 0x90 is prefixed by a useable REX it will become XCHG, otherwise it will become a NOP. - * Also note that if it's prefixed by 0xf3, it becomes a Pause. - */ -#define INST_NOP_INDEX (0x90) -extern _InstInfo II_nop; -extern _InstInfo II_pause; - -/* - * Used for letting the extract operand know the type of operands without knowing the - * instruction itself yet, because of the way those instructions work. - * See function instructions.c!inst_lookup_3dnow. - */ -extern _InstInfo II_3dnow; - #endif /* X86DEFS_H */ diff --git a/distorm3.2-package/COPYING b/distorm3.2-package/COPYING deleted file mode 100644 index 94a9ed0..0000000 --- a/distorm3.2-package/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/distorm3.2-package/include/mnemonics.h b/distorm3.2-package/include/mnemonics.h deleted file mode 100644 index 652d64b..0000000 --- a/distorm3.2-package/include/mnemonics.h +++ /dev/null @@ -1,312 +0,0 @@ -/* -mnemonics.h - -diStorm3 - Powerful disassembler for X86/AMD64 -http://ragestorm.net/distorm/ -distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see -*/ - - -#ifndef MNEMONICS_H -#define MNEMONICS_H - -#ifdef __cplusplus - extern "C" { -#endif - -#ifndef DISTORM_LIGHT - -typedef struct WMnemonic { - unsigned char length; - unsigned char p[1]; /* p is a null terminated string, which contains 'length' characters. */ -} _WMnemonic; - -typedef struct WRegister { - unsigned int length; - unsigned char p[6]; /* p is a null terminated string. */ -} _WRegister; - -extern const unsigned char _MNEMONICS[]; -extern const _WRegister _REGISTERS[]; - -#endif /* DISTORM_LIGHT */ - -#ifdef __cplusplus -} /* End Of Extern */ -#endif - -#define GET_REGISTER_NAME(r) (unsigned char*)_REGISTERS[(r)].p -#define GET_MNEMONIC_NAME(m) ((_WMnemonic*)&_MNEMONICS[(m)])->p - -typedef enum { - I_UNDEFINED = 0, I_AAA = 66, I_AAD = 389, I_AAM = 384, I_AAS = 76, I_ADC = 31, I_ADD = 11, I_ADDPD = 3110, - I_ADDPS = 3103, I_ADDSD = 3124, I_ADDSS = 3117, I_ADDSUBPD = 6394, I_ADDSUBPS = 6404, - I_AESDEC = 9209, I_AESDECLAST = 9226, I_AESENC = 9167, I_AESENCLAST = 9184, - I_AESIMC = 9150, I_AESKEYGENASSIST = 9795, I_AND = 41, I_ANDNPD = 3021, I_ANDNPS = 3013, - I_ANDPD = 2990, I_ANDPS = 2983, I_ARPL = 111, I_BLENDPD = 9372, I_BLENDPS = 9353, - I_BLENDVPD = 7619, I_BLENDVPS = 7609, I_BOUND = 104, I_BSF = 4346, I_BSR = 4358, - I_BSWAP = 960, I_BT = 872, I_BTC = 934, I_BTR = 912, I_BTS = 887, I_CALL = 456, - I_CALL_FAR = 260, I_CBW = 228, I_CDQ = 250, I_CDQE = 239, I_CLC = 492, I_CLD = 512, - I_CLFLUSH = 4329, I_CLGI = 1833, I_CLI = 502, I_CLTS = 541, I_CMC = 487, I_CMOVA = 694, - I_CMOVAE = 663, I_CMOVB = 656, I_CMOVBE = 686, I_CMOVG = 754, I_CMOVGE = 738, - I_CMOVL = 731, I_CMOVLE = 746, I_CMOVNO = 648, I_CMOVNP = 723, I_CMOVNS = 708, - I_CMOVNZ = 678, I_CMOVO = 641, I_CMOVP = 716, I_CMOVS = 701, I_CMOVZ = 671, - I_CMP = 71, I_CMPEQPD = 4449, I_CMPEQPS = 4370, I_CMPEQSD = 4607, I_CMPEQSS = 4528, - I_CMPLEPD = 4467, I_CMPLEPS = 4388, I_CMPLESD = 4625, I_CMPLESS = 4546, I_CMPLTPD = 4458, - I_CMPLTPS = 4379, I_CMPLTSD = 4616, I_CMPLTSS = 4537, I_CMPNEQPD = 4488, I_CMPNEQPS = 4409, - I_CMPNEQSD = 4646, I_CMPNEQSS = 4567, I_CMPNLEPD = 4508, I_CMPNLEPS = 4429, - I_CMPNLESD = 4666, I_CMPNLESS = 4587, I_CMPNLTPD = 4498, I_CMPNLTPS = 4419, - I_CMPNLTSD = 4656, I_CMPNLTSS = 4577, I_CMPORDPD = 4518, I_CMPORDPS = 4439, - I_CMPORDSD = 4676, I_CMPORDSS = 4597, I_CMPS = 301, I_CMPUNORDPD = 4476, I_CMPUNORDPS = 4397, - I_CMPUNORDSD = 4634, I_CMPUNORDSS = 4555, I_CMPXCHG = 898, I_CMPXCHG16B = 6373, - I_CMPXCHG8B = 6362, I_COMISD = 2779, I_COMISS = 2771, I_CPUID = 865, I_CQO = 255, - I_CRC32 = 9258, I_CVTDQ2PD = 6787, I_CVTDQ2PS = 3307, I_CVTPD2DQ = 6797, I_CVTPD2PI = 2681, - I_CVTPD2PS = 3233, I_CVTPH2PS = 4161, I_CVTPI2PD = 2495, I_CVTPI2PS = 2485, - I_CVTPS2DQ = 3317, I_CVTPS2PD = 3223, I_CVTPS2PH = 4171, I_CVTPS2PI = 2671, - I_CVTSD2SI = 2701, I_CVTSD2SS = 3253, I_CVTSI2SD = 2515, I_CVTSI2SS = 2505, - I_CVTSS2SD = 3243, I_CVTSS2SI = 2691, I_CVTTPD2DQ = 6776, I_CVTTPD2PI = 2614, - I_CVTTPS2DQ = 3327, I_CVTTPS2PI = 2603, I_CVTTSD2SI = 2636, I_CVTTSS2SI = 2625, - I_CWD = 245, I_CWDE = 233, I_DAA = 46, I_DAS = 56, I_DEC = 86, I_DIV = 1630, - I_DIVPD = 3499, I_DIVPS = 3492, I_DIVSD = 3513, I_DIVSS = 3506, I_DPPD = 9615, - I_DPPS = 9602, I_EMMS = 4100, I_ENTER = 340, I_EXTRACTPS = 9480, I_EXTRQ = 4136, - I_F2XM1 = 1176, I_FABS = 1107, I_FADD = 1007, I_FADDP = 1533, I_FBLD = 1585, - I_FBSTP = 1591, I_FCHS = 1101, I_FCLEX = 7289, I_FCMOVB = 1360, I_FCMOVBE = 1376, - I_FCMOVE = 1368, I_FCMOVNB = 1429, I_FCMOVNBE = 1447, I_FCMOVNE = 1438, I_FCMOVNU = 1457, - I_FCMOVU = 1385, I_FCOM = 1019, I_FCOMI = 1496, I_FCOMIP = 1607, I_FCOMP = 1025, - I_FCOMPP = 1547, I_FCOS = 1295, I_FDECSTP = 1222, I_FDIV = 1045, I_FDIVP = 1578, - I_FDIVR = 1051, I_FDIVRP = 1570, I_FEDISI = 1472, I_FEMMS = 574, I_FENI = 1466, - I_FFREE = 1511, I_FIADD = 1301, I_FICOM = 1315, I_FICOMP = 1322, I_FIDIV = 1345, - I_FIDIVR = 1352, I_FILD = 1402, I_FIMUL = 1308, I_FINCSTP = 1231, I_FINIT = 7304, - I_FIST = 1416, I_FISTP = 1422, I_FISTTP = 1408, I_FISUB = 1330, I_FISUBR = 1337, - I_FLD = 1058, I_FLD1 = 1125, I_FLDCW = 1082, I_FLDENV = 1074, I_FLDL2E = 1139, - I_FLDL2T = 1131, I_FLDLG2 = 1154, I_FLDLN2 = 1162, I_FLDPI = 1147, I_FLDZ = 1170, - I_FMUL = 1013, I_FMULP = 1540, I_FNCLEX = 7281, I_FNINIT = 7296, I_FNOP = 1095, - I_FNSAVE = 7311, I_FNSTCW = 7266, I_FNSTENV = 7249, I_FNSTSW = 7326, I_FPATAN = 1197, - I_FPREM = 1240, I_FPREM1 = 1214, I_FPTAN = 1190, I_FRNDINT = 1272, I_FRSTOR = 1503, - I_FSAVE = 7319, I_FSCALE = 1281, I_FSETPM = 1480, I_FSIN = 1289, I_FSINCOS = 1263, - I_FSQRT = 1256, I_FST = 1063, I_FSTCW = 7274, I_FSTENV = 7258, I_FSTP = 1068, - I_FSTSW = 7334, I_FSUB = 1032, I_FSUBP = 1563, I_FSUBR = 1038, I_FSUBRP = 1555, - I_FTST = 1113, I_FUCOM = 1518, I_FUCOMI = 1488, I_FUCOMIP = 1598, I_FUCOMP = 1525, - I_FUCOMPP = 1393, I_FXAM = 1119, I_FXCH = 1089, I_FXRSTOR = 9892, I_FXRSTOR64 = 9901, - I_FXSAVE = 9864, I_FXSAVE64 = 9872, I_FXTRACT = 1205, I_FYL2X = 1183, I_FYL2XP1 = 1247, - I_GETSEC = 633, I_HADDPD = 4181, I_HADDPS = 4189, I_HLT = 482, I_HSUBPD = 4215, - I_HSUBPS = 4223, I_IDIV = 1635, I_IMUL = 117, I_IN = 447, I_INC = 81, I_INS = 123, - I_INSERTPS = 9547, I_INSERTQ = 4143, I_INT = 367, I_INT_3 = 360, I_INT1 = 476, - I_INTO = 372, I_INVD = 555, I_INVEPT = 8284, I_INVLPG = 1711, I_INVLPGA = 1847, - I_INVPCID = 8301, I_INVVPID = 8292, I_IRET = 378, I_JA = 166, I_JAE = 147, - I_JB = 143, I_JBE = 161, I_JCXZ = 427, I_JECXZ = 433, I_JG = 202, I_JGE = 192, - I_JL = 188, I_JLE = 197, I_JMP = 462, I_JMP_FAR = 467, I_JNO = 138, I_JNP = 183, - I_JNS = 174, I_JNZ = 156, I_JO = 134, I_JP = 179, I_JRCXZ = 440, I_JS = 170, - I_JZ = 152, I_LAHF = 289, I_LAR = 522, I_LDDQU = 6994, I_LDMXCSR = 9922, I_LDS = 335, - I_LEA = 223, I_LEAVE = 347, I_LES = 330, I_LFENCE = 4265, I_LFS = 917, I_LGDT = 1687, - I_LGS = 922, I_LIDT = 1693, I_LLDT = 1652, I_LMSW = 1705, I_LODS = 313, I_LOOP = 421, - I_LOOPNZ = 406, I_LOOPZ = 414, I_LSL = 527, I_LSS = 907, I_LTR = 1658, I_LZCNT = 4363, - I_MASKMOVDQU = 7119, I_MASKMOVQ = 7109, I_MAXPD = 3559, I_MAXPS = 3552, I_MAXSD = 3573, - I_MAXSS = 3566, I_MFENCE = 4291, I_MINPD = 3439, I_MINPS = 3432, I_MINSD = 3453, - I_MINSS = 3446, I_MONITOR = 1755, I_MOV = 218, I_MOVAPD = 2459, I_MOVAPS = 2451, - I_MOVBE = 9251, I_MOVD = 3920, I_MOVDDUP = 2186, I_MOVDQ2Q = 6522, I_MOVDQA = 3946, - I_MOVDQU = 3954, I_MOVHLPS = 2151, I_MOVHPD = 2345, I_MOVHPS = 2337, I_MOVLHPS = 2328, - I_MOVLPD = 2168, I_MOVLPS = 2160, I_MOVMSKPD = 2815, I_MOVMSKPS = 2805, I_MOVNTDQ = 6849, - I_MOVNTDQA = 7895, I_MOVNTI = 952, I_MOVNTPD = 2556, I_MOVNTPS = 2547, I_MOVNTQ = 6841, - I_MOVNTSD = 2574, I_MOVNTSS = 2565, I_MOVQ = 3926, I_MOVQ2DQ = 6513, I_MOVS = 295, - I_MOVSD = 2110, I_MOVSHDUP = 2353, I_MOVSLDUP = 2176, I_MOVSS = 2103, I_MOVSX = 939, - I_MOVSXD = 10019, I_MOVUPD = 2095, I_MOVUPS = 2087, I_MOVZX = 927, I_MPSADBW = 9628, - I_MUL = 1625, I_MULPD = 3170, I_MULPS = 3163, I_MULSD = 3184, I_MULSS = 3177, - I_MWAIT = 1764, I_NEG = 1620, I_NOP = 581, I_NOT = 1615, I_OR = 27, I_ORPD = 3053, - I_ORPS = 3047, I_OUT = 451, I_OUTS = 128, I_PABSB = 7688, I_PABSD = 7718, I_PABSW = 7703, - I_PACKSSDW = 3849, I_PACKSSWB = 3681, I_PACKUSDW = 7916, I_PACKUSWB = 3759, - I_PADDB = 7204, I_PADDD = 7234, I_PADDQ = 6481, I_PADDSB = 6930, I_PADDSW = 6947, - I_PADDUSB = 6620, I_PADDUSW = 6639, I_PADDW = 7219, I_PALIGNR = 9410, I_PAND = 6607, - I_PANDN = 6665, I_PAUSE = 10027, I_PAVGB = 6680, I_PAVGUSB = 2078, I_PAVGW = 6725, - I_PBLENDVB = 7599, I_PBLENDW = 9391, I_PCLMULQDQ = 9647, I_PCMPEQB = 4043, - I_PCMPEQD = 4081, I_PCMPEQQ = 7876, I_PCMPEQW = 4062, I_PCMPESTRI = 9726, - I_PCMPESTRM = 9703, I_PCMPGTB = 3702, I_PCMPGTD = 3740, I_PCMPGTQ = 8087, - I_PCMPGTW = 3721, I_PCMPISTRI = 9772, I_PCMPISTRM = 9749, I_PEXTRB = 9429, - I_PEXTRD = 9446, I_PEXTRQ = 9454, I_PEXTRW = 6311, I_PF2ID = 1914, I_PF2IW = 1907, - I_PFACC = 2028, I_PFADD = 1977, I_PFCMPEQ = 2035, I_PFCMPGE = 1938, I_PFCMPGT = 1984, - I_PFMAX = 1993, I_PFMIN = 1947, I_PFMUL = 2044, I_PFNACC = 1921, I_PFPNACC = 1929, - I_PFRCP = 1954, I_PFRCPIT1 = 2000, I_PFRCPIT2 = 2051, I_PFRSQIT1 = 2010, I_PFRSQRT = 1961, - I_PFSUB = 1970, I_PFSUBR = 2020, I_PHADDD = 7375, I_PHADDSW = 7392, I_PHADDW = 7358, - I_PHMINPOSUW = 8259, I_PHSUBD = 7451, I_PHSUBSW = 7468, I_PHSUBW = 7434, I_PI2FD = 1900, - I_PI2FW = 1893, I_PINSRB = 9530, I_PINSRD = 9568, I_PINSRQ = 9576, I_PINSRW = 6294, - I_PMADDUBSW = 7411, I_PMADDWD = 7073, I_PMAXSB = 8174, I_PMAXSD = 8191, I_PMAXSW = 6964, - I_PMAXUB = 6648, I_PMAXUD = 8225, I_PMAXUW = 8208, I_PMINSB = 8106, I_PMINSD = 8123, - I_PMINSW = 6902, I_PMINUB = 6590, I_PMINUD = 8157, I_PMINUW = 8140, I_PMOVMSKB = 6531, - I_PMOVSXBD = 7754, I_PMOVSXBQ = 7775, I_PMOVSXBW = 7733, I_PMOVSXDQ = 7838, - I_PMOVSXWD = 7796, I_PMOVSXWQ = 7817, I_PMOVZXBD = 7982, I_PMOVZXBQ = 8003, - I_PMOVZXBW = 7961, I_PMOVZXDQ = 8066, I_PMOVZXWD = 8024, I_PMOVZXWQ = 8045, - I_PMULDQ = 7859, I_PMULHRSW = 7538, I_PMULHRW = 2061, I_PMULHUW = 6740, I_PMULHW = 6759, - I_PMULLD = 8242, I_PMULLW = 6496, I_PMULUDQ = 7054, I_POP = 22, I_POPA = 98, - I_POPCNT = 4338, I_POPF = 277, I_POR = 6919, I_PREFETCH = 1872, I_PREFETCHNTA = 2402, - I_PREFETCHT0 = 2415, I_PREFETCHT1 = 2427, I_PREFETCHT2 = 2439, I_PREFETCHW = 1882, - I_PSADBW = 7092, I_PSHUFB = 7341, I_PSHUFD = 3988, I_PSHUFHW = 3996, I_PSHUFLW = 4005, - I_PSHUFW = 3980, I_PSIGNB = 7487, I_PSIGND = 7521, I_PSIGNW = 7504, I_PSLLD = 7024, - I_PSLLDQ = 9847, I_PSLLQ = 7039, I_PSLLW = 7009, I_PSRAD = 6710, I_PSRAW = 6695, - I_PSRLD = 6451, I_PSRLDQ = 9830, I_PSRLQ = 6466, I_PSRLW = 6436, I_PSUBB = 7144, - I_PSUBD = 7174, I_PSUBQ = 7189, I_PSUBSB = 6868, I_PSUBSW = 6885, I_PSUBUSB = 6552, - I_PSUBUSW = 6571, I_PSUBW = 7159, I_PSWAPD = 2070, I_PTEST = 7629, I_PUNPCKHBW = 3780, - I_PUNPCKHDQ = 3826, I_PUNPCKHQDQ = 3895, I_PUNPCKHWD = 3803, I_PUNPCKLBW = 3612, - I_PUNPCKLDQ = 3658, I_PUNPCKLQDQ = 3870, I_PUNPCKLWD = 3635, I_PUSH = 16, - I_PUSHA = 91, I_PUSHF = 270, I_PXOR = 6981, I_RCL = 977, I_RCPPS = 2953, I_RCPSS = 2960, - I_RCR = 982, I_RDFSBASE = 9882, I_RDGSBASE = 9912, I_RDMSR = 600, I_RDPMC = 607, - I_RDRAND = 9980, I_RDTSC = 593, I_RDTSCP = 1864, I_RET = 325, I_RETF = 354, - I_ROL = 967, I_ROR = 972, I_ROUNDPD = 9296, I_ROUNDPS = 9277, I_ROUNDSD = 9334, - I_ROUNDSS = 9315, I_RSM = 882, I_RSQRTPS = 2915, I_RSQRTSS = 2924, I_SAHF = 283, - I_SAL = 997, I_SALC = 394, I_SAR = 1002, I_SBB = 36, I_SCAS = 319, I_SETA = 807, - I_SETAE = 780, I_SETB = 774, I_SETBE = 800, I_SETG = 859, I_SETGE = 845, I_SETL = 839, - I_SETLE = 852, I_SETNO = 767, I_SETNP = 832, I_SETNS = 819, I_SETNZ = 793, - I_SETO = 761, I_SETP = 826, I_SETS = 813, I_SETZ = 787, I_SFENCE = 4321, I_SGDT = 1675, - I_SHL = 987, I_SHLD = 876, I_SHR = 992, I_SHRD = 892, I_SHUFPD = 6336, I_SHUFPS = 6328, - I_SIDT = 1681, I_SKINIT = 1839, I_SLDT = 1641, I_SMSW = 1699, I_SQRTPD = 2855, - I_SQRTPS = 2847, I_SQRTSD = 2871, I_SQRTSS = 2863, I_STC = 497, I_STD = 517, - I_STGI = 1827, I_STI = 507, I_STMXCSR = 9951, I_STOS = 307, I_STR = 1647, I_SUB = 51, - I_SUBPD = 3379, I_SUBPS = 3372, I_SUBSD = 3393, I_SUBSS = 3386, I_SWAPGS = 1856, - I_SYSCALL = 532, I_SYSENTER = 614, I_SYSEXIT = 624, I_SYSRET = 547, I_TEST = 206, - I_TZCNT = 4351, I_UCOMISD = 2742, I_UCOMISS = 2733, I_UD2 = 569, I_UNPCKHPD = 2296, - I_UNPCKHPS = 2286, I_UNPCKLPD = 2254, I_UNPCKLPS = 2244, I_VADDPD = 3139, - I_VADDPS = 3131, I_VADDSD = 3155, I_VADDSS = 3147, I_VADDSUBPD = 6414, I_VADDSUBPS = 6425, - I_VAESDEC = 9217, I_VAESDECLAST = 9238, I_VAESENC = 9175, I_VAESENCLAST = 9196, - I_VAESIMC = 9158, I_VAESKEYGENASSIST = 9812, I_VANDNPD = 3038, I_VANDNPS = 3029, - I_VANDPD = 3005, I_VANDPS = 2997, I_VBLENDPD = 9381, I_VBLENDPS = 9362, I_VBLENDVPD = 9681, - I_VBLENDVPS = 9670, I_VBROADCASTF128 = 7672, I_VBROADCASTSD = 7658, I_VBROADCASTSS = 7644, - I_VCMPEQPD = 5088, I_VCMPEQPS = 4686, I_VCMPEQSD = 5892, I_VCMPEQSS = 5490, - I_VCMPEQ_OSPD = 5269, I_VCMPEQ_OSPS = 4867, I_VCMPEQ_OSSD = 6073, I_VCMPEQ_OSSS = 5671, - I_VCMPEQ_UQPD = 5175, I_VCMPEQ_UQPS = 4773, I_VCMPEQ_UQSD = 5979, I_VCMPEQ_UQSS = 5577, - I_VCMPEQ_USPD = 5378, I_VCMPEQ_USPS = 4976, I_VCMPEQ_USSD = 6182, I_VCMPEQ_USSS = 5780, - I_VCMPFALSEPD = 5210, I_VCMPFALSEPS = 4808, I_VCMPFALSESD = 6014, I_VCMPFALSESS = 5612, - I_VCMPFALSE_OSPD = 5419, I_VCMPFALSE_OSPS = 5017, I_VCMPFALSE_OSSD = 6223, - I_VCMPFALSE_OSSS = 5821, I_VCMPGEPD = 5237, I_VCMPGEPS = 4835, I_VCMPGESD = 6041, - I_VCMPGESS = 5639, I_VCMPGE_OQPD = 5449, I_VCMPGE_OQPS = 5047, I_VCMPGE_OQSD = 6253, - I_VCMPGE_OQSS = 5851, I_VCMPGTPD = 5247, I_VCMPGTPS = 4845, I_VCMPGTSD = 6051, - I_VCMPGTSS = 5649, I_VCMPGT_OQPD = 5462, I_VCMPGT_OQPS = 5060, I_VCMPGT_OQSD = 6266, - I_VCMPGT_OQSS = 5864, I_VCMPLEPD = 5108, I_VCMPLEPS = 4706, I_VCMPLESD = 5912, - I_VCMPLESS = 5510, I_VCMPLE_OQPD = 5295, I_VCMPLE_OQPS = 4893, I_VCMPLE_OQSD = 6099, - I_VCMPLE_OQSS = 5697, I_VCMPLTPD = 5098, I_VCMPLTPS = 4696, I_VCMPLTSD = 5902, - I_VCMPLTSS = 5500, I_VCMPLT_OQPD = 5282, I_VCMPLT_OQPS = 4880, I_VCMPLT_OQSD = 6086, - I_VCMPLT_OQSS = 5684, I_VCMPNEQPD = 5131, I_VCMPNEQPS = 4729, I_VCMPNEQSD = 5935, - I_VCMPNEQSS = 5533, I_VCMPNEQ_OQPD = 5223, I_VCMPNEQ_OQPS = 4821, I_VCMPNEQ_OQSD = 6027, - I_VCMPNEQ_OQSS = 5625, I_VCMPNEQ_OSPD = 5435, I_VCMPNEQ_OSPS = 5033, I_VCMPNEQ_OSSD = 6239, - I_VCMPNEQ_OSSS = 5837, I_VCMPNEQ_USPD = 5323, I_VCMPNEQ_USPS = 4921, I_VCMPNEQ_USSD = 6127, - I_VCMPNEQ_USSS = 5725, I_VCMPNGEPD = 5188, I_VCMPNGEPS = 4786, I_VCMPNGESD = 5992, - I_VCMPNGESS = 5590, I_VCMPNGE_UQPD = 5391, I_VCMPNGE_UQPS = 4989, I_VCMPNGE_UQSD = 6195, - I_VCMPNGE_UQSS = 5793, I_VCMPNGTPD = 5199, I_VCMPNGTPS = 4797, I_VCMPNGTSD = 6003, - I_VCMPNGTSS = 5601, I_VCMPNGT_UQPD = 5405, I_VCMPNGT_UQPS = 5003, I_VCMPNGT_UQSD = 6209, - I_VCMPNGT_UQSS = 5807, I_VCMPNLEPD = 5153, I_VCMPNLEPS = 4751, I_VCMPNLESD = 5957, - I_VCMPNLESS = 5555, I_VCMPNLE_UQPD = 5351, I_VCMPNLE_UQPS = 4949, I_VCMPNLE_UQSD = 6155, - I_VCMPNLE_UQSS = 5753, I_VCMPNLTPD = 5142, I_VCMPNLTPS = 4740, I_VCMPNLTSD = 5946, - I_VCMPNLTSS = 5544, I_VCMPNLT_UQPD = 5337, I_VCMPNLT_UQPS = 4935, I_VCMPNLT_UQSD = 6141, - I_VCMPNLT_UQSS = 5739, I_VCMPORDPD = 5164, I_VCMPORDPS = 4762, I_VCMPORDSD = 5968, - I_VCMPORDSS = 5566, I_VCMPORD_SPD = 5365, I_VCMPORD_SPS = 4963, I_VCMPORD_SSD = 6169, - I_VCMPORD_SSS = 5767, I_VCMPTRUEPD = 5257, I_VCMPTRUEPS = 4855, I_VCMPTRUESD = 6061, - I_VCMPTRUESS = 5659, I_VCMPTRUE_USPD = 5475, I_VCMPTRUE_USPS = 5073, I_VCMPTRUE_USSD = 6279, - I_VCMPTRUE_USSS = 5877, I_VCMPUNORDPD = 5118, I_VCMPUNORDPS = 4716, I_VCMPUNORDSD = 5922, - I_VCMPUNORDSS = 5520, I_VCMPUNORD_SPD = 5308, I_VCMPUNORD_SPS = 4906, I_VCMPUNORD_SSD = 6112, - I_VCMPUNORD_SSS = 5710, I_VCOMISD = 2796, I_VCOMISS = 2787, I_VCVTDQ2PD = 6819, - I_VCVTDQ2PS = 3338, I_VCVTPD2DQ = 6830, I_VCVTPD2PS = 3274, I_VCVTPS2DQ = 3349, - I_VCVTPS2PD = 3263, I_VCVTSD2SI = 2722, I_VCVTSD2SS = 3296, I_VCVTSI2SD = 2536, - I_VCVTSI2SS = 2525, I_VCVTSS2SD = 3285, I_VCVTSS2SI = 2711, I_VCVTTPD2DQ = 6807, - I_VCVTTPS2DQ = 3360, I_VCVTTSD2SI = 2659, I_VCVTTSS2SI = 2647, I_VDIVPD = 3528, - I_VDIVPS = 3520, I_VDIVSD = 3544, I_VDIVSS = 3536, I_VDPPD = 9621, I_VDPPS = 9608, - I_VERR = 1663, I_VERW = 1669, I_VEXTRACTF128 = 9516, I_VEXTRACTPS = 9491, - I_VFMADD132PD = 8387, I_VFMADD132PS = 8374, I_VFMADD132SD = 8413, I_VFMADD132SS = 8400, - I_VFMADD213PD = 8667, I_VFMADD213PS = 8654, I_VFMADD213SD = 8693, I_VFMADD213SS = 8680, - I_VFMADD231PD = 8947, I_VFMADD231PS = 8934, I_VFMADD231SD = 8973, I_VFMADD231SS = 8960, - I_VFMADDSUB132PD = 8326, I_VFMADDSUB132PS = 8310, I_VFMADDSUB213PD = 8606, - I_VFMADDSUB213PS = 8590, I_VFMADDSUB231PD = 8886, I_VFMADDSUB231PS = 8870, - I_VFMSUB132PD = 8439, I_VFMSUB132PS = 8426, I_VFMSUB132SD = 8465, I_VFMSUB132SS = 8452, - I_VFMSUB213PD = 8719, I_VFMSUB213PS = 8706, I_VFMSUB213SD = 8745, I_VFMSUB213SS = 8732, - I_VFMSUB231PD = 8999, I_VFMSUB231PS = 8986, I_VFMSUB231SD = 9025, I_VFMSUB231SS = 9012, - I_VFMSUBADD132PD = 8358, I_VFMSUBADD132PS = 8342, I_VFMSUBADD213PD = 8638, - I_VFMSUBADD213PS = 8622, I_VFMSUBADD231PD = 8918, I_VFMSUBADD231PS = 8902, - I_VFNMADD132PD = 8492, I_VFNMADD132PS = 8478, I_VFNMADD132SD = 8520, I_VFNMADD132SS = 8506, - I_VFNMADD213PD = 8772, I_VFNMADD213PS = 8758, I_VFNMADD213SD = 8800, I_VFNMADD213SS = 8786, - I_VFNMADD231PD = 9052, I_VFNMADD231PS = 9038, I_VFNMADD231SD = 9080, I_VFNMADD231SS = 9066, - I_VFNMSUB132PD = 8548, I_VFNMSUB132PS = 8534, I_VFNMSUB132SD = 8576, I_VFNMSUB132SS = 8562, - I_VFNMSUB213PD = 8828, I_VFNMSUB213PS = 8814, I_VFNMSUB213SD = 8856, I_VFNMSUB213SS = 8842, - I_VFNMSUB231PD = 9108, I_VFNMSUB231PS = 9094, I_VFNMSUB231SD = 9136, I_VFNMSUB231SS = 9122, - I_VHADDPD = 4197, I_VHADDPS = 4206, I_VHSUBPD = 4231, I_VHSUBPS = 4240, I_VINSERTF128 = 9503, - I_VINSERTPS = 9557, I_VLDDQU = 7001, I_VLDMXCSR = 9941, I_VMASKMOVDQU = 7131, - I_VMASKMOVPD = 7949, I_VMASKMOVPS = 7937, I_VMAXPD = 3588, I_VMAXPS = 3580, - I_VMAXSD = 3604, I_VMAXSS = 3596, I_VMCALL = 1719, I_VMCLEAR = 9997, I_VMFUNC = 1787, - I_VMINPD = 3468, I_VMINPS = 3460, I_VMINSD = 3484, I_VMINSS = 3476, I_VMLAUNCH = 1727, - I_VMLOAD = 1811, I_VMMCALL = 1802, I_VMOVAPD = 2476, I_VMOVAPS = 2467, I_VMOVD = 3932, - I_VMOVDDUP = 2234, I_VMOVDQA = 3962, I_VMOVDQU = 3971, I_VMOVHLPS = 2195, - I_VMOVHPD = 2382, I_VMOVHPS = 2373, I_VMOVLHPS = 2363, I_VMOVLPD = 2214, I_VMOVLPS = 2205, - I_VMOVMSKPD = 2836, I_VMOVMSKPS = 2825, I_VMOVNTDQ = 6858, I_VMOVNTDQA = 7905, - I_VMOVNTPD = 2593, I_VMOVNTPS = 2583, I_VMOVQ = 3939, I_VMOVSD = 2143, I_VMOVSHDUP = 2391, - I_VMOVSLDUP = 2223, I_VMOVSS = 2135, I_VMOVUPD = 2126, I_VMOVUPS = 2117, I_VMPSADBW = 9637, - I_VMPTRLD = 9988, I_VMPTRST = 6385, I_VMREAD = 4128, I_VMRESUME = 1737, I_VMRUN = 1795, - I_VMSAVE = 1819, I_VMULPD = 3199, I_VMULPS = 3191, I_VMULSD = 3215, I_VMULSS = 3207, - I_VMWRITE = 4152, I_VMXOFF = 1747, I_VMXON = 10006, I_VORPD = 3066, I_VORPS = 3059, - I_VPABSB = 7695, I_VPABSD = 7725, I_VPABSW = 7710, I_VPACKSSDW = 3859, I_VPACKSSWB = 3691, - I_VPACKUSDW = 7926, I_VPACKUSWB = 3769, I_VPADDB = 7211, I_VPADDD = 7241, - I_VPADDQ = 6488, I_VPADDSB = 6938, I_VPADDSW = 6955, I_VPADDUSW = 6629, I_VPADDW = 7226, - I_VPALIGNR = 9419, I_VPAND = 6613, I_VPANDN = 6672, I_VPAVGB = 6687, I_VPAVGW = 6732, - I_VPBLENDVB = 9692, I_VPBLENDW = 9400, I_VPCLMULQDQ = 9658, I_VPCMPEQB = 4052, - I_VPCMPEQD = 4090, I_VPCMPEQQ = 7885, I_VPCMPEQW = 4071, I_VPCMPESTRI = 9737, - I_VPCMPESTRM = 9714, I_VPCMPGTB = 3711, I_VPCMPGTD = 3749, I_VPCMPGTQ = 8096, - I_VPCMPGTW = 3730, I_VPCMPISTRI = 9783, I_VPCMPISTRM = 9760, I_VPERM2F128 = 9265, - I_VPERMILPD = 7570, I_VPERMILPS = 7559, I_VPEXTRB = 9437, I_VPEXTRD = 9462, - I_VPEXTRQ = 9471, I_VPEXTRW = 6319, I_VPHADDD = 7383, I_VPHADDSW = 7401, I_VPHADDW = 7366, - I_VPHMINPOSUW = 8271, I_VPHSUBD = 7459, I_VPHSUBSW = 7477, I_VPHSUBW = 7442, - I_VPINSRB = 9538, I_VPINSRD = 9584, I_VPINSRQ = 9593, I_VPINSRW = 6302, I_VPMADDUBSW = 7422, - I_VPMADDWD = 7082, I_VPMAXSB = 8182, I_VPMAXSD = 8199, I_VPMAXSW = 6972, I_VPMAXUB = 6656, - I_VPMAXUD = 8233, I_VPMAXUW = 8216, I_VPMINSB = 8114, I_VPMINSD = 8131, I_VPMINSW = 6910, - I_VPMINUB = 6598, I_VPMINUD = 8165, I_VPMINUW = 8148, I_VPMOVMSKB = 6541, - I_VPMOVSXBD = 7764, I_VPMOVSXBQ = 7785, I_VPMOVSXBW = 7743, I_VPMOVSXDQ = 7848, - I_VPMOVSXWD = 7806, I_VPMOVSXWQ = 7827, I_VPMOVZXBD = 7992, I_VPMOVZXBQ = 8013, - I_VPMOVZXBW = 7971, I_VPMOVZXDQ = 8076, I_VPMOVZXWD = 8034, I_VPMOVZXWQ = 8055, - I_VPMULDQ = 7867, I_VPMULHRSW = 7548, I_VPMULHUW = 6749, I_VPMULHW = 6767, - I_VPMULLD = 8250, I_VPMULLW = 6504, I_VPMULUDQ = 7063, I_VPOR = 6924, I_VPSADBW = 7100, - I_VPSHUFB = 7349, I_VPSHUFD = 4014, I_VPSHUFHW = 4023, I_VPSHUFLW = 4033, - I_VPSIGNB = 7495, I_VPSIGND = 7529, I_VPSIGNW = 7512, I_VPSLLD = 7031, I_VPSLLDQ = 9855, - I_VPSLLQ = 7046, I_VPSLLW = 7016, I_VPSRAD = 6717, I_VPSRAW = 6702, I_VPSRLD = 6458, - I_VPSRLDQ = 9838, I_VPSRLQ = 6473, I_VPSRLW = 6443, I_VPSUBB = 7151, I_VPSUBD = 7181, - I_VPSUBQ = 7196, I_VPSUBSB = 6876, I_VPSUBSW = 6893, I_VPSUBUSB = 6561, I_VPSUBUSW = 6580, - I_VPSUBW = 7166, I_VPTEST = 7636, I_VPUNPCKHBW = 3791, I_VPUNPCKHDQ = 3837, - I_VPUNPCKHQDQ = 3907, I_VPUNPCKHWD = 3814, I_VPUNPCKLBW = 3623, I_VPUNPCKLDQ = 3669, - I_VPUNPCKLQDQ = 3882, I_VPUNPCKLWD = 3646, I_VPXOR = 6987, I_VRCPPS = 2967, - I_VRCPSS = 2975, I_VROUNDPD = 9305, I_VROUNDPS = 9286, I_VROUNDSD = 9343, - I_VROUNDSS = 9324, I_VRSQRTPS = 2933, I_VRSQRTSS = 2943, I_VSHUFPD = 6353, - I_VSHUFPS = 6344, I_VSQRTPD = 2888, I_VSQRTPS = 2879, I_VSQRTSD = 2906, I_VSQRTSS = 2897, - I_VSTMXCSR = 9970, I_VSUBPD = 3408, I_VSUBPS = 3400, I_VSUBSD = 3424, I_VSUBSS = 3416, - I_VTESTPD = 7590, I_VTESTPS = 7581, I_VUCOMISD = 2761, I_VUCOMISS = 2751, - I_VUNPCKHPD = 2317, I_VUNPCKHPS = 2306, I_VUNPCKLPD = 2275, I_VUNPCKLPS = 2264, - I_VXORPD = 3095, I_VXORPS = 3087, I_VZEROALL = 4118, I_VZEROUPPER = 4106, - I_WAIT = 10013, I_WBINVD = 561, I_WRFSBASE = 9931, I_WRGSBASE = 9960, I_WRMSR = 586, - I_XADD = 946, I_XCHG = 212, I_XGETBV = 1771, I_XLAT = 400, I_XOR = 61, I_XORPD = 3080, - I_XORPS = 3073, I_XRSTOR = 4273, I_XRSTOR64 = 4281, I_XSAVE = 4249, I_XSAVE64 = 4256, - I_XSAVEOPT = 4299, I_XSAVEOPT64 = 4309, I_XSETBV = 1779 -} _InstructionType; - -typedef enum { - R_RAX, R_RCX, R_RDX, R_RBX, R_RSP, R_RBP, R_RSI, R_RDI, R_R8, R_R9, R_R10, R_R11, R_R12, R_R13, R_R14, R_R15, - R_EAX, R_ECX, R_EDX, R_EBX, R_ESP, R_EBP, R_ESI, R_EDI, R_R8D, R_R9D, R_R10D, R_R11D, R_R12D, R_R13D, R_R14D, R_R15D, - R_AX, R_CX, R_DX, R_BX, R_SP, R_BP, R_SI, R_DI, R_R8W, R_R9W, R_R10W, R_R11W, R_R12W, R_R13W, R_R14W, R_R15W, - R_AL, R_CL, R_DL, R_BL, R_AH, R_CH, R_DH, R_BH, R_R8B, R_R9B, R_R10B, R_R11B, R_R12B, R_R13B, R_R14B, R_R15B, - R_SPL, R_BPL, R_SIL, R_DIL, - R_ES, R_CS, R_SS, R_DS, R_FS, R_GS, - R_RIP, - R_ST0, R_ST1, R_ST2, R_ST3, R_ST4, R_ST5, R_ST6, R_ST7, - R_MM0, R_MM1, R_MM2, R_MM3, R_MM4, R_MM5, R_MM6, R_MM7, - R_XMM0, R_XMM1, R_XMM2, R_XMM3, R_XMM4, R_XMM5, R_XMM6, R_XMM7, R_XMM8, R_XMM9, R_XMM10, R_XMM11, R_XMM12, R_XMM13, R_XMM14, R_XMM15, - R_YMM0, R_YMM1, R_YMM2, R_YMM3, R_YMM4, R_YMM5, R_YMM6, R_YMM7, R_YMM8, R_YMM9, R_YMM10, R_YMM11, R_YMM12, R_YMM13, R_YMM14, R_YMM15, - R_CR0, R_UNUSED0, R_CR2, R_CR3, R_CR4, R_UNUSED1, R_UNUSED2, R_UNUSED3, R_CR8, - R_DR0, R_DR1, R_DR2, R_DR3, R_UNUSED4, R_UNUSED5, R_DR6, R_DR7 -} _RegisterType; - -#endif /* MNEMONICS_H */ diff --git a/distorm3.2-package/src/insts.c b/distorm3.2-package/src/insts.c deleted file mode 100644 index 4c9179b..0000000 --- a/distorm3.2-package/src/insts.c +++ /dev/null @@ -1,7343 +0,0 @@ -/* -insts.c - -diStorm3 - Powerful disassembler for X86/AMD64 -http://ragestorm.net/distorm/ -distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see -*/ - - -#include "config.h" -#include "insts.h" -#include "instructions.h" - - -/* - * GENERATED BY disOps at Mon May 07 05:39:59 2012 - */ - -/* See x86defs.c if you get an error here. */ -_iflags FlagsTable[97 + 5] = { -INST_MODRM_REQUIRED, -INST_MODRM_REQUIRED | INST_PRE_REX | INST_64BITS, -INST_FLAGS_NONE, -INST_FLAGS_NONE, -INST_32BITS | INST_MODRM_REQUIRED | INST_3DNOW_FETCH, -0x80000011, -0x80000000, -0x800400, -0x80800400, -0x800080, -0x800100, -0x80800100, -0x800200, -0x80800200, -0x800000, -0x1, -0x0, -0x80800000, -0x1000000, -0x81000000, -0x808000, -0x800001, -0x1000001, -0x80020001, -0x1002000, -0x60, -0x64, -0x80000001, -0x4010000, -0x1008000, -0x80000060, -0x83000064, -0x3000064, -0x83000000, -0x3008000, -0x200, -0xc000, -0x4014000, -0x8, -0x81000009, -0x9, -0x80000009, -0x1000808, -0x81000808, -0x80020009, -0x1001008, -0x81001008, -0x80000019, -0x3000009, -0x83000009, -0x83000008, -0xc0000011, -0x40000001, -0xc0800011, -0x40800001, -0xc0000019, -0xc1000001, -0xc0000001, -0x40000000, -0x40000008, -0x40000009, -0x41000001, -0x43000001, -0xc0000003, -0x40000003, -0x48000000, -0x200009, -0x20000009, -0x60020009, -0x60000009, -0x80090009, -0x200b0009, -0x20020009, -0x80100009, -0x21100009, -0x87000009, -0x20009, -0x20000008, -0x1000009, -0x10020009, -0x160009, -0x100009, -0x47000009, -0x47090009, -0x40090009, -0x80002009, -0xc0000009, -0x2001, -0x80002001, -0x410009, -0x20420009, -0x20060009, -0x120009, -0x21020009, -0xc7000019, -0x20100009, -0x40002009, -0x40002008, -0x4020009, -0x40100009, -0x60120009, -0x41000009 -}; - -_InstNode Table_0F = 256; -_InstNode Table_0F_0F = 1312; -_InstNode Table_0F_38 = 1768; -_InstNode Table_0F_3A = 2024; - -_InstInfo InstInfos[] = { - /*II_00*/ {0x5, 9, 15, 8, 11}, - /*II_01*/ {0x5, 11, 17, 8, 11}, - /*II_02*/ {0x5, 15, 9, 8, 11}, - /*II_03*/ {0x5, 17, 11, 8, 11}, - /*II_04*/ {0x6, 1, 33, 8, 11}, - /*II_05*/ {0x6, 3, 35, 8, 11}, - /*II_06*/ {0x7, 0, 32, 8, 16}, - /*II_07*/ {0x8, 0, 32, 8, 22}, - /*II_08*/ {0x5, 9, 15, 8, 27}, - /*II_09*/ {0x5, 11, 17, 8, 27}, - /*II_0A*/ {0x5, 15, 9, 8, 27}, - /*II_0B*/ {0x5, 17, 11, 8, 27}, - /*II_0C*/ {0x6, 1, 33, 8, 27}, - /*II_0D*/ {0x6, 3, 35, 8, 27}, - /*II_0E*/ {0x9, 0, 32, 8, 16}, - /*II_10*/ {0x5, 9, 15, 8, 31}, - /*II_11*/ {0x5, 11, 17, 8, 31}, - /*II_12*/ {0x5, 15, 9, 8, 31}, - /*II_13*/ {0x5, 17, 11, 8, 31}, - /*II_14*/ {0x6, 1, 33, 8, 31}, - /*II_15*/ {0x6, 3, 35, 8, 31}, - /*II_16*/ {0xa, 0, 32, 8, 16}, - /*II_17*/ {0xb, 0, 32, 8, 22}, - /*II_18*/ {0x5, 9, 15, 8, 36}, - /*II_19*/ {0x5, 11, 17, 8, 36}, - /*II_1A*/ {0x5, 15, 9, 8, 36}, - /*II_1B*/ {0x5, 17, 11, 8, 36}, - /*II_1C*/ {0x6, 1, 33, 8, 36}, - /*II_1D*/ {0x6, 3, 35, 8, 36}, - /*II_1E*/ {0xc, 0, 32, 8, 16}, - /*II_1F*/ {0xd, 0, 32, 8, 22}, - /*II_20*/ {0x5, 9, 15, 8, 41}, - /*II_21*/ {0x5, 11, 17, 8, 41}, - /*II_22*/ {0x5, 15, 9, 8, 41}, - /*II_23*/ {0x5, 17, 11, 8, 41}, - /*II_24*/ {0x6, 1, 33, 8, 41}, - /*II_25*/ {0x6, 3, 35, 8, 41}, - /*II_27*/ {0xe, 0, 0, 8, 46}, - /*II_28*/ {0x5, 9, 15, 8, 51}, - /*II_29*/ {0x5, 11, 17, 8, 51}, - /*II_2A*/ {0x5, 15, 9, 8, 51}, - /*II_2B*/ {0x5, 17, 11, 8, 51}, - /*II_2C*/ {0x6, 1, 33, 8, 51}, - /*II_2D*/ {0x6, 3, 35, 8, 51}, - /*II_2F*/ {0xe, 0, 0, 8, 56}, - /*II_30*/ {0x5, 9, 15, 8, 61}, - /*II_31*/ {0x5, 11, 17, 8, 61}, - /*II_32*/ {0x5, 15, 9, 8, 61}, - /*II_33*/ {0x5, 17, 11, 8, 61}, - /*II_34*/ {0x6, 1, 33, 8, 61}, - /*II_35*/ {0x6, 3, 35, 8, 61}, - /*II_37*/ {0xe, 0, 0, 8, 66}, - /*II_38*/ {0xf, 9, 15, 8, 71}, - /*II_39*/ {0xf, 11, 17, 8, 71}, - /*II_3A*/ {0xf, 15, 9, 8, 71}, - /*II_3B*/ {0xf, 17, 11, 8, 71}, - /*II_3C*/ {0x10, 1, 33, 8, 71}, - /*II_3D*/ {0x10, 3, 35, 8, 71}, - /*II_3F*/ {0xe, 0, 0, 8, 76}, - /*II_40*/ {0x11, 0, 54, 8, 81}, - /*II_40*/ {0x11, 0, 54, 8, 81}, - /*II_40*/ {0x11, 0, 54, 8, 81}, - /*II_40*/ {0x11, 0, 54, 8, 81}, - /*II_40*/ {0x11, 0, 54, 8, 81}, - /*II_40*/ {0x11, 0, 54, 8, 81}, - /*II_40*/ {0x11, 0, 54, 8, 81}, - /*II_40*/ {0x11, 0, 54, 8, 81}, - /*II_48*/ {0x11, 0, 54, 8, 86}, - /*II_48*/ {0x11, 0, 54, 8, 86}, - /*II_48*/ {0x11, 0, 54, 8, 86}, - /*II_48*/ {0x11, 0, 54, 8, 86}, - /*II_48*/ {0x11, 0, 54, 8, 86}, - /*II_48*/ {0x11, 0, 54, 8, 86}, - /*II_48*/ {0x11, 0, 54, 8, 86}, - /*II_48*/ {0x11, 0, 54, 8, 86}, - /*II_50*/ {0x12, 0, 54, 8, 16}, - /*II_50*/ {0x12, 0, 54, 8, 16}, - /*II_50*/ {0x12, 0, 54, 8, 16}, - /*II_50*/ {0x12, 0, 54, 8, 16}, - /*II_50*/ {0x12, 0, 54, 8, 16}, - /*II_50*/ {0x12, 0, 54, 8, 16}, - /*II_50*/ {0x12, 0, 54, 8, 16}, - /*II_50*/ {0x12, 0, 54, 8, 16}, - /*II_58*/ {0x13, 0, 54, 8, 22}, - /*II_58*/ {0x13, 0, 54, 8, 22}, - /*II_58*/ {0x13, 0, 54, 8, 22}, - /*II_58*/ {0x13, 0, 54, 8, 22}, - /*II_58*/ {0x13, 0, 54, 8, 22}, - /*II_58*/ {0x13, 0, 54, 8, 22}, - /*II_58*/ {0x13, 0, 54, 8, 22}, - /*II_58*/ {0x13, 0, 54, 8, 22}, - /*II_60*/ {0x14, 0, 0, 8, 91}, - /*II_61*/ {0x14, 0, 0, 8, 98}, - /*II_62*/ {0x15, 42, 11, 8, 104}, - /*II_63*/ {0x16, 10, 16, 8, 111}, - /*II_68*/ {0x12, 0, 3, 8, 16}, - /*II_6A*/ {0x18, 0, 5, 8, 16}, - /*II_6C*/ {0x19, 59, 56, 8, 123}, - /*II_6D*/ {0x1a, 59, 56, 8, 123}, - /*II_6E*/ {0x19, 55, 59, 8, 128}, - /*II_6F*/ {0x1a, 55, 59, 8, 128}, - /*II_70*/ {0x12, 0, 40, 13, 134}, - /*II_71*/ {0x12, 0, 40, 13, 138}, - /*II_72*/ {0x12, 0, 40, 13, 143}, - /*II_73*/ {0x12, 0, 40, 13, 147}, - /*II_74*/ {0x12, 0, 40, 13, 152}, - /*II_75*/ {0x12, 0, 40, 13, 156}, - /*II_76*/ {0x12, 0, 40, 13, 161}, - /*II_77*/ {0x12, 0, 40, 13, 166}, - /*II_78*/ {0x12, 0, 40, 13, 170}, - /*II_79*/ {0x12, 0, 40, 13, 174}, - /*II_7A*/ {0x12, 0, 40, 13, 179}, - /*II_7B*/ {0x12, 0, 40, 13, 183}, - /*II_7C*/ {0x12, 0, 40, 13, 188}, - /*II_7D*/ {0x12, 0, 40, 13, 192}, - /*II_7E*/ {0x12, 0, 40, 13, 197}, - /*II_7F*/ {0x12, 0, 40, 13, 202}, - /*II_84*/ {0xf, 9, 15, 8, 206}, - /*II_85*/ {0xf, 11, 17, 8, 206}, - /*II_86*/ {0x5, 9, 15, 8, 212}, - /*II_87*/ {0x5, 11, 17, 8, 212}, - /*II_88*/ {0x1b, 9, 15, 8, 218}, - /*II_89*/ {0x1b, 11, 17, 8, 218}, - /*II_8A*/ {0x1b, 15, 9, 8, 218}, - /*II_8B*/ {0x1b, 17, 11, 8, 218}, - /*II_8C*/ {0x1b, 31, 28, 8, 218}, - /*II_8D*/ {0x1b, 42, 11, 8, 223}, - /*II_8E*/ {0x1b, 28, 31, 8, 218}, - /*II_90*/ {0x6, 35, 54, 8, 212}, - /*II_91*/ {0x6, 35, 54, 8, 212}, - /*II_92*/ {0x6, 35, 54, 8, 212}, - /*II_93*/ {0x6, 35, 54, 8, 212}, - /*II_94*/ {0x6, 35, 54, 8, 212}, - /*II_95*/ {0x6, 35, 54, 8, 212}, - /*II_96*/ {0x6, 35, 54, 8, 212}, - /*II_97*/ {0x6, 35, 54, 8, 212}, - /*II_9A*/ {0xe, 0, 38, 9, 260}, - /*II_9C*/ {0x1d, 0, 0, 8, 270}, - /*II_9D*/ {0x1d, 0, 0, 8, 277}, - /*II_9E*/ {0x10, 0, 0, 8, 283}, - /*II_9F*/ {0x10, 0, 0, 8, 289}, - /*II_A0*/ {0x6, 49, 33, 8, 218}, - /*II_A1*/ {0x6, 50, 35, 8, 218}, - /*II_A2*/ {0x6, 33, 49, 8, 218}, - /*II_A3*/ {0x6, 35, 50, 8, 218}, - /*II_A4*/ {0x1e, 55, 56, 8, 295}, - /*II_A5*/ {0x1f, 55, 56, 8, 295}, - /*II_A6*/ {0x19, 56, 55, 8, 301}, - /*II_A7*/ {0x20, 56, 55, 8, 301}, - /*II_A8*/ {0x10, 1, 33, 8, 206}, - /*II_A9*/ {0x10, 3, 35, 8, 206}, - /*II_AA*/ {0x19, 33, 56, 8, 307}, - /*II_AB*/ {0x20, 35, 56, 8, 307}, - /*II_AC*/ {0x19, 55, 33, 8, 313}, - /*II_AD*/ {0x20, 55, 35, 8, 313}, - /*II_AE*/ {0x19, 33, 56, 8, 319}, - /*II_AF*/ {0x20, 35, 56, 8, 319}, - /*II_B0*/ {0x6, 1, 53, 8, 218}, - /*II_B0*/ {0x6, 1, 53, 8, 218}, - /*II_B0*/ {0x6, 1, 53, 8, 218}, - /*II_B0*/ {0x6, 1, 53, 8, 218}, - /*II_B0*/ {0x6, 1, 53, 8, 218}, - /*II_B0*/ {0x6, 1, 53, 8, 218}, - /*II_B0*/ {0x6, 1, 53, 8, 218}, - /*II_B0*/ {0x6, 1, 53, 8, 218}, - /*II_B8*/ {0x21, 3, 54, 8, 218}, - /*II_B8*/ {0x21, 3, 54, 8, 218}, - /*II_B8*/ {0x21, 3, 54, 8, 218}, - /*II_B8*/ {0x21, 3, 54, 8, 218}, - /*II_B8*/ {0x21, 3, 54, 8, 218}, - /*II_B8*/ {0x21, 3, 54, 8, 218}, - /*II_B8*/ {0x21, 3, 54, 8, 218}, - /*II_B8*/ {0x21, 3, 54, 8, 218}, - /*II_C2*/ {0x12, 0, 2, 10, 325}, - /*II_C3*/ {0x12, 0, 0, 10, 325}, - /*II_C4*/ {0x15, 37, 11, 8, 330}, - /*II_C5*/ {0x15, 37, 11, 8, 335}, - /*II_C8*/ {0x12, 8, 6, 8, 340}, - /*II_C9*/ {0x12, 0, 0, 8, 347}, - /*II_CA*/ {0x22, 0, 2, 10, 354}, - /*II_CB*/ {0x22, 0, 0, 10, 354}, - /*II_CC*/ {0x10, 0, 0, 14, 360}, - /*II_CD*/ {0x10, 0, 1, 14, 367}, - /*II_CE*/ {0xe, 0, 0, 14, 372}, - /*II_CF*/ {0x22, 0, 0, 10, 378}, - /*II_D4*/ {0xe, 0, 1, 8, 384}, - /*II_D5*/ {0xe, 0, 1, 8, 389}, - /*II_D6*/ {0xe, 0, 0, 8, 394}, - /*II_D7*/ {0x23, 0, 57, 8, 400}, - /*II_E0*/ {0x24, 0, 40, 13, 406}, - /*II_E1*/ {0x24, 0, 40, 13, 414}, - /*II_E2*/ {0x24, 0, 40, 13, 421}, - /*II_E4*/ {0x6, 1, 33, 8, 447}, - /*II_E5*/ {0x6, 1, 36, 8, 447}, - /*II_E6*/ {0x10, 33, 1, 8, 451}, - /*II_E7*/ {0x10, 36, 1, 8, 451}, - /*II_E8*/ {0x12, 0, 41, 9, 456}, - /*II_E9*/ {0x12, 0, 41, 12, 462}, - /*II_EA*/ {0xe, 0, 38, 12, 467}, - /*II_EB*/ {0x12, 0, 40, 12, 462}, - /*II_EC*/ {0x6, 59, 33, 8, 447}, - /*II_ED*/ {0x6, 59, 36, 8, 447}, - /*II_EE*/ {0x10, 33, 59, 8, 451}, - /*II_EF*/ {0x10, 36, 59, 8, 451}, - /*II_F1*/ {0x10, 0, 0, 14, 476}, - /*II_F4*/ {0x10, 0, 0, 8, 482}, - /*II_F5*/ {0x10, 0, 0, 8, 487}, - /*II_F8*/ {0x10, 0, 0, 8, 492}, - /*II_F9*/ {0x10, 0, 0, 8, 497}, - /*II_FA*/ {0x10, 0, 0, 8, 502}, - /*II_FB*/ {0x10, 0, 0, 8, 507}, - /*II_FC*/ {0x10, 0, 0, 8, 512}, - /*II_FD*/ {0x10, 0, 0, 8, 517}, - /*II_0F_02*/ {0xf, 16, 11, 8, 522}, - /*II_0F_03*/ {0xf, 16, 11, 8, 527}, - /*II_0F_05*/ {0x26, 0, 0, 27, 532}, - /*II_0F_06*/ {0x26, 0, 0, 8, 541}, - /*II_0F_07*/ {0x26, 0, 0, 27, 547}, - /*II_0F_08*/ {0x26, 0, 0, 8, 555}, - /*II_0F_09*/ {0x26, 0, 0, 8, 561}, - /*II_0F_0B*/ {0x26, 0, 0, 14, 569}, - /*II_0F_0E*/ {0x10, 0, 0, 96, 574}, - /*II_0F_1F*/ {0xf, 0, 17, 8, 581}, - /*II_0F_20*/ {0x27, 29, 14, 8, 218}, - /*II_0F_21*/ {0x27, 30, 14, 8, 218}, - /*II_0F_22*/ {0x27, 14, 29, 8, 218}, - /*II_0F_23*/ {0x27, 14, 30, 8, 218}, - /*II_0F_30*/ {0x26, 0, 0, 8, 586}, - /*II_0F_31*/ {0x26, 0, 0, 8, 593}, - /*II_0F_32*/ {0x26, 0, 0, 8, 600}, - /*II_0F_33*/ {0x26, 0, 0, 8, 607}, - /*II_0F_34*/ {0x26, 0, 0, 27, 614}, - /*II_0F_35*/ {0x26, 0, 0, 27, 624}, - /*II_0F_37*/ {0x28, 0, 0, 8, 633}, - /*II_0F_40*/ {0x29, 17, 11, 31, 641}, - /*II_0F_41*/ {0x29, 17, 11, 31, 648}, - /*II_0F_42*/ {0x29, 17, 11, 31, 656}, - /*II_0F_43*/ {0x29, 17, 11, 31, 663}, - /*II_0F_44*/ {0x29, 17, 11, 31, 671}, - /*II_0F_45*/ {0x29, 17, 11, 31, 678}, - /*II_0F_46*/ {0x29, 17, 11, 31, 686}, - /*II_0F_47*/ {0x29, 17, 11, 31, 694}, - /*II_0F_48*/ {0x29, 17, 11, 31, 701}, - /*II_0F_49*/ {0x29, 17, 11, 31, 708}, - /*II_0F_4A*/ {0x29, 17, 11, 31, 716}, - /*II_0F_4B*/ {0x29, 17, 11, 31, 723}, - /*II_0F_4C*/ {0x29, 17, 11, 31, 731}, - /*II_0F_4D*/ {0x29, 17, 11, 31, 738}, - /*II_0F_4E*/ {0x29, 17, 11, 31, 746}, - /*II_0F_4F*/ {0x29, 17, 11, 31, 754}, - /*II_0F_80*/ {0x26, 0, 41, 13, 134}, - /*II_0F_81*/ {0x26, 0, 41, 13, 138}, - /*II_0F_82*/ {0x26, 0, 41, 13, 143}, - /*II_0F_83*/ {0x26, 0, 41, 13, 147}, - /*II_0F_84*/ {0x26, 0, 41, 13, 152}, - /*II_0F_85*/ {0x26, 0, 41, 13, 156}, - /*II_0F_86*/ {0x26, 0, 41, 13, 161}, - /*II_0F_87*/ {0x26, 0, 41, 13, 166}, - /*II_0F_88*/ {0x26, 0, 41, 13, 170}, - /*II_0F_89*/ {0x26, 0, 41, 13, 174}, - /*II_0F_8A*/ {0x26, 0, 41, 13, 179}, - /*II_0F_8B*/ {0x26, 0, 41, 13, 183}, - /*II_0F_8C*/ {0x26, 0, 41, 13, 188}, - /*II_0F_8D*/ {0x26, 0, 41, 13, 192}, - /*II_0F_8E*/ {0x26, 0, 41, 13, 197}, - /*II_0F_8F*/ {0x26, 0, 41, 13, 202}, - /*II_0F_90*/ {0x29, 0, 15, 8, 761}, - /*II_0F_91*/ {0x29, 0, 15, 8, 767}, - /*II_0F_92*/ {0x29, 0, 15, 8, 774}, - /*II_0F_93*/ {0x29, 0, 15, 8, 780}, - /*II_0F_94*/ {0x29, 0, 15, 8, 787}, - /*II_0F_95*/ {0x29, 0, 15, 8, 793}, - /*II_0F_96*/ {0x29, 0, 15, 8, 800}, - /*II_0F_97*/ {0x29, 0, 15, 8, 807}, - /*II_0F_98*/ {0x29, 0, 15, 8, 813}, - /*II_0F_99*/ {0x29, 0, 15, 8, 819}, - /*II_0F_9A*/ {0x29, 0, 15, 8, 826}, - /*II_0F_9B*/ {0x29, 0, 15, 8, 832}, - /*II_0F_9C*/ {0x29, 0, 15, 8, 839}, - /*II_0F_9D*/ {0x29, 0, 15, 8, 845}, - /*II_0F_9E*/ {0x29, 0, 15, 8, 852}, - /*II_0F_9F*/ {0x29, 0, 15, 8, 859}, - /*II_0F_A0*/ {0x2a, 0, 32, 8, 16}, - /*II_0F_A1*/ {0x2b, 0, 32, 8, 22}, - /*II_0F_A2*/ {0x26, 0, 0, 8, 865}, - /*II_0F_A3*/ {0x29, 11, 17, 8, 872}, - /*II_0F_A8*/ {0x2d, 0, 32, 8, 16}, - /*II_0F_A9*/ {0x2e, 0, 32, 8, 22}, - /*II_0F_AA*/ {0x26, 0, 0, 8, 882}, - /*II_0F_AB*/ {0x2f, 11, 17, 8, 887}, - /*II_0F_AF*/ {0x29, 17, 11, 8, 117}, - /*II_0F_B0*/ {0x2f, 9, 15, 8, 898}, - /*II_0F_B1*/ {0x2f, 11, 17, 8, 898}, - /*II_0F_B2*/ {0x30, 37, 11, 8, 907}, - /*II_0F_B3*/ {0x2f, 11, 17, 8, 912}, - /*II_0F_B4*/ {0x30, 37, 11, 8, 917}, - /*II_0F_B5*/ {0x30, 37, 11, 8, 922}, - /*II_0F_B6*/ {0x29, 15, 11, 8, 927}, - /*II_0F_B7*/ {0x31, 16, 11, 8, 927}, - /*II_0F_B9*/ {0x26, 0, 0, 14, 569}, - /*II_0F_BB*/ {0x2f, 11, 17, 8, 934}, - /*II_0F_BE*/ {0x29, 15, 11, 8, 939}, - /*II_0F_BF*/ {0x31, 16, 11, 8, 939}, - /*II_0F_C0*/ {0x2f, 9, 15, 8, 946}, - /*II_0F_C1*/ {0x2f, 11, 17, 8, 946}, - /*II_0F_C3*/ {0x31, 13, 45, 48, 952}, - /*II_0F_C8*/ {0x32, 0, 54, 8, 960}, - /*II_0F_C8*/ {0x32, 0, 54, 8, 960}, - /*II_0F_C8*/ {0x32, 0, 54, 8, 960}, - /*II_0F_C8*/ {0x32, 0, 54, 8, 960}, - /*II_0F_C8*/ {0x32, 0, 54, 8, 960}, - /*II_0F_C8*/ {0x32, 0, 54, 8, 960}, - /*II_0F_C8*/ {0x32, 0, 54, 8, 960}, - /*II_0F_C8*/ {0x32, 0, 54, 8, 960}, - /*II_80_00*/ {0x33, 1, 15, 8, 11}, - /*II_80_01*/ {0x33, 1, 15, 8, 27}, - /*II_80_02*/ {0x33, 1, 15, 8, 31}, - /*II_80_03*/ {0x33, 1, 15, 8, 36}, - /*II_80_04*/ {0x33, 1, 15, 8, 41}, - /*II_80_05*/ {0x33, 1, 15, 8, 51}, - /*II_80_06*/ {0x33, 1, 15, 8, 61}, - /*II_80_07*/ {0x34, 1, 15, 8, 71}, - /*II_81_00*/ {0x33, 3, 17, 8, 11}, - /*II_81_01*/ {0x33, 3, 17, 8, 27}, - /*II_81_02*/ {0x33, 3, 17, 8, 31}, - /*II_81_03*/ {0x33, 3, 17, 8, 36}, - /*II_81_04*/ {0x33, 3, 17, 8, 41}, - /*II_81_05*/ {0x33, 3, 17, 8, 51}, - /*II_81_06*/ {0x33, 3, 17, 8, 61}, - /*II_81_07*/ {0x34, 3, 17, 8, 71}, - /*II_82_00*/ {0x35, 1, 15, 8, 11}, - /*II_82_01*/ {0x35, 1, 15, 8, 27}, - /*II_82_02*/ {0x35, 1, 15, 8, 31}, - /*II_82_03*/ {0x35, 1, 15, 8, 36}, - /*II_82_04*/ {0x35, 1, 15, 8, 41}, - /*II_82_05*/ {0x35, 1, 15, 8, 51}, - /*II_82_06*/ {0x35, 1, 15, 8, 61}, - /*II_82_07*/ {0x36, 1, 15, 8, 71}, - /*II_83_00*/ {0x33, 5, 17, 8, 11}, - /*II_83_01*/ {0x37, 5, 17, 8, 27}, - /*II_83_02*/ {0x33, 5, 17, 8, 31}, - /*II_83_03*/ {0x33, 5, 17, 8, 36}, - /*II_83_04*/ {0x37, 5, 17, 8, 41}, - /*II_83_05*/ {0x33, 5, 17, 8, 51}, - /*II_83_06*/ {0x37, 5, 17, 8, 61}, - /*II_83_07*/ {0x34, 5, 17, 8, 71}, - /*II_8F_00*/ {0x38, 0, 17, 8, 22}, - /*II_C0_00*/ {0x39, 1, 15, 8, 967}, - /*II_C0_01*/ {0x39, 1, 15, 8, 972}, - /*II_C0_02*/ {0x39, 1, 15, 8, 977}, - /*II_C0_03*/ {0x39, 1, 15, 8, 982}, - /*II_C0_04*/ {0x39, 1, 15, 8, 987}, - /*II_C0_05*/ {0x39, 1, 15, 8, 992}, - /*II_C0_06*/ {0x39, 1, 15, 8, 997}, - /*II_C0_07*/ {0x39, 1, 15, 8, 1002}, - /*II_C1_00*/ {0x39, 1, 17, 8, 967}, - /*II_C1_01*/ {0x39, 1, 17, 8, 972}, - /*II_C1_02*/ {0x39, 1, 17, 8, 977}, - /*II_C1_03*/ {0x39, 1, 17, 8, 982}, - /*II_C1_04*/ {0x39, 1, 17, 8, 987}, - /*II_C1_05*/ {0x39, 1, 17, 8, 992}, - /*II_C1_06*/ {0x39, 1, 17, 8, 997}, - /*II_C1_07*/ {0x39, 1, 17, 8, 1002}, - /*II_C6_00*/ {0x39, 1, 15, 8, 218}, - /*II_C7_00*/ {0x39, 3, 17, 8, 218}, - /*II_D0_00*/ {0x39, 51, 15, 8, 967}, - /*II_D0_01*/ {0x39, 51, 15, 8, 972}, - /*II_D0_02*/ {0x39, 51, 15, 8, 977}, - /*II_D0_03*/ {0x39, 51, 15, 8, 982}, - /*II_D0_04*/ {0x39, 51, 15, 8, 987}, - /*II_D0_05*/ {0x39, 51, 15, 8, 992}, - /*II_D0_06*/ {0x39, 51, 15, 8, 997}, - /*II_D0_07*/ {0x39, 51, 15, 8, 1002}, - /*II_D1_00*/ {0x39, 51, 17, 8, 967}, - /*II_D1_01*/ {0x39, 51, 17, 8, 972}, - /*II_D1_02*/ {0x39, 51, 17, 8, 977}, - /*II_D1_03*/ {0x39, 51, 17, 8, 982}, - /*II_D1_04*/ {0x39, 51, 17, 8, 987}, - /*II_D1_05*/ {0x39, 51, 17, 8, 992}, - /*II_D1_06*/ {0x39, 51, 17, 8, 997}, - /*II_D1_07*/ {0x39, 51, 17, 8, 1002}, - /*II_D2_00*/ {0x39, 52, 15, 8, 967}, - /*II_D2_01*/ {0x39, 52, 15, 8, 972}, - /*II_D2_02*/ {0x39, 52, 15, 8, 977}, - /*II_D2_03*/ {0x39, 52, 15, 8, 982}, - /*II_D2_04*/ {0x39, 52, 15, 8, 987}, - /*II_D2_05*/ {0x39, 52, 15, 8, 992}, - /*II_D2_06*/ {0x39, 52, 15, 8, 997}, - /*II_D2_07*/ {0x39, 52, 15, 8, 1002}, - /*II_D3_00*/ {0x39, 52, 17, 8, 967}, - /*II_D3_01*/ {0x39, 52, 17, 8, 972}, - /*II_D3_02*/ {0x39, 52, 17, 8, 977}, - /*II_D3_03*/ {0x39, 52, 17, 8, 982}, - /*II_D3_04*/ {0x39, 52, 17, 8, 987}, - /*II_D3_05*/ {0x39, 52, 17, 8, 992}, - /*II_D3_06*/ {0x39, 52, 17, 8, 997}, - /*II_D3_07*/ {0x39, 52, 17, 8, 1002}, - /*II_D8_00*/ {0x34, 0, 21, 16, 1007}, - /*II_D8_01*/ {0x34, 0, 21, 16, 1013}, - /*II_D8_02*/ {0x34, 0, 21, 16, 1019}, - /*II_D8_03*/ {0x34, 0, 21, 16, 1025}, - /*II_D8_04*/ {0x34, 0, 21, 16, 1032}, - /*II_D8_05*/ {0x34, 0, 21, 16, 1038}, - /*II_D8_06*/ {0x34, 0, 21, 16, 1045}, - /*II_D8_07*/ {0x34, 0, 21, 16, 1051}, - /*II_D8_C0*/ {0x3a, 0, 62, 16, 1007}, - /*II_D8_C0*/ {0x3a, 0, 62, 16, 1007}, - /*II_D8_C0*/ {0x3a, 0, 62, 16, 1007}, - /*II_D8_C0*/ {0x3a, 0, 62, 16, 1007}, - /*II_D8_C0*/ {0x3a, 0, 62, 16, 1007}, - /*II_D8_C0*/ {0x3a, 0, 62, 16, 1007}, - /*II_D8_C0*/ {0x3a, 0, 62, 16, 1007}, - /*II_D8_C0*/ {0x3a, 0, 62, 16, 1007}, - /*II_D8_C8*/ {0x3a, 0, 62, 16, 1013}, - /*II_D8_C8*/ {0x3a, 0, 62, 16, 1013}, - /*II_D8_C8*/ {0x3a, 0, 62, 16, 1013}, - /*II_D8_C8*/ {0x3a, 0, 62, 16, 1013}, - /*II_D8_C8*/ {0x3a, 0, 62, 16, 1013}, - /*II_D8_C8*/ {0x3a, 0, 62, 16, 1013}, - /*II_D8_C8*/ {0x3a, 0, 62, 16, 1013}, - /*II_D8_C8*/ {0x3a, 0, 62, 16, 1013}, - /*II_D8_D0*/ {0x3a, 0, 61, 16, 1019}, - /*II_D8_D0*/ {0x3a, 0, 61, 16, 1019}, - /*II_D8_D0*/ {0x3a, 0, 61, 16, 1019}, - /*II_D8_D0*/ {0x3a, 0, 61, 16, 1019}, - /*II_D8_D0*/ {0x3a, 0, 61, 16, 1019}, - /*II_D8_D0*/ {0x3a, 0, 61, 16, 1019}, - /*II_D8_D0*/ {0x3a, 0, 61, 16, 1019}, - /*II_D8_D0*/ {0x3a, 0, 61, 16, 1019}, - /*II_D8_D8*/ {0x3a, 0, 61, 16, 1025}, - /*II_D8_D9*/ {0x3a, 0, 0, 16, 1025}, - /*II_D8_D8*/ {0x3a, 0, 61, 16, 1025}, - /*II_D8_D8*/ {0x3a, 0, 61, 16, 1025}, - /*II_D8_D8*/ {0x3a, 0, 61, 16, 1025}, - /*II_D8_D8*/ {0x3a, 0, 61, 16, 1025}, - /*II_D8_D8*/ {0x3a, 0, 61, 16, 1025}, - /*II_D8_D8*/ {0x3a, 0, 61, 16, 1025}, - /*II_D8_E0*/ {0x3a, 0, 62, 16, 1032}, - /*II_D8_E0*/ {0x3a, 0, 62, 16, 1032}, - /*II_D8_E0*/ {0x3a, 0, 62, 16, 1032}, - /*II_D8_E0*/ {0x3a, 0, 62, 16, 1032}, - /*II_D8_E0*/ {0x3a, 0, 62, 16, 1032}, - /*II_D8_E0*/ {0x3a, 0, 62, 16, 1032}, - /*II_D8_E0*/ {0x3a, 0, 62, 16, 1032}, - /*II_D8_E0*/ {0x3a, 0, 62, 16, 1032}, - /*II_D8_E8*/ {0x3a, 0, 62, 16, 1038}, - /*II_D8_E8*/ {0x3a, 0, 62, 16, 1038}, - /*II_D8_E8*/ {0x3a, 0, 62, 16, 1038}, - /*II_D8_E8*/ {0x3a, 0, 62, 16, 1038}, - /*II_D8_E8*/ {0x3a, 0, 62, 16, 1038}, - /*II_D8_E8*/ {0x3a, 0, 62, 16, 1038}, - /*II_D8_E8*/ {0x3a, 0, 62, 16, 1038}, - /*II_D8_E8*/ {0x3a, 0, 62, 16, 1038}, - /*II_D8_F0*/ {0x3a, 0, 62, 16, 1045}, - /*II_D8_F0*/ {0x3a, 0, 62, 16, 1045}, - /*II_D8_F0*/ {0x3a, 0, 62, 16, 1045}, - /*II_D8_F0*/ {0x3a, 0, 62, 16, 1045}, - /*II_D8_F0*/ {0x3a, 0, 62, 16, 1045}, - /*II_D8_F0*/ {0x3a, 0, 62, 16, 1045}, - /*II_D8_F0*/ {0x3a, 0, 62, 16, 1045}, - /*II_D8_F0*/ {0x3a, 0, 62, 16, 1045}, - /*II_D8_F8*/ {0x3a, 0, 62, 16, 1051}, - /*II_D8_F8*/ {0x3a, 0, 62, 16, 1051}, - /*II_D8_F8*/ {0x3a, 0, 62, 16, 1051}, - /*II_D8_F8*/ {0x3a, 0, 62, 16, 1051}, - /*II_D8_F8*/ {0x3a, 0, 62, 16, 1051}, - /*II_D8_F8*/ {0x3a, 0, 62, 16, 1051}, - /*II_D8_F8*/ {0x3a, 0, 62, 16, 1051}, - /*II_D8_F8*/ {0x3a, 0, 62, 16, 1051}, - /*II_D9_00*/ {0x34, 0, 21, 16, 1058}, - /*II_D9_02*/ {0x34, 0, 21, 16, 1063}, - /*II_D9_03*/ {0x34, 0, 21, 16, 1068}, - /*II_D9_04*/ {0x34, 0, 42, 16, 1074}, - /*II_D9_05*/ {0x34, 0, 42, 16, 1082}, - /*II_D9_C0*/ {0x3a, 0, 61, 16, 1058}, - /*II_D9_C0*/ {0x3a, 0, 61, 16, 1058}, - /*II_D9_C0*/ {0x3a, 0, 61, 16, 1058}, - /*II_D9_C0*/ {0x3a, 0, 61, 16, 1058}, - /*II_D9_C0*/ {0x3a, 0, 61, 16, 1058}, - /*II_D9_C0*/ {0x3a, 0, 61, 16, 1058}, - /*II_D9_C0*/ {0x3a, 0, 61, 16, 1058}, - /*II_D9_C0*/ {0x3a, 0, 61, 16, 1058}, - /*II_D9_C8*/ {0x3a, 0, 61, 16, 1089}, - /*II_D9_C9*/ {0x3a, 0, 0, 16, 1089}, - /*II_D9_C8*/ {0x3a, 0, 61, 16, 1089}, - /*II_D9_C8*/ {0x3a, 0, 61, 16, 1089}, - /*II_D9_C8*/ {0x3a, 0, 61, 16, 1089}, - /*II_D9_C8*/ {0x3a, 0, 61, 16, 1089}, - /*II_D9_C8*/ {0x3a, 0, 61, 16, 1089}, - /*II_D9_C8*/ {0x3a, 0, 61, 16, 1089}, - /*II_D9_D0*/ {0x3a, 0, 0, 16, 1095}, - /*II_D9_E0*/ {0x3a, 0, 0, 16, 1101}, - /*II_D9_E1*/ {0x3a, 0, 0, 16, 1107}, - /*II_D9_E4*/ {0x3a, 0, 0, 16, 1113}, - /*II_D9_E5*/ {0x3a, 0, 0, 16, 1119}, - /*II_D9_E8*/ {0x3a, 0, 0, 16, 1125}, - /*II_D9_E9*/ {0x3a, 0, 0, 16, 1131}, - /*II_D9_EA*/ {0x3a, 0, 0, 16, 1139}, - /*II_D9_EB*/ {0x3a, 0, 0, 16, 1147}, - /*II_D9_EC*/ {0x3a, 0, 0, 16, 1154}, - /*II_D9_ED*/ {0x3a, 0, 0, 16, 1162}, - /*II_D9_EE*/ {0x3a, 0, 0, 16, 1170}, - /*II_D9_F0*/ {0x3a, 0, 0, 16, 1176}, - /*II_D9_F1*/ {0x3a, 0, 0, 16, 1183}, - /*II_D9_F2*/ {0x3a, 0, 0, 16, 1190}, - /*II_D9_F3*/ {0x3a, 0, 0, 16, 1197}, - /*II_D9_F4*/ {0x3a, 0, 0, 16, 1205}, - /*II_D9_F5*/ {0x3a, 0, 0, 16, 1214}, - /*II_D9_F6*/ {0x3a, 0, 0, 16, 1222}, - /*II_D9_F7*/ {0x3a, 0, 0, 16, 1231}, - /*II_D9_F8*/ {0x3a, 0, 0, 16, 1240}, - /*II_D9_F9*/ {0x3a, 0, 0, 16, 1247}, - /*II_D9_FA*/ {0x3a, 0, 0, 16, 1256}, - /*II_D9_FB*/ {0x3a, 0, 0, 16, 1263}, - /*II_D9_FC*/ {0x3a, 0, 0, 16, 1272}, - /*II_D9_FD*/ {0x3a, 0, 0, 16, 1281}, - /*II_D9_FE*/ {0x3a, 0, 0, 16, 1289}, - /*II_D9_FF*/ {0x3a, 0, 0, 16, 1295}, - /*II_DA_00*/ {0x34, 0, 21, 16, 1301}, - /*II_DA_01*/ {0x34, 0, 21, 16, 1308}, - /*II_DA_02*/ {0x34, 0, 21, 16, 1315}, - /*II_DA_03*/ {0x34, 0, 21, 16, 1322}, - /*II_DA_04*/ {0x34, 0, 21, 16, 1330}, - /*II_DA_05*/ {0x34, 0, 21, 16, 1337}, - /*II_DA_06*/ {0x34, 0, 21, 16, 1345}, - /*II_DA_07*/ {0x34, 0, 21, 16, 1352}, - /*II_DA_C0*/ {0x3b, 0, 62, 24, 1360}, - /*II_DA_C0*/ {0x3b, 0, 62, 24, 1360}, - /*II_DA_C0*/ {0x3b, 0, 62, 24, 1360}, - /*II_DA_C0*/ {0x3b, 0, 62, 24, 1360}, - /*II_DA_C0*/ {0x3b, 0, 62, 24, 1360}, - /*II_DA_C0*/ {0x3b, 0, 62, 24, 1360}, - /*II_DA_C0*/ {0x3b, 0, 62, 24, 1360}, - /*II_DA_C0*/ {0x3b, 0, 62, 24, 1360}, - /*II_DA_C8*/ {0x3b, 0, 62, 24, 1368}, - /*II_DA_C8*/ {0x3b, 0, 62, 24, 1368}, - /*II_DA_C8*/ {0x3b, 0, 62, 24, 1368}, - /*II_DA_C8*/ {0x3b, 0, 62, 24, 1368}, - /*II_DA_C8*/ {0x3b, 0, 62, 24, 1368}, - /*II_DA_C8*/ {0x3b, 0, 62, 24, 1368}, - /*II_DA_C8*/ {0x3b, 0, 62, 24, 1368}, - /*II_DA_C8*/ {0x3b, 0, 62, 24, 1368}, - /*II_DA_D0*/ {0x3b, 0, 62, 24, 1376}, - /*II_DA_D0*/ {0x3b, 0, 62, 24, 1376}, - /*II_DA_D0*/ {0x3b, 0, 62, 24, 1376}, - /*II_DA_D0*/ {0x3b, 0, 62, 24, 1376}, - /*II_DA_D0*/ {0x3b, 0, 62, 24, 1376}, - /*II_DA_D0*/ {0x3b, 0, 62, 24, 1376}, - /*II_DA_D0*/ {0x3b, 0, 62, 24, 1376}, - /*II_DA_D0*/ {0x3b, 0, 62, 24, 1376}, - /*II_DA_D8*/ {0x3b, 0, 62, 24, 1385}, - /*II_DA_D8*/ {0x3b, 0, 62, 24, 1385}, - /*II_DA_D8*/ {0x3b, 0, 62, 24, 1385}, - /*II_DA_D8*/ {0x3b, 0, 62, 24, 1385}, - /*II_DA_D8*/ {0x3b, 0, 62, 24, 1385}, - /*II_DA_D8*/ {0x3b, 0, 62, 24, 1385}, - /*II_DA_D8*/ {0x3b, 0, 62, 24, 1385}, - /*II_DA_D8*/ {0x3b, 0, 62, 24, 1385}, - /*II_DA_E9*/ {0x3a, 0, 0, 16, 1393}, - /*II_DB_00*/ {0x34, 0, 21, 16, 1402}, - /*II_DB_01*/ {0x3c, 0, 21, 56, 1408}, - /*II_DB_02*/ {0x34, 0, 21, 16, 1416}, - /*II_DB_03*/ {0x34, 0, 21, 16, 1422}, - /*II_DB_05*/ {0x34, 0, 23, 16, 1058}, - /*II_DB_07*/ {0x34, 0, 23, 16, 1068}, - /*II_DB_C0*/ {0x3b, 0, 62, 24, 1429}, - /*II_DB_C0*/ {0x3b, 0, 62, 24, 1429}, - /*II_DB_C0*/ {0x3b, 0, 62, 24, 1429}, - /*II_DB_C0*/ {0x3b, 0, 62, 24, 1429}, - /*II_DB_C0*/ {0x3b, 0, 62, 24, 1429}, - /*II_DB_C0*/ {0x3b, 0, 62, 24, 1429}, - /*II_DB_C0*/ {0x3b, 0, 62, 24, 1429}, - /*II_DB_C0*/ {0x3b, 0, 62, 24, 1429}, - /*II_DB_C8*/ {0x3b, 0, 62, 24, 1438}, - /*II_DB_C8*/ {0x3b, 0, 62, 24, 1438}, - /*II_DB_C8*/ {0x3b, 0, 62, 24, 1438}, - /*II_DB_C8*/ {0x3b, 0, 62, 24, 1438}, - /*II_DB_C8*/ {0x3b, 0, 62, 24, 1438}, - /*II_DB_C8*/ {0x3b, 0, 62, 24, 1438}, - /*II_DB_C8*/ {0x3b, 0, 62, 24, 1438}, - /*II_DB_C8*/ {0x3b, 0, 62, 24, 1438}, - /*II_DB_D0*/ {0x3b, 0, 62, 24, 1447}, - /*II_DB_D0*/ {0x3b, 0, 62, 24, 1447}, - /*II_DB_D0*/ {0x3b, 0, 62, 24, 1447}, - /*II_DB_D0*/ {0x3b, 0, 62, 24, 1447}, - /*II_DB_D0*/ {0x3b, 0, 62, 24, 1447}, - /*II_DB_D0*/ {0x3b, 0, 62, 24, 1447}, - /*II_DB_D0*/ {0x3b, 0, 62, 24, 1447}, - /*II_DB_D0*/ {0x3b, 0, 62, 24, 1447}, - /*II_DB_D8*/ {0x3b, 0, 62, 24, 1457}, - /*II_DB_D8*/ {0x3b, 0, 62, 24, 1457}, - /*II_DB_D8*/ {0x3b, 0, 62, 24, 1457}, - /*II_DB_D8*/ {0x3b, 0, 62, 24, 1457}, - /*II_DB_D8*/ {0x3b, 0, 62, 24, 1457}, - /*II_DB_D8*/ {0x3b, 0, 62, 24, 1457}, - /*II_DB_D8*/ {0x3b, 0, 62, 24, 1457}, - /*II_DB_D8*/ {0x3b, 0, 62, 24, 1457}, - /*II_DB_E0*/ {0x3a, 0, 0, 16, 1466}, - /*II_DB_E1*/ {0x3a, 0, 0, 16, 1472}, - /*II_DB_E4*/ {0x3a, 0, 0, 16, 1480}, - /*II_DB_E8*/ {0x3b, 0, 62, 16, 1488}, - /*II_DB_E8*/ {0x3b, 0, 62, 16, 1488}, - /*II_DB_E8*/ {0x3b, 0, 62, 16, 1488}, - /*II_DB_E8*/ {0x3b, 0, 62, 16, 1488}, - /*II_DB_E8*/ {0x3b, 0, 62, 16, 1488}, - /*II_DB_E8*/ {0x3b, 0, 62, 16, 1488}, - /*II_DB_E8*/ {0x3b, 0, 62, 16, 1488}, - /*II_DB_E8*/ {0x3b, 0, 62, 16, 1488}, - /*II_DB_F0*/ {0x3b, 0, 62, 24, 1496}, - /*II_DB_F0*/ {0x3b, 0, 62, 24, 1496}, - /*II_DB_F0*/ {0x3b, 0, 62, 24, 1496}, - /*II_DB_F0*/ {0x3b, 0, 62, 24, 1496}, - /*II_DB_F0*/ {0x3b, 0, 62, 24, 1496}, - /*II_DB_F0*/ {0x3b, 0, 62, 24, 1496}, - /*II_DB_F0*/ {0x3b, 0, 62, 24, 1496}, - /*II_DB_F0*/ {0x3b, 0, 62, 24, 1496}, - /*II_DC_00*/ {0x34, 0, 22, 16, 1007}, - /*II_DC_01*/ {0x34, 0, 22, 16, 1013}, - /*II_DC_02*/ {0x34, 0, 22, 16, 1019}, - /*II_DC_03*/ {0x34, 0, 22, 16, 1025}, - /*II_DC_04*/ {0x34, 0, 22, 16, 1032}, - /*II_DC_05*/ {0x34, 0, 22, 16, 1038}, - /*II_DC_06*/ {0x34, 0, 22, 16, 1045}, - /*II_DC_07*/ {0x34, 0, 22, 16, 1051}, - /*II_DC_C0*/ {0x3a, 0, 63, 16, 1007}, - /*II_DC_C0*/ {0x3a, 0, 63, 16, 1007}, - /*II_DC_C0*/ {0x3a, 0, 63, 16, 1007}, - /*II_DC_C0*/ {0x3a, 0, 63, 16, 1007}, - /*II_DC_C0*/ {0x3a, 0, 63, 16, 1007}, - /*II_DC_C0*/ {0x3a, 0, 63, 16, 1007}, - /*II_DC_C0*/ {0x3a, 0, 63, 16, 1007}, - /*II_DC_C0*/ {0x3a, 0, 63, 16, 1007}, - /*II_DC_C8*/ {0x3a, 0, 63, 16, 1013}, - /*II_DC_C8*/ {0x3a, 0, 63, 16, 1013}, - /*II_DC_C8*/ {0x3a, 0, 63, 16, 1013}, - /*II_DC_C8*/ {0x3a, 0, 63, 16, 1013}, - /*II_DC_C8*/ {0x3a, 0, 63, 16, 1013}, - /*II_DC_C8*/ {0x3a, 0, 63, 16, 1013}, - /*II_DC_C8*/ {0x3a, 0, 63, 16, 1013}, - /*II_DC_C8*/ {0x3a, 0, 63, 16, 1013}, - /*II_DC_E0*/ {0x3a, 0, 63, 16, 1038}, - /*II_DC_E0*/ {0x3a, 0, 63, 16, 1038}, - /*II_DC_E0*/ {0x3a, 0, 63, 16, 1038}, - /*II_DC_E0*/ {0x3a, 0, 63, 16, 1038}, - /*II_DC_E0*/ {0x3a, 0, 63, 16, 1038}, - /*II_DC_E0*/ {0x3a, 0, 63, 16, 1038}, - /*II_DC_E0*/ {0x3a, 0, 63, 16, 1038}, - /*II_DC_E0*/ {0x3a, 0, 63, 16, 1038}, - /*II_DC_E8*/ {0x3a, 0, 63, 16, 1032}, - /*II_DC_E8*/ {0x3a, 0, 63, 16, 1032}, - /*II_DC_E8*/ {0x3a, 0, 63, 16, 1032}, - /*II_DC_E8*/ {0x3a, 0, 63, 16, 1032}, - /*II_DC_E8*/ {0x3a, 0, 63, 16, 1032}, - /*II_DC_E8*/ {0x3a, 0, 63, 16, 1032}, - /*II_DC_E8*/ {0x3a, 0, 63, 16, 1032}, - /*II_DC_E8*/ {0x3a, 0, 63, 16, 1032}, - /*II_DC_F0*/ {0x3a, 0, 63, 16, 1051}, - /*II_DC_F0*/ {0x3a, 0, 63, 16, 1051}, - /*II_DC_F0*/ {0x3a, 0, 63, 16, 1051}, - /*II_DC_F0*/ {0x3a, 0, 63, 16, 1051}, - /*II_DC_F0*/ {0x3a, 0, 63, 16, 1051}, - /*II_DC_F0*/ {0x3a, 0, 63, 16, 1051}, - /*II_DC_F0*/ {0x3a, 0, 63, 16, 1051}, - /*II_DC_F0*/ {0x3a, 0, 63, 16, 1051}, - /*II_DC_F8*/ {0x3a, 0, 63, 16, 1045}, - /*II_DC_F8*/ {0x3a, 0, 63, 16, 1045}, - /*II_DC_F8*/ {0x3a, 0, 63, 16, 1045}, - /*II_DC_F8*/ {0x3a, 0, 63, 16, 1045}, - /*II_DC_F8*/ {0x3a, 0, 63, 16, 1045}, - /*II_DC_F8*/ {0x3a, 0, 63, 16, 1045}, - /*II_DC_F8*/ {0x3a, 0, 63, 16, 1045}, - /*II_DC_F8*/ {0x3a, 0, 63, 16, 1045}, - /*II_DD_00*/ {0x34, 0, 22, 16, 1058}, - /*II_DD_01*/ {0x3c, 0, 22, 56, 1408}, - /*II_DD_02*/ {0x34, 0, 22, 16, 1063}, - /*II_DD_03*/ {0x34, 0, 22, 16, 1068}, - /*II_DD_04*/ {0x34, 0, 42, 16, 1503}, - /*II_DD_C0*/ {0x3a, 0, 61, 16, 1511}, - /*II_DD_C0*/ {0x3a, 0, 61, 16, 1511}, - /*II_DD_C0*/ {0x3a, 0, 61, 16, 1511}, - /*II_DD_C0*/ {0x3a, 0, 61, 16, 1511}, - /*II_DD_C0*/ {0x3a, 0, 61, 16, 1511}, - /*II_DD_C0*/ {0x3a, 0, 61, 16, 1511}, - /*II_DD_C0*/ {0x3a, 0, 61, 16, 1511}, - /*II_DD_C0*/ {0x3a, 0, 61, 16, 1511}, - /*II_DD_D0*/ {0x3a, 0, 61, 16, 1063}, - /*II_DD_D0*/ {0x3a, 0, 61, 16, 1063}, - /*II_DD_D0*/ {0x3a, 0, 61, 16, 1063}, - /*II_DD_D0*/ {0x3a, 0, 61, 16, 1063}, - /*II_DD_D0*/ {0x3a, 0, 61, 16, 1063}, - /*II_DD_D0*/ {0x3a, 0, 61, 16, 1063}, - /*II_DD_D0*/ {0x3a, 0, 61, 16, 1063}, - /*II_DD_D0*/ {0x3a, 0, 61, 16, 1063}, - /*II_DD_D8*/ {0x3a, 0, 61, 16, 1068}, - /*II_DD_D8*/ {0x3a, 0, 61, 16, 1068}, - /*II_DD_D8*/ {0x3a, 0, 61, 16, 1068}, - /*II_DD_D8*/ {0x3a, 0, 61, 16, 1068}, - /*II_DD_D8*/ {0x3a, 0, 61, 16, 1068}, - /*II_DD_D8*/ {0x3a, 0, 61, 16, 1068}, - /*II_DD_D8*/ {0x3a, 0, 61, 16, 1068}, - /*II_DD_D8*/ {0x3a, 0, 61, 16, 1068}, - /*II_DD_E0*/ {0x3a, 0, 63, 16, 1518}, - /*II_DD_E1*/ {0x3a, 0, 0, 16, 1518}, - /*II_DD_E0*/ {0x3a, 0, 63, 16, 1518}, - /*II_DD_E0*/ {0x3a, 0, 63, 16, 1518}, - /*II_DD_E0*/ {0x3a, 0, 63, 16, 1518}, - /*II_DD_E0*/ {0x3a, 0, 63, 16, 1518}, - /*II_DD_E0*/ {0x3a, 0, 63, 16, 1518}, - /*II_DD_E0*/ {0x3a, 0, 63, 16, 1518}, - /*II_DD_E8*/ {0x3a, 0, 61, 16, 1525}, - /*II_DD_E9*/ {0x3a, 0, 0, 16, 1525}, - /*II_DD_E8*/ {0x3a, 0, 61, 16, 1525}, - /*II_DD_E8*/ {0x3a, 0, 61, 16, 1525}, - /*II_DD_E8*/ {0x3a, 0, 61, 16, 1525}, - /*II_DD_E8*/ {0x3a, 0, 61, 16, 1525}, - /*II_DD_E8*/ {0x3a, 0, 61, 16, 1525}, - /*II_DD_E8*/ {0x3a, 0, 61, 16, 1525}, - /*II_DE_00*/ {0x34, 0, 20, 16, 1301}, - /*II_DE_01*/ {0x34, 0, 20, 16, 1308}, - /*II_DE_02*/ {0x34, 0, 20, 16, 1315}, - /*II_DE_03*/ {0x34, 0, 20, 16, 1322}, - /*II_DE_04*/ {0x34, 0, 20, 16, 1330}, - /*II_DE_05*/ {0x34, 0, 20, 16, 1337}, - /*II_DE_06*/ {0x34, 0, 20, 16, 1345}, - /*II_DE_07*/ {0x34, 0, 20, 16, 1352}, - /*II_DE_C0*/ {0x3a, 0, 63, 16, 1533}, - /*II_DE_C1*/ {0x3a, 0, 0, 16, 1533}, - /*II_DE_C0*/ {0x3a, 0, 63, 16, 1533}, - /*II_DE_C0*/ {0x3a, 0, 63, 16, 1533}, - /*II_DE_C0*/ {0x3a, 0, 63, 16, 1533}, - /*II_DE_C0*/ {0x3a, 0, 63, 16, 1533}, - /*II_DE_C0*/ {0x3a, 0, 63, 16, 1533}, - /*II_DE_C0*/ {0x3a, 0, 63, 16, 1533}, - /*II_DE_C8*/ {0x3a, 0, 63, 16, 1540}, - /*II_DE_C9*/ {0x3a, 0, 0, 16, 1540}, - /*II_DE_C8*/ {0x3a, 0, 63, 16, 1540}, - /*II_DE_C8*/ {0x3a, 0, 63, 16, 1540}, - /*II_DE_C8*/ {0x3a, 0, 63, 16, 1540}, - /*II_DE_C8*/ {0x3a, 0, 63, 16, 1540}, - /*II_DE_C8*/ {0x3a, 0, 63, 16, 1540}, - /*II_DE_C8*/ {0x3a, 0, 63, 16, 1540}, - /*II_DE_D9*/ {0x3a, 0, 0, 16, 1547}, - /*II_DE_E0*/ {0x3a, 0, 63, 16, 1555}, - /*II_DE_E1*/ {0x3a, 0, 0, 16, 1555}, - /*II_DE_E0*/ {0x3a, 0, 63, 16, 1555}, - /*II_DE_E0*/ {0x3a, 0, 63, 16, 1555}, - /*II_DE_E0*/ {0x3a, 0, 63, 16, 1555}, - /*II_DE_E0*/ {0x3a, 0, 63, 16, 1555}, - /*II_DE_E0*/ {0x3a, 0, 63, 16, 1555}, - /*II_DE_E0*/ {0x3a, 0, 63, 16, 1555}, - /*II_DE_E8*/ {0x3a, 0, 63, 16, 1563}, - /*II_DE_E9*/ {0x3a, 0, 0, 16, 1563}, - /*II_DE_E8*/ {0x3a, 0, 63, 16, 1563}, - /*II_DE_E8*/ {0x3a, 0, 63, 16, 1563}, - /*II_DE_E8*/ {0x3a, 0, 63, 16, 1563}, - /*II_DE_E8*/ {0x3a, 0, 63, 16, 1563}, - /*II_DE_E8*/ {0x3a, 0, 63, 16, 1563}, - /*II_DE_E8*/ {0x3a, 0, 63, 16, 1563}, - /*II_DE_F0*/ {0x3a, 0, 63, 16, 1570}, - /*II_DE_F1*/ {0x3a, 0, 0, 16, 1570}, - /*II_DE_F0*/ {0x3a, 0, 63, 16, 1570}, - /*II_DE_F0*/ {0x3a, 0, 63, 16, 1570}, - /*II_DE_F0*/ {0x3a, 0, 63, 16, 1570}, - /*II_DE_F0*/ {0x3a, 0, 63, 16, 1570}, - /*II_DE_F0*/ {0x3a, 0, 63, 16, 1570}, - /*II_DE_F0*/ {0x3a, 0, 63, 16, 1570}, - /*II_DE_F8*/ {0x3a, 0, 63, 16, 1578}, - /*II_DE_F9*/ {0x3a, 0, 0, 16, 1578}, - /*II_DE_F8*/ {0x3a, 0, 63, 16, 1578}, - /*II_DE_F8*/ {0x3a, 0, 63, 16, 1578}, - /*II_DE_F8*/ {0x3a, 0, 63, 16, 1578}, - /*II_DE_F8*/ {0x3a, 0, 63, 16, 1578}, - /*II_DE_F8*/ {0x3a, 0, 63, 16, 1578}, - /*II_DE_F8*/ {0x3a, 0, 63, 16, 1578}, - /*II_DF_00*/ {0x34, 0, 20, 16, 1402}, - /*II_DF_01*/ {0x3c, 0, 20, 56, 1408}, - /*II_DF_02*/ {0x34, 0, 20, 16, 1416}, - /*II_DF_03*/ {0x34, 0, 20, 16, 1422}, - /*II_DF_04*/ {0x34, 0, 23, 16, 1585}, - /*II_DF_05*/ {0x34, 0, 22, 16, 1402}, - /*II_DF_06*/ {0x34, 0, 23, 16, 1591}, - /*II_DF_07*/ {0x34, 0, 22, 16, 1422}, - /*II_DF_E8*/ {0x3b, 0, 62, 16, 1598}, - /*II_DF_E8*/ {0x3b, 0, 62, 16, 1598}, - /*II_DF_E8*/ {0x3b, 0, 62, 16, 1598}, - /*II_DF_E8*/ {0x3b, 0, 62, 16, 1598}, - /*II_DF_E8*/ {0x3b, 0, 62, 16, 1598}, - /*II_DF_E8*/ {0x3b, 0, 62, 16, 1598}, - /*II_DF_E8*/ {0x3b, 0, 62, 16, 1598}, - /*II_DF_E8*/ {0x3b, 0, 62, 16, 1598}, - /*II_DF_F0*/ {0x3b, 0, 62, 16, 1607}, - /*II_DF_F0*/ {0x3b, 0, 62, 16, 1607}, - /*II_DF_F0*/ {0x3b, 0, 62, 16, 1607}, - /*II_DF_F0*/ {0x3b, 0, 62, 16, 1607}, - /*II_DF_F0*/ {0x3b, 0, 62, 16, 1607}, - /*II_DF_F0*/ {0x3b, 0, 62, 16, 1607}, - /*II_DF_F0*/ {0x3b, 0, 62, 16, 1607}, - /*II_DF_F0*/ {0x3b, 0, 62, 16, 1607}, - /*II_F6_00*/ {0x34, 1, 15, 8, 206}, - /*II_F6_02*/ {0x33, 0, 15, 8, 1615}, - /*II_F6_03*/ {0x33, 0, 15, 8, 1620}, - /*II_F6_04*/ {0x39, 0, 15, 8, 1625}, - /*II_F6_05*/ {0x39, 0, 15, 8, 117}, - /*II_F6_06*/ {0x39, 0, 15, 8, 1630}, - /*II_F6_07*/ {0x39, 0, 15, 8, 1635}, - /*II_F7_00*/ {0x34, 3, 17, 8, 206}, - /*II_F7_02*/ {0x33, 0, 17, 8, 1615}, - /*II_F7_03*/ {0x33, 0, 17, 8, 1620}, - /*II_F7_04*/ {0x39, 0, 17, 8, 1625}, - /*II_F7_05*/ {0x39, 0, 17, 8, 117}, - /*II_F7_06*/ {0x39, 0, 17, 8, 1630}, - /*II_F7_07*/ {0x39, 0, 17, 8, 1635}, - /*II_FE_00*/ {0x33, 0, 15, 8, 81}, - /*II_FE_01*/ {0x33, 0, 15, 8, 86}, - /*II_FF_00*/ {0x33, 0, 17, 8, 81}, - /*II_FF_01*/ {0x33, 0, 17, 8, 86}, - /*II_FF_02*/ {0x3d, 0, 17, 9, 456}, - /*II_FF_03*/ {0x3e, 0, 37, 9, 260}, - /*II_FF_04*/ {0x3d, 0, 17, 12, 462}, - /*II_FF_05*/ {0x3e, 0, 37, 12, 467}, - /*II_FF_06*/ {0x3d, 0, 17, 8, 16}, - /*II_0F_00_00*/ {0x34, 0, 17, 8, 1641}, - /*II_0F_00_01*/ {0x34, 0, 16, 8, 1647}, - /*II_0F_00_02*/ {0x34, 0, 16, 8, 1652}, - /*II_0F_00_03*/ {0x3c, 0, 16, 8, 1658}, - /*II_0F_00_04*/ {0x34, 0, 16, 8, 1663}, - /*II_0F_00_05*/ {0x34, 0, 16, 8, 1669}, - /*II_0F_01_00*/ {0x3d, 0, 39, 8, 1675}, - /*II_0F_01_01*/ {0x3d, 0, 39, 8, 1681}, - /*II_0F_01_02*/ {0x3d, 0, 39, 8, 1687}, - /*II_0F_01_03*/ {0x3d, 0, 39, 8, 1693}, - /*II_0F_01_04*/ {0x3f, 0, 28, 8, 1699}, - /*II_0F_01_06*/ {0x40, 0, 16, 8, 1705}, - /*II_0F_01_07*/ {0x3c, 0, 42, 8, 1711}, - /*II_0F_01_C1*/ {0x3b, 0, 0, 112, 1719}, - /*II_0F_01_C2*/ {0x3b, 0, 0, 112, 1727}, - /*II_0F_01_C3*/ {0x3b, 0, 0, 112, 1737}, - /*II_0F_01_C4*/ {0x3b, 0, 0, 112, 1747}, - /*II_0F_01_C8*/ {0x3b, 0, 0, 8, 1755}, - /*II_0F_01_C9*/ {0x3b, 0, 0, 8, 1764}, - /*II_0F_01_D0*/ {0x26, 0, 0, 8, 1771}, - /*II_0F_01_D1*/ {0x26, 0, 0, 8, 1779}, - /*II_0F_01_D4*/ {0x3b, 0, 0, 112, 1787}, - /*II_0F_01_D8*/ {0x3c, 0, 58, 120, 1795}, - /*II_0F_01_D9*/ {0x3b, 0, 0, 120, 1802}, - /*II_0F_01_DA*/ {0x3b, 0, 58, 120, 1811}, - /*II_0F_01_DB*/ {0x3b, 0, 58, 120, 1819}, - /*II_0F_01_DC*/ {0x3b, 0, 0, 120, 1827}, - /*II_0F_01_DD*/ {0x3b, 0, 0, 120, 1833}, - /*II_0F_01_DE*/ {0x3b, 0, 58, 120, 1839}, - /*II_0F_01_DF*/ {0x3b, 60, 58, 120, 1847}, - /*II_0F_01_F8*/ {0x41, 0, 0, 8, 1856}, - /*II_0F_01_F9*/ {0x41, 0, 0, 8, 1864}, - /*II_0F_0D_00*/ {0x3c, 0, 42, 96, 1872}, - /*II_0F_0D_01*/ {0x3c, 0, 42, 96, 1882}, - /*II_0F_0F_0C*/ {0x42, 67, 64, 104, 1893}, - /*II_0F_0F_0D*/ {0x42, 67, 64, 96, 1900}, - /*II_0F_0F_1C*/ {0x42, 67, 64, 104, 1907}, - /*II_0F_0F_1D*/ {0x42, 67, 64, 96, 1914}, - /*II_0F_0F_8A*/ {0x42, 67, 64, 104, 1921}, - /*II_0F_0F_8E*/ {0x42, 67, 64, 104, 1929}, - /*II_0F_0F_90*/ {0x42, 67, 64, 96, 1938}, - /*II_0F_0F_94*/ {0x42, 67, 64, 96, 1947}, - /*II_0F_0F_96*/ {0x42, 67, 64, 96, 1954}, - /*II_0F_0F_97*/ {0x42, 67, 64, 96, 1961}, - /*II_0F_0F_9A*/ {0x42, 67, 64, 96, 1970}, - /*II_0F_0F_9E*/ {0x42, 67, 64, 96, 1977}, - /*II_0F_0F_A0*/ {0x42, 67, 64, 96, 1984}, - /*II_0F_0F_A4*/ {0x42, 67, 64, 96, 1993}, - /*II_0F_0F_A6*/ {0x42, 67, 64, 96, 2000}, - /*II_0F_0F_A7*/ {0x42, 67, 64, 96, 2010}, - /*II_0F_0F_AA*/ {0x42, 67, 64, 96, 2020}, - /*II_0F_0F_AE*/ {0x42, 67, 64, 96, 2028}, - /*II_0F_0F_B0*/ {0x42, 67, 64, 96, 2035}, - /*II_0F_0F_B4*/ {0x42, 67, 64, 96, 2044}, - /*II_0F_0F_B6*/ {0x42, 67, 64, 96, 2051}, - /*II_0F_0F_B7*/ {0x42, 67, 64, 96, 2061}, - /*II_0F_0F_BB*/ {0x42, 67, 64, 104, 2070}, - /*II_0F_0F_BF*/ {0x42, 67, 64, 96, 2078}, - /*II_0F_10*/ {0x29, 73, 68, 40, 2087}, - /*II_66_0F_10*/ {0x29, 73, 68, 48, 2095}, - /*II_F3_0F_10*/ {0x29, 71, 68, 40, 2103}, - /*II_F2_0F_10*/ {0x29, 72, 68, 48, 2110}, - /*II_0F_11*/ {0x29, 68, 73, 40, 2087}, - /*II_66_0F_11*/ {0x29, 68, 73, 48, 2095}, - /*II_F3_0F_11*/ {0x29, 68, 71, 40, 2103}, - /*II_F2_0F_11*/ {0x29, 68, 72, 48, 2110}, - /*II_66_0F_12*/ {0x29, 46, 68, 48, 2168}, - /*II_F3_0F_12*/ {0x29, 72, 68, 56, 2176}, - /*II_F2_0F_12*/ {0x29, 72, 68, 56, 2186}, - /*II_0F_13*/ {0x29, 68, 46, 40, 2160}, - /*II_66_0F_13*/ {0x29, 68, 46, 48, 2168}, - /*II_0F_14*/ {0x28, 73, 68, 40, 2244}, - /*II_66_0F_14*/ {0x28, 73, 68, 48, 2254}, - /*II_0F_15*/ {0x28, 73, 68, 40, 2286}, - /*II_66_0F_15*/ {0x28, 73, 68, 48, 2296}, - /*II_66_0F_16*/ {0x29, 46, 68, 48, 2345}, - /*II_F3_0F_16*/ {0x29, 73, 68, 56, 2353}, - /*II_0F_17*/ {0x29, 68, 46, 40, 2337}, - /*II_66_0F_17*/ {0x29, 68, 46, 48, 2345}, - /*II_0F_18_00*/ {0x3c, 0, 42, 40, 2402}, - /*II_0F_18_01*/ {0x3c, 0, 42, 40, 2415}, - /*II_0F_18_02*/ {0x3c, 0, 42, 40, 2427}, - /*II_0F_18_03*/ {0x3c, 0, 42, 40, 2439}, - /*II_0F_28*/ {0x29, 73, 68, 40, 2451}, - /*II_66_0F_28*/ {0x29, 73, 68, 48, 2459}, - /*II_0F_29*/ {0x29, 68, 73, 40, 2451}, - /*II_66_0F_29*/ {0x29, 68, 73, 48, 2459}, - /*II_0F_2A*/ {0x28, 67, 68, 40, 2485}, - /*II_66_0F_2A*/ {0x28, 67, 68, 48, 2495}, - /*II_F3_0F_2A*/ {0x30, 18, 68, 40, 2505}, - /*II_F2_0F_2A*/ {0x30, 18, 68, 48, 2515}, - /*II_0F_2B*/ {0x29, 68, 47, 40, 2547}, - /*II_66_0F_2B*/ {0x29, 68, 47, 48, 2556}, - /*II_F3_0F_2B*/ {0x29, 68, 44, 88, 2565}, - /*II_F2_0F_2B*/ {0x29, 68, 46, 88, 2574}, - /*II_0F_2C*/ {0x28, 72, 64, 40, 2603}, - /*II_66_0F_2C*/ {0x28, 73, 64, 48, 2614}, - /*II_F3_0F_2C*/ {0x30, 71, 13, 40, 2625}, - /*II_F2_0F_2C*/ {0x30, 72, 13, 48, 2636}, - /*II_0F_2D*/ {0x28, 72, 64, 40, 2671}, - /*II_66_0F_2D*/ {0x28, 73, 68, 48, 2681}, - /*II_F3_0F_2D*/ {0x30, 71, 13, 40, 2691}, - /*II_F2_0F_2D*/ {0x30, 72, 13, 48, 2701}, - /*II_0F_2E*/ {0x28, 71, 68, 40, 2733}, - /*II_66_0F_2E*/ {0x28, 72, 68, 48, 2742}, - /*II_0F_2F*/ {0x28, 71, 68, 40, 2771}, - /*II_66_0F_2F*/ {0x28, 72, 68, 48, 2779}, - /*II_0F_50*/ {0x49, 69, 12, 40, 2805}, - /*II_66_0F_50*/ {0x49, 69, 12, 48, 2815}, - /*II_0F_51*/ {0x28, 73, 68, 40, 2847}, - /*II_66_0F_51*/ {0x28, 73, 68, 48, 2855}, - /*II_F3_0F_51*/ {0x28, 71, 68, 40, 2863}, - /*II_F2_0F_51*/ {0x28, 72, 68, 48, 2871}, - /*II_0F_52*/ {0x28, 73, 68, 40, 2915}, - /*II_F3_0F_52*/ {0x28, 71, 68, 40, 2924}, - /*II_0F_53*/ {0x28, 73, 68, 40, 2953}, - /*II_F3_0F_53*/ {0x28, 71, 68, 40, 2960}, - /*II_0F_54*/ {0x28, 73, 68, 40, 2983}, - /*II_66_0F_54*/ {0x28, 73, 68, 48, 2990}, - /*II_0F_55*/ {0x28, 73, 68, 40, 3013}, - /*II_66_0F_55*/ {0x28, 73, 68, 48, 3021}, - /*II_0F_56*/ {0x28, 73, 68, 40, 3047}, - /*II_66_0F_56*/ {0x28, 73, 68, 48, 3053}, - /*II_0F_57*/ {0x28, 73, 68, 40, 3073}, - /*II_66_0F_57*/ {0x28, 73, 68, 48, 3080}, - /*II_0F_58*/ {0x28, 73, 68, 40, 3103}, - /*II_66_0F_58*/ {0x28, 73, 68, 48, 3110}, - /*II_F3_0F_58*/ {0x28, 71, 68, 40, 3117}, - /*II_F2_0F_58*/ {0x28, 72, 68, 48, 3124}, - /*II_0F_59*/ {0x28, 73, 68, 40, 3163}, - /*II_66_0F_59*/ {0x28, 73, 68, 48, 3170}, - /*II_F3_0F_59*/ {0x28, 71, 68, 40, 3177}, - /*II_F2_0F_59*/ {0x28, 72, 68, 48, 3184}, - /*II_0F_5A*/ {0x28, 72, 68, 48, 3223}, - /*II_66_0F_5A*/ {0x28, 73, 68, 48, 3233}, - /*II_F3_0F_5A*/ {0x28, 71, 68, 48, 3243}, - /*II_F2_0F_5A*/ {0x28, 72, 68, 48, 3253}, - /*II_0F_5B*/ {0x28, 73, 68, 48, 3307}, - /*II_66_0F_5B*/ {0x28, 73, 68, 48, 3317}, - /*II_F3_0F_5B*/ {0x28, 73, 68, 48, 3327}, - /*II_0F_5C*/ {0x28, 73, 68, 40, 3372}, - /*II_66_0F_5C*/ {0x28, 73, 68, 48, 3379}, - /*II_F3_0F_5C*/ {0x28, 71, 68, 40, 3386}, - /*II_F2_0F_5C*/ {0x28, 72, 68, 48, 3393}, - /*II_0F_5D*/ {0x28, 73, 68, 40, 3432}, - /*II_66_0F_5D*/ {0x28, 73, 68, 48, 3439}, - /*II_F3_0F_5D*/ {0x28, 71, 68, 40, 3446}, - /*II_F2_0F_5D*/ {0x28, 72, 68, 48, 3453}, - /*II_0F_5E*/ {0x28, 73, 68, 40, 3492}, - /*II_66_0F_5E*/ {0x28, 73, 68, 48, 3499}, - /*II_F3_0F_5E*/ {0x28, 71, 68, 40, 3506}, - /*II_F2_0F_5E*/ {0x28, 72, 68, 48, 3513}, - /*II_0F_5F*/ {0x28, 73, 68, 40, 3552}, - /*II_66_0F_5F*/ {0x28, 73, 68, 48, 3559}, - /*II_F3_0F_5F*/ {0x28, 71, 68, 40, 3566}, - /*II_F2_0F_5F*/ {0x28, 72, 68, 48, 3573}, - /*II_0F_60*/ {0x28, 66, 64, 32, 3612}, - /*II_66_0F_60*/ {0x28, 73, 68, 48, 3612}, - /*II_0F_61*/ {0x28, 66, 64, 32, 3635}, - /*II_66_0F_61*/ {0x28, 73, 68, 48, 3635}, - /*II_0F_62*/ {0x28, 66, 64, 32, 3658}, - /*II_66_0F_62*/ {0x28, 73, 68, 48, 3658}, - /*II_0F_63*/ {0x28, 67, 64, 32, 3681}, - /*II_66_0F_63*/ {0x28, 73, 68, 48, 3681}, - /*II_0F_64*/ {0x28, 67, 64, 32, 3702}, - /*II_66_0F_64*/ {0x28, 73, 68, 48, 3702}, - /*II_0F_65*/ {0x28, 67, 64, 32, 3721}, - /*II_66_0F_65*/ {0x28, 73, 68, 48, 3721}, - /*II_0F_66*/ {0x28, 67, 64, 32, 3740}, - /*II_66_0F_66*/ {0x28, 73, 68, 48, 3740}, - /*II_0F_67*/ {0x28, 67, 64, 32, 3759}, - /*II_66_0F_67*/ {0x28, 73, 68, 48, 3759}, - /*II_0F_68*/ {0x28, 67, 64, 32, 3780}, - /*II_66_0F_68*/ {0x28, 73, 68, 48, 3780}, - /*II_0F_69*/ {0x28, 67, 64, 32, 3803}, - /*II_66_0F_69*/ {0x28, 73, 68, 48, 3803}, - /*II_0F_6A*/ {0x28, 67, 64, 32, 3826}, - /*II_66_0F_6A*/ {0x28, 73, 68, 48, 3826}, - /*II_0F_6B*/ {0x28, 67, 64, 32, 3849}, - /*II_66_0F_6B*/ {0x28, 73, 68, 48, 3849}, - /*II_66_0F_6C*/ {0x28, 73, 68, 48, 3870}, - /*II_66_0F_6D*/ {0x28, 73, 68, 48, 3895}, - /*II_0F_6F*/ {0x29, 67, 64, 32, 3926}, - /*II_66_0F_6F*/ {0x29, 73, 68, 48, 3946}, - /*II_F3_0F_6F*/ {0x29, 73, 68, 48, 3954}, - /*II_0F_74*/ {0x28, 67, 64, 32, 4043}, - /*II_66_0F_74*/ {0x28, 73, 68, 48, 4043}, - /*II_0F_75*/ {0x28, 67, 64, 32, 4062}, - /*II_66_0F_75*/ {0x28, 73, 68, 48, 4062}, - /*II_0F_76*/ {0x28, 67, 64, 32, 4081}, - /*II_66_0F_76*/ {0x28, 73, 68, 48, 4081}, - /*II_0F_77*/ {0x26, 0, 0, 32, 4100}, - /*II_0F_78*/ {0x4e, 13, 18, 112, 4128}, - /*II_0F_79*/ {0x4e, 18, 13, 112, 4152}, - /*II_66_0F_79*/ {0x28, 69, 68, 88, 4136}, - /*II_F2_0F_79*/ {0x51, 69, 68, 88, 4143}, - /*II_0F_7A_30*/ {0x26, 72, 68, 112, 4161}, - /*II_0F_7A_31*/ {0x26, 68, 72, 112, 4171}, - /*II_66_0F_7C*/ {0x28, 73, 68, 56, 4181}, - /*II_F2_0F_7C*/ {0x28, 73, 68, 56, 4189}, - /*II_66_0F_7D*/ {0x28, 73, 68, 56, 4215}, - /*II_F2_0F_7D*/ {0x28, 73, 68, 56, 4223}, - /*II_F3_0F_7E*/ {0x29, 72, 68, 48, 3926}, - /*II_0F_7F*/ {0x29, 64, 67, 32, 3926}, - /*II_66_0F_7F*/ {0x29, 68, 73, 48, 3946}, - /*II_F3_0F_7F*/ {0x29, 68, 73, 48, 3954}, - /*II_F3_0F_B8*/ {0x55, 17, 11, 80, 4338}, - /*II_0F_BA_04*/ {0x56, 1, 17, 8, 872}, - /*II_0F_BA_05*/ {0x37, 1, 17, 8, 887}, - /*II_0F_BA_06*/ {0x37, 1, 17, 8, 912}, - /*II_0F_BA_07*/ {0x37, 1, 17, 8, 934}, - /*II_0F_BC*/ {0x28, 17, 11, 8, 4346}, - /*II_F3_0F_BC*/ {0x57, 17, 11, 112, 4351}, - /*II_0F_BD*/ {0x28, 17, 11, 8, 4358}, - /*II_F3_0F_BD*/ {0x58, 17, 11, 8, 4363}, - /*II_0F_C7_07*/ {0x3c, 0, 46, 112, 6385}, - /*II_66_0F_D0*/ {0x28, 73, 68, 56, 6394}, - /*II_F2_0F_D0*/ {0x28, 73, 68, 56, 6404}, - /*II_0F_D1*/ {0x28, 67, 64, 32, 6436}, - /*II_66_0F_D1*/ {0x28, 73, 68, 48, 6436}, - /*II_0F_D2*/ {0x28, 67, 64, 32, 6451}, - /*II_66_0F_D2*/ {0x28, 73, 68, 48, 6451}, - /*II_0F_D3*/ {0x28, 67, 64, 32, 6466}, - /*II_66_0F_D3*/ {0x28, 73, 68, 48, 6466}, - /*II_0F_D4*/ {0x28, 72, 68, 48, 6481}, - /*II_66_0F_D4*/ {0x28, 73, 68, 48, 6481}, - /*II_0F_D5*/ {0x28, 67, 64, 32, 6496}, - /*II_66_0F_D5*/ {0x28, 73, 68, 48, 6496}, - /*II_66_0F_D6*/ {0x29, 68, 72, 48, 3926}, - /*II_F3_0F_D6*/ {0x49, 65, 68, 48, 6513}, - /*II_F2_0F_D6*/ {0x49, 69, 64, 48, 6522}, - /*II_0F_D7*/ {0x51, 65, 12, 40, 6531}, - /*II_66_0F_D7*/ {0x51, 69, 12, 48, 6531}, - /*II_0F_D8*/ {0x28, 67, 64, 32, 6552}, - /*II_66_0F_D8*/ {0x28, 73, 68, 48, 6552}, - /*II_0F_D9*/ {0x28, 67, 64, 32, 6571}, - /*II_66_0F_D9*/ {0x28, 73, 68, 48, 6571}, - /*II_0F_DA*/ {0x28, 67, 64, 40, 6590}, - /*II_66_0F_DA*/ {0x28, 73, 68, 48, 6590}, - /*II_0F_DB*/ {0x28, 67, 64, 32, 6607}, - /*II_66_0F_DB*/ {0x28, 73, 68, 48, 6607}, - /*II_0F_DC*/ {0x28, 67, 64, 32, 6620}, - /*II_66_0F_DC*/ {0x28, 73, 68, 48, 6620}, - /*II_0F_DD*/ {0x28, 67, 64, 32, 6639}, - /*II_66_0F_DD*/ {0x28, 73, 68, 48, 6639}, - /*II_0F_DE*/ {0x28, 67, 64, 40, 6648}, - /*II_66_0F_DE*/ {0x28, 73, 68, 48, 6648}, - /*II_0F_DF*/ {0x28, 67, 64, 32, 6665}, - /*II_66_0F_DF*/ {0x28, 73, 68, 48, 6665}, - /*II_0F_E0*/ {0x28, 67, 64, 40, 6680}, - /*II_66_0F_E0*/ {0x28, 73, 68, 48, 6680}, - /*II_0F_E1*/ {0x28, 67, 64, 32, 6695}, - /*II_66_0F_E1*/ {0x28, 73, 68, 48, 6695}, - /*II_0F_E2*/ {0x28, 67, 64, 32, 6710}, - /*II_66_0F_E2*/ {0x28, 73, 68, 48, 6710}, - /*II_0F_E3*/ {0x28, 67, 64, 40, 6725}, - /*II_66_0F_E3*/ {0x28, 73, 68, 48, 6725}, - /*II_0F_E4*/ {0x28, 67, 64, 40, 6740}, - /*II_66_0F_E4*/ {0x28, 73, 68, 48, 6740}, - /*II_0F_E5*/ {0x28, 67, 64, 32, 6759}, - /*II_66_0F_E5*/ {0x28, 73, 68, 48, 6759}, - /*II_66_0F_E6*/ {0x28, 73, 68, 48, 6776}, - /*II_F3_0F_E6*/ {0x28, 72, 68, 48, 6787}, - /*II_F2_0F_E6*/ {0x28, 73, 68, 48, 6797}, - /*II_0F_E7*/ {0x29, 64, 46, 40, 6841}, - /*II_66_0F_E7*/ {0x29, 68, 47, 48, 6849}, - /*II_0F_E8*/ {0x28, 67, 64, 32, 6868}, - /*II_66_0F_E8*/ {0x28, 73, 68, 48, 6868}, - /*II_0F_E9*/ {0x28, 67, 64, 32, 6885}, - /*II_66_0F_E9*/ {0x28, 73, 68, 48, 6885}, - /*II_0F_EA*/ {0x28, 67, 64, 40, 6902}, - /*II_66_0F_EA*/ {0x28, 73, 68, 48, 6902}, - /*II_0F_EB*/ {0x28, 67, 64, 32, 6919}, - /*II_66_0F_EB*/ {0x28, 73, 68, 48, 6919}, - /*II_0F_EC*/ {0x28, 67, 64, 32, 6930}, - /*II_66_0F_EC*/ {0x28, 73, 68, 48, 6930}, - /*II_0F_ED*/ {0x28, 67, 64, 32, 6947}, - /*II_66_0F_ED*/ {0x28, 73, 68, 48, 6947}, - /*II_0F_EE*/ {0x28, 67, 64, 40, 6964}, - /*II_66_0F_EE*/ {0x28, 73, 68, 48, 6964}, - /*II_0F_EF*/ {0x28, 67, 64, 32, 6981}, - /*II_66_0F_EF*/ {0x28, 73, 68, 48, 6981}, - /*II_F2_0F_F0*/ {0x28, 42, 68, 56, 6994}, - /*II_0F_F1*/ {0x28, 67, 64, 32, 7009}, - /*II_66_0F_F1*/ {0x28, 73, 68, 48, 7009}, - /*II_0F_F2*/ {0x28, 67, 64, 32, 7024}, - /*II_66_0F_F2*/ {0x28, 73, 68, 48, 7024}, - /*II_0F_F3*/ {0x28, 67, 64, 32, 7039}, - /*II_66_0F_F3*/ {0x28, 73, 68, 48, 7039}, - /*II_0F_F4*/ {0x28, 67, 64, 48, 7054}, - /*II_66_0F_F4*/ {0x28, 73, 68, 48, 7054}, - /*II_0F_F5*/ {0x28, 67, 64, 32, 7073}, - /*II_66_0F_F5*/ {0x28, 73, 68, 48, 7073}, - /*II_0F_F6*/ {0x28, 67, 64, 40, 7092}, - /*II_66_0F_F6*/ {0x28, 73, 68, 48, 7092}, - /*II_0F_F7*/ {0x51, 65, 64, 40, 7109}, - /*II_66_0F_F7*/ {0x51, 69, 68, 48, 7119}, - /*II_0F_F8*/ {0x28, 67, 64, 32, 7144}, - /*II_66_0F_F8*/ {0x28, 73, 68, 48, 7144}, - /*II_0F_F9*/ {0x28, 67, 64, 32, 7159}, - /*II_66_0F_F9*/ {0x28, 73, 68, 48, 7159}, - /*II_0F_FA*/ {0x28, 67, 64, 32, 7174}, - /*II_66_0F_FA*/ {0x28, 73, 68, 48, 7174}, - /*II_0F_FB*/ {0x28, 67, 64, 48, 7189}, - /*II_66_0F_FB*/ {0x28, 73, 68, 48, 7189}, - /*II_0F_FC*/ {0x28, 67, 64, 32, 7204}, - /*II_66_0F_FC*/ {0x28, 73, 68, 48, 7204}, - /*II_0F_FD*/ {0x28, 67, 64, 32, 7219}, - /*II_66_0F_FD*/ {0x28, 73, 68, 48, 7219}, - /*II_0F_FE*/ {0x28, 67, 64, 32, 7234}, - /*II_66_0F_FE*/ {0x28, 73, 68, 48, 7234}, - /*II_D9_06*/ {0x34, 0, 42, 16, 7249}, - /*II_9B_D9_06*/ {0x60, 0, 42, 16, 7258}, - /*II_D9_07*/ {0x34, 0, 42, 16, 7266}, - /*II_9B_D9_07*/ {0x60, 0, 42, 16, 7274}, - /*II_DB_E2*/ {0x3a, 0, 0, 16, 7281}, - /*II_9B_DB_E2*/ {0x61, 0, 0, 16, 7289}, - /*II_DB_E3*/ {0x3a, 0, 0, 16, 7296}, - /*II_9B_DB_E3*/ {0x61, 0, 0, 16, 7304}, - /*II_DD_06*/ {0x34, 0, 42, 16, 7311}, - /*II_9B_DD_06*/ {0x60, 0, 42, 16, 7319}, - /*II_DD_07*/ {0x34, 0, 42, 16, 7326}, - /*II_9B_DD_07*/ {0x60, 0, 42, 16, 7334}, - /*II_DF_E0*/ {0x3a, 0, 34, 16, 7326}, - /*II_9B_DF_E0*/ {0x61, 0, 34, 16, 7334}, - /*II_0F_38_00*/ {0x28, 67, 64, 64, 7341}, - /*II_66_0F_38_00*/ {0x28, 73, 68, 64, 7341}, - /*II_0F_38_01*/ {0x28, 67, 64, 64, 7358}, - /*II_66_0F_38_01*/ {0x28, 73, 68, 64, 7358}, - /*II_0F_38_02*/ {0x28, 67, 64, 64, 7375}, - /*II_66_0F_38_02*/ {0x28, 73, 68, 64, 7375}, - /*II_0F_38_03*/ {0x28, 67, 64, 64, 7392}, - /*II_66_0F_38_03*/ {0x28, 73, 68, 64, 7392}, - /*II_0F_38_04*/ {0x28, 67, 64, 64, 7411}, - /*II_66_0F_38_04*/ {0x28, 73, 68, 64, 7411}, - /*II_0F_38_05*/ {0x28, 67, 64, 64, 7434}, - /*II_66_0F_38_05*/ {0x28, 73, 68, 64, 7434}, - /*II_0F_38_06*/ {0x28, 67, 64, 64, 7451}, - /*II_66_0F_38_06*/ {0x28, 73, 68, 64, 7451}, - /*II_0F_38_07*/ {0x28, 67, 64, 64, 7468}, - /*II_66_0F_38_07*/ {0x28, 73, 68, 64, 7468}, - /*II_0F_38_08*/ {0x28, 67, 64, 64, 7487}, - /*II_66_0F_38_08*/ {0x28, 73, 68, 64, 7487}, - /*II_0F_38_09*/ {0x28, 67, 64, 64, 7504}, - /*II_66_0F_38_09*/ {0x28, 73, 68, 64, 7504}, - /*II_0F_38_0A*/ {0x28, 67, 64, 64, 7521}, - /*II_66_0F_38_0A*/ {0x28, 73, 68, 64, 7521}, - /*II_0F_38_0B*/ {0x28, 67, 64, 64, 7538}, - /*II_66_0F_38_0B*/ {0x28, 73, 68, 64, 7538}, - /*II_66_0F_38_17*/ {0x28, 73, 68, 80, 7629}, - /*II_0F_38_1C*/ {0x28, 67, 64, 64, 7688}, - /*II_66_0F_38_1C*/ {0x28, 73, 68, 64, 7688}, - /*II_0F_38_1D*/ {0x28, 67, 64, 64, 7703}, - /*II_66_0F_38_1D*/ {0x28, 73, 68, 64, 7703}, - /*II_0F_38_1E*/ {0x28, 67, 64, 64, 7718}, - /*II_66_0F_38_1E*/ {0x28, 73, 68, 64, 7718}, - /*II_66_0F_38_20*/ {0x28, 72, 68, 72, 7733}, - /*II_66_0F_38_21*/ {0x28, 71, 68, 72, 7754}, - /*II_66_0F_38_22*/ {0x28, 70, 68, 72, 7775}, - /*II_66_0F_38_23*/ {0x28, 72, 68, 72, 7796}, - /*II_66_0F_38_24*/ {0x28, 71, 68, 72, 7817}, - /*II_66_0F_38_25*/ {0x28, 72, 68, 72, 7838}, - /*II_66_0F_38_28*/ {0x28, 73, 68, 72, 7859}, - /*II_66_0F_38_29*/ {0x28, 73, 68, 72, 7876}, - /*II_66_0F_38_2A*/ {0x29, 47, 68, 72, 7895}, - /*II_66_0F_38_2B*/ {0x28, 73, 68, 72, 7916}, - /*II_66_0F_38_30*/ {0x28, 72, 68, 72, 7961}, - /*II_66_0F_38_31*/ {0x28, 71, 68, 72, 7982}, - /*II_66_0F_38_32*/ {0x28, 70, 68, 72, 8003}, - /*II_66_0F_38_33*/ {0x28, 72, 68, 72, 8024}, - /*II_66_0F_38_34*/ {0x28, 71, 68, 72, 8045}, - /*II_66_0F_38_35*/ {0x28, 72, 68, 72, 8066}, - /*II_66_0F_38_37*/ {0x28, 73, 68, 80, 8087}, - /*II_66_0F_38_38*/ {0x28, 73, 68, 72, 8106}, - /*II_66_0F_38_39*/ {0x28, 73, 68, 72, 8123}, - /*II_66_0F_38_3A*/ {0x28, 73, 68, 72, 8140}, - /*II_66_0F_38_3B*/ {0x28, 73, 68, 72, 8157}, - /*II_66_0F_38_3C*/ {0x28, 73, 68, 72, 8174}, - /*II_66_0F_38_3D*/ {0x28, 73, 68, 72, 8191}, - /*II_66_0F_38_3E*/ {0x28, 73, 68, 72, 8208}, - /*II_66_0F_38_3F*/ {0x28, 73, 68, 72, 8225}, - /*II_66_0F_38_40*/ {0x28, 73, 68, 72, 8242}, - /*II_66_0F_38_41*/ {0x28, 73, 68, 72, 8259}, - /*II_66_0F_38_80*/ {0x4e, 47, 13, 112, 8284}, - /*II_66_0F_38_81*/ {0x4e, 47, 13, 112, 8292}, - /*II_66_0F_38_82*/ {0x4e, 47, 13, 112, 8301}, - /*II_66_0F_38_DB*/ {0x28, 73, 68, 152, 9150}, - /*II_66_0F_38_DC*/ {0x28, 73, 68, 152, 9167}, - /*II_66_0F_38_DD*/ {0x28, 73, 68, 152, 9184}, - /*II_66_0F_38_DE*/ {0x28, 73, 68, 152, 9209}, - /*II_66_0F_38_DF*/ {0x28, 73, 68, 152, 9226}, - /*II_0F_38_F0*/ {0x29, 17, 11, 8, 9251}, - /*II_F2_0F_38_F0*/ {0x29, 15, 13, 80, 9258}, - /*II_0F_38_F1*/ {0x29, 11, 17, 8, 9251}, - /*II_F2_0F_38_F1*/ {0x29, 17, 13, 80, 9258}, - /*II_0F_71_02*/ {0x63, 1, 65, 32, 6436}, - /*II_66_0F_71_02*/ {0x3c, 1, 69, 48, 6436}, - /*II_0F_71_04*/ {0x63, 1, 65, 32, 6695}, - /*II_66_0F_71_04*/ {0x3c, 1, 69, 48, 6695}, - /*II_0F_71_06*/ {0x63, 1, 65, 32, 7009}, - /*II_66_0F_71_06*/ {0x3c, 1, 69, 48, 7009}, - /*II_0F_72_02*/ {0x63, 1, 65, 32, 6451}, - /*II_66_0F_72_02*/ {0x3c, 1, 69, 48, 6451}, - /*II_0F_72_04*/ {0x63, 1, 65, 32, 6710}, - /*II_66_0F_72_04*/ {0x3c, 1, 69, 48, 6710}, - /*II_0F_72_06*/ {0x63, 1, 65, 32, 7024}, - /*II_66_0F_72_06*/ {0x3c, 1, 69, 48, 7024}, - /*II_0F_73_02*/ {0x63, 1, 65, 32, 6466}, - /*II_66_0F_73_02*/ {0x3c, 1, 69, 48, 6466}, - /*II_66_0F_73_03*/ {0x3c, 1, 69, 48, 9830}, - /*II_0F_73_06*/ {0x63, 1, 65, 32, 7039}, - /*II_66_0F_73_06*/ {0x3c, 1, 69, 48, 7039}, - /*II_66_0F_73_07*/ {0x3c, 1, 69, 48, 9847}, - /*II_F3_0F_AE_00*/ {0x65, 0, 13, 112, 9882}, - /*II_F3_0F_AE_01*/ {0x65, 0, 13, 112, 9912}, - /*II_0F_AE_02*/ {0x3c, 0, 42, 8, 9922}, - /*II_F3_0F_AE_02*/ {0x65, 0, 13, 112, 9931}, - /*II_0F_AE_03*/ {0x3c, 0, 42, 8, 9951}, - /*II_F3_0F_AE_03*/ {0x65, 0, 13, 112, 9960}, - /*II_66_0F_C7_06*/ {0x3c, 0, 46, 112, 9997}, - /*II_F3_0F_C7_06*/ {0x3c, 0, 46, 112, 10006} -}; - -_InstInfoEx InstInfosEx[] = { - /*II_69*/ {{0x17, 17, 11, 8, 117}, 0x0, 3, 0, 0, 0}, - /*II_6B*/ {{0x17, 17, 11, 8, 117}, 0x0, 5, 0, 0, 0}, - /*II_98*/ {{0x1c, 0, 0, 8, 228}, 0x0, 0, 0, 233, 239}, - /*II_99*/ {{0x1c, 0, 0, 8, 245}, 0x0, 0, 0, 250, 255}, - /*II_E3*/ {{0x25, 0, 40, 13, 427}, 0x0, 0, 0, 433, 440}, - /*II_0F_A4*/ {{0x2c, 11, 17, 8, 876}, 0x0, 1, 0, 0, 0}, - /*II_0F_A5*/ {{0x2c, 11, 17, 8, 876}, 0x0, 52, 0, 0, 0}, - /*II_0F_AC*/ {{0x2c, 11, 17, 8, 892}, 0x0, 1, 0, 0, 0}, - /*II_0F_AD*/ {{0x2c, 11, 17, 8, 892}, 0x0, 52, 0, 0, 0}, - /*II_V_0F_10*/ {{0x43, 90, 83, 128, 2117}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_10*/ {{0x43, 90, 83, 128, 2126}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_10*/ {{0x44, 81, 68, 128, 2135}, 0x20, 69, 0, 0, 0}, - /*II_V_F2_0F_10*/ {{0x44, 81, 68, 128, 2143}, 0x20, 69, 0, 0, 0}, - /*II_VRR_F3_0F_10*/ {{0x45, 44, 68, 128, 2135}, 0x60, 0, 0, 0, 0}, - /*II_VRR_F2_0F_10*/ {{0x45, 46, 68, 128, 2143}, 0x60, 0, 0, 0, 0}, - /*II_V_0F_11*/ {{0x43, 83, 90, 128, 2117}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_11*/ {{0x43, 83, 90, 128, 2126}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_11*/ {{0x44, 81, 68, 128, 2135}, 0x20, 69, 0, 0, 0}, - /*II_V_F2_0F_11*/ {{0x44, 81, 68, 128, 2143}, 0x20, 69, 0, 0, 0}, - /*II_VRR_F3_0F_11*/ {{0x45, 68, 44, 128, 2135}, 0x60, 0, 0, 0, 0}, - /*II_VRR_F2_0F_11*/ {{0x45, 68, 46, 128, 2143}, 0x60, 0, 0, 0, 0}, - /*II_0F_12*/ {{0x46, 72, 68, 40, 2151}, 0x0, 0, 0, 2160, 0}, - /*II_V_0F_12*/ {{0x47, 81, 68, 128, 2195}, 0x0, 72, 0, 2205, 0}, - /*II_V_66_0F_12*/ {{0x48, 81, 68, 128, 2214}, 0x0, 46, 0, 0, 0}, - /*II_V_F3_0F_12*/ {{0x43, 90, 83, 128, 2223}, 0x41, 0, 0, 0, 0}, - /*II_V_F2_0F_12*/ {{0x43, 89, 83, 128, 2234}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_13*/ {{0x43, 68, 46, 128, 2205}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_13*/ {{0x43, 68, 46, 128, 2214}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_14*/ {{0x48, 88, 83, 128, 2264}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_14*/ {{0x48, 88, 83, 128, 2275}, 0x1, 90, 0, 0, 0}, - /*II_V_0F_15*/ {{0x48, 88, 83, 128, 2306}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_15*/ {{0x48, 88, 83, 128, 2317}, 0x1, 90, 0, 0, 0}, - /*II_0F_16*/ {{0x46, 72, 68, 40, 2328}, 0x0, 0, 0, 2337, 0}, - /*II_V_0F_16*/ {{0x47, 81, 68, 128, 2363}, 0x0, 72, 0, 2373, 0}, - /*II_V_66_0F_16*/ {{0x48, 81, 68, 128, 2382}, 0x0, 46, 0, 0, 0}, - /*II_V_F3_0F_16*/ {{0x43, 90, 83, 128, 2391}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_17*/ {{0x43, 68, 46, 128, 2373}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_17*/ {{0x43, 68, 46, 128, 2382}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_28*/ {{0x43, 90, 83, 128, 2467}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_28*/ {{0x43, 90, 83, 128, 2476}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_29*/ {{0x43, 83, 90, 128, 2467}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_29*/ {{0x43, 83, 90, 128, 2476}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_2A*/ {{0x48, 81, 68, 128, 2525}, 0x2, 79, 0, 0, 0}, - /*II_V_F2_0F_2A*/ {{0x48, 81, 68, 128, 2536}, 0x2, 79, 0, 0, 0}, - /*II_V_0F_2B*/ {{0x43, 83, 92, 128, 2583}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_2B*/ {{0x43, 83, 92, 128, 2593}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_2C*/ {{0x43, 80, 78, 128, 2647}, 0x42, 0, 0, 0, 0}, - /*II_V_F2_0F_2C*/ {{0x43, 80, 78, 128, 2659}, 0x42, 0, 0, 0, 0}, - /*II_V_F3_0F_2D*/ {{0x43, 80, 78, 128, 2711}, 0x42, 0, 0, 0, 0}, - /*II_V_F2_0F_2D*/ {{0x43, 80, 78, 128, 2722}, 0x42, 0, 0, 0, 0}, - /*II_V_0F_2E*/ {{0x43, 71, 68, 128, 2751}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_2E*/ {{0x43, 72, 68, 128, 2761}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_2F*/ {{0x43, 71, 68, 128, 2787}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_2F*/ {{0x43, 72, 68, 128, 2796}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_50*/ {{0x4a, 83, 13, 128, 2825}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_50*/ {{0x4a, 83, 13, 128, 2836}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_51*/ {{0x43, 90, 83, 128, 2879}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_51*/ {{0x43, 90, 83, 128, 2888}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_51*/ {{0x48, 81, 68, 128, 2897}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_51*/ {{0x48, 81, 68, 128, 2906}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_52*/ {{0x43, 90, 83, 128, 2933}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_52*/ {{0x48, 81, 68, 128, 2943}, 0x0, 71, 0, 0, 0}, - /*II_V_0F_53*/ {{0x43, 90, 83, 128, 2967}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_53*/ {{0x48, 81, 68, 128, 2975}, 0x0, 71, 0, 0, 0}, - /*II_V_0F_54*/ {{0x48, 88, 83, 128, 2997}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_54*/ {{0x48, 88, 83, 128, 3005}, 0x1, 90, 0, 0, 0}, - /*II_V_0F_55*/ {{0x48, 88, 83, 128, 3029}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_55*/ {{0x48, 88, 83, 128, 3038}, 0x1, 90, 0, 0, 0}, - /*II_V_0F_56*/ {{0x48, 88, 83, 128, 3059}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_56*/ {{0x48, 88, 83, 128, 3066}, 0x1, 90, 0, 0, 0}, - /*II_V_0F_57*/ {{0x48, 88, 83, 128, 3087}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_57*/ {{0x48, 88, 83, 128, 3095}, 0x1, 90, 0, 0, 0}, - /*II_V_0F_58*/ {{0x48, 88, 83, 128, 3131}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_58*/ {{0x48, 88, 83, 128, 3139}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_58*/ {{0x48, 81, 68, 128, 3147}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_58*/ {{0x48, 81, 68, 128, 3155}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_59*/ {{0x48, 88, 83, 128, 3191}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_59*/ {{0x48, 88, 83, 128, 3199}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_59*/ {{0x48, 81, 68, 128, 3207}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_59*/ {{0x48, 81, 68, 128, 3215}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_5A*/ {{0x43, 91, 83, 128, 3263}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_5A*/ {{0x43, 90, 68, 128, 3274}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_5A*/ {{0x48, 81, 68, 128, 3285}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_5A*/ {{0x48, 81, 68, 128, 3296}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_5B*/ {{0x43, 90, 83, 128, 3338}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_5B*/ {{0x43, 90, 83, 128, 3349}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_5B*/ {{0x43, 90, 83, 128, 3360}, 0x41, 0, 0, 0, 0}, - /*II_V_0F_5C*/ {{0x48, 88, 83, 128, 3400}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_5C*/ {{0x48, 88, 83, 128, 3408}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_5C*/ {{0x48, 81, 68, 128, 3416}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_5C*/ {{0x48, 81, 68, 128, 3424}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_5D*/ {{0x48, 88, 83, 128, 3460}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_5D*/ {{0x48, 88, 83, 128, 3468}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_5D*/ {{0x48, 81, 68, 128, 3476}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_5D*/ {{0x48, 81, 68, 128, 3484}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_5E*/ {{0x48, 88, 83, 128, 3520}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_5E*/ {{0x48, 88, 83, 128, 3528}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_5E*/ {{0x48, 81, 68, 128, 3536}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_5E*/ {{0x48, 81, 68, 128, 3544}, 0x0, 72, 0, 0, 0}, - /*II_V_0F_5F*/ {{0x48, 88, 83, 128, 3580}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_5F*/ {{0x48, 88, 83, 128, 3588}, 0x1, 90, 0, 0, 0}, - /*II_V_F3_0F_5F*/ {{0x48, 81, 68, 128, 3596}, 0x0, 71, 0, 0, 0}, - /*II_V_F2_0F_5F*/ {{0x48, 81, 68, 128, 3604}, 0x0, 72, 0, 0, 0}, - /*II_V_66_0F_60*/ {{0x48, 81, 68, 128, 3623}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_61*/ {{0x48, 81, 68, 128, 3646}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_62*/ {{0x48, 81, 68, 128, 3669}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_63*/ {{0x48, 81, 68, 128, 3691}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_64*/ {{0x48, 81, 68, 128, 3711}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_65*/ {{0x48, 81, 68, 128, 3730}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_66*/ {{0x48, 81, 68, 128, 3749}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_67*/ {{0x48, 81, 68, 128, 3769}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_68*/ {{0x48, 81, 68, 128, 3791}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_69*/ {{0x48, 81, 68, 128, 3814}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_6A*/ {{0x48, 81, 68, 128, 3837}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_6B*/ {{0x48, 81, 68, 128, 3859}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_6C*/ {{0x48, 81, 68, 128, 3882}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_6D*/ {{0x48, 81, 68, 128, 3907}, 0x0, 73, 0, 0, 0}, - /*II_0F_6E*/ {{0x4b, 18, 64, 32, 3920}, 0x0, 0, 0, 0, 3926}, - /*II_66_0F_6E*/ {{0x4b, 18, 68, 48, 3920}, 0x0, 0, 0, 0, 3926}, - /*II_V_66_0F_6E*/ {{0x43, 79, 68, 128, 3932}, 0x46, 0, 0, 3939, 0}, - /*II_V_66_0F_6F*/ {{0x43, 90, 83, 128, 3962}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_6F*/ {{0x43, 90, 83, 128, 3971}, 0x41, 0, 0, 0, 0}, - /*II_0F_70*/ {{0x4c, 67, 64, 40, 3980}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_70*/ {{0x4c, 73, 68, 48, 3988}, 0x0, 1, 0, 0, 0}, - /*II_F3_0F_70*/ {{0x4c, 73, 68, 48, 3996}, 0x0, 1, 0, 0, 0}, - /*II_F2_0F_70*/ {{0x4c, 73, 68, 48, 4005}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_70*/ {{0x48, 73, 68, 128, 4014}, 0x40, 1, 0, 0, 0}, - /*II_V_F3_0F_70*/ {{0x48, 73, 68, 128, 4023}, 0x40, 1, 0, 0, 0}, - /*II_V_F2_0F_70*/ {{0x48, 73, 68, 128, 4033}, 0x40, 1, 0, 0, 0}, - /*II_V_66_0F_74*/ {{0x48, 81, 68, 128, 4052}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_75*/ {{0x48, 81, 68, 128, 4071}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_76*/ {{0x48, 81, 68, 128, 4090}, 0x0, 73, 0, 0, 0}, - /*II_V_0F_77*/ {{0x4d, 0, 0, 128, 4106}, 0x49, 0, 0, 4118, 0}, - /*II_66_0F_78*/ {{0x4f, 7, 69, 88, 4136}, 0x0, 8, 0, 0, 0}, - /*II_F2_0F_78*/ {{0x50, 69, 68, 88, 4143}, 0x0, 7, 8, 0, 0}, - /*II_V_66_0F_7C*/ {{0x48, 88, 83, 128, 4197}, 0x1, 90, 0, 0, 0}, - /*II_V_F2_0F_7C*/ {{0x48, 88, 83, 128, 4206}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_7D*/ {{0x48, 88, 83, 128, 4231}, 0x1, 90, 0, 0, 0}, - /*II_V_F2_0F_7D*/ {{0x48, 88, 83, 128, 4240}, 0x1, 90, 0, 0, 0}, - /*II_0F_7E*/ {{0x4b, 64, 18, 32, 3920}, 0x0, 0, 0, 0, 3926}, - /*II_66_0F_7E*/ {{0x4b, 68, 18, 48, 3920}, 0x0, 0, 0, 0, 3926}, - /*II_V_66_0F_7E*/ {{0x43, 68, 79, 128, 3932}, 0x46, 0, 0, 3939, 0}, - /*II_V_F3_0F_7E*/ {{0x43, 72, 68, 128, 3939}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_7F*/ {{0x43, 83, 90, 128, 3962}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_7F*/ {{0x43, 83, 90, 128, 3971}, 0x41, 0, 0, 0, 0}, - /*II_0F_AE_04*/ {{0x52, 0, 42, 8, 4249}, 0x0, 0, 0, 0, 4256}, - /*II_0F_AE_05*/ {{0x53, 0, 43, 8, 4265}, 0x0, 0, 0, 4273, 4281}, - /*II_0F_AE_06*/ {{0x53, 0, 43, 8, 4291}, 0x0, 0, 0, 4299, 4309}, - /*II_0F_AE_07*/ {{0x54, 0, 43, 8, 4321}, 0x0, 0, 0, 4329, 0}, - /*II_0F_C2*/ {{0x59, 73, 68, 40, 4370}, 0x0, 0, 0, 4379, 4388}, - /*II_66_0F_C2*/ {{0x59, 73, 68, 48, 4449}, 0x0, 0, 0, 4458, 4467}, - /*II_F3_0F_C2*/ {{0x59, 71, 68, 40, 4528}, 0x0, 0, 0, 4537, 4546}, - /*II_F2_0F_C2*/ {{0x59, 72, 68, 48, 4607}, 0x0, 0, 0, 4616, 4625}, - /*II_V_0F_C2*/ {{0x5a, 88, 83, 128, 4686}, 0x1, 90, 0, 4696, 4706}, - /*II_V_66_0F_C2*/ {{0x5a, 88, 83, 128, 5088}, 0x1, 90, 0, 5098, 5108}, - /*II_V_F3_0F_C2*/ {{0x5a, 81, 68, 128, 5490}, 0x0, 71, 0, 5500, 5510}, - /*II_V_F2_0F_C2*/ {{0x5a, 81, 68, 128, 5892}, 0x0, 72, 0, 5902, 5912}, - /*II_0F_C4*/ {{0x4c, 25, 64, 40, 6294}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_C4*/ {{0x4c, 25, 68, 48, 6294}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_C4*/ {{0x5b, 81, 68, 128, 6302}, 0x0, 25, 1, 0, 0}, - /*II_0F_C5*/ {{0x5c, 65, 12, 40, 6311}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_C5*/ {{0x4c, 69, 12, 48, 6311}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_C5*/ {{0x5d, 68, 13, 128, 6319}, 0x40, 1, 0, 0, 0}, - /*II_0F_C6*/ {{0x4c, 73, 68, 40, 6328}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_C6*/ {{0x4c, 73, 68, 48, 6336}, 0x0, 1, 0, 0, 0}, - /*II_V_0F_C6*/ {{0x5b, 88, 83, 128, 6344}, 0x1, 90, 1, 0, 0}, - /*II_V_66_0F_C6*/ {{0x5b, 88, 83, 128, 6353}, 0x1, 90, 1, 0, 0}, - /*II_0F_C7_01*/ {{0x5e, 0, 48, 8, 6362}, 0x0, 0, 0, 0, 6373}, - /*II_V_66_0F_D0*/ {{0x48, 88, 83, 128, 6414}, 0x1, 90, 0, 0, 0}, - /*II_V_F2_0F_D0*/ {{0x48, 88, 83, 128, 6425}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_D1*/ {{0x48, 81, 68, 128, 6443}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D2*/ {{0x48, 81, 68, 128, 6458}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D3*/ {{0x48, 81, 68, 128, 6473}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D4*/ {{0x48, 81, 68, 128, 6488}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D5*/ {{0x48, 81, 68, 128, 6504}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D6*/ {{0x43, 68, 72, 128, 3939}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_D7*/ {{0x4a, 68, 13, 128, 6541}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_D8*/ {{0x48, 81, 68, 128, 6561}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_D9*/ {{0x48, 81, 68, 128, 6580}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DA*/ {{0x48, 81, 68, 128, 6598}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DB*/ {{0x48, 81, 68, 128, 6613}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DC*/ {{0x48, 81, 68, 128, 6629}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DD*/ {{0x48, 81, 68, 128, 6629}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DE*/ {{0x48, 81, 68, 128, 6656}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_DF*/ {{0x48, 81, 68, 128, 6672}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E0*/ {{0x48, 81, 68, 128, 6687}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E1*/ {{0x48, 81, 68, 128, 6702}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E2*/ {{0x48, 81, 68, 128, 6717}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E3*/ {{0x48, 81, 68, 128, 6732}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E4*/ {{0x48, 81, 68, 128, 6749}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E5*/ {{0x48, 81, 68, 128, 6767}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E6*/ {{0x43, 90, 68, 128, 6807}, 0x41, 0, 0, 0, 0}, - /*II_V_F3_0F_E6*/ {{0x43, 91, 83, 128, 6819}, 0x41, 0, 0, 0, 0}, - /*II_V_F2_0F_E6*/ {{0x43, 90, 68, 128, 6830}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_E7*/ {{0x43, 83, 92, 128, 6858}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_E8*/ {{0x48, 81, 68, 128, 6876}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_E9*/ {{0x48, 81, 68, 128, 6893}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_EA*/ {{0x48, 81, 68, 128, 6910}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_EB*/ {{0x48, 81, 68, 128, 6924}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_EC*/ {{0x48, 81, 68, 128, 6938}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_ED*/ {{0x48, 81, 68, 128, 6955}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_EE*/ {{0x48, 81, 68, 128, 6972}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_EF*/ {{0x48, 81, 68, 128, 6987}, 0x0, 73, 0, 0, 0}, - /*II_V_F2_0F_F0*/ {{0x43, 92, 83, 128, 7001}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_F1*/ {{0x48, 81, 68, 128, 7016}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F2*/ {{0x48, 81, 68, 128, 7031}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F3*/ {{0x48, 81, 68, 128, 7046}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F4*/ {{0x48, 81, 68, 128, 7063}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F5*/ {{0x48, 81, 68, 128, 7082}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F6*/ {{0x48, 81, 68, 128, 7100}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F7*/ {{0x5f, 69, 68, 128, 7131}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_F8*/ {{0x48, 81, 68, 128, 7151}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_F9*/ {{0x48, 81, 68, 128, 7166}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_FA*/ {{0x48, 81, 68, 128, 7181}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_FB*/ {{0x48, 81, 68, 128, 7196}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_FC*/ {{0x48, 81, 68, 128, 7211}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_FD*/ {{0x48, 81, 68, 128, 7226}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_FE*/ {{0x48, 81, 68, 128, 7241}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_00*/ {{0x48, 81, 68, 128, 7349}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_01*/ {{0x48, 81, 68, 128, 7366}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_02*/ {{0x48, 81, 68, 128, 7383}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_03*/ {{0x48, 81, 68, 128, 7401}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_04*/ {{0x48, 81, 68, 128, 7422}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_05*/ {{0x48, 81, 68, 128, 7442}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_06*/ {{0x48, 81, 68, 128, 7459}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_07*/ {{0x48, 81, 68, 128, 7477}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_08*/ {{0x48, 81, 68, 128, 7495}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_09*/ {{0x48, 81, 68, 128, 7512}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_0A*/ {{0x48, 81, 68, 128, 7529}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_0B*/ {{0x48, 81, 68, 128, 7548}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_0C*/ {{0x48, 88, 83, 128, 7559}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_38_0D*/ {{0x48, 88, 83, 128, 7570}, 0x1, 90, 0, 0, 0}, - /*II_V_66_0F_38_0E*/ {{0x43, 90, 83, 128, 7581}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_38_0F*/ {{0x43, 90, 83, 128, 7590}, 0x41, 0, 0, 0, 0}, - /*II_66_0F_38_10*/ {{0x4c, 73, 68, 72, 7599}, 0x0, 74, 0, 0, 0}, - /*II_66_0F_38_14*/ {{0x4c, 73, 68, 72, 7609}, 0x0, 74, 0, 0, 0}, - /*II_66_0F_38_15*/ {{0x4c, 73, 68, 72, 7619}, 0x0, 74, 0, 0, 0}, - /*II_V_66_0F_38_17*/ {{0x43, 90, 83, 128, 7636}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_38_18*/ {{0x43, 44, 83, 128, 7644}, 0x41, 0, 0, 0, 0}, - /*II_V_66_0F_38_19*/ {{0x43, 46, 85, 128, 7658}, 0x50, 0, 0, 0, 0}, - /*II_V_66_0F_38_1A*/ {{0x43, 47, 85, 128, 7672}, 0x50, 0, 0, 0, 0}, - /*II_V_66_0F_38_1C*/ {{0x43, 73, 68, 128, 7695}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_1D*/ {{0x43, 73, 68, 128, 7710}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_1E*/ {{0x43, 73, 68, 128, 7725}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_20*/ {{0x43, 72, 68, 128, 7743}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_21*/ {{0x43, 71, 68, 128, 7764}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_22*/ {{0x43, 70, 68, 128, 7785}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_23*/ {{0x43, 72, 68, 128, 7806}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_24*/ {{0x43, 71, 68, 128, 7827}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_25*/ {{0x43, 72, 68, 128, 7848}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_28*/ {{0x48, 81, 68, 128, 7867}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_29*/ {{0x48, 81, 68, 128, 7885}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_2A*/ {{0x43, 47, 68, 128, 7905}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_2B*/ {{0x48, 81, 68, 128, 7926}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_2C*/ {{0x48, 88, 83, 128, 7937}, 0x1, 92, 0, 0, 0}, - /*II_V_66_0F_38_2D*/ {{0x48, 88, 83, 128, 7949}, 0x1, 92, 0, 0, 0}, - /*II_V_66_0F_38_2E*/ {{0x48, 88, 92, 128, 7937}, 0x1, 83, 0, 0, 0}, - /*II_V_66_0F_38_2F*/ {{0x48, 88, 92, 128, 7949}, 0x1, 83, 0, 0, 0}, - /*II_V_66_0F_38_30*/ {{0x43, 72, 68, 128, 7971}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_31*/ {{0x43, 71, 68, 128, 7992}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_32*/ {{0x43, 70, 68, 128, 8013}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_33*/ {{0x43, 72, 68, 128, 8034}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_34*/ {{0x43, 71, 68, 128, 8055}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_35*/ {{0x43, 72, 68, 128, 8076}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_37*/ {{0x48, 81, 68, 128, 8096}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_38*/ {{0x48, 81, 68, 128, 8114}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_39*/ {{0x48, 81, 68, 128, 8131}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3A*/ {{0x48, 81, 68, 128, 8148}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3B*/ {{0x48, 81, 68, 128, 8165}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3C*/ {{0x48, 81, 68, 128, 8182}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3D*/ {{0x48, 81, 68, 128, 8199}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3E*/ {{0x48, 81, 68, 128, 8216}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_3F*/ {{0x48, 81, 68, 128, 8233}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_40*/ {{0x48, 81, 68, 128, 8250}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_41*/ {{0x43, 73, 68, 128, 8271}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_96*/ {{0x48, 88, 83, 136, 8310}, 0x7, 90, 0, 8326, 0}, - /*II_V_66_0F_38_97*/ {{0x48, 88, 83, 136, 8342}, 0x7, 90, 0, 8358, 0}, - /*II_V_66_0F_38_98*/ {{0x48, 88, 83, 136, 8374}, 0x7, 90, 0, 8387, 0}, - /*II_V_66_0F_38_99*/ {{0x48, 81, 68, 136, 8400}, 0x6, 80, 0, 8413, 0}, - /*II_V_66_0F_38_9A*/ {{0x48, 88, 83, 136, 8426}, 0x7, 90, 0, 8439, 0}, - /*II_V_66_0F_38_9B*/ {{0x48, 81, 68, 136, 8452}, 0x6, 80, 0, 8465, 0}, - /*II_V_66_0F_38_9C*/ {{0x48, 88, 83, 136, 8478}, 0x7, 90, 0, 8492, 0}, - /*II_V_66_0F_38_9D*/ {{0x48, 81, 68, 136, 8506}, 0x6, 80, 0, 8520, 0}, - /*II_V_66_0F_38_9E*/ {{0x48, 88, 83, 136, 8534}, 0x7, 90, 0, 8548, 0}, - /*II_V_66_0F_38_9F*/ {{0x48, 81, 68, 136, 8562}, 0x6, 80, 0, 8576, 0}, - /*II_V_66_0F_38_A6*/ {{0x48, 88, 83, 136, 8590}, 0x7, 90, 0, 8606, 0}, - /*II_V_66_0F_38_A7*/ {{0x48, 88, 83, 136, 8622}, 0x7, 90, 0, 8638, 0}, - /*II_V_66_0F_38_A8*/ {{0x48, 88, 83, 136, 8654}, 0x7, 90, 0, 8667, 0}, - /*II_V_66_0F_38_A9*/ {{0x48, 81, 68, 136, 8680}, 0x6, 80, 0, 8693, 0}, - /*II_V_66_0F_38_AA*/ {{0x48, 88, 83, 136, 8706}, 0x7, 90, 0, 8719, 0}, - /*II_V_66_0F_38_AB*/ {{0x48, 81, 68, 136, 8732}, 0x6, 80, 0, 8745, 0}, - /*II_V_66_0F_38_AC*/ {{0x48, 88, 83, 136, 8758}, 0x7, 90, 0, 8772, 0}, - /*II_V_66_0F_38_AD*/ {{0x48, 81, 68, 136, 8786}, 0x6, 80, 0, 8800, 0}, - /*II_V_66_0F_38_AE*/ {{0x48, 88, 83, 136, 8814}, 0x7, 90, 0, 8828, 0}, - /*II_V_66_0F_38_AF*/ {{0x48, 81, 68, 136, 8842}, 0x6, 80, 0, 8856, 0}, - /*II_V_66_0F_38_B6*/ {{0x48, 88, 83, 136, 8870}, 0x7, 90, 0, 8886, 0}, - /*II_V_66_0F_38_B7*/ {{0x48, 88, 83, 136, 8902}, 0x7, 90, 0, 8918, 0}, - /*II_V_66_0F_38_B8*/ {{0x48, 88, 83, 136, 8934}, 0x7, 90, 0, 8947, 0}, - /*II_V_66_0F_38_B9*/ {{0x48, 81, 68, 136, 8960}, 0x6, 80, 0, 8973, 0}, - /*II_V_66_0F_38_BA*/ {{0x48, 88, 83, 136, 8986}, 0x7, 90, 0, 8999, 0}, - /*II_V_66_0F_38_BB*/ {{0x48, 81, 68, 136, 9012}, 0x6, 80, 0, 9025, 0}, - /*II_V_66_0F_38_BC*/ {{0x48, 88, 83, 136, 9038}, 0x7, 90, 0, 9052, 0}, - /*II_V_66_0F_38_BD*/ {{0x48, 81, 68, 136, 9066}, 0x6, 80, 0, 9080, 0}, - /*II_V_66_0F_38_BE*/ {{0x48, 88, 83, 136, 9094}, 0x7, 90, 0, 9108, 0}, - /*II_V_66_0F_38_BF*/ {{0x48, 81, 68, 136, 9122}, 0x6, 80, 0, 9136, 0}, - /*II_V_66_0F_38_DB*/ {{0x43, 73, 68, 152, 9158}, 0x40, 0, 0, 0, 0}, - /*II_V_66_0F_38_DC*/ {{0x48, 81, 68, 152, 9175}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_DD*/ {{0x48, 81, 68, 152, 9196}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_DE*/ {{0x48, 81, 68, 152, 9217}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_38_DF*/ {{0x48, 81, 68, 152, 9238}, 0x0, 73, 0, 0, 0}, - /*II_V_66_0F_3A_04*/ {{0x48, 90, 83, 128, 7559}, 0x41, 1, 0, 0, 0}, - /*II_V_66_0F_3A_05*/ {{0x48, 90, 83, 128, 7570}, 0x41, 1, 0, 0, 0}, - /*II_V_66_0F_3A_06*/ {{0x5b, 87, 85, 128, 9265}, 0x10, 86, 1, 0, 0}, - /*II_66_0F_3A_08*/ {{0x4c, 73, 68, 72, 9277}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_08*/ {{0x48, 90, 83, 128, 9286}, 0x41, 1, 0, 0, 0}, - /*II_66_0F_3A_09*/ {{0x4c, 73, 68, 72, 9296}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_09*/ {{0x48, 90, 83, 128, 9305}, 0x41, 1, 0, 0, 0}, - /*II_66_0F_3A_0A*/ {{0x4c, 71, 68, 72, 9315}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0A*/ {{0x5b, 81, 68, 128, 9324}, 0x0, 71, 1, 0, 0}, - /*II_66_0F_3A_0B*/ {{0x4c, 72, 68, 72, 9334}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0B*/ {{0x5b, 81, 68, 128, 9343}, 0x0, 72, 1, 0, 0}, - /*II_66_0F_3A_0C*/ {{0x4c, 73, 68, 72, 9353}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0C*/ {{0x5b, 88, 83, 128, 9362}, 0x1, 90, 1, 0, 0}, - /*II_66_0F_3A_0D*/ {{0x4c, 73, 68, 72, 9372}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0D*/ {{0x5b, 88, 83, 128, 9381}, 0x1, 90, 1, 0, 0}, - /*II_66_0F_3A_0E*/ {{0x4c, 73, 68, 72, 9391}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0E*/ {{0x5b, 81, 68, 128, 9400}, 0x0, 73, 1, 0, 0}, - /*II_0F_3A_0F*/ {{0x4c, 67, 64, 64, 9410}, 0x0, 1, 0, 0, 0}, - /*II_66_0F_3A_0F*/ {{0x4c, 73, 68, 64, 9410}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_0F*/ {{0x5b, 81, 68, 128, 9419}, 0x0, 73, 1, 0, 0}, - /*II_66_0F_3A_14*/ {{0x4c, 68, 26, 72, 9429}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_14*/ {{0x5d, 68, 76, 128, 9437}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_15*/ {{0x4c, 68, 27, 72, 6311}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_15*/ {{0x5d, 68, 77, 128, 6319}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_16*/ {{0x62, 68, 18, 72, 9446}, 0x0, 1, 0, 0, 9454}, - /*II_V_66_0F_3A_16*/ {{0x48, 68, 79, 128, 9462}, 0x46, 1, 0, 9471, 0}, - /*II_66_0F_3A_17*/ {{0x4c, 68, 18, 72, 9480}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_17*/ {{0x48, 68, 75, 128, 9491}, 0x40, 1, 0, 0, 0}, - /*II_V_66_0F_3A_18*/ {{0x5b, 87, 85, 128, 9503}, 0x10, 73, 1, 0, 0}, - /*II_V_66_0F_3A_19*/ {{0x48, 85, 73, 128, 9516}, 0x50, 1, 0, 0, 0}, - /*II_66_0F_3A_20*/ {{0x4c, 24, 68, 72, 9530}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_20*/ {{0x5b, 81, 68, 128, 9538}, 0x0, 76, 1, 0, 0}, - /*II_66_0F_3A_21*/ {{0x4c, 71, 68, 72, 9547}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_21*/ {{0x5b, 81, 68, 128, 9557}, 0x0, 71, 1, 0, 0}, - /*II_66_0F_3A_22*/ {{0x62, 18, 68, 72, 9568}, 0x0, 1, 0, 0, 9576}, - /*II_V_66_0F_3A_22*/ {{0x5b, 81, 68, 128, 9584}, 0x6, 79, 1, 9593, 0}, - /*II_66_0F_3A_40*/ {{0x4c, 73, 68, 72, 9602}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_40*/ {{0x5b, 88, 83, 128, 9608}, 0x1, 90, 1, 0, 0}, - /*II_66_0F_3A_41*/ {{0x4c, 73, 68, 72, 9615}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_41*/ {{0x5b, 81, 68, 128, 9621}, 0x0, 73, 1, 0, 0}, - /*II_66_0F_3A_42*/ {{0x4c, 73, 68, 72, 9628}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_42*/ {{0x5b, 81, 68, 128, 9637}, 0x0, 73, 1, 0, 0}, - /*II_66_0F_3A_44*/ {{0x4c, 73, 68, 144, 9647}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_44*/ {{0x5b, 81, 68, 144, 9658}, 0x0, 73, 1, 0, 0}, - /*II_V_66_0F_3A_4A*/ {{0x5b, 88, 83, 128, 9670}, 0x1, 90, 84, 0, 0}, - /*II_V_66_0F_3A_4B*/ {{0x5b, 88, 83, 128, 9681}, 0x1, 90, 84, 0, 0}, - /*II_V_66_0F_3A_4C*/ {{0x5b, 81, 68, 128, 9692}, 0x0, 73, 82, 0, 0}, - /*II_66_0F_3A_60*/ {{0x4c, 73, 68, 80, 9703}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_60*/ {{0x48, 73, 68, 128, 9714}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_61*/ {{0x4c, 73, 68, 80, 9726}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_61*/ {{0x48, 73, 68, 128, 9737}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_62*/ {{0x4c, 73, 68, 80, 9749}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_62*/ {{0x48, 73, 68, 128, 9760}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_63*/ {{0x4c, 73, 68, 80, 9772}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_63*/ {{0x48, 73, 68, 128, 9783}, 0x40, 1, 0, 0, 0}, - /*II_66_0F_3A_DF*/ {{0x4c, 73, 68, 152, 9795}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_3A_DF*/ {{0x48, 73, 68, 152, 9812}, 0x40, 1, 0, 0, 0}, - /*II_V_66_0F_71_02*/ {{0x64, 69, 81, 128, 6443}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_71_04*/ {{0x64, 69, 81, 128, 6702}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_71_06*/ {{0x64, 69, 81, 128, 7016}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_72_02*/ {{0x64, 69, 81, 128, 6458}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_72_04*/ {{0x64, 69, 81, 128, 6717}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_72_06*/ {{0x64, 69, 81, 128, 7031}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_02*/ {{0x64, 69, 81, 128, 6473}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_03*/ {{0x64, 69, 81, 128, 9838}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_06*/ {{0x64, 69, 81, 128, 7046}, 0x0, 1, 0, 0, 0}, - /*II_V_66_0F_73_07*/ {{0x64, 69, 81, 128, 9855}, 0x0, 1, 0, 0, 0}, - /*II_0F_AE_00*/ {{0x52, 0, 42, 8, 9864}, 0x0, 0, 0, 0, 9872}, - /*II_0F_AE_01*/ {{0x52, 0, 42, 8, 9892}, 0x0, 0, 0, 0, 9901}, - /*II_V_0F_AE_02*/ {{0x45, 0, 44, 128, 9941}, 0x40, 0, 0, 0, 0}, - /*II_V_0F_AE_03*/ {{0x45, 0, 44, 128, 9970}, 0x40, 0, 0, 0, 0}, - /*II_0F_C7_06*/ {{0x54, 0, 43, 112, 9980}, 0x0, 0, 0, 9988, 0} -}; - -_InstNode InstructionsTree[] = { -/* 0 - _00 */ 0x2000, -/* 1 - _01 */ 0x2001, -/* 2 - _02 */ 0x2002, -/* 3 - _03 */ 0x2003, -/* 4 - _04 */ 0x2004, -/* 5 - _05 */ 0x2005, -/* 6 - _06 */ 0x2006, -/* 7 - _07 */ 0x2007, -/* 8 - _08 */ 0x2008, -/* 9 - _09 */ 0x2009, -/* a - _0A */ 0x200a, -/* b - _0B */ 0x200b, -/* c - _0C */ 0x200c, -/* d - _0D */ 0x200d, -/* e - _0E */ 0x200e, -/* f - _0F */ 0x8100, -/* 10 - _10 */ 0x200f, -/* 11 - _11 */ 0x2010, -/* 12 - _12 */ 0x2011, -/* 13 - _13 */ 0x2012, -/* 14 - _14 */ 0x2013, -/* 15 - _15 */ 0x2014, -/* 16 - _16 */ 0x2015, -/* 17 - _17 */ 0x2016, -/* 18 - _18 */ 0x2017, -/* 19 - _19 */ 0x2018, -/* 1a - _1A */ 0x2019, -/* 1b - _1B */ 0x201a, -/* 1c - _1C */ 0x201b, -/* 1d - _1D */ 0x201c, -/* 1e - _1E */ 0x201d, -/* 1f - _1F */ 0x201e, -/* 20 - _20 */ 0x201f, -/* 21 - _21 */ 0x2020, -/* 22 - _22 */ 0x2021, -/* 23 - _23 */ 0x2022, -/* 24 - _24 */ 0x2023, -/* 25 - _25 */ 0x2024, -/* 26 - */ 0, -/* 27 - _27 */ 0x2025, -/* 28 - _28 */ 0x2026, -/* 29 - _29 */ 0x2027, -/* 2a - _2A */ 0x2028, -/* 2b - _2B */ 0x2029, -/* 2c - _2C */ 0x202a, -/* 2d - _2D */ 0x202b, -/* 2e - */ 0, -/* 2f - _2F */ 0x202c, -/* 30 - _30 */ 0x202d, -/* 31 - _31 */ 0x202e, -/* 32 - _32 */ 0x202f, -/* 33 - _33 */ 0x2030, -/* 34 - _34 */ 0x2031, -/* 35 - _35 */ 0x2032, -/* 36 - */ 0, -/* 37 - _37 */ 0x2033, -/* 38 - _38 */ 0x2034, -/* 39 - _39 */ 0x2035, -/* 3a - _3A */ 0x2036, -/* 3b - _3B */ 0x2037, -/* 3c - _3C */ 0x2038, -/* 3d - _3D */ 0x2039, -/* 3e - */ 0, -/* 3f - _3F */ 0x203a, -/* 40 - _40 */ 0x203b, -/* 41 - _40 */ 0x203c, -/* 42 - _40 */ 0x203d, -/* 43 - _40 */ 0x203e, -/* 44 - _40 */ 0x203f, -/* 45 - _40 */ 0x2040, -/* 46 - _40 */ 0x2041, -/* 47 - _40 */ 0x2042, -/* 48 - _48 */ 0x2043, -/* 49 - _48 */ 0x2044, -/* 4a - _48 */ 0x2045, -/* 4b - _48 */ 0x2046, -/* 4c - _48 */ 0x2047, -/* 4d - _48 */ 0x2048, -/* 4e - _48 */ 0x2049, -/* 4f - _48 */ 0x204a, -/* 50 - _50 */ 0x204b, -/* 51 - _50 */ 0x204c, -/* 52 - _50 */ 0x204d, -/* 53 - _50 */ 0x204e, -/* 54 - _50 */ 0x204f, -/* 55 - _50 */ 0x2050, -/* 56 - _50 */ 0x2051, -/* 57 - _50 */ 0x2052, -/* 58 - _58 */ 0x2053, -/* 59 - _58 */ 0x2054, -/* 5a - _58 */ 0x2055, -/* 5b - _58 */ 0x2056, -/* 5c - _58 */ 0x2057, -/* 5d - _58 */ 0x2058, -/* 5e - _58 */ 0x2059, -/* 5f - _58 */ 0x205a, -/* 60 - _60 */ 0x205b, -/* 61 - _61 */ 0x205c, -/* 62 - _62 */ 0x205d, -/* 63 - _63 */ 0x205e, -/* 64 - */ 0, -/* 65 - */ 0, -/* 66 - */ 0, -/* 67 - */ 0, -/* 68 - _68 */ 0x205f, -/* 69 - _69 */ 0x4000, -/* 6a - _6A */ 0x2060, -/* 6b - _6B */ 0x4001, -/* 6c - _6C */ 0x2061, -/* 6d - _6D */ 0x2062, -/* 6e - _6E */ 0x2063, -/* 6f - _6F */ 0x2064, -/* 70 - _70 */ 0x2065, -/* 71 - _71 */ 0x2066, -/* 72 - _72 */ 0x2067, -/* 73 - _73 */ 0x2068, -/* 74 - _74 */ 0x2069, -/* 75 - _75 */ 0x206a, -/* 76 - _76 */ 0x206b, -/* 77 - _77 */ 0x206c, -/* 78 - _78 */ 0x206d, -/* 79 - _79 */ 0x206e, -/* 7a - _7A */ 0x206f, -/* 7b - _7B */ 0x2070, -/* 7c - _7C */ 0x2071, -/* 7d - _7D */ 0x2072, -/* 7e - _7E */ 0x2073, -/* 7f - _7F */ 0x2074, -/* 80 - _80 */ 0x6200, -/* 81 - _81 */ 0x6208, -/* 82 - _82 */ 0x6210, -/* 83 - _83 */ 0x6218, -/* 84 - _84 */ 0x2075, -/* 85 - _85 */ 0x2076, -/* 86 - _86 */ 0x2077, -/* 87 - _87 */ 0x2078, -/* 88 - _88 */ 0x2079, -/* 89 - _89 */ 0x207a, -/* 8a - _8A */ 0x207b, -/* 8b - _8B */ 0x207c, -/* 8c - _8C */ 0x207d, -/* 8d - _8D */ 0x207e, -/* 8e - _8E */ 0x207f, -/* 8f - _8F */ 0x6220, -/* 90 - _90 */ 0x2080, -/* 91 - _91 */ 0x2081, -/* 92 - _92 */ 0x2082, -/* 93 - _93 */ 0x2083, -/* 94 - _94 */ 0x2084, -/* 95 - _95 */ 0x2085, -/* 96 - _96 */ 0x2086, -/* 97 - _97 */ 0x2087, -/* 98 - _98 */ 0x4002, -/* 99 - _99 */ 0x4003, -/* 9a - _9A */ 0x2088, -/* 9b - */ 0, -/* 9c - _9C */ 0x2089, -/* 9d - _9D */ 0x208a, -/* 9e - _9E */ 0x208b, -/* 9f - _9F */ 0x208c, -/* a0 - _A0 */ 0x208d, -/* a1 - _A1 */ 0x208e, -/* a2 - _A2 */ 0x208f, -/* a3 - _A3 */ 0x2090, -/* a4 - _A4 */ 0x2091, -/* a5 - _A5 */ 0x2092, -/* a6 - _A6 */ 0x2093, -/* a7 - _A7 */ 0x2094, -/* a8 - _A8 */ 0x2095, -/* a9 - _A9 */ 0x2096, -/* aa - _AA */ 0x2097, -/* ab - _AB */ 0x2098, -/* ac - _AC */ 0x2099, -/* ad - _AD */ 0x209a, -/* ae - _AE */ 0x209b, -/* af - _AF */ 0x209c, -/* b0 - _B0 */ 0x209d, -/* b1 - _B0 */ 0x209e, -/* b2 - _B0 */ 0x209f, -/* b3 - _B0 */ 0x20a0, -/* b4 - _B0 */ 0x20a1, -/* b5 - _B0 */ 0x20a2, -/* b6 - _B0 */ 0x20a3, -/* b7 - _B0 */ 0x20a4, -/* b8 - _B8 */ 0x20a5, -/* b9 - _B8 */ 0x20a6, -/* ba - _B8 */ 0x20a7, -/* bb - _B8 */ 0x20a8, -/* bc - _B8 */ 0x20a9, -/* bd - _B8 */ 0x20aa, -/* be - _B8 */ 0x20ab, -/* bf - _B8 */ 0x20ac, -/* c0 - _C0 */ 0x6228, -/* c1 - _C1 */ 0x6230, -/* c2 - _C2 */ 0x20ad, -/* c3 - _C3 */ 0x20ae, -/* c4 - _C4 */ 0x20af, -/* c5 - _C5 */ 0x20b0, -/* c6 - _C6 */ 0x6238, -/* c7 - _C7 */ 0x6240, -/* c8 - _C8 */ 0x20b1, -/* c9 - _C9 */ 0x20b2, -/* ca - _CA */ 0x20b3, -/* cb - _CB */ 0x20b4, -/* cc - _CC */ 0x20b5, -/* cd - _CD */ 0x20b6, -/* ce - _CE */ 0x20b7, -/* cf - _CF */ 0x20b8, -/* d0 - _D0 */ 0x6248, -/* d1 - _D1 */ 0x6250, -/* d2 - _D2 */ 0x6258, -/* d3 - _D3 */ 0x6260, -/* d4 - _D4 */ 0x20b9, -/* d5 - _D5 */ 0x20ba, -/* d6 - _D6 */ 0x20bb, -/* d7 - _D7 */ 0x20bc, -/* d8 - _D8 */ 0xa268, -/* d9 - _D9 */ 0xa2b0, -/* da - _DA */ 0xa2f8, -/* db - _DB */ 0xa340, -/* dc - _DC */ 0xa388, -/* dd - _DD */ 0xa3d0, -/* de - _DE */ 0xa418, -/* df - _DF */ 0xa460, -/* e0 - _E0 */ 0x20bd, -/* e1 - _E1 */ 0x20be, -/* e2 - _E2 */ 0x20bf, -/* e3 - _E3 */ 0x4004, -/* e4 - _E4 */ 0x20c0, -/* e5 - _E5 */ 0x20c1, -/* e6 - _E6 */ 0x20c2, -/* e7 - _E7 */ 0x20c3, -/* e8 - _E8 */ 0x20c4, -/* e9 - _E9 */ 0x20c5, -/* ea - _EA */ 0x20c6, -/* eb - _EB */ 0x20c7, -/* ec - _EC */ 0x20c8, -/* ed - _ED */ 0x20c9, -/* ee - _EE */ 0x20ca, -/* ef - _EF */ 0x20cb, -/* f0 - */ 0, -/* f1 - _F1 */ 0x20cc, -/* f2 - */ 0, -/* f3 - */ 0, -/* f4 - _F4 */ 0x20cd, -/* f5 - _F5 */ 0x20ce, -/* f6 - _F6 */ 0x64a8, -/* f7 - _F7 */ 0x64b0, -/* f8 - _F8 */ 0x20cf, -/* f9 - _F9 */ 0x20d0, -/* fa - _FA */ 0x20d1, -/* fb - _FB */ 0x20d2, -/* fc - _FC */ 0x20d3, -/* fd - _FD */ 0x20d4, -/* fe - _FE */ 0x64b8, -/* ff - _FF */ 0x64c0, -/* 100 - _0F_00 */ 0x64c8, -/* 101 - _0F_01 */ 0xa4d0, -/* 102 - _0F_02 */ 0x20d5, -/* 103 - _0F_03 */ 0x20d6, -/* 104 - */ 0, -/* 105 - _0F_05 */ 0x20d7, -/* 106 - _0F_06 */ 0x20d8, -/* 107 - _0F_07 */ 0x20d9, -/* 108 - _0F_08 */ 0x20da, -/* 109 - _0F_09 */ 0x20db, -/* 10a - */ 0, -/* 10b - _0F_0B */ 0x20dc, -/* 10c - */ 0, -/* 10d - _0F_0D */ 0x6518, -/* 10e - _0F_0E */ 0x20dd, -/* 10f - _0F_0F */ 0x8520, -/* 110 - _0F_10 */ 0xc620, -/* 111 - _0F_11 */ 0xc62c, -/* 112 - _0F_12 */ 0xc638, -/* 113 - _0F_13 */ 0xc644, -/* 114 - _0F_14 */ 0xc650, -/* 115 - _0F_15 */ 0xc65c, -/* 116 - _0F_16 */ 0xc668, -/* 117 - _0F_17 */ 0xc674, -/* 118 - _0F_18 */ 0x6680, -/* 119 - */ 0, -/* 11a - */ 0, -/* 11b - */ 0, -/* 11c - */ 0, -/* 11d - */ 0, -/* 11e - */ 0, -/* 11f - _0F_1F */ 0x20de, -/* 120 - _0F_20 */ 0x20df, -/* 121 - _0F_21 */ 0x20e0, -/* 122 - _0F_22 */ 0x20e1, -/* 123 - _0F_23 */ 0x20e2, -/* 124 - */ 0, -/* 125 - */ 0, -/* 126 - */ 0, -/* 127 - */ 0, -/* 128 - _0F_28 */ 0xc688, -/* 129 - _0F_29 */ 0xc694, -/* 12a - _0F_2A */ 0xc6a0, -/* 12b - _0F_2B */ 0xc6ac, -/* 12c - _0F_2C */ 0xc6b8, -/* 12d - _0F_2D */ 0xc6c4, -/* 12e - _0F_2E */ 0xc6d0, -/* 12f - _0F_2F */ 0xc6dc, -/* 130 - _0F_30 */ 0x20e3, -/* 131 - _0F_31 */ 0x20e4, -/* 132 - _0F_32 */ 0x20e5, -/* 133 - _0F_33 */ 0x20e6, -/* 134 - _0F_34 */ 0x20e7, -/* 135 - _0F_35 */ 0x20e8, -/* 136 - */ 0, -/* 137 - _0F_37 */ 0x20e9, -/* 138 - _0F_38 */ 0x86e8, -/* 139 - */ 0, -/* 13a - _0F_3A */ 0x87e8, -/* 13b - */ 0, -/* 13c - */ 0, -/* 13d - */ 0, -/* 13e - */ 0, -/* 13f - */ 0, -/* 140 - _0F_40 */ 0x20ea, -/* 141 - _0F_41 */ 0x20eb, -/* 142 - _0F_42 */ 0x20ec, -/* 143 - _0F_43 */ 0x20ed, -/* 144 - _0F_44 */ 0x20ee, -/* 145 - _0F_45 */ 0x20ef, -/* 146 - _0F_46 */ 0x20f0, -/* 147 - _0F_47 */ 0x20f1, -/* 148 - _0F_48 */ 0x20f2, -/* 149 - _0F_49 */ 0x20f3, -/* 14a - _0F_4A */ 0x20f4, -/* 14b - _0F_4B */ 0x20f5, -/* 14c - _0F_4C */ 0x20f6, -/* 14d - _0F_4D */ 0x20f7, -/* 14e - _0F_4E */ 0x20f8, -/* 14f - _0F_4F */ 0x20f9, -/* 150 - _0F_50 */ 0xc8e8, -/* 151 - _0F_51 */ 0xc8f4, -/* 152 - _0F_52 */ 0xc900, -/* 153 - _0F_53 */ 0xc90c, -/* 154 - _0F_54 */ 0xc918, -/* 155 - _0F_55 */ 0xc924, -/* 156 - _0F_56 */ 0xc930, -/* 157 - _0F_57 */ 0xc93c, -/* 158 - _0F_58 */ 0xc948, -/* 159 - _0F_59 */ 0xc954, -/* 15a - _0F_5A */ 0xc960, -/* 15b - _0F_5B */ 0xc96c, -/* 15c - _0F_5C */ 0xc978, -/* 15d - _0F_5D */ 0xc984, -/* 15e - _0F_5E */ 0xc990, -/* 15f - _0F_5F */ 0xc99c, -/* 160 - _0F_60 */ 0xc9a8, -/* 161 - _0F_61 */ 0xc9b4, -/* 162 - _0F_62 */ 0xc9c0, -/* 163 - _0F_63 */ 0xc9cc, -/* 164 - _0F_64 */ 0xc9d8, -/* 165 - _0F_65 */ 0xc9e4, -/* 166 - _0F_66 */ 0xc9f0, -/* 167 - _0F_67 */ 0xc9fc, -/* 168 - _0F_68 */ 0xca08, -/* 169 - _0F_69 */ 0xca14, -/* 16a - _0F_6A */ 0xca20, -/* 16b - _0F_6B */ 0xca2c, -/* 16c - _0F_6C */ 0xca38, -/* 16d - _0F_6D */ 0xca44, -/* 16e - _0F_6E */ 0xca50, -/* 16f - _0F_6F */ 0xca5c, -/* 170 - _0F_70 */ 0xca68, -/* 171 - _0F_71 */ 0x6a74, -/* 172 - _0F_72 */ 0x6a7c, -/* 173 - _0F_73 */ 0x6a84, -/* 174 - _0F_74 */ 0xca8c, -/* 175 - _0F_75 */ 0xca98, -/* 176 - _0F_76 */ 0xcaa4, -/* 177 - _0F_77 */ 0xcab0, -/* 178 - _0F_78 */ 0xcabc, -/* 179 - _0F_79 */ 0xcac8, -/* 17a - _0F_7A */ 0x8ad4, -/* 17b - */ 0, -/* 17c - _0F_7C */ 0xcbd4, -/* 17d - _0F_7D */ 0xcbe0, -/* 17e - _0F_7E */ 0xcbec, -/* 17f - _0F_7F */ 0xcbf8, -/* 180 - _0F_80 */ 0x20fa, -/* 181 - _0F_81 */ 0x20fb, -/* 182 - _0F_82 */ 0x20fc, -/* 183 - _0F_83 */ 0x20fd, -/* 184 - _0F_84 */ 0x20fe, -/* 185 - _0F_85 */ 0x20ff, -/* 186 - _0F_86 */ 0x2100, -/* 187 - _0F_87 */ 0x2101, -/* 188 - _0F_88 */ 0x2102, -/* 189 - _0F_89 */ 0x2103, -/* 18a - _0F_8A */ 0x2104, -/* 18b - _0F_8B */ 0x2105, -/* 18c - _0F_8C */ 0x2106, -/* 18d - _0F_8D */ 0x2107, -/* 18e - _0F_8E */ 0x2108, -/* 18f - _0F_8F */ 0x2109, -/* 190 - _0F_90 */ 0x210a, -/* 191 - _0F_91 */ 0x210b, -/* 192 - _0F_92 */ 0x210c, -/* 193 - _0F_93 */ 0x210d, -/* 194 - _0F_94 */ 0x210e, -/* 195 - _0F_95 */ 0x210f, -/* 196 - _0F_96 */ 0x2110, -/* 197 - _0F_97 */ 0x2111, -/* 198 - _0F_98 */ 0x2112, -/* 199 - _0F_99 */ 0x2113, -/* 19a - _0F_9A */ 0x2114, -/* 19b - _0F_9B */ 0x2115, -/* 19c - _0F_9C */ 0x2116, -/* 19d - _0F_9D */ 0x2117, -/* 19e - _0F_9E */ 0x2118, -/* 19f - _0F_9F */ 0x2119, -/* 1a0 - _0F_A0 */ 0x211a, -/* 1a1 - _0F_A1 */ 0x211b, -/* 1a2 - _0F_A2 */ 0x211c, -/* 1a3 - _0F_A3 */ 0x211d, -/* 1a4 - _0F_A4 */ 0x4005, -/* 1a5 - _0F_A5 */ 0x4006, -/* 1a6 - */ 0, -/* 1a7 - */ 0, -/* 1a8 - _0F_A8 */ 0x211e, -/* 1a9 - _0F_A9 */ 0x211f, -/* 1aa - _0F_AA */ 0x2120, -/* 1ab - _0F_AB */ 0x2121, -/* 1ac - _0F_AC */ 0x4007, -/* 1ad - _0F_AD */ 0x4008, -/* 1ae - _0F_AE */ 0x6c04, -/* 1af - _0F_AF */ 0x2122, -/* 1b0 - _0F_B0 */ 0x2123, -/* 1b1 - _0F_B1 */ 0x2124, -/* 1b2 - _0F_B2 */ 0x2125, -/* 1b3 - _0F_B3 */ 0x2126, -/* 1b4 - _0F_B4 */ 0x2127, -/* 1b5 - _0F_B5 */ 0x2128, -/* 1b6 - _0F_B6 */ 0x2129, -/* 1b7 - _0F_B7 */ 0x212a, -/* 1b8 - _0F_B8 */ 0xcc0c, -/* 1b9 - _0F_B9 */ 0x212b, -/* 1ba - _0F_BA */ 0x6c18, -/* 1bb - _0F_BB */ 0x212c, -/* 1bc - _0F_BC */ 0xcc20, -/* 1bd - _0F_BD */ 0xcc2c, -/* 1be - _0F_BE */ 0x212d, -/* 1bf - _0F_BF */ 0x212e, -/* 1c0 - _0F_C0 */ 0x212f, -/* 1c1 - _0F_C1 */ 0x2130, -/* 1c2 - _0F_C2 */ 0xcc38, -/* 1c3 - _0F_C3 */ 0x2131, -/* 1c4 - _0F_C4 */ 0xcc44, -/* 1c5 - _0F_C5 */ 0xcc50, -/* 1c6 - _0F_C6 */ 0xcc5c, -/* 1c7 - _0F_C7 */ 0x6c68, -/* 1c8 - _0F_C8 */ 0x2132, -/* 1c9 - _0F_C8 */ 0x2133, -/* 1ca - _0F_C8 */ 0x2134, -/* 1cb - _0F_C8 */ 0x2135, -/* 1cc - _0F_C8 */ 0x2136, -/* 1cd - _0F_C8 */ 0x2137, -/* 1ce - _0F_C8 */ 0x2138, -/* 1cf - _0F_C8 */ 0x2139, -/* 1d0 - _0F_D0 */ 0xcc70, -/* 1d1 - _0F_D1 */ 0xcc7c, -/* 1d2 - _0F_D2 */ 0xcc88, -/* 1d3 - _0F_D3 */ 0xcc94, -/* 1d4 - _0F_D4 */ 0xcca0, -/* 1d5 - _0F_D5 */ 0xccac, -/* 1d6 - _0F_D6 */ 0xccb8, -/* 1d7 - _0F_D7 */ 0xccc4, -/* 1d8 - _0F_D8 */ 0xccd0, -/* 1d9 - _0F_D9 */ 0xccdc, -/* 1da - _0F_DA */ 0xcce8, -/* 1db - _0F_DB */ 0xccf4, -/* 1dc - _0F_DC */ 0xcd00, -/* 1dd - _0F_DD */ 0xcd0c, -/* 1de - _0F_DE */ 0xcd18, -/* 1df - _0F_DF */ 0xcd24, -/* 1e0 - _0F_E0 */ 0xcd30, -/* 1e1 - _0F_E1 */ 0xcd3c, -/* 1e2 - _0F_E2 */ 0xcd48, -/* 1e3 - _0F_E3 */ 0xcd54, -/* 1e4 - _0F_E4 */ 0xcd60, -/* 1e5 - _0F_E5 */ 0xcd6c, -/* 1e6 - _0F_E6 */ 0xcd78, -/* 1e7 - _0F_E7 */ 0xcd84, -/* 1e8 - _0F_E8 */ 0xcd90, -/* 1e9 - _0F_E9 */ 0xcd9c, -/* 1ea - _0F_EA */ 0xcda8, -/* 1eb - _0F_EB */ 0xcdb4, -/* 1ec - _0F_EC */ 0xcdc0, -/* 1ed - _0F_ED */ 0xcdcc, -/* 1ee - _0F_EE */ 0xcdd8, -/* 1ef - _0F_EF */ 0xcde4, -/* 1f0 - _0F_F0 */ 0xcdf0, -/* 1f1 - _0F_F1 */ 0xcdfc, -/* 1f2 - _0F_F2 */ 0xce08, -/* 1f3 - _0F_F3 */ 0xce14, -/* 1f4 - _0F_F4 */ 0xce20, -/* 1f5 - _0F_F5 */ 0xce2c, -/* 1f6 - _0F_F6 */ 0xce38, -/* 1f7 - _0F_F7 */ 0xce44, -/* 1f8 - _0F_F8 */ 0xce50, -/* 1f9 - _0F_F9 */ 0xce5c, -/* 1fa - _0F_FA */ 0xce68, -/* 1fb - _0F_FB */ 0xce74, -/* 1fc - _0F_FC */ 0xce80, -/* 1fd - _0F_FD */ 0xce8c, -/* 1fe - _0F_FE */ 0xce98, -/* 1ff - */ 0, -/* 200 - _80_00 */ 0x213a, -/* 201 - _80_01 */ 0x213b, -/* 202 - _80_02 */ 0x213c, -/* 203 - _80_03 */ 0x213d, -/* 204 - _80_04 */ 0x213e, -/* 205 - _80_05 */ 0x213f, -/* 206 - _80_06 */ 0x2140, -/* 207 - _80_07 */ 0x2141, -/* 208 - _81_00 */ 0x2142, -/* 209 - _81_01 */ 0x2143, -/* 20a - _81_02 */ 0x2144, -/* 20b - _81_03 */ 0x2145, -/* 20c - _81_04 */ 0x2146, -/* 20d - _81_05 */ 0x2147, -/* 20e - _81_06 */ 0x2148, -/* 20f - _81_07 */ 0x2149, -/* 210 - _82_00 */ 0x214a, -/* 211 - _82_01 */ 0x214b, -/* 212 - _82_02 */ 0x214c, -/* 213 - _82_03 */ 0x214d, -/* 214 - _82_04 */ 0x214e, -/* 215 - _82_05 */ 0x214f, -/* 216 - _82_06 */ 0x2150, -/* 217 - _82_07 */ 0x2151, -/* 218 - _83_00 */ 0x2152, -/* 219 - _83_01 */ 0x2153, -/* 21a - _83_02 */ 0x2154, -/* 21b - _83_03 */ 0x2155, -/* 21c - _83_04 */ 0x2156, -/* 21d - _83_05 */ 0x2157, -/* 21e - _83_06 */ 0x2158, -/* 21f - _83_07 */ 0x2159, -/* 220 - _8F_00 */ 0x215a, -/* 221 - */ 0, -/* 222 - */ 0, -/* 223 - */ 0, -/* 224 - */ 0, -/* 225 - */ 0, -/* 226 - */ 0, -/* 227 - */ 0, -/* 228 - _C0_00 */ 0x215b, -/* 229 - _C0_01 */ 0x215c, -/* 22a - _C0_02 */ 0x215d, -/* 22b - _C0_03 */ 0x215e, -/* 22c - _C0_04 */ 0x215f, -/* 22d - _C0_05 */ 0x2160, -/* 22e - _C0_06 */ 0x2161, -/* 22f - _C0_07 */ 0x2162, -/* 230 - _C1_00 */ 0x2163, -/* 231 - _C1_01 */ 0x2164, -/* 232 - _C1_02 */ 0x2165, -/* 233 - _C1_03 */ 0x2166, -/* 234 - _C1_04 */ 0x2167, -/* 235 - _C1_05 */ 0x2168, -/* 236 - _C1_06 */ 0x2169, -/* 237 - _C1_07 */ 0x216a, -/* 238 - _C6_00 */ 0x216b, -/* 239 - */ 0, -/* 23a - */ 0, -/* 23b - */ 0, -/* 23c - */ 0, -/* 23d - */ 0, -/* 23e - */ 0, -/* 23f - */ 0, -/* 240 - _C7_00 */ 0x216c, -/* 241 - */ 0, -/* 242 - */ 0, -/* 243 - */ 0, -/* 244 - */ 0, -/* 245 - */ 0, -/* 246 - */ 0, -/* 247 - */ 0, -/* 248 - _D0_00 */ 0x216d, -/* 249 - _D0_01 */ 0x216e, -/* 24a - _D0_02 */ 0x216f, -/* 24b - _D0_03 */ 0x2170, -/* 24c - _D0_04 */ 0x2171, -/* 24d - _D0_05 */ 0x2172, -/* 24e - _D0_06 */ 0x2173, -/* 24f - _D0_07 */ 0x2174, -/* 250 - _D1_00 */ 0x2175, -/* 251 - _D1_01 */ 0x2176, -/* 252 - _D1_02 */ 0x2177, -/* 253 - _D1_03 */ 0x2178, -/* 254 - _D1_04 */ 0x2179, -/* 255 - _D1_05 */ 0x217a, -/* 256 - _D1_06 */ 0x217b, -/* 257 - _D1_07 */ 0x217c, -/* 258 - _D2_00 */ 0x217d, -/* 259 - _D2_01 */ 0x217e, -/* 25a - _D2_02 */ 0x217f, -/* 25b - _D2_03 */ 0x2180, -/* 25c - _D2_04 */ 0x2181, -/* 25d - _D2_05 */ 0x2182, -/* 25e - _D2_06 */ 0x2183, -/* 25f - _D2_07 */ 0x2184, -/* 260 - _D3_00 */ 0x2185, -/* 261 - _D3_01 */ 0x2186, -/* 262 - _D3_02 */ 0x2187, -/* 263 - _D3_03 */ 0x2188, -/* 264 - _D3_04 */ 0x2189, -/* 265 - _D3_05 */ 0x218a, -/* 266 - _D3_06 */ 0x218b, -/* 267 - _D3_07 */ 0x218c, -/* 268 - _D8_00 */ 0x218d, -/* 269 - _D8_01 */ 0x218e, -/* 26a - _D8_02 */ 0x218f, -/* 26b - _D8_03 */ 0x2190, -/* 26c - _D8_04 */ 0x2191, -/* 26d - _D8_05 */ 0x2192, -/* 26e - _D8_06 */ 0x2193, -/* 26f - _D8_07 */ 0x2194, -/* 270 - _D8_C0 */ 0x2195, -/* 271 - _D8_C0 */ 0x2196, -/* 272 - _D8_C0 */ 0x2197, -/* 273 - _D8_C0 */ 0x2198, -/* 274 - _D8_C0 */ 0x2199, -/* 275 - _D8_C0 */ 0x219a, -/* 276 - _D8_C0 */ 0x219b, -/* 277 - _D8_C0 */ 0x219c, -/* 278 - _D8_C8 */ 0x219d, -/* 279 - _D8_C8 */ 0x219e, -/* 27a - _D8_C8 */ 0x219f, -/* 27b - _D8_C8 */ 0x21a0, -/* 27c - _D8_C8 */ 0x21a1, -/* 27d - _D8_C8 */ 0x21a2, -/* 27e - _D8_C8 */ 0x21a3, -/* 27f - _D8_C8 */ 0x21a4, -/* 280 - _D8_D0 */ 0x21a5, -/* 281 - _D8_D0 */ 0x21a6, -/* 282 - _D8_D0 */ 0x21a7, -/* 283 - _D8_D0 */ 0x21a8, -/* 284 - _D8_D0 */ 0x21a9, -/* 285 - _D8_D0 */ 0x21aa, -/* 286 - _D8_D0 */ 0x21ab, -/* 287 - _D8_D0 */ 0x21ac, -/* 288 - _D8_D8 */ 0x21ad, -/* 289 - _D8_D9 */ 0x21ae, -/* 28a - _D8_D8 */ 0x21af, -/* 28b - _D8_D8 */ 0x21b0, -/* 28c - _D8_D8 */ 0x21b1, -/* 28d - _D8_D8 */ 0x21b2, -/* 28e - _D8_D8 */ 0x21b3, -/* 28f - _D8_D8 */ 0x21b4, -/* 290 - _D8_E0 */ 0x21b5, -/* 291 - _D8_E0 */ 0x21b6, -/* 292 - _D8_E0 */ 0x21b7, -/* 293 - _D8_E0 */ 0x21b8, -/* 294 - _D8_E0 */ 0x21b9, -/* 295 - _D8_E0 */ 0x21ba, -/* 296 - _D8_E0 */ 0x21bb, -/* 297 - _D8_E0 */ 0x21bc, -/* 298 - _D8_E8 */ 0x21bd, -/* 299 - _D8_E8 */ 0x21be, -/* 29a - _D8_E8 */ 0x21bf, -/* 29b - _D8_E8 */ 0x21c0, -/* 29c - _D8_E8 */ 0x21c1, -/* 29d - _D8_E8 */ 0x21c2, -/* 29e - _D8_E8 */ 0x21c3, -/* 29f - _D8_E8 */ 0x21c4, -/* 2a0 - _D8_F0 */ 0x21c5, -/* 2a1 - _D8_F0 */ 0x21c6, -/* 2a2 - _D8_F0 */ 0x21c7, -/* 2a3 - _D8_F0 */ 0x21c8, -/* 2a4 - _D8_F0 */ 0x21c9, -/* 2a5 - _D8_F0 */ 0x21ca, -/* 2a6 - _D8_F0 */ 0x21cb, -/* 2a7 - _D8_F0 */ 0x21cc, -/* 2a8 - _D8_F8 */ 0x21cd, -/* 2a9 - _D8_F8 */ 0x21ce, -/* 2aa - _D8_F8 */ 0x21cf, -/* 2ab - _D8_F8 */ 0x21d0, -/* 2ac - _D8_F8 */ 0x21d1, -/* 2ad - _D8_F8 */ 0x21d2, -/* 2ae - _D8_F8 */ 0x21d3, -/* 2af - _D8_F8 */ 0x21d4, -/* 2b0 - _D9_00 */ 0x21d5, -/* 2b1 - */ 0, -/* 2b2 - _D9_02 */ 0x21d6, -/* 2b3 - _D9_03 */ 0x21d7, -/* 2b4 - _D9_04 */ 0x21d8, -/* 2b5 - _D9_05 */ 0x21d9, -/* 2b6 - _D9_06 */ 0xcea4, -/* 2b7 - _D9_07 */ 0xceb0, -/* 2b8 - _D9_C0 */ 0x21da, -/* 2b9 - _D9_C0 */ 0x21db, -/* 2ba - _D9_C0 */ 0x21dc, -/* 2bb - _D9_C0 */ 0x21dd, -/* 2bc - _D9_C0 */ 0x21de, -/* 2bd - _D9_C0 */ 0x21df, -/* 2be - _D9_C0 */ 0x21e0, -/* 2bf - _D9_C0 */ 0x21e1, -/* 2c0 - _D9_C8 */ 0x21e2, -/* 2c1 - _D9_C9 */ 0x21e3, -/* 2c2 - _D9_C8 */ 0x21e4, -/* 2c3 - _D9_C8 */ 0x21e5, -/* 2c4 - _D9_C8 */ 0x21e6, -/* 2c5 - _D9_C8 */ 0x21e7, -/* 2c6 - _D9_C8 */ 0x21e8, -/* 2c7 - _D9_C8 */ 0x21e9, -/* 2c8 - _D9_D0 */ 0x21ea, -/* 2c9 - */ 0, -/* 2ca - */ 0, -/* 2cb - */ 0, -/* 2cc - */ 0, -/* 2cd - */ 0, -/* 2ce - */ 0, -/* 2cf - */ 0, -/* 2d0 - */ 0, -/* 2d1 - */ 0, -/* 2d2 - */ 0, -/* 2d3 - */ 0, -/* 2d4 - */ 0, -/* 2d5 - */ 0, -/* 2d6 - */ 0, -/* 2d7 - */ 0, -/* 2d8 - _D9_E0 */ 0x21eb, -/* 2d9 - _D9_E1 */ 0x21ec, -/* 2da - */ 0, -/* 2db - */ 0, -/* 2dc - _D9_E4 */ 0x21ed, -/* 2dd - _D9_E5 */ 0x21ee, -/* 2de - */ 0, -/* 2df - */ 0, -/* 2e0 - _D9_E8 */ 0x21ef, -/* 2e1 - _D9_E9 */ 0x21f0, -/* 2e2 - _D9_EA */ 0x21f1, -/* 2e3 - _D9_EB */ 0x21f2, -/* 2e4 - _D9_EC */ 0x21f3, -/* 2e5 - _D9_ED */ 0x21f4, -/* 2e6 - _D9_EE */ 0x21f5, -/* 2e7 - */ 0, -/* 2e8 - _D9_F0 */ 0x21f6, -/* 2e9 - _D9_F1 */ 0x21f7, -/* 2ea - _D9_F2 */ 0x21f8, -/* 2eb - _D9_F3 */ 0x21f9, -/* 2ec - _D9_F4 */ 0x21fa, -/* 2ed - _D9_F5 */ 0x21fb, -/* 2ee - _D9_F6 */ 0x21fc, -/* 2ef - _D9_F7 */ 0x21fd, -/* 2f0 - _D9_F8 */ 0x21fe, -/* 2f1 - _D9_F9 */ 0x21ff, -/* 2f2 - _D9_FA */ 0x2200, -/* 2f3 - _D9_FB */ 0x2201, -/* 2f4 - _D9_FC */ 0x2202, -/* 2f5 - _D9_FD */ 0x2203, -/* 2f6 - _D9_FE */ 0x2204, -/* 2f7 - _D9_FF */ 0x2205, -/* 2f8 - _DA_00 */ 0x2206, -/* 2f9 - _DA_01 */ 0x2207, -/* 2fa - _DA_02 */ 0x2208, -/* 2fb - _DA_03 */ 0x2209, -/* 2fc - _DA_04 */ 0x220a, -/* 2fd - _DA_05 */ 0x220b, -/* 2fe - _DA_06 */ 0x220c, -/* 2ff - _DA_07 */ 0x220d, -/* 300 - _DA_C0 */ 0x220e, -/* 301 - _DA_C0 */ 0x220f, -/* 302 - _DA_C0 */ 0x2210, -/* 303 - _DA_C0 */ 0x2211, -/* 304 - _DA_C0 */ 0x2212, -/* 305 - _DA_C0 */ 0x2213, -/* 306 - _DA_C0 */ 0x2214, -/* 307 - _DA_C0 */ 0x2215, -/* 308 - _DA_C8 */ 0x2216, -/* 309 - _DA_C8 */ 0x2217, -/* 30a - _DA_C8 */ 0x2218, -/* 30b - _DA_C8 */ 0x2219, -/* 30c - _DA_C8 */ 0x221a, -/* 30d - _DA_C8 */ 0x221b, -/* 30e - _DA_C8 */ 0x221c, -/* 30f - _DA_C8 */ 0x221d, -/* 310 - _DA_D0 */ 0x221e, -/* 311 - _DA_D0 */ 0x221f, -/* 312 - _DA_D0 */ 0x2220, -/* 313 - _DA_D0 */ 0x2221, -/* 314 - _DA_D0 */ 0x2222, -/* 315 - _DA_D0 */ 0x2223, -/* 316 - _DA_D0 */ 0x2224, -/* 317 - _DA_D0 */ 0x2225, -/* 318 - _DA_D8 */ 0x2226, -/* 319 - _DA_D8 */ 0x2227, -/* 31a - _DA_D8 */ 0x2228, -/* 31b - _DA_D8 */ 0x2229, -/* 31c - _DA_D8 */ 0x222a, -/* 31d - _DA_D8 */ 0x222b, -/* 31e - _DA_D8 */ 0x222c, -/* 31f - _DA_D8 */ 0x222d, -/* 320 - */ 0, -/* 321 - */ 0, -/* 322 - */ 0, -/* 323 - */ 0, -/* 324 - */ 0, -/* 325 - */ 0, -/* 326 - */ 0, -/* 327 - */ 0, -/* 328 - */ 0, -/* 329 - _DA_E9 */ 0x222e, -/* 32a - */ 0, -/* 32b - */ 0, -/* 32c - */ 0, -/* 32d - */ 0, -/* 32e - */ 0, -/* 32f - */ 0, -/* 330 - */ 0, -/* 331 - */ 0, -/* 332 - */ 0, -/* 333 - */ 0, -/* 334 - */ 0, -/* 335 - */ 0, -/* 336 - */ 0, -/* 337 - */ 0, -/* 338 - */ 0, -/* 339 - */ 0, -/* 33a - */ 0, -/* 33b - */ 0, -/* 33c - */ 0, -/* 33d - */ 0, -/* 33e - */ 0, -/* 33f - */ 0, -/* 340 - _DB_00 */ 0x222f, -/* 341 - _DB_01 */ 0x2230, -/* 342 - _DB_02 */ 0x2231, -/* 343 - _DB_03 */ 0x2232, -/* 344 - */ 0, -/* 345 - _DB_05 */ 0x2233, -/* 346 - */ 0, -/* 347 - _DB_07 */ 0x2234, -/* 348 - _DB_C0 */ 0x2235, -/* 349 - _DB_C0 */ 0x2236, -/* 34a - _DB_C0 */ 0x2237, -/* 34b - _DB_C0 */ 0x2238, -/* 34c - _DB_C0 */ 0x2239, -/* 34d - _DB_C0 */ 0x223a, -/* 34e - _DB_C0 */ 0x223b, -/* 34f - _DB_C0 */ 0x223c, -/* 350 - _DB_C8 */ 0x223d, -/* 351 - _DB_C8 */ 0x223e, -/* 352 - _DB_C8 */ 0x223f, -/* 353 - _DB_C8 */ 0x2240, -/* 354 - _DB_C8 */ 0x2241, -/* 355 - _DB_C8 */ 0x2242, -/* 356 - _DB_C8 */ 0x2243, -/* 357 - _DB_C8 */ 0x2244, -/* 358 - _DB_D0 */ 0x2245, -/* 359 - _DB_D0 */ 0x2246, -/* 35a - _DB_D0 */ 0x2247, -/* 35b - _DB_D0 */ 0x2248, -/* 35c - _DB_D0 */ 0x2249, -/* 35d - _DB_D0 */ 0x224a, -/* 35e - _DB_D0 */ 0x224b, -/* 35f - _DB_D0 */ 0x224c, -/* 360 - _DB_D8 */ 0x224d, -/* 361 - _DB_D8 */ 0x224e, -/* 362 - _DB_D8 */ 0x224f, -/* 363 - _DB_D8 */ 0x2250, -/* 364 - _DB_D8 */ 0x2251, -/* 365 - _DB_D8 */ 0x2252, -/* 366 - _DB_D8 */ 0x2253, -/* 367 - _DB_D8 */ 0x2254, -/* 368 - _DB_E0 */ 0x2255, -/* 369 - _DB_E1 */ 0x2256, -/* 36a - _DB_E2 */ 0xcebc, -/* 36b - _DB_E3 */ 0xcec8, -/* 36c - _DB_E4 */ 0x2257, -/* 36d - */ 0, -/* 36e - */ 0, -/* 36f - */ 0, -/* 370 - _DB_E8 */ 0x2258, -/* 371 - _DB_E8 */ 0x2259, -/* 372 - _DB_E8 */ 0x225a, -/* 373 - _DB_E8 */ 0x225b, -/* 374 - _DB_E8 */ 0x225c, -/* 375 - _DB_E8 */ 0x225d, -/* 376 - _DB_E8 */ 0x225e, -/* 377 - _DB_E8 */ 0x225f, -/* 378 - _DB_F0 */ 0x2260, -/* 379 - _DB_F0 */ 0x2261, -/* 37a - _DB_F0 */ 0x2262, -/* 37b - _DB_F0 */ 0x2263, -/* 37c - _DB_F0 */ 0x2264, -/* 37d - _DB_F0 */ 0x2265, -/* 37e - _DB_F0 */ 0x2266, -/* 37f - _DB_F0 */ 0x2267, -/* 380 - */ 0, -/* 381 - */ 0, -/* 382 - */ 0, -/* 383 - */ 0, -/* 384 - */ 0, -/* 385 - */ 0, -/* 386 - */ 0, -/* 387 - */ 0, -/* 388 - _DC_00 */ 0x2268, -/* 389 - _DC_01 */ 0x2269, -/* 38a - _DC_02 */ 0x226a, -/* 38b - _DC_03 */ 0x226b, -/* 38c - _DC_04 */ 0x226c, -/* 38d - _DC_05 */ 0x226d, -/* 38e - _DC_06 */ 0x226e, -/* 38f - _DC_07 */ 0x226f, -/* 390 - _DC_C0 */ 0x2270, -/* 391 - _DC_C0 */ 0x2271, -/* 392 - _DC_C0 */ 0x2272, -/* 393 - _DC_C0 */ 0x2273, -/* 394 - _DC_C0 */ 0x2274, -/* 395 - _DC_C0 */ 0x2275, -/* 396 - _DC_C0 */ 0x2276, -/* 397 - _DC_C0 */ 0x2277, -/* 398 - _DC_C8 */ 0x2278, -/* 399 - _DC_C8 */ 0x2279, -/* 39a - _DC_C8 */ 0x227a, -/* 39b - _DC_C8 */ 0x227b, -/* 39c - _DC_C8 */ 0x227c, -/* 39d - _DC_C8 */ 0x227d, -/* 39e - _DC_C8 */ 0x227e, -/* 39f - _DC_C8 */ 0x227f, -/* 3a0 - */ 0, -/* 3a1 - */ 0, -/* 3a2 - */ 0, -/* 3a3 - */ 0, -/* 3a4 - */ 0, -/* 3a5 - */ 0, -/* 3a6 - */ 0, -/* 3a7 - */ 0, -/* 3a8 - */ 0, -/* 3a9 - */ 0, -/* 3aa - */ 0, -/* 3ab - */ 0, -/* 3ac - */ 0, -/* 3ad - */ 0, -/* 3ae - */ 0, -/* 3af - */ 0, -/* 3b0 - _DC_E0 */ 0x2280, -/* 3b1 - _DC_E0 */ 0x2281, -/* 3b2 - _DC_E0 */ 0x2282, -/* 3b3 - _DC_E0 */ 0x2283, -/* 3b4 - _DC_E0 */ 0x2284, -/* 3b5 - _DC_E0 */ 0x2285, -/* 3b6 - _DC_E0 */ 0x2286, -/* 3b7 - _DC_E0 */ 0x2287, -/* 3b8 - _DC_E8 */ 0x2288, -/* 3b9 - _DC_E8 */ 0x2289, -/* 3ba - _DC_E8 */ 0x228a, -/* 3bb - _DC_E8 */ 0x228b, -/* 3bc - _DC_E8 */ 0x228c, -/* 3bd - _DC_E8 */ 0x228d, -/* 3be - _DC_E8 */ 0x228e, -/* 3bf - _DC_E8 */ 0x228f, -/* 3c0 - _DC_F0 */ 0x2290, -/* 3c1 - _DC_F0 */ 0x2291, -/* 3c2 - _DC_F0 */ 0x2292, -/* 3c3 - _DC_F0 */ 0x2293, -/* 3c4 - _DC_F0 */ 0x2294, -/* 3c5 - _DC_F0 */ 0x2295, -/* 3c6 - _DC_F0 */ 0x2296, -/* 3c7 - _DC_F0 */ 0x2297, -/* 3c8 - _DC_F8 */ 0x2298, -/* 3c9 - _DC_F8 */ 0x2299, -/* 3ca - _DC_F8 */ 0x229a, -/* 3cb - _DC_F8 */ 0x229b, -/* 3cc - _DC_F8 */ 0x229c, -/* 3cd - _DC_F8 */ 0x229d, -/* 3ce - _DC_F8 */ 0x229e, -/* 3cf - _DC_F8 */ 0x229f, -/* 3d0 - _DD_00 */ 0x22a0, -/* 3d1 - _DD_01 */ 0x22a1, -/* 3d2 - _DD_02 */ 0x22a2, -/* 3d3 - _DD_03 */ 0x22a3, -/* 3d4 - _DD_04 */ 0x22a4, -/* 3d5 - */ 0, -/* 3d6 - _DD_06 */ 0xced4, -/* 3d7 - _DD_07 */ 0xcee0, -/* 3d8 - _DD_C0 */ 0x22a5, -/* 3d9 - _DD_C0 */ 0x22a6, -/* 3da - _DD_C0 */ 0x22a7, -/* 3db - _DD_C0 */ 0x22a8, -/* 3dc - _DD_C0 */ 0x22a9, -/* 3dd - _DD_C0 */ 0x22aa, -/* 3de - _DD_C0 */ 0x22ab, -/* 3df - _DD_C0 */ 0x22ac, -/* 3e0 - */ 0, -/* 3e1 - */ 0, -/* 3e2 - */ 0, -/* 3e3 - */ 0, -/* 3e4 - */ 0, -/* 3e5 - */ 0, -/* 3e6 - */ 0, -/* 3e7 - */ 0, -/* 3e8 - _DD_D0 */ 0x22ad, -/* 3e9 - _DD_D0 */ 0x22ae, -/* 3ea - _DD_D0 */ 0x22af, -/* 3eb - _DD_D0 */ 0x22b0, -/* 3ec - _DD_D0 */ 0x22b1, -/* 3ed - _DD_D0 */ 0x22b2, -/* 3ee - _DD_D0 */ 0x22b3, -/* 3ef - _DD_D0 */ 0x22b4, -/* 3f0 - _DD_D8 */ 0x22b5, -/* 3f1 - _DD_D8 */ 0x22b6, -/* 3f2 - _DD_D8 */ 0x22b7, -/* 3f3 - _DD_D8 */ 0x22b8, -/* 3f4 - _DD_D8 */ 0x22b9, -/* 3f5 - _DD_D8 */ 0x22ba, -/* 3f6 - _DD_D8 */ 0x22bb, -/* 3f7 - _DD_D8 */ 0x22bc, -/* 3f8 - _DD_E0 */ 0x22bd, -/* 3f9 - _DD_E1 */ 0x22be, -/* 3fa - _DD_E0 */ 0x22bf, -/* 3fb - _DD_E0 */ 0x22c0, -/* 3fc - _DD_E0 */ 0x22c1, -/* 3fd - _DD_E0 */ 0x22c2, -/* 3fe - _DD_E0 */ 0x22c3, -/* 3ff - _DD_E0 */ 0x22c4, -/* 400 - _DD_E8 */ 0x22c5, -/* 401 - _DD_E9 */ 0x22c6, -/* 402 - _DD_E8 */ 0x22c7, -/* 403 - _DD_E8 */ 0x22c8, -/* 404 - _DD_E8 */ 0x22c9, -/* 405 - _DD_E8 */ 0x22ca, -/* 406 - _DD_E8 */ 0x22cb, -/* 407 - _DD_E8 */ 0x22cc, -/* 408 - */ 0, -/* 409 - */ 0, -/* 40a - */ 0, -/* 40b - */ 0, -/* 40c - */ 0, -/* 40d - */ 0, -/* 40e - */ 0, -/* 40f - */ 0, -/* 410 - */ 0, -/* 411 - */ 0, -/* 412 - */ 0, -/* 413 - */ 0, -/* 414 - */ 0, -/* 415 - */ 0, -/* 416 - */ 0, -/* 417 - */ 0, -/* 418 - _DE_00 */ 0x22cd, -/* 419 - _DE_01 */ 0x22ce, -/* 41a - _DE_02 */ 0x22cf, -/* 41b - _DE_03 */ 0x22d0, -/* 41c - _DE_04 */ 0x22d1, -/* 41d - _DE_05 */ 0x22d2, -/* 41e - _DE_06 */ 0x22d3, -/* 41f - _DE_07 */ 0x22d4, -/* 420 - _DE_C0 */ 0x22d5, -/* 421 - _DE_C1 */ 0x22d6, -/* 422 - _DE_C0 */ 0x22d7, -/* 423 - _DE_C0 */ 0x22d8, -/* 424 - _DE_C0 */ 0x22d9, -/* 425 - _DE_C0 */ 0x22da, -/* 426 - _DE_C0 */ 0x22db, -/* 427 - _DE_C0 */ 0x22dc, -/* 428 - _DE_C8 */ 0x22dd, -/* 429 - _DE_C9 */ 0x22de, -/* 42a - _DE_C8 */ 0x22df, -/* 42b - _DE_C8 */ 0x22e0, -/* 42c - _DE_C8 */ 0x22e1, -/* 42d - _DE_C8 */ 0x22e2, -/* 42e - _DE_C8 */ 0x22e3, -/* 42f - _DE_C8 */ 0x22e4, -/* 430 - */ 0, -/* 431 - */ 0, -/* 432 - */ 0, -/* 433 - */ 0, -/* 434 - */ 0, -/* 435 - */ 0, -/* 436 - */ 0, -/* 437 - */ 0, -/* 438 - */ 0, -/* 439 - _DE_D9 */ 0x22e5, -/* 43a - */ 0, -/* 43b - */ 0, -/* 43c - */ 0, -/* 43d - */ 0, -/* 43e - */ 0, -/* 43f - */ 0, -/* 440 - _DE_E0 */ 0x22e6, -/* 441 - _DE_E1 */ 0x22e7, -/* 442 - _DE_E0 */ 0x22e8, -/* 443 - _DE_E0 */ 0x22e9, -/* 444 - _DE_E0 */ 0x22ea, -/* 445 - _DE_E0 */ 0x22eb, -/* 446 - _DE_E0 */ 0x22ec, -/* 447 - _DE_E0 */ 0x22ed, -/* 448 - _DE_E8 */ 0x22ee, -/* 449 - _DE_E9 */ 0x22ef, -/* 44a - _DE_E8 */ 0x22f0, -/* 44b - _DE_E8 */ 0x22f1, -/* 44c - _DE_E8 */ 0x22f2, -/* 44d - _DE_E8 */ 0x22f3, -/* 44e - _DE_E8 */ 0x22f4, -/* 44f - _DE_E8 */ 0x22f5, -/* 450 - _DE_F0 */ 0x22f6, -/* 451 - _DE_F1 */ 0x22f7, -/* 452 - _DE_F0 */ 0x22f8, -/* 453 - _DE_F0 */ 0x22f9, -/* 454 - _DE_F0 */ 0x22fa, -/* 455 - _DE_F0 */ 0x22fb, -/* 456 - _DE_F0 */ 0x22fc, -/* 457 - _DE_F0 */ 0x22fd, -/* 458 - _DE_F8 */ 0x22fe, -/* 459 - _DE_F9 */ 0x22ff, -/* 45a - _DE_F8 */ 0x2300, -/* 45b - _DE_F8 */ 0x2301, -/* 45c - _DE_F8 */ 0x2302, -/* 45d - _DE_F8 */ 0x2303, -/* 45e - _DE_F8 */ 0x2304, -/* 45f - _DE_F8 */ 0x2305, -/* 460 - _DF_00 */ 0x2306, -/* 461 - _DF_01 */ 0x2307, -/* 462 - _DF_02 */ 0x2308, -/* 463 - _DF_03 */ 0x2309, -/* 464 - _DF_04 */ 0x230a, -/* 465 - _DF_05 */ 0x230b, -/* 466 - _DF_06 */ 0x230c, -/* 467 - _DF_07 */ 0x230d, -/* 468 - */ 0, -/* 469 - */ 0, -/* 46a - */ 0, -/* 46b - */ 0, -/* 46c - */ 0, -/* 46d - */ 0, -/* 46e - */ 0, -/* 46f - */ 0, -/* 470 - */ 0, -/* 471 - */ 0, -/* 472 - */ 0, -/* 473 - */ 0, -/* 474 - */ 0, -/* 475 - */ 0, -/* 476 - */ 0, -/* 477 - */ 0, -/* 478 - */ 0, -/* 479 - */ 0, -/* 47a - */ 0, -/* 47b - */ 0, -/* 47c - */ 0, -/* 47d - */ 0, -/* 47e - */ 0, -/* 47f - */ 0, -/* 480 - */ 0, -/* 481 - */ 0, -/* 482 - */ 0, -/* 483 - */ 0, -/* 484 - */ 0, -/* 485 - */ 0, -/* 486 - */ 0, -/* 487 - */ 0, -/* 488 - _DF_E0 */ 0xceec, -/* 489 - */ 0, -/* 48a - */ 0, -/* 48b - */ 0, -/* 48c - */ 0, -/* 48d - */ 0, -/* 48e - */ 0, -/* 48f - */ 0, -/* 490 - _DF_E8 */ 0x230e, -/* 491 - _DF_E8 */ 0x230f, -/* 492 - _DF_E8 */ 0x2310, -/* 493 - _DF_E8 */ 0x2311, -/* 494 - _DF_E8 */ 0x2312, -/* 495 - _DF_E8 */ 0x2313, -/* 496 - _DF_E8 */ 0x2314, -/* 497 - _DF_E8 */ 0x2315, -/* 498 - _DF_F0 */ 0x2316, -/* 499 - _DF_F0 */ 0x2317, -/* 49a - _DF_F0 */ 0x2318, -/* 49b - _DF_F0 */ 0x2319, -/* 49c - _DF_F0 */ 0x231a, -/* 49d - _DF_F0 */ 0x231b, -/* 49e - _DF_F0 */ 0x231c, -/* 49f - _DF_F0 */ 0x231d, -/* 4a0 - */ 0, -/* 4a1 - */ 0, -/* 4a2 - */ 0, -/* 4a3 - */ 0, -/* 4a4 - */ 0, -/* 4a5 - */ 0, -/* 4a6 - */ 0, -/* 4a7 - */ 0, -/* 4a8 - _F6_00 */ 0x231e, -/* 4a9 - */ 0, -/* 4aa - _F6_02 */ 0x231f, -/* 4ab - _F6_03 */ 0x2320, -/* 4ac - _F6_04 */ 0x2321, -/* 4ad - _F6_05 */ 0x2322, -/* 4ae - _F6_06 */ 0x2323, -/* 4af - _F6_07 */ 0x2324, -/* 4b0 - _F7_00 */ 0x2325, -/* 4b1 - */ 0, -/* 4b2 - _F7_02 */ 0x2326, -/* 4b3 - _F7_03 */ 0x2327, -/* 4b4 - _F7_04 */ 0x2328, -/* 4b5 - _F7_05 */ 0x2329, -/* 4b6 - _F7_06 */ 0x232a, -/* 4b7 - _F7_07 */ 0x232b, -/* 4b8 - _FE_00 */ 0x232c, -/* 4b9 - _FE_01 */ 0x232d, -/* 4ba - */ 0, -/* 4bb - */ 0, -/* 4bc - */ 0, -/* 4bd - */ 0, -/* 4be - */ 0, -/* 4bf - */ 0, -/* 4c0 - _FF_00 */ 0x232e, -/* 4c1 - _FF_01 */ 0x232f, -/* 4c2 - _FF_02 */ 0x2330, -/* 4c3 - _FF_03 */ 0x2331, -/* 4c4 - _FF_04 */ 0x2332, -/* 4c5 - _FF_05 */ 0x2333, -/* 4c6 - _FF_06 */ 0x2334, -/* 4c7 - */ 0, -/* 4c8 - _0F_00_00 */ 0x2335, -/* 4c9 - _0F_00_01 */ 0x2336, -/* 4ca - _0F_00_02 */ 0x2337, -/* 4cb - _0F_00_03 */ 0x2338, -/* 4cc - _0F_00_04 */ 0x2339, -/* 4cd - _0F_00_05 */ 0x233a, -/* 4ce - */ 0, -/* 4cf - */ 0, -/* 4d0 - _0F_01_00 */ 0x233b, -/* 4d1 - _0F_01_01 */ 0x233c, -/* 4d2 - _0F_01_02 */ 0x233d, -/* 4d3 - _0F_01_03 */ 0x233e, -/* 4d4 - _0F_01_04 */ 0x233f, -/* 4d5 - */ 0, -/* 4d6 - _0F_01_06 */ 0x2340, -/* 4d7 - _0F_01_07 */ 0x2341, -/* 4d8 - */ 0, -/* 4d9 - _0F_01_C1 */ 0x2342, -/* 4da - _0F_01_C2 */ 0x2343, -/* 4db - _0F_01_C3 */ 0x2344, -/* 4dc - _0F_01_C4 */ 0x2345, -/* 4dd - */ 0, -/* 4de - */ 0, -/* 4df - */ 0, -/* 4e0 - _0F_01_C8 */ 0x2346, -/* 4e1 - _0F_01_C9 */ 0x2347, -/* 4e2 - */ 0, -/* 4e3 - */ 0, -/* 4e4 - */ 0, -/* 4e5 - */ 0, -/* 4e6 - */ 0, -/* 4e7 - */ 0, -/* 4e8 - _0F_01_D0 */ 0x2348, -/* 4e9 - _0F_01_D1 */ 0x2349, -/* 4ea - */ 0, -/* 4eb - */ 0, -/* 4ec - _0F_01_D4 */ 0x234a, -/* 4ed - */ 0, -/* 4ee - */ 0, -/* 4ef - */ 0, -/* 4f0 - _0F_01_D8 */ 0x234b, -/* 4f1 - _0F_01_D9 */ 0x234c, -/* 4f2 - _0F_01_DA */ 0x234d, -/* 4f3 - _0F_01_DB */ 0x234e, -/* 4f4 - _0F_01_DC */ 0x234f, -/* 4f5 - _0F_01_DD */ 0x2350, -/* 4f6 - _0F_01_DE */ 0x2351, -/* 4f7 - _0F_01_DF */ 0x2352, -/* 4f8 - */ 0, -/* 4f9 - */ 0, -/* 4fa - */ 0, -/* 4fb - */ 0, -/* 4fc - */ 0, -/* 4fd - */ 0, -/* 4fe - */ 0, -/* 4ff - */ 0, -/* 500 - */ 0, -/* 501 - */ 0, -/* 502 - */ 0, -/* 503 - */ 0, -/* 504 - */ 0, -/* 505 - */ 0, -/* 506 - */ 0, -/* 507 - */ 0, -/* 508 - */ 0, -/* 509 - */ 0, -/* 50a - */ 0, -/* 50b - */ 0, -/* 50c - */ 0, -/* 50d - */ 0, -/* 50e - */ 0, -/* 50f - */ 0, -/* 510 - _0F_01_F8 */ 0x2353, -/* 511 - _0F_01_F9 */ 0x2354, -/* 512 - */ 0, -/* 513 - */ 0, -/* 514 - */ 0, -/* 515 - */ 0, -/* 516 - */ 0, -/* 517 - */ 0, -/* 518 - _0F_0D_00 */ 0x2355, -/* 519 - _0F_0D_01 */ 0x2356, -/* 51a - */ 0, -/* 51b - */ 0, -/* 51c - */ 0, -/* 51d - */ 0, -/* 51e - */ 0, -/* 51f - */ 0, -/* 520 - */ 0, -/* 521 - */ 0, -/* 522 - */ 0, -/* 523 - */ 0, -/* 524 - */ 0, -/* 525 - */ 0, -/* 526 - */ 0, -/* 527 - */ 0, -/* 528 - */ 0, -/* 529 - */ 0, -/* 52a - */ 0, -/* 52b - */ 0, -/* 52c - _0F_0F_0C */ 0x2357, -/* 52d - _0F_0F_0D */ 0x2358, -/* 52e - */ 0, -/* 52f - */ 0, -/* 530 - */ 0, -/* 531 - */ 0, -/* 532 - */ 0, -/* 533 - */ 0, -/* 534 - */ 0, -/* 535 - */ 0, -/* 536 - */ 0, -/* 537 - */ 0, -/* 538 - */ 0, -/* 539 - */ 0, -/* 53a - */ 0, -/* 53b - */ 0, -/* 53c - _0F_0F_1C */ 0x2359, -/* 53d - _0F_0F_1D */ 0x235a, -/* 53e - */ 0, -/* 53f - */ 0, -/* 540 - */ 0, -/* 541 - */ 0, -/* 542 - */ 0, -/* 543 - */ 0, -/* 544 - */ 0, -/* 545 - */ 0, -/* 546 - */ 0, -/* 547 - */ 0, -/* 548 - */ 0, -/* 549 - */ 0, -/* 54a - */ 0, -/* 54b - */ 0, -/* 54c - */ 0, -/* 54d - */ 0, -/* 54e - */ 0, -/* 54f - */ 0, -/* 550 - */ 0, -/* 551 - */ 0, -/* 552 - */ 0, -/* 553 - */ 0, -/* 554 - */ 0, -/* 555 - */ 0, -/* 556 - */ 0, -/* 557 - */ 0, -/* 558 - */ 0, -/* 559 - */ 0, -/* 55a - */ 0, -/* 55b - */ 0, -/* 55c - */ 0, -/* 55d - */ 0, -/* 55e - */ 0, -/* 55f - */ 0, -/* 560 - */ 0, -/* 561 - */ 0, -/* 562 - */ 0, -/* 563 - */ 0, -/* 564 - */ 0, -/* 565 - */ 0, -/* 566 - */ 0, -/* 567 - */ 0, -/* 568 - */ 0, -/* 569 - */ 0, -/* 56a - */ 0, -/* 56b - */ 0, -/* 56c - */ 0, -/* 56d - */ 0, -/* 56e - */ 0, -/* 56f - */ 0, -/* 570 - */ 0, -/* 571 - */ 0, -/* 572 - */ 0, -/* 573 - */ 0, -/* 574 - */ 0, -/* 575 - */ 0, -/* 576 - */ 0, -/* 577 - */ 0, -/* 578 - */ 0, -/* 579 - */ 0, -/* 57a - */ 0, -/* 57b - */ 0, -/* 57c - */ 0, -/* 57d - */ 0, -/* 57e - */ 0, -/* 57f - */ 0, -/* 580 - */ 0, -/* 581 - */ 0, -/* 582 - */ 0, -/* 583 - */ 0, -/* 584 - */ 0, -/* 585 - */ 0, -/* 586 - */ 0, -/* 587 - */ 0, -/* 588 - */ 0, -/* 589 - */ 0, -/* 58a - */ 0, -/* 58b - */ 0, -/* 58c - */ 0, -/* 58d - */ 0, -/* 58e - */ 0, -/* 58f - */ 0, -/* 590 - */ 0, -/* 591 - */ 0, -/* 592 - */ 0, -/* 593 - */ 0, -/* 594 - */ 0, -/* 595 - */ 0, -/* 596 - */ 0, -/* 597 - */ 0, -/* 598 - */ 0, -/* 599 - */ 0, -/* 59a - */ 0, -/* 59b - */ 0, -/* 59c - */ 0, -/* 59d - */ 0, -/* 59e - */ 0, -/* 59f - */ 0, -/* 5a0 - */ 0, -/* 5a1 - */ 0, -/* 5a2 - */ 0, -/* 5a3 - */ 0, -/* 5a4 - */ 0, -/* 5a5 - */ 0, -/* 5a6 - */ 0, -/* 5a7 - */ 0, -/* 5a8 - */ 0, -/* 5a9 - */ 0, -/* 5aa - _0F_0F_8A */ 0x235b, -/* 5ab - */ 0, -/* 5ac - */ 0, -/* 5ad - */ 0, -/* 5ae - _0F_0F_8E */ 0x235c, -/* 5af - */ 0, -/* 5b0 - _0F_0F_90 */ 0x235d, -/* 5b1 - */ 0, -/* 5b2 - */ 0, -/* 5b3 - */ 0, -/* 5b4 - _0F_0F_94 */ 0x235e, -/* 5b5 - */ 0, -/* 5b6 - _0F_0F_96 */ 0x235f, -/* 5b7 - _0F_0F_97 */ 0x2360, -/* 5b8 - */ 0, -/* 5b9 - */ 0, -/* 5ba - _0F_0F_9A */ 0x2361, -/* 5bb - */ 0, -/* 5bc - */ 0, -/* 5bd - */ 0, -/* 5be - _0F_0F_9E */ 0x2362, -/* 5bf - */ 0, -/* 5c0 - _0F_0F_A0 */ 0x2363, -/* 5c1 - */ 0, -/* 5c2 - */ 0, -/* 5c3 - */ 0, -/* 5c4 - _0F_0F_A4 */ 0x2364, -/* 5c5 - */ 0, -/* 5c6 - _0F_0F_A6 */ 0x2365, -/* 5c7 - _0F_0F_A7 */ 0x2366, -/* 5c8 - */ 0, -/* 5c9 - */ 0, -/* 5ca - _0F_0F_AA */ 0x2367, -/* 5cb - */ 0, -/* 5cc - */ 0, -/* 5cd - */ 0, -/* 5ce - _0F_0F_AE */ 0x2368, -/* 5cf - */ 0, -/* 5d0 - _0F_0F_B0 */ 0x2369, -/* 5d1 - */ 0, -/* 5d2 - */ 0, -/* 5d3 - */ 0, -/* 5d4 - _0F_0F_B4 */ 0x236a, -/* 5d5 - */ 0, -/* 5d6 - _0F_0F_B6 */ 0x236b, -/* 5d7 - _0F_0F_B7 */ 0x236c, -/* 5d8 - */ 0, -/* 5d9 - */ 0, -/* 5da - */ 0, -/* 5db - _0F_0F_BB */ 0x236d, -/* 5dc - */ 0, -/* 5dd - */ 0, -/* 5de - */ 0, -/* 5df - _0F_0F_BF */ 0x236e, -/* 5e0 - */ 0, -/* 5e1 - */ 0, -/* 5e2 - */ 0, -/* 5e3 - */ 0, -/* 5e4 - */ 0, -/* 5e5 - */ 0, -/* 5e6 - */ 0, -/* 5e7 - */ 0, -/* 5e8 - */ 0, -/* 5e9 - */ 0, -/* 5ea - */ 0, -/* 5eb - */ 0, -/* 5ec - */ 0, -/* 5ed - */ 0, -/* 5ee - */ 0, -/* 5ef - */ 0, -/* 5f0 - */ 0, -/* 5f1 - */ 0, -/* 5f2 - */ 0, -/* 5f3 - */ 0, -/* 5f4 - */ 0, -/* 5f5 - */ 0, -/* 5f6 - */ 0, -/* 5f7 - */ 0, -/* 5f8 - */ 0, -/* 5f9 - */ 0, -/* 5fa - */ 0, -/* 5fb - */ 0, -/* 5fc - */ 0, -/* 5fd - */ 0, -/* 5fe - */ 0, -/* 5ff - */ 0, -/* 600 - */ 0, -/* 601 - */ 0, -/* 602 - */ 0, -/* 603 - */ 0, -/* 604 - */ 0, -/* 605 - */ 0, -/* 606 - */ 0, -/* 607 - */ 0, -/* 608 - */ 0, -/* 609 - */ 0, -/* 60a - */ 0, -/* 60b - */ 0, -/* 60c - */ 0, -/* 60d - */ 0, -/* 60e - */ 0, -/* 60f - */ 0, -/* 610 - */ 0, -/* 611 - */ 0, -/* 612 - */ 0, -/* 613 - */ 0, -/* 614 - */ 0, -/* 615 - */ 0, -/* 616 - */ 0, -/* 617 - */ 0, -/* 618 - */ 0, -/* 619 - */ 0, -/* 61a - */ 0, -/* 61b - */ 0, -/* 61c - */ 0, -/* 61d - */ 0, -/* 61e - */ 0, -/* 61f - */ 0, -/* 620 - _0F_10 */ 0x236f, -/* 621 - _66_0F_10 */ 0x2370, -/* 622 - _F3_0F_10 */ 0x2371, -/* 623 - _F2_0F_10 */ 0x2372, -/* 624 - _V_0F_10 */ 0x4009, -/* 625 - _V_66_0F_10 */ 0x400a, -/* 626 - _V_F3_0F_10 */ 0x400b, -/* 627 - _V_F2_0F_10 */ 0x400c, -/* 628 - */ 0, -/* 629 - */ 0, -/* 62a - _VRR_F3_0F_10 */ 0x400d, -/* 62b - _VRR_F2_0F_10 */ 0x400e, -/* 62c - _0F_11 */ 0x2373, -/* 62d - _66_0F_11 */ 0x2374, -/* 62e - _F3_0F_11 */ 0x2375, -/* 62f - _F2_0F_11 */ 0x2376, -/* 630 - _V_0F_11 */ 0x400f, -/* 631 - _V_66_0F_11 */ 0x4010, -/* 632 - _V_F3_0F_11 */ 0x4011, -/* 633 - _V_F2_0F_11 */ 0x4012, -/* 634 - */ 0, -/* 635 - */ 0, -/* 636 - _VRR_F3_0F_11 */ 0x4013, -/* 637 - _VRR_F2_0F_11 */ 0x4014, -/* 638 - _0F_12 */ 0x4015, -/* 639 - _66_0F_12 */ 0x2377, -/* 63a - _F3_0F_12 */ 0x2378, -/* 63b - _F2_0F_12 */ 0x2379, -/* 63c - _V_0F_12 */ 0x4016, -/* 63d - _V_66_0F_12 */ 0x4017, -/* 63e - _V_F3_0F_12 */ 0x4018, -/* 63f - _V_F2_0F_12 */ 0x4019, -/* 640 - */ 0, -/* 641 - */ 0, -/* 642 - */ 0, -/* 643 - */ 0, -/* 644 - _0F_13 */ 0x237a, -/* 645 - _66_0F_13 */ 0x237b, -/* 646 - */ 0, -/* 647 - */ 0, -/* 648 - _V_0F_13 */ 0x401a, -/* 649 - _V_66_0F_13 */ 0x401b, -/* 64a - */ 0, -/* 64b - */ 0, -/* 64c - */ 0, -/* 64d - */ 0, -/* 64e - */ 0, -/* 64f - */ 0, -/* 650 - _0F_14 */ 0x237c, -/* 651 - _66_0F_14 */ 0x237d, -/* 652 - */ 0, -/* 653 - */ 0, -/* 654 - _V_0F_14 */ 0x401c, -/* 655 - _V_66_0F_14 */ 0x401d, -/* 656 - */ 0, -/* 657 - */ 0, -/* 658 - */ 0, -/* 659 - */ 0, -/* 65a - */ 0, -/* 65b - */ 0, -/* 65c - _0F_15 */ 0x237e, -/* 65d - _66_0F_15 */ 0x237f, -/* 65e - */ 0, -/* 65f - */ 0, -/* 660 - _V_0F_15 */ 0x401e, -/* 661 - _V_66_0F_15 */ 0x401f, -/* 662 - */ 0, -/* 663 - */ 0, -/* 664 - */ 0, -/* 665 - */ 0, -/* 666 - */ 0, -/* 667 - */ 0, -/* 668 - _0F_16 */ 0x4020, -/* 669 - _66_0F_16 */ 0x2380, -/* 66a - _F3_0F_16 */ 0x2381, -/* 66b - */ 0, -/* 66c - _V_0F_16 */ 0x4021, -/* 66d - _V_66_0F_16 */ 0x4022, -/* 66e - _V_F3_0F_16 */ 0x4023, -/* 66f - */ 0, -/* 670 - */ 0, -/* 671 - */ 0, -/* 672 - */ 0, -/* 673 - */ 0, -/* 674 - _0F_17 */ 0x2382, -/* 675 - _66_0F_17 */ 0x2383, -/* 676 - */ 0, -/* 677 - */ 0, -/* 678 - _V_0F_17 */ 0x4024, -/* 679 - _V_66_0F_17 */ 0x4025, -/* 67a - */ 0, -/* 67b - */ 0, -/* 67c - */ 0, -/* 67d - */ 0, -/* 67e - */ 0, -/* 67f - */ 0, -/* 680 - _0F_18_00 */ 0x2384, -/* 681 - _0F_18_01 */ 0x2385, -/* 682 - _0F_18_02 */ 0x2386, -/* 683 - _0F_18_03 */ 0x2387, -/* 684 - */ 0, -/* 685 - */ 0, -/* 686 - */ 0, -/* 687 - */ 0, -/* 688 - _0F_28 */ 0x2388, -/* 689 - _66_0F_28 */ 0x2389, -/* 68a - */ 0, -/* 68b - */ 0, -/* 68c - _V_0F_28 */ 0x4026, -/* 68d - _V_66_0F_28 */ 0x4027, -/* 68e - */ 0, -/* 68f - */ 0, -/* 690 - */ 0, -/* 691 - */ 0, -/* 692 - */ 0, -/* 693 - */ 0, -/* 694 - _0F_29 */ 0x238a, -/* 695 - _66_0F_29 */ 0x238b, -/* 696 - */ 0, -/* 697 - */ 0, -/* 698 - _V_0F_29 */ 0x4028, -/* 699 - _V_66_0F_29 */ 0x4029, -/* 69a - */ 0, -/* 69b - */ 0, -/* 69c - */ 0, -/* 69d - */ 0, -/* 69e - */ 0, -/* 69f - */ 0, -/* 6a0 - _0F_2A */ 0x238c, -/* 6a1 - _66_0F_2A */ 0x238d, -/* 6a2 - _F3_0F_2A */ 0x238e, -/* 6a3 - _F2_0F_2A */ 0x238f, -/* 6a4 - */ 0, -/* 6a5 - */ 0, -/* 6a6 - _V_F3_0F_2A */ 0x402a, -/* 6a7 - _V_F2_0F_2A */ 0x402b, -/* 6a8 - */ 0, -/* 6a9 - */ 0, -/* 6aa - */ 0, -/* 6ab - */ 0, -/* 6ac - _0F_2B */ 0x2390, -/* 6ad - _66_0F_2B */ 0x2391, -/* 6ae - _F3_0F_2B */ 0x2392, -/* 6af - _F2_0F_2B */ 0x2393, -/* 6b0 - _V_0F_2B */ 0x402c, -/* 6b1 - _V_66_0F_2B */ 0x402d, -/* 6b2 - */ 0, -/* 6b3 - */ 0, -/* 6b4 - */ 0, -/* 6b5 - */ 0, -/* 6b6 - */ 0, -/* 6b7 - */ 0, -/* 6b8 - _0F_2C */ 0x2394, -/* 6b9 - _66_0F_2C */ 0x2395, -/* 6ba - _F3_0F_2C */ 0x2396, -/* 6bb - _F2_0F_2C */ 0x2397, -/* 6bc - */ 0, -/* 6bd - */ 0, -/* 6be - _V_F3_0F_2C */ 0x402e, -/* 6bf - _V_F2_0F_2C */ 0x402f, -/* 6c0 - */ 0, -/* 6c1 - */ 0, -/* 6c2 - */ 0, -/* 6c3 - */ 0, -/* 6c4 - _0F_2D */ 0x2398, -/* 6c5 - _66_0F_2D */ 0x2399, -/* 6c6 - _F3_0F_2D */ 0x239a, -/* 6c7 - _F2_0F_2D */ 0x239b, -/* 6c8 - */ 0, -/* 6c9 - */ 0, -/* 6ca - _V_F3_0F_2D */ 0x4030, -/* 6cb - _V_F2_0F_2D */ 0x4031, -/* 6cc - */ 0, -/* 6cd - */ 0, -/* 6ce - */ 0, -/* 6cf - */ 0, -/* 6d0 - _0F_2E */ 0x239c, -/* 6d1 - _66_0F_2E */ 0x239d, -/* 6d2 - */ 0, -/* 6d3 - */ 0, -/* 6d4 - _V_0F_2E */ 0x4032, -/* 6d5 - _V_66_0F_2E */ 0x4033, -/* 6d6 - */ 0, -/* 6d7 - */ 0, -/* 6d8 - */ 0, -/* 6d9 - */ 0, -/* 6da - */ 0, -/* 6db - */ 0, -/* 6dc - _0F_2F */ 0x239e, -/* 6dd - _66_0F_2F */ 0x239f, -/* 6de - */ 0, -/* 6df - */ 0, -/* 6e0 - _V_0F_2F */ 0x4034, -/* 6e1 - _V_66_0F_2F */ 0x4035, -/* 6e2 - */ 0, -/* 6e3 - */ 0, -/* 6e4 - */ 0, -/* 6e5 - */ 0, -/* 6e6 - */ 0, -/* 6e7 - */ 0, -/* 6e8 - _0F_38_00 */ 0xcef8, -/* 6e9 - _0F_38_01 */ 0xcf04, -/* 6ea - _0F_38_02 */ 0xcf10, -/* 6eb - _0F_38_03 */ 0xcf1c, -/* 6ec - _0F_38_04 */ 0xcf28, -/* 6ed - _0F_38_05 */ 0xcf34, -/* 6ee - _0F_38_06 */ 0xcf40, -/* 6ef - _0F_38_07 */ 0xcf4c, -/* 6f0 - _0F_38_08 */ 0xcf58, -/* 6f1 - _0F_38_09 */ 0xcf64, -/* 6f2 - _0F_38_0A */ 0xcf70, -/* 6f3 - _0F_38_0B */ 0xcf7c, -/* 6f4 - _0F_38_0C */ 0xcf88, -/* 6f5 - _0F_38_0D */ 0xcf94, -/* 6f6 - _0F_38_0E */ 0xcfa0, -/* 6f7 - _0F_38_0F */ 0xcfac, -/* 6f8 - _0F_38_10 */ 0xcfb8, -/* 6f9 - */ 0, -/* 6fa - */ 0, -/* 6fb - */ 0, -/* 6fc - _0F_38_14 */ 0xcfc4, -/* 6fd - _0F_38_15 */ 0xcfd0, -/* 6fe - */ 0, -/* 6ff - _0F_38_17 */ 0xcfdc, -/* 700 - _0F_38_18 */ 0xcfe8, -/* 701 - _0F_38_19 */ 0xcff4, -/* 702 - _0F_38_1A */ 0xd000, -/* 703 - */ 0, -/* 704 - _0F_38_1C */ 0xd00c, -/* 705 - _0F_38_1D */ 0xd018, -/* 706 - _0F_38_1E */ 0xd024, -/* 707 - */ 0, -/* 708 - _0F_38_20 */ 0xd030, -/* 709 - _0F_38_21 */ 0xd03c, -/* 70a - _0F_38_22 */ 0xd048, -/* 70b - _0F_38_23 */ 0xd054, -/* 70c - _0F_38_24 */ 0xd060, -/* 70d - _0F_38_25 */ 0xd06c, -/* 70e - */ 0, -/* 70f - */ 0, -/* 710 - _0F_38_28 */ 0xd078, -/* 711 - _0F_38_29 */ 0xd084, -/* 712 - _0F_38_2A */ 0xd090, -/* 713 - _0F_38_2B */ 0xd09c, -/* 714 - _0F_38_2C */ 0xd0a8, -/* 715 - _0F_38_2D */ 0xd0b4, -/* 716 - _0F_38_2E */ 0xd0c0, -/* 717 - _0F_38_2F */ 0xd0cc, -/* 718 - _0F_38_30 */ 0xd0d8, -/* 719 - _0F_38_31 */ 0xd0e4, -/* 71a - _0F_38_32 */ 0xd0f0, -/* 71b - _0F_38_33 */ 0xd0fc, -/* 71c - _0F_38_34 */ 0xd108, -/* 71d - _0F_38_35 */ 0xd114, -/* 71e - */ 0, -/* 71f - _0F_38_37 */ 0xd120, -/* 720 - _0F_38_38 */ 0xd12c, -/* 721 - _0F_38_39 */ 0xd138, -/* 722 - _0F_38_3A */ 0xd144, -/* 723 - _0F_38_3B */ 0xd150, -/* 724 - _0F_38_3C */ 0xd15c, -/* 725 - _0F_38_3D */ 0xd168, -/* 726 - _0F_38_3E */ 0xd174, -/* 727 - _0F_38_3F */ 0xd180, -/* 728 - _0F_38_40 */ 0xd18c, -/* 729 - _0F_38_41 */ 0xd198, -/* 72a - */ 0, -/* 72b - */ 0, -/* 72c - */ 0, -/* 72d - */ 0, -/* 72e - */ 0, -/* 72f - */ 0, -/* 730 - */ 0, -/* 731 - */ 0, -/* 732 - */ 0, -/* 733 - */ 0, -/* 734 - */ 0, -/* 735 - */ 0, -/* 736 - */ 0, -/* 737 - */ 0, -/* 738 - */ 0, -/* 739 - */ 0, -/* 73a - */ 0, -/* 73b - */ 0, -/* 73c - */ 0, -/* 73d - */ 0, -/* 73e - */ 0, -/* 73f - */ 0, -/* 740 - */ 0, -/* 741 - */ 0, -/* 742 - */ 0, -/* 743 - */ 0, -/* 744 - */ 0, -/* 745 - */ 0, -/* 746 - */ 0, -/* 747 - */ 0, -/* 748 - */ 0, -/* 749 - */ 0, -/* 74a - */ 0, -/* 74b - */ 0, -/* 74c - */ 0, -/* 74d - */ 0, -/* 74e - */ 0, -/* 74f - */ 0, -/* 750 - */ 0, -/* 751 - */ 0, -/* 752 - */ 0, -/* 753 - */ 0, -/* 754 - */ 0, -/* 755 - */ 0, -/* 756 - */ 0, -/* 757 - */ 0, -/* 758 - */ 0, -/* 759 - */ 0, -/* 75a - */ 0, -/* 75b - */ 0, -/* 75c - */ 0, -/* 75d - */ 0, -/* 75e - */ 0, -/* 75f - */ 0, -/* 760 - */ 0, -/* 761 - */ 0, -/* 762 - */ 0, -/* 763 - */ 0, -/* 764 - */ 0, -/* 765 - */ 0, -/* 766 - */ 0, -/* 767 - */ 0, -/* 768 - _0F_38_80 */ 0xd1a4, -/* 769 - _0F_38_81 */ 0xd1b0, -/* 76a - _0F_38_82 */ 0xd1bc, -/* 76b - */ 0, -/* 76c - */ 0, -/* 76d - */ 0, -/* 76e - */ 0, -/* 76f - */ 0, -/* 770 - */ 0, -/* 771 - */ 0, -/* 772 - */ 0, -/* 773 - */ 0, -/* 774 - */ 0, -/* 775 - */ 0, -/* 776 - */ 0, -/* 777 - */ 0, -/* 778 - */ 0, -/* 779 - */ 0, -/* 77a - */ 0, -/* 77b - */ 0, -/* 77c - */ 0, -/* 77d - */ 0, -/* 77e - _0F_38_96 */ 0xd1c8, -/* 77f - _0F_38_97 */ 0xd1d4, -/* 780 - _0F_38_98 */ 0xd1e0, -/* 781 - _0F_38_99 */ 0xd1ec, -/* 782 - _0F_38_9A */ 0xd1f8, -/* 783 - _0F_38_9B */ 0xd204, -/* 784 - _0F_38_9C */ 0xd210, -/* 785 - _0F_38_9D */ 0xd21c, -/* 786 - _0F_38_9E */ 0xd228, -/* 787 - _0F_38_9F */ 0xd234, -/* 788 - */ 0, -/* 789 - */ 0, -/* 78a - */ 0, -/* 78b - */ 0, -/* 78c - */ 0, -/* 78d - */ 0, -/* 78e - _0F_38_A6 */ 0xd240, -/* 78f - _0F_38_A7 */ 0xd24c, -/* 790 - _0F_38_A8 */ 0xd258, -/* 791 - _0F_38_A9 */ 0xd264, -/* 792 - _0F_38_AA */ 0xd270, -/* 793 - _0F_38_AB */ 0xd27c, -/* 794 - _0F_38_AC */ 0xd288, -/* 795 - _0F_38_AD */ 0xd294, -/* 796 - _0F_38_AE */ 0xd2a0, -/* 797 - _0F_38_AF */ 0xd2ac, -/* 798 - */ 0, -/* 799 - */ 0, -/* 79a - */ 0, -/* 79b - */ 0, -/* 79c - */ 0, -/* 79d - */ 0, -/* 79e - _0F_38_B6 */ 0xd2b8, -/* 79f - _0F_38_B7 */ 0xd2c4, -/* 7a0 - _0F_38_B8 */ 0xd2d0, -/* 7a1 - _0F_38_B9 */ 0xd2dc, -/* 7a2 - _0F_38_BA */ 0xd2e8, -/* 7a3 - _0F_38_BB */ 0xd2f4, -/* 7a4 - _0F_38_BC */ 0xd300, -/* 7a5 - _0F_38_BD */ 0xd30c, -/* 7a6 - _0F_38_BE */ 0xd318, -/* 7a7 - _0F_38_BF */ 0xd324, -/* 7a8 - */ 0, -/* 7a9 - */ 0, -/* 7aa - */ 0, -/* 7ab - */ 0, -/* 7ac - */ 0, -/* 7ad - */ 0, -/* 7ae - */ 0, -/* 7af - */ 0, -/* 7b0 - */ 0, -/* 7b1 - */ 0, -/* 7b2 - */ 0, -/* 7b3 - */ 0, -/* 7b4 - */ 0, -/* 7b5 - */ 0, -/* 7b6 - */ 0, -/* 7b7 - */ 0, -/* 7b8 - */ 0, -/* 7b9 - */ 0, -/* 7ba - */ 0, -/* 7bb - */ 0, -/* 7bc - */ 0, -/* 7bd - */ 0, -/* 7be - */ 0, -/* 7bf - */ 0, -/* 7c0 - */ 0, -/* 7c1 - */ 0, -/* 7c2 - */ 0, -/* 7c3 - _0F_38_DB */ 0xd330, -/* 7c4 - _0F_38_DC */ 0xd33c, -/* 7c5 - _0F_38_DD */ 0xd348, -/* 7c6 - _0F_38_DE */ 0xd354, -/* 7c7 - _0F_38_DF */ 0xd360, -/* 7c8 - */ 0, -/* 7c9 - */ 0, -/* 7ca - */ 0, -/* 7cb - */ 0, -/* 7cc - */ 0, -/* 7cd - */ 0, -/* 7ce - */ 0, -/* 7cf - */ 0, -/* 7d0 - */ 0, -/* 7d1 - */ 0, -/* 7d2 - */ 0, -/* 7d3 - */ 0, -/* 7d4 - */ 0, -/* 7d5 - */ 0, -/* 7d6 - */ 0, -/* 7d7 - */ 0, -/* 7d8 - _0F_38_F0 */ 0xd36c, -/* 7d9 - _0F_38_F1 */ 0xd378, -/* 7da - */ 0, -/* 7db - */ 0, -/* 7dc - */ 0, -/* 7dd - */ 0, -/* 7de - */ 0, -/* 7df - */ 0, -/* 7e0 - */ 0, -/* 7e1 - */ 0, -/* 7e2 - */ 0, -/* 7e3 - */ 0, -/* 7e4 - */ 0, -/* 7e5 - */ 0, -/* 7e6 - */ 0, -/* 7e7 - */ 0, -/* 7e8 - */ 0, -/* 7e9 - */ 0, -/* 7ea - */ 0, -/* 7eb - */ 0, -/* 7ec - _0F_3A_04 */ 0xd384, -/* 7ed - _0F_3A_05 */ 0xd390, -/* 7ee - _0F_3A_06 */ 0xd39c, -/* 7ef - */ 0, -/* 7f0 - _0F_3A_08 */ 0xd3a8, -/* 7f1 - _0F_3A_09 */ 0xd3b4, -/* 7f2 - _0F_3A_0A */ 0xd3c0, -/* 7f3 - _0F_3A_0B */ 0xd3cc, -/* 7f4 - _0F_3A_0C */ 0xd3d8, -/* 7f5 - _0F_3A_0D */ 0xd3e4, -/* 7f6 - _0F_3A_0E */ 0xd3f0, -/* 7f7 - _0F_3A_0F */ 0xd3fc, -/* 7f8 - */ 0, -/* 7f9 - */ 0, -/* 7fa - */ 0, -/* 7fb - */ 0, -/* 7fc - _0F_3A_14 */ 0xd408, -/* 7fd - _0F_3A_15 */ 0xd414, -/* 7fe - _0F_3A_16 */ 0xd420, -/* 7ff - _0F_3A_17 */ 0xd42c, -/* 800 - _0F_3A_18 */ 0xd438, -/* 801 - _0F_3A_19 */ 0xd444, -/* 802 - */ 0, -/* 803 - */ 0, -/* 804 - */ 0, -/* 805 - */ 0, -/* 806 - */ 0, -/* 807 - */ 0, -/* 808 - _0F_3A_20 */ 0xd450, -/* 809 - _0F_3A_21 */ 0xd45c, -/* 80a - _0F_3A_22 */ 0xd468, -/* 80b - */ 0, -/* 80c - */ 0, -/* 80d - */ 0, -/* 80e - */ 0, -/* 80f - */ 0, -/* 810 - */ 0, -/* 811 - */ 0, -/* 812 - */ 0, -/* 813 - */ 0, -/* 814 - */ 0, -/* 815 - */ 0, -/* 816 - */ 0, -/* 817 - */ 0, -/* 818 - */ 0, -/* 819 - */ 0, -/* 81a - */ 0, -/* 81b - */ 0, -/* 81c - */ 0, -/* 81d - */ 0, -/* 81e - */ 0, -/* 81f - */ 0, -/* 820 - */ 0, -/* 821 - */ 0, -/* 822 - */ 0, -/* 823 - */ 0, -/* 824 - */ 0, -/* 825 - */ 0, -/* 826 - */ 0, -/* 827 - */ 0, -/* 828 - _0F_3A_40 */ 0xd474, -/* 829 - _0F_3A_41 */ 0xd480, -/* 82a - _0F_3A_42 */ 0xd48c, -/* 82b - */ 0, -/* 82c - _0F_3A_44 */ 0xd498, -/* 82d - */ 0, -/* 82e - */ 0, -/* 82f - */ 0, -/* 830 - */ 0, -/* 831 - */ 0, -/* 832 - _0F_3A_4A */ 0xd4a4, -/* 833 - _0F_3A_4B */ 0xd4b0, -/* 834 - _0F_3A_4C */ 0xd4bc, -/* 835 - */ 0, -/* 836 - */ 0, -/* 837 - */ 0, -/* 838 - */ 0, -/* 839 - */ 0, -/* 83a - */ 0, -/* 83b - */ 0, -/* 83c - */ 0, -/* 83d - */ 0, -/* 83e - */ 0, -/* 83f - */ 0, -/* 840 - */ 0, -/* 841 - */ 0, -/* 842 - */ 0, -/* 843 - */ 0, -/* 844 - */ 0, -/* 845 - */ 0, -/* 846 - */ 0, -/* 847 - */ 0, -/* 848 - _0F_3A_60 */ 0xd4c8, -/* 849 - _0F_3A_61 */ 0xd4d4, -/* 84a - _0F_3A_62 */ 0xd4e0, -/* 84b - _0F_3A_63 */ 0xd4ec, -/* 84c - */ 0, -/* 84d - */ 0, -/* 84e - */ 0, -/* 84f - */ 0, -/* 850 - */ 0, -/* 851 - */ 0, -/* 852 - */ 0, -/* 853 - */ 0, -/* 854 - */ 0, -/* 855 - */ 0, -/* 856 - */ 0, -/* 857 - */ 0, -/* 858 - */ 0, -/* 859 - */ 0, -/* 85a - */ 0, -/* 85b - */ 0, -/* 85c - */ 0, -/* 85d - */ 0, -/* 85e - */ 0, -/* 85f - */ 0, -/* 860 - */ 0, -/* 861 - */ 0, -/* 862 - */ 0, -/* 863 - */ 0, -/* 864 - */ 0, -/* 865 - */ 0, -/* 866 - */ 0, -/* 867 - */ 0, -/* 868 - */ 0, -/* 869 - */ 0, -/* 86a - */ 0, -/* 86b - */ 0, -/* 86c - */ 0, -/* 86d - */ 0, -/* 86e - */ 0, -/* 86f - */ 0, -/* 870 - */ 0, -/* 871 - */ 0, -/* 872 - */ 0, -/* 873 - */ 0, -/* 874 - */ 0, -/* 875 - */ 0, -/* 876 - */ 0, -/* 877 - */ 0, -/* 878 - */ 0, -/* 879 - */ 0, -/* 87a - */ 0, -/* 87b - */ 0, -/* 87c - */ 0, -/* 87d - */ 0, -/* 87e - */ 0, -/* 87f - */ 0, -/* 880 - */ 0, -/* 881 - */ 0, -/* 882 - */ 0, -/* 883 - */ 0, -/* 884 - */ 0, -/* 885 - */ 0, -/* 886 - */ 0, -/* 887 - */ 0, -/* 888 - */ 0, -/* 889 - */ 0, -/* 88a - */ 0, -/* 88b - */ 0, -/* 88c - */ 0, -/* 88d - */ 0, -/* 88e - */ 0, -/* 88f - */ 0, -/* 890 - */ 0, -/* 891 - */ 0, -/* 892 - */ 0, -/* 893 - */ 0, -/* 894 - */ 0, -/* 895 - */ 0, -/* 896 - */ 0, -/* 897 - */ 0, -/* 898 - */ 0, -/* 899 - */ 0, -/* 89a - */ 0, -/* 89b - */ 0, -/* 89c - */ 0, -/* 89d - */ 0, -/* 89e - */ 0, -/* 89f - */ 0, -/* 8a0 - */ 0, -/* 8a1 - */ 0, -/* 8a2 - */ 0, -/* 8a3 - */ 0, -/* 8a4 - */ 0, -/* 8a5 - */ 0, -/* 8a6 - */ 0, -/* 8a7 - */ 0, -/* 8a8 - */ 0, -/* 8a9 - */ 0, -/* 8aa - */ 0, -/* 8ab - */ 0, -/* 8ac - */ 0, -/* 8ad - */ 0, -/* 8ae - */ 0, -/* 8af - */ 0, -/* 8b0 - */ 0, -/* 8b1 - */ 0, -/* 8b2 - */ 0, -/* 8b3 - */ 0, -/* 8b4 - */ 0, -/* 8b5 - */ 0, -/* 8b6 - */ 0, -/* 8b7 - */ 0, -/* 8b8 - */ 0, -/* 8b9 - */ 0, -/* 8ba - */ 0, -/* 8bb - */ 0, -/* 8bc - */ 0, -/* 8bd - */ 0, -/* 8be - */ 0, -/* 8bf - */ 0, -/* 8c0 - */ 0, -/* 8c1 - */ 0, -/* 8c2 - */ 0, -/* 8c3 - */ 0, -/* 8c4 - */ 0, -/* 8c5 - */ 0, -/* 8c6 - */ 0, -/* 8c7 - _0F_3A_DF */ 0xd4f8, -/* 8c8 - */ 0, -/* 8c9 - */ 0, -/* 8ca - */ 0, -/* 8cb - */ 0, -/* 8cc - */ 0, -/* 8cd - */ 0, -/* 8ce - */ 0, -/* 8cf - */ 0, -/* 8d0 - */ 0, -/* 8d1 - */ 0, -/* 8d2 - */ 0, -/* 8d3 - */ 0, -/* 8d4 - */ 0, -/* 8d5 - */ 0, -/* 8d6 - */ 0, -/* 8d7 - */ 0, -/* 8d8 - */ 0, -/* 8d9 - */ 0, -/* 8da - */ 0, -/* 8db - */ 0, -/* 8dc - */ 0, -/* 8dd - */ 0, -/* 8de - */ 0, -/* 8df - */ 0, -/* 8e0 - */ 0, -/* 8e1 - */ 0, -/* 8e2 - */ 0, -/* 8e3 - */ 0, -/* 8e4 - */ 0, -/* 8e5 - */ 0, -/* 8e6 - */ 0, -/* 8e7 - */ 0, -/* 8e8 - _0F_50 */ 0x23a0, -/* 8e9 - _66_0F_50 */ 0x23a1, -/* 8ea - */ 0, -/* 8eb - */ 0, -/* 8ec - _V_0F_50 */ 0x4036, -/* 8ed - _V_66_0F_50 */ 0x4037, -/* 8ee - */ 0, -/* 8ef - */ 0, -/* 8f0 - */ 0, -/* 8f1 - */ 0, -/* 8f2 - */ 0, -/* 8f3 - */ 0, -/* 8f4 - _0F_51 */ 0x23a2, -/* 8f5 - _66_0F_51 */ 0x23a3, -/* 8f6 - _F3_0F_51 */ 0x23a4, -/* 8f7 - _F2_0F_51 */ 0x23a5, -/* 8f8 - _V_0F_51 */ 0x4038, -/* 8f9 - _V_66_0F_51 */ 0x4039, -/* 8fa - _V_F3_0F_51 */ 0x403a, -/* 8fb - _V_F2_0F_51 */ 0x403b, -/* 8fc - */ 0, -/* 8fd - */ 0, -/* 8fe - */ 0, -/* 8ff - */ 0, -/* 900 - _0F_52 */ 0x23a6, -/* 901 - */ 0, -/* 902 - _F3_0F_52 */ 0x23a7, -/* 903 - */ 0, -/* 904 - _V_0F_52 */ 0x403c, -/* 905 - */ 0, -/* 906 - _V_F3_0F_52 */ 0x403d, -/* 907 - */ 0, -/* 908 - */ 0, -/* 909 - */ 0, -/* 90a - */ 0, -/* 90b - */ 0, -/* 90c - _0F_53 */ 0x23a8, -/* 90d - */ 0, -/* 90e - _F3_0F_53 */ 0x23a9, -/* 90f - */ 0, -/* 910 - _V_0F_53 */ 0x403e, -/* 911 - */ 0, -/* 912 - _V_F3_0F_53 */ 0x403f, -/* 913 - */ 0, -/* 914 - */ 0, -/* 915 - */ 0, -/* 916 - */ 0, -/* 917 - */ 0, -/* 918 - _0F_54 */ 0x23aa, -/* 919 - _66_0F_54 */ 0x23ab, -/* 91a - */ 0, -/* 91b - */ 0, -/* 91c - _V_0F_54 */ 0x4040, -/* 91d - _V_66_0F_54 */ 0x4041, -/* 91e - */ 0, -/* 91f - */ 0, -/* 920 - */ 0, -/* 921 - */ 0, -/* 922 - */ 0, -/* 923 - */ 0, -/* 924 - _0F_55 */ 0x23ac, -/* 925 - _66_0F_55 */ 0x23ad, -/* 926 - */ 0, -/* 927 - */ 0, -/* 928 - _V_0F_55 */ 0x4042, -/* 929 - _V_66_0F_55 */ 0x4043, -/* 92a - */ 0, -/* 92b - */ 0, -/* 92c - */ 0, -/* 92d - */ 0, -/* 92e - */ 0, -/* 92f - */ 0, -/* 930 - _0F_56 */ 0x23ae, -/* 931 - _66_0F_56 */ 0x23af, -/* 932 - */ 0, -/* 933 - */ 0, -/* 934 - _V_0F_56 */ 0x4044, -/* 935 - _V_66_0F_56 */ 0x4045, -/* 936 - */ 0, -/* 937 - */ 0, -/* 938 - */ 0, -/* 939 - */ 0, -/* 93a - */ 0, -/* 93b - */ 0, -/* 93c - _0F_57 */ 0x23b0, -/* 93d - _66_0F_57 */ 0x23b1, -/* 93e - */ 0, -/* 93f - */ 0, -/* 940 - _V_0F_57 */ 0x4046, -/* 941 - _V_66_0F_57 */ 0x4047, -/* 942 - */ 0, -/* 943 - */ 0, -/* 944 - */ 0, -/* 945 - */ 0, -/* 946 - */ 0, -/* 947 - */ 0, -/* 948 - _0F_58 */ 0x23b2, -/* 949 - _66_0F_58 */ 0x23b3, -/* 94a - _F3_0F_58 */ 0x23b4, -/* 94b - _F2_0F_58 */ 0x23b5, -/* 94c - _V_0F_58 */ 0x4048, -/* 94d - _V_66_0F_58 */ 0x4049, -/* 94e - _V_F3_0F_58 */ 0x404a, -/* 94f - _V_F2_0F_58 */ 0x404b, -/* 950 - */ 0, -/* 951 - */ 0, -/* 952 - */ 0, -/* 953 - */ 0, -/* 954 - _0F_59 */ 0x23b6, -/* 955 - _66_0F_59 */ 0x23b7, -/* 956 - _F3_0F_59 */ 0x23b8, -/* 957 - _F2_0F_59 */ 0x23b9, -/* 958 - _V_0F_59 */ 0x404c, -/* 959 - _V_66_0F_59 */ 0x404d, -/* 95a - _V_F3_0F_59 */ 0x404e, -/* 95b - _V_F2_0F_59 */ 0x404f, -/* 95c - */ 0, -/* 95d - */ 0, -/* 95e - */ 0, -/* 95f - */ 0, -/* 960 - _0F_5A */ 0x23ba, -/* 961 - _66_0F_5A */ 0x23bb, -/* 962 - _F3_0F_5A */ 0x23bc, -/* 963 - _F2_0F_5A */ 0x23bd, -/* 964 - _V_0F_5A */ 0x4050, -/* 965 - _V_66_0F_5A */ 0x4051, -/* 966 - _V_F3_0F_5A */ 0x4052, -/* 967 - _V_F2_0F_5A */ 0x4053, -/* 968 - */ 0, -/* 969 - */ 0, -/* 96a - */ 0, -/* 96b - */ 0, -/* 96c - _0F_5B */ 0x23be, -/* 96d - _66_0F_5B */ 0x23bf, -/* 96e - _F3_0F_5B */ 0x23c0, -/* 96f - */ 0, -/* 970 - _V_0F_5B */ 0x4054, -/* 971 - _V_66_0F_5B */ 0x4055, -/* 972 - _V_F3_0F_5B */ 0x4056, -/* 973 - */ 0, -/* 974 - */ 0, -/* 975 - */ 0, -/* 976 - */ 0, -/* 977 - */ 0, -/* 978 - _0F_5C */ 0x23c1, -/* 979 - _66_0F_5C */ 0x23c2, -/* 97a - _F3_0F_5C */ 0x23c3, -/* 97b - _F2_0F_5C */ 0x23c4, -/* 97c - _V_0F_5C */ 0x4057, -/* 97d - _V_66_0F_5C */ 0x4058, -/* 97e - _V_F3_0F_5C */ 0x4059, -/* 97f - _V_F2_0F_5C */ 0x405a, -/* 980 - */ 0, -/* 981 - */ 0, -/* 982 - */ 0, -/* 983 - */ 0, -/* 984 - _0F_5D */ 0x23c5, -/* 985 - _66_0F_5D */ 0x23c6, -/* 986 - _F3_0F_5D */ 0x23c7, -/* 987 - _F2_0F_5D */ 0x23c8, -/* 988 - _V_0F_5D */ 0x405b, -/* 989 - _V_66_0F_5D */ 0x405c, -/* 98a - _V_F3_0F_5D */ 0x405d, -/* 98b - _V_F2_0F_5D */ 0x405e, -/* 98c - */ 0, -/* 98d - */ 0, -/* 98e - */ 0, -/* 98f - */ 0, -/* 990 - _0F_5E */ 0x23c9, -/* 991 - _66_0F_5E */ 0x23ca, -/* 992 - _F3_0F_5E */ 0x23cb, -/* 993 - _F2_0F_5E */ 0x23cc, -/* 994 - _V_0F_5E */ 0x405f, -/* 995 - _V_66_0F_5E */ 0x4060, -/* 996 - _V_F3_0F_5E */ 0x4061, -/* 997 - _V_F2_0F_5E */ 0x4062, -/* 998 - */ 0, -/* 999 - */ 0, -/* 99a - */ 0, -/* 99b - */ 0, -/* 99c - _0F_5F */ 0x23cd, -/* 99d - _66_0F_5F */ 0x23ce, -/* 99e - _F3_0F_5F */ 0x23cf, -/* 99f - _F2_0F_5F */ 0x23d0, -/* 9a0 - _V_0F_5F */ 0x4063, -/* 9a1 - _V_66_0F_5F */ 0x4064, -/* 9a2 - _V_F3_0F_5F */ 0x4065, -/* 9a3 - _V_F2_0F_5F */ 0x4066, -/* 9a4 - */ 0, -/* 9a5 - */ 0, -/* 9a6 - */ 0, -/* 9a7 - */ 0, -/* 9a8 - _0F_60 */ 0x23d1, -/* 9a9 - _66_0F_60 */ 0x23d2, -/* 9aa - */ 0, -/* 9ab - */ 0, -/* 9ac - */ 0, -/* 9ad - _V_66_0F_60 */ 0x4067, -/* 9ae - */ 0, -/* 9af - */ 0, -/* 9b0 - */ 0, -/* 9b1 - */ 0, -/* 9b2 - */ 0, -/* 9b3 - */ 0, -/* 9b4 - _0F_61 */ 0x23d3, -/* 9b5 - _66_0F_61 */ 0x23d4, -/* 9b6 - */ 0, -/* 9b7 - */ 0, -/* 9b8 - */ 0, -/* 9b9 - _V_66_0F_61 */ 0x4068, -/* 9ba - */ 0, -/* 9bb - */ 0, -/* 9bc - */ 0, -/* 9bd - */ 0, -/* 9be - */ 0, -/* 9bf - */ 0, -/* 9c0 - _0F_62 */ 0x23d5, -/* 9c1 - _66_0F_62 */ 0x23d6, -/* 9c2 - */ 0, -/* 9c3 - */ 0, -/* 9c4 - */ 0, -/* 9c5 - _V_66_0F_62 */ 0x4069, -/* 9c6 - */ 0, -/* 9c7 - */ 0, -/* 9c8 - */ 0, -/* 9c9 - */ 0, -/* 9ca - */ 0, -/* 9cb - */ 0, -/* 9cc - _0F_63 */ 0x23d7, -/* 9cd - _66_0F_63 */ 0x23d8, -/* 9ce - */ 0, -/* 9cf - */ 0, -/* 9d0 - */ 0, -/* 9d1 - _V_66_0F_63 */ 0x406a, -/* 9d2 - */ 0, -/* 9d3 - */ 0, -/* 9d4 - */ 0, -/* 9d5 - */ 0, -/* 9d6 - */ 0, -/* 9d7 - */ 0, -/* 9d8 - _0F_64 */ 0x23d9, -/* 9d9 - _66_0F_64 */ 0x23da, -/* 9da - */ 0, -/* 9db - */ 0, -/* 9dc - */ 0, -/* 9dd - _V_66_0F_64 */ 0x406b, -/* 9de - */ 0, -/* 9df - */ 0, -/* 9e0 - */ 0, -/* 9e1 - */ 0, -/* 9e2 - */ 0, -/* 9e3 - */ 0, -/* 9e4 - _0F_65 */ 0x23db, -/* 9e5 - _66_0F_65 */ 0x23dc, -/* 9e6 - */ 0, -/* 9e7 - */ 0, -/* 9e8 - */ 0, -/* 9e9 - _V_66_0F_65 */ 0x406c, -/* 9ea - */ 0, -/* 9eb - */ 0, -/* 9ec - */ 0, -/* 9ed - */ 0, -/* 9ee - */ 0, -/* 9ef - */ 0, -/* 9f0 - _0F_66 */ 0x23dd, -/* 9f1 - _66_0F_66 */ 0x23de, -/* 9f2 - */ 0, -/* 9f3 - */ 0, -/* 9f4 - */ 0, -/* 9f5 - _V_66_0F_66 */ 0x406d, -/* 9f6 - */ 0, -/* 9f7 - */ 0, -/* 9f8 - */ 0, -/* 9f9 - */ 0, -/* 9fa - */ 0, -/* 9fb - */ 0, -/* 9fc - _0F_67 */ 0x23df, -/* 9fd - _66_0F_67 */ 0x23e0, -/* 9fe - */ 0, -/* 9ff - */ 0, -/* a00 - */ 0, -/* a01 - _V_66_0F_67 */ 0x406e, -/* a02 - */ 0, -/* a03 - */ 0, -/* a04 - */ 0, -/* a05 - */ 0, -/* a06 - */ 0, -/* a07 - */ 0, -/* a08 - _0F_68 */ 0x23e1, -/* a09 - _66_0F_68 */ 0x23e2, -/* a0a - */ 0, -/* a0b - */ 0, -/* a0c - */ 0, -/* a0d - _V_66_0F_68 */ 0x406f, -/* a0e - */ 0, -/* a0f - */ 0, -/* a10 - */ 0, -/* a11 - */ 0, -/* a12 - */ 0, -/* a13 - */ 0, -/* a14 - _0F_69 */ 0x23e3, -/* a15 - _66_0F_69 */ 0x23e4, -/* a16 - */ 0, -/* a17 - */ 0, -/* a18 - */ 0, -/* a19 - _V_66_0F_69 */ 0x4070, -/* a1a - */ 0, -/* a1b - */ 0, -/* a1c - */ 0, -/* a1d - */ 0, -/* a1e - */ 0, -/* a1f - */ 0, -/* a20 - _0F_6A */ 0x23e5, -/* a21 - _66_0F_6A */ 0x23e6, -/* a22 - */ 0, -/* a23 - */ 0, -/* a24 - */ 0, -/* a25 - _V_66_0F_6A */ 0x4071, -/* a26 - */ 0, -/* a27 - */ 0, -/* a28 - */ 0, -/* a29 - */ 0, -/* a2a - */ 0, -/* a2b - */ 0, -/* a2c - _0F_6B */ 0x23e7, -/* a2d - _66_0F_6B */ 0x23e8, -/* a2e - */ 0, -/* a2f - */ 0, -/* a30 - */ 0, -/* a31 - _V_66_0F_6B */ 0x4072, -/* a32 - */ 0, -/* a33 - */ 0, -/* a34 - */ 0, -/* a35 - */ 0, -/* a36 - */ 0, -/* a37 - */ 0, -/* a38 - */ 0, -/* a39 - _66_0F_6C */ 0x23e9, -/* a3a - */ 0, -/* a3b - */ 0, -/* a3c - */ 0, -/* a3d - _V_66_0F_6C */ 0x4073, -/* a3e - */ 0, -/* a3f - */ 0, -/* a40 - */ 0, -/* a41 - */ 0, -/* a42 - */ 0, -/* a43 - */ 0, -/* a44 - */ 0, -/* a45 - _66_0F_6D */ 0x23ea, -/* a46 - */ 0, -/* a47 - */ 0, -/* a48 - */ 0, -/* a49 - _V_66_0F_6D */ 0x4074, -/* a4a - */ 0, -/* a4b - */ 0, -/* a4c - */ 0, -/* a4d - */ 0, -/* a4e - */ 0, -/* a4f - */ 0, -/* a50 - _0F_6E */ 0x4075, -/* a51 - _66_0F_6E */ 0x4076, -/* a52 - */ 0, -/* a53 - */ 0, -/* a54 - */ 0, -/* a55 - _V_66_0F_6E */ 0x4077, -/* a56 - */ 0, -/* a57 - */ 0, -/* a58 - */ 0, -/* a59 - */ 0, -/* a5a - */ 0, -/* a5b - */ 0, -/* a5c - _0F_6F */ 0x23eb, -/* a5d - _66_0F_6F */ 0x23ec, -/* a5e - _F3_0F_6F */ 0x23ed, -/* a5f - */ 0, -/* a60 - */ 0, -/* a61 - _V_66_0F_6F */ 0x4078, -/* a62 - _V_F3_0F_6F */ 0x4079, -/* a63 - */ 0, -/* a64 - */ 0, -/* a65 - */ 0, -/* a66 - */ 0, -/* a67 - */ 0, -/* a68 - _0F_70 */ 0x407a, -/* a69 - _66_0F_70 */ 0x407b, -/* a6a - _F3_0F_70 */ 0x407c, -/* a6b - _F2_0F_70 */ 0x407d, -/* a6c - */ 0, -/* a6d - _V_66_0F_70 */ 0x407e, -/* a6e - _V_F3_0F_70 */ 0x407f, -/* a6f - _V_F2_0F_70 */ 0x4080, -/* a70 - */ 0, -/* a71 - */ 0, -/* a72 - */ 0, -/* a73 - */ 0, -/* a74 - */ 0, -/* a75 - */ 0, -/* a76 - _0F_71_02 */ 0xd504, -/* a77 - */ 0, -/* a78 - _0F_71_04 */ 0xd510, -/* a79 - */ 0, -/* a7a - _0F_71_06 */ 0xd51c, -/* a7b - */ 0, -/* a7c - */ 0, -/* a7d - */ 0, -/* a7e - _0F_72_02 */ 0xd528, -/* a7f - */ 0, -/* a80 - _0F_72_04 */ 0xd534, -/* a81 - */ 0, -/* a82 - _0F_72_06 */ 0xd540, -/* a83 - */ 0, -/* a84 - */ 0, -/* a85 - */ 0, -/* a86 - _0F_73_02 */ 0xd54c, -/* a87 - _0F_73_03 */ 0xd558, -/* a88 - */ 0, -/* a89 - */ 0, -/* a8a - _0F_73_06 */ 0xd564, -/* a8b - _0F_73_07 */ 0xd570, -/* a8c - _0F_74 */ 0x23ee, -/* a8d - _66_0F_74 */ 0x23ef, -/* a8e - */ 0, -/* a8f - */ 0, -/* a90 - */ 0, -/* a91 - _V_66_0F_74 */ 0x4081, -/* a92 - */ 0, -/* a93 - */ 0, -/* a94 - */ 0, -/* a95 - */ 0, -/* a96 - */ 0, -/* a97 - */ 0, -/* a98 - _0F_75 */ 0x23f0, -/* a99 - _66_0F_75 */ 0x23f1, -/* a9a - */ 0, -/* a9b - */ 0, -/* a9c - */ 0, -/* a9d - _V_66_0F_75 */ 0x4082, -/* a9e - */ 0, -/* a9f - */ 0, -/* aa0 - */ 0, -/* aa1 - */ 0, -/* aa2 - */ 0, -/* aa3 - */ 0, -/* aa4 - _0F_76 */ 0x23f2, -/* aa5 - _66_0F_76 */ 0x23f3, -/* aa6 - */ 0, -/* aa7 - */ 0, -/* aa8 - */ 0, -/* aa9 - _V_66_0F_76 */ 0x4083, -/* aaa - */ 0, -/* aab - */ 0, -/* aac - */ 0, -/* aad - */ 0, -/* aae - */ 0, -/* aaf - */ 0, -/* ab0 - _0F_77 */ 0x23f4, -/* ab1 - */ 0, -/* ab2 - */ 0, -/* ab3 - */ 0, -/* ab4 - _V_0F_77 */ 0x4084, -/* ab5 - */ 0, -/* ab6 - */ 0, -/* ab7 - */ 0, -/* ab8 - */ 0, -/* ab9 - */ 0, -/* aba - */ 0, -/* abb - */ 0, -/* abc - _0F_78 */ 0x23f5, -/* abd - _66_0F_78 */ 0x4085, -/* abe - */ 0, -/* abf - _F2_0F_78 */ 0x4086, -/* ac0 - */ 0, -/* ac1 - */ 0, -/* ac2 - */ 0, -/* ac3 - */ 0, -/* ac4 - */ 0, -/* ac5 - */ 0, -/* ac6 - */ 0, -/* ac7 - */ 0, -/* ac8 - _0F_79 */ 0x23f6, -/* ac9 - _66_0F_79 */ 0x23f7, -/* aca - */ 0, -/* acb - _F2_0F_79 */ 0x23f8, -/* acc - */ 0, -/* acd - */ 0, -/* ace - */ 0, -/* acf - */ 0, -/* ad0 - */ 0, -/* ad1 - */ 0, -/* ad2 - */ 0, -/* ad3 - */ 0, -/* ad4 - */ 0, -/* ad5 - */ 0, -/* ad6 - */ 0, -/* ad7 - */ 0, -/* ad8 - */ 0, -/* ad9 - */ 0, -/* ada - */ 0, -/* adb - */ 0, -/* adc - */ 0, -/* add - */ 0, -/* ade - */ 0, -/* adf - */ 0, -/* ae0 - */ 0, -/* ae1 - */ 0, -/* ae2 - */ 0, -/* ae3 - */ 0, -/* ae4 - */ 0, -/* ae5 - */ 0, -/* ae6 - */ 0, -/* ae7 - */ 0, -/* ae8 - */ 0, -/* ae9 - */ 0, -/* aea - */ 0, -/* aeb - */ 0, -/* aec - */ 0, -/* aed - */ 0, -/* aee - */ 0, -/* aef - */ 0, -/* af0 - */ 0, -/* af1 - */ 0, -/* af2 - */ 0, -/* af3 - */ 0, -/* af4 - */ 0, -/* af5 - */ 0, -/* af6 - */ 0, -/* af7 - */ 0, -/* af8 - */ 0, -/* af9 - */ 0, -/* afa - */ 0, -/* afb - */ 0, -/* afc - */ 0, -/* afd - */ 0, -/* afe - */ 0, -/* aff - */ 0, -/* b00 - */ 0, -/* b01 - */ 0, -/* b02 - */ 0, -/* b03 - */ 0, -/* b04 - _0F_7A_30 */ 0x23f9, -/* b05 - _0F_7A_31 */ 0x23fa, -/* b06 - */ 0, -/* b07 - */ 0, -/* b08 - */ 0, -/* b09 - */ 0, -/* b0a - */ 0, -/* b0b - */ 0, -/* b0c - */ 0, -/* b0d - */ 0, -/* b0e - */ 0, -/* b0f - */ 0, -/* b10 - */ 0, -/* b11 - */ 0, -/* b12 - */ 0, -/* b13 - */ 0, -/* b14 - */ 0, -/* b15 - */ 0, -/* b16 - */ 0, -/* b17 - */ 0, -/* b18 - */ 0, -/* b19 - */ 0, -/* b1a - */ 0, -/* b1b - */ 0, -/* b1c - */ 0, -/* b1d - */ 0, -/* b1e - */ 0, -/* b1f - */ 0, -/* b20 - */ 0, -/* b21 - */ 0, -/* b22 - */ 0, -/* b23 - */ 0, -/* b24 - */ 0, -/* b25 - */ 0, -/* b26 - */ 0, -/* b27 - */ 0, -/* b28 - */ 0, -/* b29 - */ 0, -/* b2a - */ 0, -/* b2b - */ 0, -/* b2c - */ 0, -/* b2d - */ 0, -/* b2e - */ 0, -/* b2f - */ 0, -/* b30 - */ 0, -/* b31 - */ 0, -/* b32 - */ 0, -/* b33 - */ 0, -/* b34 - */ 0, -/* b35 - */ 0, -/* b36 - */ 0, -/* b37 - */ 0, -/* b38 - */ 0, -/* b39 - */ 0, -/* b3a - */ 0, -/* b3b - */ 0, -/* b3c - */ 0, -/* b3d - */ 0, -/* b3e - */ 0, -/* b3f - */ 0, -/* b40 - */ 0, -/* b41 - */ 0, -/* b42 - */ 0, -/* b43 - */ 0, -/* b44 - */ 0, -/* b45 - */ 0, -/* b46 - */ 0, -/* b47 - */ 0, -/* b48 - */ 0, -/* b49 - */ 0, -/* b4a - */ 0, -/* b4b - */ 0, -/* b4c - */ 0, -/* b4d - */ 0, -/* b4e - */ 0, -/* b4f - */ 0, -/* b50 - */ 0, -/* b51 - */ 0, -/* b52 - */ 0, -/* b53 - */ 0, -/* b54 - */ 0, -/* b55 - */ 0, -/* b56 - */ 0, -/* b57 - */ 0, -/* b58 - */ 0, -/* b59 - */ 0, -/* b5a - */ 0, -/* b5b - */ 0, -/* b5c - */ 0, -/* b5d - */ 0, -/* b5e - */ 0, -/* b5f - */ 0, -/* b60 - */ 0, -/* b61 - */ 0, -/* b62 - */ 0, -/* b63 - */ 0, -/* b64 - */ 0, -/* b65 - */ 0, -/* b66 - */ 0, -/* b67 - */ 0, -/* b68 - */ 0, -/* b69 - */ 0, -/* b6a - */ 0, -/* b6b - */ 0, -/* b6c - */ 0, -/* b6d - */ 0, -/* b6e - */ 0, -/* b6f - */ 0, -/* b70 - */ 0, -/* b71 - */ 0, -/* b72 - */ 0, -/* b73 - */ 0, -/* b74 - */ 0, -/* b75 - */ 0, -/* b76 - */ 0, -/* b77 - */ 0, -/* b78 - */ 0, -/* b79 - */ 0, -/* b7a - */ 0, -/* b7b - */ 0, -/* b7c - */ 0, -/* b7d - */ 0, -/* b7e - */ 0, -/* b7f - */ 0, -/* b80 - */ 0, -/* b81 - */ 0, -/* b82 - */ 0, -/* b83 - */ 0, -/* b84 - */ 0, -/* b85 - */ 0, -/* b86 - */ 0, -/* b87 - */ 0, -/* b88 - */ 0, -/* b89 - */ 0, -/* b8a - */ 0, -/* b8b - */ 0, -/* b8c - */ 0, -/* b8d - */ 0, -/* b8e - */ 0, -/* b8f - */ 0, -/* b90 - */ 0, -/* b91 - */ 0, -/* b92 - */ 0, -/* b93 - */ 0, -/* b94 - */ 0, -/* b95 - */ 0, -/* b96 - */ 0, -/* b97 - */ 0, -/* b98 - */ 0, -/* b99 - */ 0, -/* b9a - */ 0, -/* b9b - */ 0, -/* b9c - */ 0, -/* b9d - */ 0, -/* b9e - */ 0, -/* b9f - */ 0, -/* ba0 - */ 0, -/* ba1 - */ 0, -/* ba2 - */ 0, -/* ba3 - */ 0, -/* ba4 - */ 0, -/* ba5 - */ 0, -/* ba6 - */ 0, -/* ba7 - */ 0, -/* ba8 - */ 0, -/* ba9 - */ 0, -/* baa - */ 0, -/* bab - */ 0, -/* bac - */ 0, -/* bad - */ 0, -/* bae - */ 0, -/* baf - */ 0, -/* bb0 - */ 0, -/* bb1 - */ 0, -/* bb2 - */ 0, -/* bb3 - */ 0, -/* bb4 - */ 0, -/* bb5 - */ 0, -/* bb6 - */ 0, -/* bb7 - */ 0, -/* bb8 - */ 0, -/* bb9 - */ 0, -/* bba - */ 0, -/* bbb - */ 0, -/* bbc - */ 0, -/* bbd - */ 0, -/* bbe - */ 0, -/* bbf - */ 0, -/* bc0 - */ 0, -/* bc1 - */ 0, -/* bc2 - */ 0, -/* bc3 - */ 0, -/* bc4 - */ 0, -/* bc5 - */ 0, -/* bc6 - */ 0, -/* bc7 - */ 0, -/* bc8 - */ 0, -/* bc9 - */ 0, -/* bca - */ 0, -/* bcb - */ 0, -/* bcc - */ 0, -/* bcd - */ 0, -/* bce - */ 0, -/* bcf - */ 0, -/* bd0 - */ 0, -/* bd1 - */ 0, -/* bd2 - */ 0, -/* bd3 - */ 0, -/* bd4 - */ 0, -/* bd5 - _66_0F_7C */ 0x23fb, -/* bd6 - */ 0, -/* bd7 - _F2_0F_7C */ 0x23fc, -/* bd8 - */ 0, -/* bd9 - _V_66_0F_7C */ 0x4087, -/* bda - */ 0, -/* bdb - _V_F2_0F_7C */ 0x4088, -/* bdc - */ 0, -/* bdd - */ 0, -/* bde - */ 0, -/* bdf - */ 0, -/* be0 - */ 0, -/* be1 - _66_0F_7D */ 0x23fd, -/* be2 - */ 0, -/* be3 - _F2_0F_7D */ 0x23fe, -/* be4 - */ 0, -/* be5 - _V_66_0F_7D */ 0x4089, -/* be6 - */ 0, -/* be7 - _V_F2_0F_7D */ 0x408a, -/* be8 - */ 0, -/* be9 - */ 0, -/* bea - */ 0, -/* beb - */ 0, -/* bec - _0F_7E */ 0x408b, -/* bed - _66_0F_7E */ 0x408c, -/* bee - _F3_0F_7E */ 0x23ff, -/* bef - */ 0, -/* bf0 - */ 0, -/* bf1 - _V_66_0F_7E */ 0x408d, -/* bf2 - _V_F3_0F_7E */ 0x408e, -/* bf3 - */ 0, -/* bf4 - */ 0, -/* bf5 - */ 0, -/* bf6 - */ 0, -/* bf7 - */ 0, -/* bf8 - _0F_7F */ 0x2400, -/* bf9 - _66_0F_7F */ 0x2401, -/* bfa - _F3_0F_7F */ 0x2402, -/* bfb - */ 0, -/* bfc - */ 0, -/* bfd - _V_66_0F_7F */ 0x408f, -/* bfe - _V_F3_0F_7F */ 0x4090, -/* bff - */ 0, -/* c00 - */ 0, -/* c01 - */ 0, -/* c02 - */ 0, -/* c03 - */ 0, -/* c04 - _0F_AE_00 */ 0xd57c, -/* c05 - _0F_AE_01 */ 0xd588, -/* c06 - _0F_AE_02 */ 0xd594, -/* c07 - _0F_AE_03 */ 0xd5a0, -/* c08 - _0F_AE_04 */ 0x4091, -/* c09 - _0F_AE_05 */ 0x4092, -/* c0a - _0F_AE_06 */ 0x4093, -/* c0b - _0F_AE_07 */ 0x4094, -/* c0c - */ 0, -/* c0d - */ 0, -/* c0e - _F3_0F_B8 */ 0x2403, -/* c0f - */ 0, -/* c10 - */ 0, -/* c11 - */ 0, -/* c12 - */ 0, -/* c13 - */ 0, -/* c14 - */ 0, -/* c15 - */ 0, -/* c16 - */ 0, -/* c17 - */ 0, -/* c18 - */ 0, -/* c19 - */ 0, -/* c1a - */ 0, -/* c1b - */ 0, -/* c1c - _0F_BA_04 */ 0x2404, -/* c1d - _0F_BA_05 */ 0x2405, -/* c1e - _0F_BA_06 */ 0x2406, -/* c1f - _0F_BA_07 */ 0x2407, -/* c20 - _0F_BC */ 0x2408, -/* c21 - */ 0, -/* c22 - _F3_0F_BC */ 0x2409, -/* c23 - */ 0, -/* c24 - */ 0, -/* c25 - */ 0, -/* c26 - */ 0, -/* c27 - */ 0, -/* c28 - */ 0, -/* c29 - */ 0, -/* c2a - */ 0, -/* c2b - */ 0, -/* c2c - _0F_BD */ 0x240a, -/* c2d - */ 0, -/* c2e - _F3_0F_BD */ 0x240b, -/* c2f - */ 0, -/* c30 - */ 0, -/* c31 - */ 0, -/* c32 - */ 0, -/* c33 - */ 0, -/* c34 - */ 0, -/* c35 - */ 0, -/* c36 - */ 0, -/* c37 - */ 0, -/* c38 - _0F_C2 */ 0x4095, -/* c39 - _66_0F_C2 */ 0x4096, -/* c3a - _F3_0F_C2 */ 0x4097, -/* c3b - _F2_0F_C2 */ 0x4098, -/* c3c - _V_0F_C2 */ 0x4099, -/* c3d - _V_66_0F_C2 */ 0x409a, -/* c3e - _V_F3_0F_C2 */ 0x409b, -/* c3f - _V_F2_0F_C2 */ 0x409c, -/* c40 - */ 0, -/* c41 - */ 0, -/* c42 - */ 0, -/* c43 - */ 0, -/* c44 - _0F_C4 */ 0x409d, -/* c45 - _66_0F_C4 */ 0x409e, -/* c46 - */ 0, -/* c47 - */ 0, -/* c48 - */ 0, -/* c49 - _V_66_0F_C4 */ 0x409f, -/* c4a - */ 0, -/* c4b - */ 0, -/* c4c - */ 0, -/* c4d - */ 0, -/* c4e - */ 0, -/* c4f - */ 0, -/* c50 - _0F_C5 */ 0x40a0, -/* c51 - _66_0F_C5 */ 0x40a1, -/* c52 - */ 0, -/* c53 - */ 0, -/* c54 - */ 0, -/* c55 - _V_66_0F_C5 */ 0x40a2, -/* c56 - */ 0, -/* c57 - */ 0, -/* c58 - */ 0, -/* c59 - */ 0, -/* c5a - */ 0, -/* c5b - */ 0, -/* c5c - _0F_C6 */ 0x40a3, -/* c5d - _66_0F_C6 */ 0x40a4, -/* c5e - */ 0, -/* c5f - */ 0, -/* c60 - _V_0F_C6 */ 0x40a5, -/* c61 - _V_66_0F_C6 */ 0x40a6, -/* c62 - */ 0, -/* c63 - */ 0, -/* c64 - */ 0, -/* c65 - */ 0, -/* c66 - */ 0, -/* c67 - */ 0, -/* c68 - */ 0, -/* c69 - _0F_C7_01 */ 0x40a7, -/* c6a - */ 0, -/* c6b - */ 0, -/* c6c - */ 0, -/* c6d - */ 0, -/* c6e - _0F_C7_06 */ 0xd5ac, -/* c6f - _0F_C7_07 */ 0x240c, -/* c70 - */ 0, -/* c71 - _66_0F_D0 */ 0x240d, -/* c72 - */ 0, -/* c73 - _F2_0F_D0 */ 0x240e, -/* c74 - */ 0, -/* c75 - _V_66_0F_D0 */ 0x40a8, -/* c76 - */ 0, -/* c77 - _V_F2_0F_D0 */ 0x40a9, -/* c78 - */ 0, -/* c79 - */ 0, -/* c7a - */ 0, -/* c7b - */ 0, -/* c7c - _0F_D1 */ 0x240f, -/* c7d - _66_0F_D1 */ 0x2410, -/* c7e - */ 0, -/* c7f - */ 0, -/* c80 - */ 0, -/* c81 - _V_66_0F_D1 */ 0x40aa, -/* c82 - */ 0, -/* c83 - */ 0, -/* c84 - */ 0, -/* c85 - */ 0, -/* c86 - */ 0, -/* c87 - */ 0, -/* c88 - _0F_D2 */ 0x2411, -/* c89 - _66_0F_D2 */ 0x2412, -/* c8a - */ 0, -/* c8b - */ 0, -/* c8c - */ 0, -/* c8d - _V_66_0F_D2 */ 0x40ab, -/* c8e - */ 0, -/* c8f - */ 0, -/* c90 - */ 0, -/* c91 - */ 0, -/* c92 - */ 0, -/* c93 - */ 0, -/* c94 - _0F_D3 */ 0x2413, -/* c95 - _66_0F_D3 */ 0x2414, -/* c96 - */ 0, -/* c97 - */ 0, -/* c98 - */ 0, -/* c99 - _V_66_0F_D3 */ 0x40ac, -/* c9a - */ 0, -/* c9b - */ 0, -/* c9c - */ 0, -/* c9d - */ 0, -/* c9e - */ 0, -/* c9f - */ 0, -/* ca0 - _0F_D4 */ 0x2415, -/* ca1 - _66_0F_D4 */ 0x2416, -/* ca2 - */ 0, -/* ca3 - */ 0, -/* ca4 - */ 0, -/* ca5 - _V_66_0F_D4 */ 0x40ad, -/* ca6 - */ 0, -/* ca7 - */ 0, -/* ca8 - */ 0, -/* ca9 - */ 0, -/* caa - */ 0, -/* cab - */ 0, -/* cac - _0F_D5 */ 0x2417, -/* cad - _66_0F_D5 */ 0x2418, -/* cae - */ 0, -/* caf - */ 0, -/* cb0 - */ 0, -/* cb1 - _V_66_0F_D5 */ 0x40ae, -/* cb2 - */ 0, -/* cb3 - */ 0, -/* cb4 - */ 0, -/* cb5 - */ 0, -/* cb6 - */ 0, -/* cb7 - */ 0, -/* cb8 - */ 0, -/* cb9 - _66_0F_D6 */ 0x2419, -/* cba - _F3_0F_D6 */ 0x241a, -/* cbb - _F2_0F_D6 */ 0x241b, -/* cbc - */ 0, -/* cbd - _V_66_0F_D6 */ 0x40af, -/* cbe - */ 0, -/* cbf - */ 0, -/* cc0 - */ 0, -/* cc1 - */ 0, -/* cc2 - */ 0, -/* cc3 - */ 0, -/* cc4 - _0F_D7 */ 0x241c, -/* cc5 - _66_0F_D7 */ 0x241d, -/* cc6 - */ 0, -/* cc7 - */ 0, -/* cc8 - */ 0, -/* cc9 - _V_66_0F_D7 */ 0x40b0, -/* cca - */ 0, -/* ccb - */ 0, -/* ccc - */ 0, -/* ccd - */ 0, -/* cce - */ 0, -/* ccf - */ 0, -/* cd0 - _0F_D8 */ 0x241e, -/* cd1 - _66_0F_D8 */ 0x241f, -/* cd2 - */ 0, -/* cd3 - */ 0, -/* cd4 - */ 0, -/* cd5 - _V_66_0F_D8 */ 0x40b1, -/* cd6 - */ 0, -/* cd7 - */ 0, -/* cd8 - */ 0, -/* cd9 - */ 0, -/* cda - */ 0, -/* cdb - */ 0, -/* cdc - _0F_D9 */ 0x2420, -/* cdd - _66_0F_D9 */ 0x2421, -/* cde - */ 0, -/* cdf - */ 0, -/* ce0 - */ 0, -/* ce1 - _V_66_0F_D9 */ 0x40b2, -/* ce2 - */ 0, -/* ce3 - */ 0, -/* ce4 - */ 0, -/* ce5 - */ 0, -/* ce6 - */ 0, -/* ce7 - */ 0, -/* ce8 - _0F_DA */ 0x2422, -/* ce9 - _66_0F_DA */ 0x2423, -/* cea - */ 0, -/* ceb - */ 0, -/* cec - */ 0, -/* ced - _V_66_0F_DA */ 0x40b3, -/* cee - */ 0, -/* cef - */ 0, -/* cf0 - */ 0, -/* cf1 - */ 0, -/* cf2 - */ 0, -/* cf3 - */ 0, -/* cf4 - _0F_DB */ 0x2424, -/* cf5 - _66_0F_DB */ 0x2425, -/* cf6 - */ 0, -/* cf7 - */ 0, -/* cf8 - */ 0, -/* cf9 - _V_66_0F_DB */ 0x40b4, -/* cfa - */ 0, -/* cfb - */ 0, -/* cfc - */ 0, -/* cfd - */ 0, -/* cfe - */ 0, -/* cff - */ 0, -/* d00 - _0F_DC */ 0x2426, -/* d01 - _66_0F_DC */ 0x2427, -/* d02 - */ 0, -/* d03 - */ 0, -/* d04 - */ 0, -/* d05 - _V_66_0F_DC */ 0x40b5, -/* d06 - */ 0, -/* d07 - */ 0, -/* d08 - */ 0, -/* d09 - */ 0, -/* d0a - */ 0, -/* d0b - */ 0, -/* d0c - _0F_DD */ 0x2428, -/* d0d - _66_0F_DD */ 0x2429, -/* d0e - */ 0, -/* d0f - */ 0, -/* d10 - */ 0, -/* d11 - _V_66_0F_DD */ 0x40b6, -/* d12 - */ 0, -/* d13 - */ 0, -/* d14 - */ 0, -/* d15 - */ 0, -/* d16 - */ 0, -/* d17 - */ 0, -/* d18 - _0F_DE */ 0x242a, -/* d19 - _66_0F_DE */ 0x242b, -/* d1a - */ 0, -/* d1b - */ 0, -/* d1c - */ 0, -/* d1d - _V_66_0F_DE */ 0x40b7, -/* d1e - */ 0, -/* d1f - */ 0, -/* d20 - */ 0, -/* d21 - */ 0, -/* d22 - */ 0, -/* d23 - */ 0, -/* d24 - _0F_DF */ 0x242c, -/* d25 - _66_0F_DF */ 0x242d, -/* d26 - */ 0, -/* d27 - */ 0, -/* d28 - */ 0, -/* d29 - _V_66_0F_DF */ 0x40b8, -/* d2a - */ 0, -/* d2b - */ 0, -/* d2c - */ 0, -/* d2d - */ 0, -/* d2e - */ 0, -/* d2f - */ 0, -/* d30 - _0F_E0 */ 0x242e, -/* d31 - _66_0F_E0 */ 0x242f, -/* d32 - */ 0, -/* d33 - */ 0, -/* d34 - */ 0, -/* d35 - _V_66_0F_E0 */ 0x40b9, -/* d36 - */ 0, -/* d37 - */ 0, -/* d38 - */ 0, -/* d39 - */ 0, -/* d3a - */ 0, -/* d3b - */ 0, -/* d3c - _0F_E1 */ 0x2430, -/* d3d - _66_0F_E1 */ 0x2431, -/* d3e - */ 0, -/* d3f - */ 0, -/* d40 - */ 0, -/* d41 - _V_66_0F_E1 */ 0x40ba, -/* d42 - */ 0, -/* d43 - */ 0, -/* d44 - */ 0, -/* d45 - */ 0, -/* d46 - */ 0, -/* d47 - */ 0, -/* d48 - _0F_E2 */ 0x2432, -/* d49 - _66_0F_E2 */ 0x2433, -/* d4a - */ 0, -/* d4b - */ 0, -/* d4c - */ 0, -/* d4d - _V_66_0F_E2 */ 0x40bb, -/* d4e - */ 0, -/* d4f - */ 0, -/* d50 - */ 0, -/* d51 - */ 0, -/* d52 - */ 0, -/* d53 - */ 0, -/* d54 - _0F_E3 */ 0x2434, -/* d55 - _66_0F_E3 */ 0x2435, -/* d56 - */ 0, -/* d57 - */ 0, -/* d58 - */ 0, -/* d59 - _V_66_0F_E3 */ 0x40bc, -/* d5a - */ 0, -/* d5b - */ 0, -/* d5c - */ 0, -/* d5d - */ 0, -/* d5e - */ 0, -/* d5f - */ 0, -/* d60 - _0F_E4 */ 0x2436, -/* d61 - _66_0F_E4 */ 0x2437, -/* d62 - */ 0, -/* d63 - */ 0, -/* d64 - */ 0, -/* d65 - _V_66_0F_E4 */ 0x40bd, -/* d66 - */ 0, -/* d67 - */ 0, -/* d68 - */ 0, -/* d69 - */ 0, -/* d6a - */ 0, -/* d6b - */ 0, -/* d6c - _0F_E5 */ 0x2438, -/* d6d - _66_0F_E5 */ 0x2439, -/* d6e - */ 0, -/* d6f - */ 0, -/* d70 - */ 0, -/* d71 - _V_66_0F_E5 */ 0x40be, -/* d72 - */ 0, -/* d73 - */ 0, -/* d74 - */ 0, -/* d75 - */ 0, -/* d76 - */ 0, -/* d77 - */ 0, -/* d78 - */ 0, -/* d79 - _66_0F_E6 */ 0x243a, -/* d7a - _F3_0F_E6 */ 0x243b, -/* d7b - _F2_0F_E6 */ 0x243c, -/* d7c - */ 0, -/* d7d - _V_66_0F_E6 */ 0x40bf, -/* d7e - _V_F3_0F_E6 */ 0x40c0, -/* d7f - _V_F2_0F_E6 */ 0x40c1, -/* d80 - */ 0, -/* d81 - */ 0, -/* d82 - */ 0, -/* d83 - */ 0, -/* d84 - _0F_E7 */ 0x243d, -/* d85 - _66_0F_E7 */ 0x243e, -/* d86 - */ 0, -/* d87 - */ 0, -/* d88 - */ 0, -/* d89 - _V_66_0F_E7 */ 0x40c2, -/* d8a - */ 0, -/* d8b - */ 0, -/* d8c - */ 0, -/* d8d - */ 0, -/* d8e - */ 0, -/* d8f - */ 0, -/* d90 - _0F_E8 */ 0x243f, -/* d91 - _66_0F_E8 */ 0x2440, -/* d92 - */ 0, -/* d93 - */ 0, -/* d94 - */ 0, -/* d95 - _V_66_0F_E8 */ 0x40c3, -/* d96 - */ 0, -/* d97 - */ 0, -/* d98 - */ 0, -/* d99 - */ 0, -/* d9a - */ 0, -/* d9b - */ 0, -/* d9c - _0F_E9 */ 0x2441, -/* d9d - _66_0F_E9 */ 0x2442, -/* d9e - */ 0, -/* d9f - */ 0, -/* da0 - */ 0, -/* da1 - _V_66_0F_E9 */ 0x40c4, -/* da2 - */ 0, -/* da3 - */ 0, -/* da4 - */ 0, -/* da5 - */ 0, -/* da6 - */ 0, -/* da7 - */ 0, -/* da8 - _0F_EA */ 0x2443, -/* da9 - _66_0F_EA */ 0x2444, -/* daa - */ 0, -/* dab - */ 0, -/* dac - */ 0, -/* dad - _V_66_0F_EA */ 0x40c5, -/* dae - */ 0, -/* daf - */ 0, -/* db0 - */ 0, -/* db1 - */ 0, -/* db2 - */ 0, -/* db3 - */ 0, -/* db4 - _0F_EB */ 0x2445, -/* db5 - _66_0F_EB */ 0x2446, -/* db6 - */ 0, -/* db7 - */ 0, -/* db8 - */ 0, -/* db9 - _V_66_0F_EB */ 0x40c6, -/* dba - */ 0, -/* dbb - */ 0, -/* dbc - */ 0, -/* dbd - */ 0, -/* dbe - */ 0, -/* dbf - */ 0, -/* dc0 - _0F_EC */ 0x2447, -/* dc1 - _66_0F_EC */ 0x2448, -/* dc2 - */ 0, -/* dc3 - */ 0, -/* dc4 - */ 0, -/* dc5 - _V_66_0F_EC */ 0x40c7, -/* dc6 - */ 0, -/* dc7 - */ 0, -/* dc8 - */ 0, -/* dc9 - */ 0, -/* dca - */ 0, -/* dcb - */ 0, -/* dcc - _0F_ED */ 0x2449, -/* dcd - _66_0F_ED */ 0x244a, -/* dce - */ 0, -/* dcf - */ 0, -/* dd0 - */ 0, -/* dd1 - _V_66_0F_ED */ 0x40c8, -/* dd2 - */ 0, -/* dd3 - */ 0, -/* dd4 - */ 0, -/* dd5 - */ 0, -/* dd6 - */ 0, -/* dd7 - */ 0, -/* dd8 - _0F_EE */ 0x244b, -/* dd9 - _66_0F_EE */ 0x244c, -/* dda - */ 0, -/* ddb - */ 0, -/* ddc - */ 0, -/* ddd - _V_66_0F_EE */ 0x40c9, -/* dde - */ 0, -/* ddf - */ 0, -/* de0 - */ 0, -/* de1 - */ 0, -/* de2 - */ 0, -/* de3 - */ 0, -/* de4 - _0F_EF */ 0x244d, -/* de5 - _66_0F_EF */ 0x244e, -/* de6 - */ 0, -/* de7 - */ 0, -/* de8 - */ 0, -/* de9 - _V_66_0F_EF */ 0x40ca, -/* dea - */ 0, -/* deb - */ 0, -/* dec - */ 0, -/* ded - */ 0, -/* dee - */ 0, -/* def - */ 0, -/* df0 - */ 0, -/* df1 - */ 0, -/* df2 - */ 0, -/* df3 - _F2_0F_F0 */ 0x244f, -/* df4 - */ 0, -/* df5 - */ 0, -/* df6 - */ 0, -/* df7 - _V_F2_0F_F0 */ 0x40cb, -/* df8 - */ 0, -/* df9 - */ 0, -/* dfa - */ 0, -/* dfb - */ 0, -/* dfc - _0F_F1 */ 0x2450, -/* dfd - _66_0F_F1 */ 0x2451, -/* dfe - */ 0, -/* dff - */ 0, -/* e00 - */ 0, -/* e01 - _V_66_0F_F1 */ 0x40cc, -/* e02 - */ 0, -/* e03 - */ 0, -/* e04 - */ 0, -/* e05 - */ 0, -/* e06 - */ 0, -/* e07 - */ 0, -/* e08 - _0F_F2 */ 0x2452, -/* e09 - _66_0F_F2 */ 0x2453, -/* e0a - */ 0, -/* e0b - */ 0, -/* e0c - */ 0, -/* e0d - _V_66_0F_F2 */ 0x40cd, -/* e0e - */ 0, -/* e0f - */ 0, -/* e10 - */ 0, -/* e11 - */ 0, -/* e12 - */ 0, -/* e13 - */ 0, -/* e14 - _0F_F3 */ 0x2454, -/* e15 - _66_0F_F3 */ 0x2455, -/* e16 - */ 0, -/* e17 - */ 0, -/* e18 - */ 0, -/* e19 - _V_66_0F_F3 */ 0x40ce, -/* e1a - */ 0, -/* e1b - */ 0, -/* e1c - */ 0, -/* e1d - */ 0, -/* e1e - */ 0, -/* e1f - */ 0, -/* e20 - _0F_F4 */ 0x2456, -/* e21 - _66_0F_F4 */ 0x2457, -/* e22 - */ 0, -/* e23 - */ 0, -/* e24 - */ 0, -/* e25 - _V_66_0F_F4 */ 0x40cf, -/* e26 - */ 0, -/* e27 - */ 0, -/* e28 - */ 0, -/* e29 - */ 0, -/* e2a - */ 0, -/* e2b - */ 0, -/* e2c - _0F_F5 */ 0x2458, -/* e2d - _66_0F_F5 */ 0x2459, -/* e2e - */ 0, -/* e2f - */ 0, -/* e30 - */ 0, -/* e31 - _V_66_0F_F5 */ 0x40d0, -/* e32 - */ 0, -/* e33 - */ 0, -/* e34 - */ 0, -/* e35 - */ 0, -/* e36 - */ 0, -/* e37 - */ 0, -/* e38 - _0F_F6 */ 0x245a, -/* e39 - _66_0F_F6 */ 0x245b, -/* e3a - */ 0, -/* e3b - */ 0, -/* e3c - */ 0, -/* e3d - _V_66_0F_F6 */ 0x40d1, -/* e3e - */ 0, -/* e3f - */ 0, -/* e40 - */ 0, -/* e41 - */ 0, -/* e42 - */ 0, -/* e43 - */ 0, -/* e44 - _0F_F7 */ 0x245c, -/* e45 - _66_0F_F7 */ 0x245d, -/* e46 - */ 0, -/* e47 - */ 0, -/* e48 - */ 0, -/* e49 - _V_66_0F_F7 */ 0x40d2, -/* e4a - */ 0, -/* e4b - */ 0, -/* e4c - */ 0, -/* e4d - */ 0, -/* e4e - */ 0, -/* e4f - */ 0, -/* e50 - _0F_F8 */ 0x245e, -/* e51 - _66_0F_F8 */ 0x245f, -/* e52 - */ 0, -/* e53 - */ 0, -/* e54 - */ 0, -/* e55 - _V_66_0F_F8 */ 0x40d3, -/* e56 - */ 0, -/* e57 - */ 0, -/* e58 - */ 0, -/* e59 - */ 0, -/* e5a - */ 0, -/* e5b - */ 0, -/* e5c - _0F_F9 */ 0x2460, -/* e5d - _66_0F_F9 */ 0x2461, -/* e5e - */ 0, -/* e5f - */ 0, -/* e60 - */ 0, -/* e61 - _V_66_0F_F9 */ 0x40d4, -/* e62 - */ 0, -/* e63 - */ 0, -/* e64 - */ 0, -/* e65 - */ 0, -/* e66 - */ 0, -/* e67 - */ 0, -/* e68 - _0F_FA */ 0x2462, -/* e69 - _66_0F_FA */ 0x2463, -/* e6a - */ 0, -/* e6b - */ 0, -/* e6c - */ 0, -/* e6d - _V_66_0F_FA */ 0x40d5, -/* e6e - */ 0, -/* e6f - */ 0, -/* e70 - */ 0, -/* e71 - */ 0, -/* e72 - */ 0, -/* e73 - */ 0, -/* e74 - _0F_FB */ 0x2464, -/* e75 - _66_0F_FB */ 0x2465, -/* e76 - */ 0, -/* e77 - */ 0, -/* e78 - */ 0, -/* e79 - _V_66_0F_FB */ 0x40d6, -/* e7a - */ 0, -/* e7b - */ 0, -/* e7c - */ 0, -/* e7d - */ 0, -/* e7e - */ 0, -/* e7f - */ 0, -/* e80 - _0F_FC */ 0x2466, -/* e81 - _66_0F_FC */ 0x2467, -/* e82 - */ 0, -/* e83 - */ 0, -/* e84 - */ 0, -/* e85 - _V_66_0F_FC */ 0x40d7, -/* e86 - */ 0, -/* e87 - */ 0, -/* e88 - */ 0, -/* e89 - */ 0, -/* e8a - */ 0, -/* e8b - */ 0, -/* e8c - _0F_FD */ 0x2468, -/* e8d - _66_0F_FD */ 0x2469, -/* e8e - */ 0, -/* e8f - */ 0, -/* e90 - */ 0, -/* e91 - _V_66_0F_FD */ 0x40d8, -/* e92 - */ 0, -/* e93 - */ 0, -/* e94 - */ 0, -/* e95 - */ 0, -/* e96 - */ 0, -/* e97 - */ 0, -/* e98 - _0F_FE */ 0x246a, -/* e99 - _66_0F_FE */ 0x246b, -/* e9a - */ 0, -/* e9b - */ 0, -/* e9c - */ 0, -/* e9d - _V_66_0F_FE */ 0x40d9, -/* e9e - */ 0, -/* e9f - */ 0, -/* ea0 - */ 0, -/* ea1 - */ 0, -/* ea2 - */ 0, -/* ea3 - */ 0, -/* ea4 - _D9_06 */ 0x246c, -/* ea5 - _9B_D9_06 */ 0x246d, -/* ea6 - */ 0, -/* ea7 - */ 0, -/* ea8 - */ 0, -/* ea9 - */ 0, -/* eaa - */ 0, -/* eab - */ 0, -/* eac - */ 0, -/* ead - */ 0, -/* eae - */ 0, -/* eaf - */ 0, -/* eb0 - _D9_07 */ 0x246e, -/* eb1 - _9B_D9_07 */ 0x246f, -/* eb2 - */ 0, -/* eb3 - */ 0, -/* eb4 - */ 0, -/* eb5 - */ 0, -/* eb6 - */ 0, -/* eb7 - */ 0, -/* eb8 - */ 0, -/* eb9 - */ 0, -/* eba - */ 0, -/* ebb - */ 0, -/* ebc - _DB_E2 */ 0x2470, -/* ebd - _9B_DB_E2 */ 0x2471, -/* ebe - */ 0, -/* ebf - */ 0, -/* ec0 - */ 0, -/* ec1 - */ 0, -/* ec2 - */ 0, -/* ec3 - */ 0, -/* ec4 - */ 0, -/* ec5 - */ 0, -/* ec6 - */ 0, -/* ec7 - */ 0, -/* ec8 - _DB_E3 */ 0x2472, -/* ec9 - _9B_DB_E3 */ 0x2473, -/* eca - */ 0, -/* ecb - */ 0, -/* ecc - */ 0, -/* ecd - */ 0, -/* ece - */ 0, -/* ecf - */ 0, -/* ed0 - */ 0, -/* ed1 - */ 0, -/* ed2 - */ 0, -/* ed3 - */ 0, -/* ed4 - _DD_06 */ 0x2474, -/* ed5 - _9B_DD_06 */ 0x2475, -/* ed6 - */ 0, -/* ed7 - */ 0, -/* ed8 - */ 0, -/* ed9 - */ 0, -/* eda - */ 0, -/* edb - */ 0, -/* edc - */ 0, -/* edd - */ 0, -/* ede - */ 0, -/* edf - */ 0, -/* ee0 - _DD_07 */ 0x2476, -/* ee1 - _9B_DD_07 */ 0x2477, -/* ee2 - */ 0, -/* ee3 - */ 0, -/* ee4 - */ 0, -/* ee5 - */ 0, -/* ee6 - */ 0, -/* ee7 - */ 0, -/* ee8 - */ 0, -/* ee9 - */ 0, -/* eea - */ 0, -/* eeb - */ 0, -/* eec - _DF_E0 */ 0x2478, -/* eed - _9B_DF_E0 */ 0x2479, -/* eee - */ 0, -/* eef - */ 0, -/* ef0 - */ 0, -/* ef1 - */ 0, -/* ef2 - */ 0, -/* ef3 - */ 0, -/* ef4 - */ 0, -/* ef5 - */ 0, -/* ef6 - */ 0, -/* ef7 - */ 0, -/* ef8 - _0F_38_00 */ 0x247a, -/* ef9 - _66_0F_38_00 */ 0x247b, -/* efa - */ 0, -/* efb - */ 0, -/* efc - */ 0, -/* efd - _V_66_0F_38_00 */ 0x40da, -/* efe - */ 0, -/* eff - */ 0, -/* f00 - */ 0, -/* f01 - */ 0, -/* f02 - */ 0, -/* f03 - */ 0, -/* f04 - _0F_38_01 */ 0x247c, -/* f05 - _66_0F_38_01 */ 0x247d, -/* f06 - */ 0, -/* f07 - */ 0, -/* f08 - */ 0, -/* f09 - _V_66_0F_38_01 */ 0x40db, -/* f0a - */ 0, -/* f0b - */ 0, -/* f0c - */ 0, -/* f0d - */ 0, -/* f0e - */ 0, -/* f0f - */ 0, -/* f10 - _0F_38_02 */ 0x247e, -/* f11 - _66_0F_38_02 */ 0x247f, -/* f12 - */ 0, -/* f13 - */ 0, -/* f14 - */ 0, -/* f15 - _V_66_0F_38_02 */ 0x40dc, -/* f16 - */ 0, -/* f17 - */ 0, -/* f18 - */ 0, -/* f19 - */ 0, -/* f1a - */ 0, -/* f1b - */ 0, -/* f1c - _0F_38_03 */ 0x2480, -/* f1d - _66_0F_38_03 */ 0x2481, -/* f1e - */ 0, -/* f1f - */ 0, -/* f20 - */ 0, -/* f21 - _V_66_0F_38_03 */ 0x40dd, -/* f22 - */ 0, -/* f23 - */ 0, -/* f24 - */ 0, -/* f25 - */ 0, -/* f26 - */ 0, -/* f27 - */ 0, -/* f28 - _0F_38_04 */ 0x2482, -/* f29 - _66_0F_38_04 */ 0x2483, -/* f2a - */ 0, -/* f2b - */ 0, -/* f2c - */ 0, -/* f2d - _V_66_0F_38_04 */ 0x40de, -/* f2e - */ 0, -/* f2f - */ 0, -/* f30 - */ 0, -/* f31 - */ 0, -/* f32 - */ 0, -/* f33 - */ 0, -/* f34 - _0F_38_05 */ 0x2484, -/* f35 - _66_0F_38_05 */ 0x2485, -/* f36 - */ 0, -/* f37 - */ 0, -/* f38 - */ 0, -/* f39 - _V_66_0F_38_05 */ 0x40df, -/* f3a - */ 0, -/* f3b - */ 0, -/* f3c - */ 0, -/* f3d - */ 0, -/* f3e - */ 0, -/* f3f - */ 0, -/* f40 - _0F_38_06 */ 0x2486, -/* f41 - _66_0F_38_06 */ 0x2487, -/* f42 - */ 0, -/* f43 - */ 0, -/* f44 - */ 0, -/* f45 - _V_66_0F_38_06 */ 0x40e0, -/* f46 - */ 0, -/* f47 - */ 0, -/* f48 - */ 0, -/* f49 - */ 0, -/* f4a - */ 0, -/* f4b - */ 0, -/* f4c - _0F_38_07 */ 0x2488, -/* f4d - _66_0F_38_07 */ 0x2489, -/* f4e - */ 0, -/* f4f - */ 0, -/* f50 - */ 0, -/* f51 - _V_66_0F_38_07 */ 0x40e1, -/* f52 - */ 0, -/* f53 - */ 0, -/* f54 - */ 0, -/* f55 - */ 0, -/* f56 - */ 0, -/* f57 - */ 0, -/* f58 - _0F_38_08 */ 0x248a, -/* f59 - _66_0F_38_08 */ 0x248b, -/* f5a - */ 0, -/* f5b - */ 0, -/* f5c - */ 0, -/* f5d - _V_66_0F_38_08 */ 0x40e2, -/* f5e - */ 0, -/* f5f - */ 0, -/* f60 - */ 0, -/* f61 - */ 0, -/* f62 - */ 0, -/* f63 - */ 0, -/* f64 - _0F_38_09 */ 0x248c, -/* f65 - _66_0F_38_09 */ 0x248d, -/* f66 - */ 0, -/* f67 - */ 0, -/* f68 - */ 0, -/* f69 - _V_66_0F_38_09 */ 0x40e3, -/* f6a - */ 0, -/* f6b - */ 0, -/* f6c - */ 0, -/* f6d - */ 0, -/* f6e - */ 0, -/* f6f - */ 0, -/* f70 - _0F_38_0A */ 0x248e, -/* f71 - _66_0F_38_0A */ 0x248f, -/* f72 - */ 0, -/* f73 - */ 0, -/* f74 - */ 0, -/* f75 - _V_66_0F_38_0A */ 0x40e4, -/* f76 - */ 0, -/* f77 - */ 0, -/* f78 - */ 0, -/* f79 - */ 0, -/* f7a - */ 0, -/* f7b - */ 0, -/* f7c - _0F_38_0B */ 0x2490, -/* f7d - _66_0F_38_0B */ 0x2491, -/* f7e - */ 0, -/* f7f - */ 0, -/* f80 - */ 0, -/* f81 - _V_66_0F_38_0B */ 0x40e5, -/* f82 - */ 0, -/* f83 - */ 0, -/* f84 - */ 0, -/* f85 - */ 0, -/* f86 - */ 0, -/* f87 - */ 0, -/* f88 - */ 0, -/* f89 - */ 0, -/* f8a - */ 0, -/* f8b - */ 0, -/* f8c - */ 0, -/* f8d - _V_66_0F_38_0C */ 0x40e6, -/* f8e - */ 0, -/* f8f - */ 0, -/* f90 - */ 0, -/* f91 - */ 0, -/* f92 - */ 0, -/* f93 - */ 0, -/* f94 - */ 0, -/* f95 - */ 0, -/* f96 - */ 0, -/* f97 - */ 0, -/* f98 - */ 0, -/* f99 - _V_66_0F_38_0D */ 0x40e7, -/* f9a - */ 0, -/* f9b - */ 0, -/* f9c - */ 0, -/* f9d - */ 0, -/* f9e - */ 0, -/* f9f - */ 0, -/* fa0 - */ 0, -/* fa1 - */ 0, -/* fa2 - */ 0, -/* fa3 - */ 0, -/* fa4 - */ 0, -/* fa5 - _V_66_0F_38_0E */ 0x40e8, -/* fa6 - */ 0, -/* fa7 - */ 0, -/* fa8 - */ 0, -/* fa9 - */ 0, -/* faa - */ 0, -/* fab - */ 0, -/* fac - */ 0, -/* fad - */ 0, -/* fae - */ 0, -/* faf - */ 0, -/* fb0 - */ 0, -/* fb1 - _V_66_0F_38_0F */ 0x40e9, -/* fb2 - */ 0, -/* fb3 - */ 0, -/* fb4 - */ 0, -/* fb5 - */ 0, -/* fb6 - */ 0, -/* fb7 - */ 0, -/* fb8 - */ 0, -/* fb9 - _66_0F_38_10 */ 0x40ea, -/* fba - */ 0, -/* fbb - */ 0, -/* fbc - */ 0, -/* fbd - */ 0, -/* fbe - */ 0, -/* fbf - */ 0, -/* fc0 - */ 0, -/* fc1 - */ 0, -/* fc2 - */ 0, -/* fc3 - */ 0, -/* fc4 - */ 0, -/* fc5 - _66_0F_38_14 */ 0x40eb, -/* fc6 - */ 0, -/* fc7 - */ 0, -/* fc8 - */ 0, -/* fc9 - */ 0, -/* fca - */ 0, -/* fcb - */ 0, -/* fcc - */ 0, -/* fcd - */ 0, -/* fce - */ 0, -/* fcf - */ 0, -/* fd0 - */ 0, -/* fd1 - _66_0F_38_15 */ 0x40ec, -/* fd2 - */ 0, -/* fd3 - */ 0, -/* fd4 - */ 0, -/* fd5 - */ 0, -/* fd6 - */ 0, -/* fd7 - */ 0, -/* fd8 - */ 0, -/* fd9 - */ 0, -/* fda - */ 0, -/* fdb - */ 0, -/* fdc - */ 0, -/* fdd - _66_0F_38_17 */ 0x2492, -/* fde - */ 0, -/* fdf - */ 0, -/* fe0 - */ 0, -/* fe1 - _V_66_0F_38_17 */ 0x40ed, -/* fe2 - */ 0, -/* fe3 - */ 0, -/* fe4 - */ 0, -/* fe5 - */ 0, -/* fe6 - */ 0, -/* fe7 - */ 0, -/* fe8 - */ 0, -/* fe9 - */ 0, -/* fea - */ 0, -/* feb - */ 0, -/* fec - */ 0, -/* fed - _V_66_0F_38_18 */ 0x40ee, -/* fee - */ 0, -/* fef - */ 0, -/* ff0 - */ 0, -/* ff1 - */ 0, -/* ff2 - */ 0, -/* ff3 - */ 0, -/* ff4 - */ 0, -/* ff5 - */ 0, -/* ff6 - */ 0, -/* ff7 - */ 0, -/* ff8 - */ 0, -/* ff9 - _V_66_0F_38_19 */ 0x40ef, -/* ffa - */ 0, -/* ffb - */ 0, -/* ffc - */ 0, -/* ffd - */ 0, -/* ffe - */ 0, -/* fff - */ 0, -/* 1000 - */ 0, -/* 1001 - */ 0, -/* 1002 - */ 0, -/* 1003 - */ 0, -/* 1004 - */ 0, -/* 1005 - _V_66_0F_38_1A */ 0x40f0, -/* 1006 - */ 0, -/* 1007 - */ 0, -/* 1008 - */ 0, -/* 1009 - */ 0, -/* 100a - */ 0, -/* 100b - */ 0, -/* 100c - _0F_38_1C */ 0x2493, -/* 100d - _66_0F_38_1C */ 0x2494, -/* 100e - */ 0, -/* 100f - */ 0, -/* 1010 - */ 0, -/* 1011 - _V_66_0F_38_1C */ 0x40f1, -/* 1012 - */ 0, -/* 1013 - */ 0, -/* 1014 - */ 0, -/* 1015 - */ 0, -/* 1016 - */ 0, -/* 1017 - */ 0, -/* 1018 - _0F_38_1D */ 0x2495, -/* 1019 - _66_0F_38_1D */ 0x2496, -/* 101a - */ 0, -/* 101b - */ 0, -/* 101c - */ 0, -/* 101d - _V_66_0F_38_1D */ 0x40f2, -/* 101e - */ 0, -/* 101f - */ 0, -/* 1020 - */ 0, -/* 1021 - */ 0, -/* 1022 - */ 0, -/* 1023 - */ 0, -/* 1024 - _0F_38_1E */ 0x2497, -/* 1025 - _66_0F_38_1E */ 0x2498, -/* 1026 - */ 0, -/* 1027 - */ 0, -/* 1028 - */ 0, -/* 1029 - _V_66_0F_38_1E */ 0x40f3, -/* 102a - */ 0, -/* 102b - */ 0, -/* 102c - */ 0, -/* 102d - */ 0, -/* 102e - */ 0, -/* 102f - */ 0, -/* 1030 - */ 0, -/* 1031 - _66_0F_38_20 */ 0x2499, -/* 1032 - */ 0, -/* 1033 - */ 0, -/* 1034 - */ 0, -/* 1035 - _V_66_0F_38_20 */ 0x40f4, -/* 1036 - */ 0, -/* 1037 - */ 0, -/* 1038 - */ 0, -/* 1039 - */ 0, -/* 103a - */ 0, -/* 103b - */ 0, -/* 103c - */ 0, -/* 103d - _66_0F_38_21 */ 0x249a, -/* 103e - */ 0, -/* 103f - */ 0, -/* 1040 - */ 0, -/* 1041 - _V_66_0F_38_21 */ 0x40f5, -/* 1042 - */ 0, -/* 1043 - */ 0, -/* 1044 - */ 0, -/* 1045 - */ 0, -/* 1046 - */ 0, -/* 1047 - */ 0, -/* 1048 - */ 0, -/* 1049 - _66_0F_38_22 */ 0x249b, -/* 104a - */ 0, -/* 104b - */ 0, -/* 104c - */ 0, -/* 104d - _V_66_0F_38_22 */ 0x40f6, -/* 104e - */ 0, -/* 104f - */ 0, -/* 1050 - */ 0, -/* 1051 - */ 0, -/* 1052 - */ 0, -/* 1053 - */ 0, -/* 1054 - */ 0, -/* 1055 - _66_0F_38_23 */ 0x249c, -/* 1056 - */ 0, -/* 1057 - */ 0, -/* 1058 - */ 0, -/* 1059 - _V_66_0F_38_23 */ 0x40f7, -/* 105a - */ 0, -/* 105b - */ 0, -/* 105c - */ 0, -/* 105d - */ 0, -/* 105e - */ 0, -/* 105f - */ 0, -/* 1060 - */ 0, -/* 1061 - _66_0F_38_24 */ 0x249d, -/* 1062 - */ 0, -/* 1063 - */ 0, -/* 1064 - */ 0, -/* 1065 - _V_66_0F_38_24 */ 0x40f8, -/* 1066 - */ 0, -/* 1067 - */ 0, -/* 1068 - */ 0, -/* 1069 - */ 0, -/* 106a - */ 0, -/* 106b - */ 0, -/* 106c - */ 0, -/* 106d - _66_0F_38_25 */ 0x249e, -/* 106e - */ 0, -/* 106f - */ 0, -/* 1070 - */ 0, -/* 1071 - _V_66_0F_38_25 */ 0x40f9, -/* 1072 - */ 0, -/* 1073 - */ 0, -/* 1074 - */ 0, -/* 1075 - */ 0, -/* 1076 - */ 0, -/* 1077 - */ 0, -/* 1078 - */ 0, -/* 1079 - _66_0F_38_28 */ 0x249f, -/* 107a - */ 0, -/* 107b - */ 0, -/* 107c - */ 0, -/* 107d - _V_66_0F_38_28 */ 0x40fa, -/* 107e - */ 0, -/* 107f - */ 0, -/* 1080 - */ 0, -/* 1081 - */ 0, -/* 1082 - */ 0, -/* 1083 - */ 0, -/* 1084 - */ 0, -/* 1085 - _66_0F_38_29 */ 0x24a0, -/* 1086 - */ 0, -/* 1087 - */ 0, -/* 1088 - */ 0, -/* 1089 - _V_66_0F_38_29 */ 0x40fb, -/* 108a - */ 0, -/* 108b - */ 0, -/* 108c - */ 0, -/* 108d - */ 0, -/* 108e - */ 0, -/* 108f - */ 0, -/* 1090 - */ 0, -/* 1091 - _66_0F_38_2A */ 0x24a1, -/* 1092 - */ 0, -/* 1093 - */ 0, -/* 1094 - */ 0, -/* 1095 - _V_66_0F_38_2A */ 0x40fc, -/* 1096 - */ 0, -/* 1097 - */ 0, -/* 1098 - */ 0, -/* 1099 - */ 0, -/* 109a - */ 0, -/* 109b - */ 0, -/* 109c - */ 0, -/* 109d - _66_0F_38_2B */ 0x24a2, -/* 109e - */ 0, -/* 109f - */ 0, -/* 10a0 - */ 0, -/* 10a1 - _V_66_0F_38_2B */ 0x40fd, -/* 10a2 - */ 0, -/* 10a3 - */ 0, -/* 10a4 - */ 0, -/* 10a5 - */ 0, -/* 10a6 - */ 0, -/* 10a7 - */ 0, -/* 10a8 - */ 0, -/* 10a9 - */ 0, -/* 10aa - */ 0, -/* 10ab - */ 0, -/* 10ac - */ 0, -/* 10ad - _V_66_0F_38_2C */ 0x40fe, -/* 10ae - */ 0, -/* 10af - */ 0, -/* 10b0 - */ 0, -/* 10b1 - */ 0, -/* 10b2 - */ 0, -/* 10b3 - */ 0, -/* 10b4 - */ 0, -/* 10b5 - */ 0, -/* 10b6 - */ 0, -/* 10b7 - */ 0, -/* 10b8 - */ 0, -/* 10b9 - _V_66_0F_38_2D */ 0x40ff, -/* 10ba - */ 0, -/* 10bb - */ 0, -/* 10bc - */ 0, -/* 10bd - */ 0, -/* 10be - */ 0, -/* 10bf - */ 0, -/* 10c0 - */ 0, -/* 10c1 - */ 0, -/* 10c2 - */ 0, -/* 10c3 - */ 0, -/* 10c4 - */ 0, -/* 10c5 - _V_66_0F_38_2E */ 0x4100, -/* 10c6 - */ 0, -/* 10c7 - */ 0, -/* 10c8 - */ 0, -/* 10c9 - */ 0, -/* 10ca - */ 0, -/* 10cb - */ 0, -/* 10cc - */ 0, -/* 10cd - */ 0, -/* 10ce - */ 0, -/* 10cf - */ 0, -/* 10d0 - */ 0, -/* 10d1 - _V_66_0F_38_2F */ 0x4101, -/* 10d2 - */ 0, -/* 10d3 - */ 0, -/* 10d4 - */ 0, -/* 10d5 - */ 0, -/* 10d6 - */ 0, -/* 10d7 - */ 0, -/* 10d8 - */ 0, -/* 10d9 - _66_0F_38_30 */ 0x24a3, -/* 10da - */ 0, -/* 10db - */ 0, -/* 10dc - */ 0, -/* 10dd - _V_66_0F_38_30 */ 0x4102, -/* 10de - */ 0, -/* 10df - */ 0, -/* 10e0 - */ 0, -/* 10e1 - */ 0, -/* 10e2 - */ 0, -/* 10e3 - */ 0, -/* 10e4 - */ 0, -/* 10e5 - _66_0F_38_31 */ 0x24a4, -/* 10e6 - */ 0, -/* 10e7 - */ 0, -/* 10e8 - */ 0, -/* 10e9 - _V_66_0F_38_31 */ 0x4103, -/* 10ea - */ 0, -/* 10eb - */ 0, -/* 10ec - */ 0, -/* 10ed - */ 0, -/* 10ee - */ 0, -/* 10ef - */ 0, -/* 10f0 - */ 0, -/* 10f1 - _66_0F_38_32 */ 0x24a5, -/* 10f2 - */ 0, -/* 10f3 - */ 0, -/* 10f4 - */ 0, -/* 10f5 - _V_66_0F_38_32 */ 0x4104, -/* 10f6 - */ 0, -/* 10f7 - */ 0, -/* 10f8 - */ 0, -/* 10f9 - */ 0, -/* 10fa - */ 0, -/* 10fb - */ 0, -/* 10fc - */ 0, -/* 10fd - _66_0F_38_33 */ 0x24a6, -/* 10fe - */ 0, -/* 10ff - */ 0, -/* 1100 - */ 0, -/* 1101 - _V_66_0F_38_33 */ 0x4105, -/* 1102 - */ 0, -/* 1103 - */ 0, -/* 1104 - */ 0, -/* 1105 - */ 0, -/* 1106 - */ 0, -/* 1107 - */ 0, -/* 1108 - */ 0, -/* 1109 - _66_0F_38_34 */ 0x24a7, -/* 110a - */ 0, -/* 110b - */ 0, -/* 110c - */ 0, -/* 110d - _V_66_0F_38_34 */ 0x4106, -/* 110e - */ 0, -/* 110f - */ 0, -/* 1110 - */ 0, -/* 1111 - */ 0, -/* 1112 - */ 0, -/* 1113 - */ 0, -/* 1114 - */ 0, -/* 1115 - _66_0F_38_35 */ 0x24a8, -/* 1116 - */ 0, -/* 1117 - */ 0, -/* 1118 - */ 0, -/* 1119 - _V_66_0F_38_35 */ 0x4107, -/* 111a - */ 0, -/* 111b - */ 0, -/* 111c - */ 0, -/* 111d - */ 0, -/* 111e - */ 0, -/* 111f - */ 0, -/* 1120 - */ 0, -/* 1121 - _66_0F_38_37 */ 0x24a9, -/* 1122 - */ 0, -/* 1123 - */ 0, -/* 1124 - */ 0, -/* 1125 - _V_66_0F_38_37 */ 0x4108, -/* 1126 - */ 0, -/* 1127 - */ 0, -/* 1128 - */ 0, -/* 1129 - */ 0, -/* 112a - */ 0, -/* 112b - */ 0, -/* 112c - */ 0, -/* 112d - _66_0F_38_38 */ 0x24aa, -/* 112e - */ 0, -/* 112f - */ 0, -/* 1130 - */ 0, -/* 1131 - _V_66_0F_38_38 */ 0x4109, -/* 1132 - */ 0, -/* 1133 - */ 0, -/* 1134 - */ 0, -/* 1135 - */ 0, -/* 1136 - */ 0, -/* 1137 - */ 0, -/* 1138 - */ 0, -/* 1139 - _66_0F_38_39 */ 0x24ab, -/* 113a - */ 0, -/* 113b - */ 0, -/* 113c - */ 0, -/* 113d - _V_66_0F_38_39 */ 0x410a, -/* 113e - */ 0, -/* 113f - */ 0, -/* 1140 - */ 0, -/* 1141 - */ 0, -/* 1142 - */ 0, -/* 1143 - */ 0, -/* 1144 - */ 0, -/* 1145 - _66_0F_38_3A */ 0x24ac, -/* 1146 - */ 0, -/* 1147 - */ 0, -/* 1148 - */ 0, -/* 1149 - _V_66_0F_38_3A */ 0x410b, -/* 114a - */ 0, -/* 114b - */ 0, -/* 114c - */ 0, -/* 114d - */ 0, -/* 114e - */ 0, -/* 114f - */ 0, -/* 1150 - */ 0, -/* 1151 - _66_0F_38_3B */ 0x24ad, -/* 1152 - */ 0, -/* 1153 - */ 0, -/* 1154 - */ 0, -/* 1155 - _V_66_0F_38_3B */ 0x410c, -/* 1156 - */ 0, -/* 1157 - */ 0, -/* 1158 - */ 0, -/* 1159 - */ 0, -/* 115a - */ 0, -/* 115b - */ 0, -/* 115c - */ 0, -/* 115d - _66_0F_38_3C */ 0x24ae, -/* 115e - */ 0, -/* 115f - */ 0, -/* 1160 - */ 0, -/* 1161 - _V_66_0F_38_3C */ 0x410d, -/* 1162 - */ 0, -/* 1163 - */ 0, -/* 1164 - */ 0, -/* 1165 - */ 0, -/* 1166 - */ 0, -/* 1167 - */ 0, -/* 1168 - */ 0, -/* 1169 - _66_0F_38_3D */ 0x24af, -/* 116a - */ 0, -/* 116b - */ 0, -/* 116c - */ 0, -/* 116d - _V_66_0F_38_3D */ 0x410e, -/* 116e - */ 0, -/* 116f - */ 0, -/* 1170 - */ 0, -/* 1171 - */ 0, -/* 1172 - */ 0, -/* 1173 - */ 0, -/* 1174 - */ 0, -/* 1175 - _66_0F_38_3E */ 0x24b0, -/* 1176 - */ 0, -/* 1177 - */ 0, -/* 1178 - */ 0, -/* 1179 - _V_66_0F_38_3E */ 0x410f, -/* 117a - */ 0, -/* 117b - */ 0, -/* 117c - */ 0, -/* 117d - */ 0, -/* 117e - */ 0, -/* 117f - */ 0, -/* 1180 - */ 0, -/* 1181 - _66_0F_38_3F */ 0x24b1, -/* 1182 - */ 0, -/* 1183 - */ 0, -/* 1184 - */ 0, -/* 1185 - _V_66_0F_38_3F */ 0x4110, -/* 1186 - */ 0, -/* 1187 - */ 0, -/* 1188 - */ 0, -/* 1189 - */ 0, -/* 118a - */ 0, -/* 118b - */ 0, -/* 118c - */ 0, -/* 118d - _66_0F_38_40 */ 0x24b2, -/* 118e - */ 0, -/* 118f - */ 0, -/* 1190 - */ 0, -/* 1191 - _V_66_0F_38_40 */ 0x4111, -/* 1192 - */ 0, -/* 1193 - */ 0, -/* 1194 - */ 0, -/* 1195 - */ 0, -/* 1196 - */ 0, -/* 1197 - */ 0, -/* 1198 - */ 0, -/* 1199 - _66_0F_38_41 */ 0x24b3, -/* 119a - */ 0, -/* 119b - */ 0, -/* 119c - */ 0, -/* 119d - _V_66_0F_38_41 */ 0x4112, -/* 119e - */ 0, -/* 119f - */ 0, -/* 11a0 - */ 0, -/* 11a1 - */ 0, -/* 11a2 - */ 0, -/* 11a3 - */ 0, -/* 11a4 - */ 0, -/* 11a5 - _66_0F_38_80 */ 0x24b4, -/* 11a6 - */ 0, -/* 11a7 - */ 0, -/* 11a8 - */ 0, -/* 11a9 - */ 0, -/* 11aa - */ 0, -/* 11ab - */ 0, -/* 11ac - */ 0, -/* 11ad - */ 0, -/* 11ae - */ 0, -/* 11af - */ 0, -/* 11b0 - */ 0, -/* 11b1 - _66_0F_38_81 */ 0x24b5, -/* 11b2 - */ 0, -/* 11b3 - */ 0, -/* 11b4 - */ 0, -/* 11b5 - */ 0, -/* 11b6 - */ 0, -/* 11b7 - */ 0, -/* 11b8 - */ 0, -/* 11b9 - */ 0, -/* 11ba - */ 0, -/* 11bb - */ 0, -/* 11bc - */ 0, -/* 11bd - _66_0F_38_82 */ 0x24b6, -/* 11be - */ 0, -/* 11bf - */ 0, -/* 11c0 - */ 0, -/* 11c1 - */ 0, -/* 11c2 - */ 0, -/* 11c3 - */ 0, -/* 11c4 - */ 0, -/* 11c5 - */ 0, -/* 11c6 - */ 0, -/* 11c7 - */ 0, -/* 11c8 - */ 0, -/* 11c9 - */ 0, -/* 11ca - */ 0, -/* 11cb - */ 0, -/* 11cc - */ 0, -/* 11cd - _V_66_0F_38_96 */ 0x4113, -/* 11ce - */ 0, -/* 11cf - */ 0, -/* 11d0 - */ 0, -/* 11d1 - */ 0, -/* 11d2 - */ 0, -/* 11d3 - */ 0, -/* 11d4 - */ 0, -/* 11d5 - */ 0, -/* 11d6 - */ 0, -/* 11d7 - */ 0, -/* 11d8 - */ 0, -/* 11d9 - _V_66_0F_38_97 */ 0x4114, -/* 11da - */ 0, -/* 11db - */ 0, -/* 11dc - */ 0, -/* 11dd - */ 0, -/* 11de - */ 0, -/* 11df - */ 0, -/* 11e0 - */ 0, -/* 11e1 - */ 0, -/* 11e2 - */ 0, -/* 11e3 - */ 0, -/* 11e4 - */ 0, -/* 11e5 - _V_66_0F_38_98 */ 0x4115, -/* 11e6 - */ 0, -/* 11e7 - */ 0, -/* 11e8 - */ 0, -/* 11e9 - */ 0, -/* 11ea - */ 0, -/* 11eb - */ 0, -/* 11ec - */ 0, -/* 11ed - */ 0, -/* 11ee - */ 0, -/* 11ef - */ 0, -/* 11f0 - */ 0, -/* 11f1 - _V_66_0F_38_99 */ 0x4116, -/* 11f2 - */ 0, -/* 11f3 - */ 0, -/* 11f4 - */ 0, -/* 11f5 - */ 0, -/* 11f6 - */ 0, -/* 11f7 - */ 0, -/* 11f8 - */ 0, -/* 11f9 - */ 0, -/* 11fa - */ 0, -/* 11fb - */ 0, -/* 11fc - */ 0, -/* 11fd - _V_66_0F_38_9A */ 0x4117, -/* 11fe - */ 0, -/* 11ff - */ 0, -/* 1200 - */ 0, -/* 1201 - */ 0, -/* 1202 - */ 0, -/* 1203 - */ 0, -/* 1204 - */ 0, -/* 1205 - */ 0, -/* 1206 - */ 0, -/* 1207 - */ 0, -/* 1208 - */ 0, -/* 1209 - _V_66_0F_38_9B */ 0x4118, -/* 120a - */ 0, -/* 120b - */ 0, -/* 120c - */ 0, -/* 120d - */ 0, -/* 120e - */ 0, -/* 120f - */ 0, -/* 1210 - */ 0, -/* 1211 - */ 0, -/* 1212 - */ 0, -/* 1213 - */ 0, -/* 1214 - */ 0, -/* 1215 - _V_66_0F_38_9C */ 0x4119, -/* 1216 - */ 0, -/* 1217 - */ 0, -/* 1218 - */ 0, -/* 1219 - */ 0, -/* 121a - */ 0, -/* 121b - */ 0, -/* 121c - */ 0, -/* 121d - */ 0, -/* 121e - */ 0, -/* 121f - */ 0, -/* 1220 - */ 0, -/* 1221 - _V_66_0F_38_9D */ 0x411a, -/* 1222 - */ 0, -/* 1223 - */ 0, -/* 1224 - */ 0, -/* 1225 - */ 0, -/* 1226 - */ 0, -/* 1227 - */ 0, -/* 1228 - */ 0, -/* 1229 - */ 0, -/* 122a - */ 0, -/* 122b - */ 0, -/* 122c - */ 0, -/* 122d - _V_66_0F_38_9E */ 0x411b, -/* 122e - */ 0, -/* 122f - */ 0, -/* 1230 - */ 0, -/* 1231 - */ 0, -/* 1232 - */ 0, -/* 1233 - */ 0, -/* 1234 - */ 0, -/* 1235 - */ 0, -/* 1236 - */ 0, -/* 1237 - */ 0, -/* 1238 - */ 0, -/* 1239 - _V_66_0F_38_9F */ 0x411c, -/* 123a - */ 0, -/* 123b - */ 0, -/* 123c - */ 0, -/* 123d - */ 0, -/* 123e - */ 0, -/* 123f - */ 0, -/* 1240 - */ 0, -/* 1241 - */ 0, -/* 1242 - */ 0, -/* 1243 - */ 0, -/* 1244 - */ 0, -/* 1245 - _V_66_0F_38_A6 */ 0x411d, -/* 1246 - */ 0, -/* 1247 - */ 0, -/* 1248 - */ 0, -/* 1249 - */ 0, -/* 124a - */ 0, -/* 124b - */ 0, -/* 124c - */ 0, -/* 124d - */ 0, -/* 124e - */ 0, -/* 124f - */ 0, -/* 1250 - */ 0, -/* 1251 - _V_66_0F_38_A7 */ 0x411e, -/* 1252 - */ 0, -/* 1253 - */ 0, -/* 1254 - */ 0, -/* 1255 - */ 0, -/* 1256 - */ 0, -/* 1257 - */ 0, -/* 1258 - */ 0, -/* 1259 - */ 0, -/* 125a - */ 0, -/* 125b - */ 0, -/* 125c - */ 0, -/* 125d - _V_66_0F_38_A8 */ 0x411f, -/* 125e - */ 0, -/* 125f - */ 0, -/* 1260 - */ 0, -/* 1261 - */ 0, -/* 1262 - */ 0, -/* 1263 - */ 0, -/* 1264 - */ 0, -/* 1265 - */ 0, -/* 1266 - */ 0, -/* 1267 - */ 0, -/* 1268 - */ 0, -/* 1269 - _V_66_0F_38_A9 */ 0x4120, -/* 126a - */ 0, -/* 126b - */ 0, -/* 126c - */ 0, -/* 126d - */ 0, -/* 126e - */ 0, -/* 126f - */ 0, -/* 1270 - */ 0, -/* 1271 - */ 0, -/* 1272 - */ 0, -/* 1273 - */ 0, -/* 1274 - */ 0, -/* 1275 - _V_66_0F_38_AA */ 0x4121, -/* 1276 - */ 0, -/* 1277 - */ 0, -/* 1278 - */ 0, -/* 1279 - */ 0, -/* 127a - */ 0, -/* 127b - */ 0, -/* 127c - */ 0, -/* 127d - */ 0, -/* 127e - */ 0, -/* 127f - */ 0, -/* 1280 - */ 0, -/* 1281 - _V_66_0F_38_AB */ 0x4122, -/* 1282 - */ 0, -/* 1283 - */ 0, -/* 1284 - */ 0, -/* 1285 - */ 0, -/* 1286 - */ 0, -/* 1287 - */ 0, -/* 1288 - */ 0, -/* 1289 - */ 0, -/* 128a - */ 0, -/* 128b - */ 0, -/* 128c - */ 0, -/* 128d - _V_66_0F_38_AC */ 0x4123, -/* 128e - */ 0, -/* 128f - */ 0, -/* 1290 - */ 0, -/* 1291 - */ 0, -/* 1292 - */ 0, -/* 1293 - */ 0, -/* 1294 - */ 0, -/* 1295 - */ 0, -/* 1296 - */ 0, -/* 1297 - */ 0, -/* 1298 - */ 0, -/* 1299 - _V_66_0F_38_AD */ 0x4124, -/* 129a - */ 0, -/* 129b - */ 0, -/* 129c - */ 0, -/* 129d - */ 0, -/* 129e - */ 0, -/* 129f - */ 0, -/* 12a0 - */ 0, -/* 12a1 - */ 0, -/* 12a2 - */ 0, -/* 12a3 - */ 0, -/* 12a4 - */ 0, -/* 12a5 - _V_66_0F_38_AE */ 0x4125, -/* 12a6 - */ 0, -/* 12a7 - */ 0, -/* 12a8 - */ 0, -/* 12a9 - */ 0, -/* 12aa - */ 0, -/* 12ab - */ 0, -/* 12ac - */ 0, -/* 12ad - */ 0, -/* 12ae - */ 0, -/* 12af - */ 0, -/* 12b0 - */ 0, -/* 12b1 - _V_66_0F_38_AF */ 0x4126, -/* 12b2 - */ 0, -/* 12b3 - */ 0, -/* 12b4 - */ 0, -/* 12b5 - */ 0, -/* 12b6 - */ 0, -/* 12b7 - */ 0, -/* 12b8 - */ 0, -/* 12b9 - */ 0, -/* 12ba - */ 0, -/* 12bb - */ 0, -/* 12bc - */ 0, -/* 12bd - _V_66_0F_38_B6 */ 0x4127, -/* 12be - */ 0, -/* 12bf - */ 0, -/* 12c0 - */ 0, -/* 12c1 - */ 0, -/* 12c2 - */ 0, -/* 12c3 - */ 0, -/* 12c4 - */ 0, -/* 12c5 - */ 0, -/* 12c6 - */ 0, -/* 12c7 - */ 0, -/* 12c8 - */ 0, -/* 12c9 - _V_66_0F_38_B7 */ 0x4128, -/* 12ca - */ 0, -/* 12cb - */ 0, -/* 12cc - */ 0, -/* 12cd - */ 0, -/* 12ce - */ 0, -/* 12cf - */ 0, -/* 12d0 - */ 0, -/* 12d1 - */ 0, -/* 12d2 - */ 0, -/* 12d3 - */ 0, -/* 12d4 - */ 0, -/* 12d5 - _V_66_0F_38_B8 */ 0x4129, -/* 12d6 - */ 0, -/* 12d7 - */ 0, -/* 12d8 - */ 0, -/* 12d9 - */ 0, -/* 12da - */ 0, -/* 12db - */ 0, -/* 12dc - */ 0, -/* 12dd - */ 0, -/* 12de - */ 0, -/* 12df - */ 0, -/* 12e0 - */ 0, -/* 12e1 - _V_66_0F_38_B9 */ 0x412a, -/* 12e2 - */ 0, -/* 12e3 - */ 0, -/* 12e4 - */ 0, -/* 12e5 - */ 0, -/* 12e6 - */ 0, -/* 12e7 - */ 0, -/* 12e8 - */ 0, -/* 12e9 - */ 0, -/* 12ea - */ 0, -/* 12eb - */ 0, -/* 12ec - */ 0, -/* 12ed - _V_66_0F_38_BA */ 0x412b, -/* 12ee - */ 0, -/* 12ef - */ 0, -/* 12f0 - */ 0, -/* 12f1 - */ 0, -/* 12f2 - */ 0, -/* 12f3 - */ 0, -/* 12f4 - */ 0, -/* 12f5 - */ 0, -/* 12f6 - */ 0, -/* 12f7 - */ 0, -/* 12f8 - */ 0, -/* 12f9 - _V_66_0F_38_BB */ 0x412c, -/* 12fa - */ 0, -/* 12fb - */ 0, -/* 12fc - */ 0, -/* 12fd - */ 0, -/* 12fe - */ 0, -/* 12ff - */ 0, -/* 1300 - */ 0, -/* 1301 - */ 0, -/* 1302 - */ 0, -/* 1303 - */ 0, -/* 1304 - */ 0, -/* 1305 - _V_66_0F_38_BC */ 0x412d, -/* 1306 - */ 0, -/* 1307 - */ 0, -/* 1308 - */ 0, -/* 1309 - */ 0, -/* 130a - */ 0, -/* 130b - */ 0, -/* 130c - */ 0, -/* 130d - */ 0, -/* 130e - */ 0, -/* 130f - */ 0, -/* 1310 - */ 0, -/* 1311 - _V_66_0F_38_BD */ 0x412e, -/* 1312 - */ 0, -/* 1313 - */ 0, -/* 1314 - */ 0, -/* 1315 - */ 0, -/* 1316 - */ 0, -/* 1317 - */ 0, -/* 1318 - */ 0, -/* 1319 - */ 0, -/* 131a - */ 0, -/* 131b - */ 0, -/* 131c - */ 0, -/* 131d - _V_66_0F_38_BE */ 0x412f, -/* 131e - */ 0, -/* 131f - */ 0, -/* 1320 - */ 0, -/* 1321 - */ 0, -/* 1322 - */ 0, -/* 1323 - */ 0, -/* 1324 - */ 0, -/* 1325 - */ 0, -/* 1326 - */ 0, -/* 1327 - */ 0, -/* 1328 - */ 0, -/* 1329 - _V_66_0F_38_BF */ 0x4130, -/* 132a - */ 0, -/* 132b - */ 0, -/* 132c - */ 0, -/* 132d - */ 0, -/* 132e - */ 0, -/* 132f - */ 0, -/* 1330 - */ 0, -/* 1331 - _66_0F_38_DB */ 0x24b7, -/* 1332 - */ 0, -/* 1333 - */ 0, -/* 1334 - */ 0, -/* 1335 - _V_66_0F_38_DB */ 0x4131, -/* 1336 - */ 0, -/* 1337 - */ 0, -/* 1338 - */ 0, -/* 1339 - */ 0, -/* 133a - */ 0, -/* 133b - */ 0, -/* 133c - */ 0, -/* 133d - _66_0F_38_DC */ 0x24b8, -/* 133e - */ 0, -/* 133f - */ 0, -/* 1340 - */ 0, -/* 1341 - _V_66_0F_38_DC */ 0x4132, -/* 1342 - */ 0, -/* 1343 - */ 0, -/* 1344 - */ 0, -/* 1345 - */ 0, -/* 1346 - */ 0, -/* 1347 - */ 0, -/* 1348 - */ 0, -/* 1349 - _66_0F_38_DD */ 0x24b9, -/* 134a - */ 0, -/* 134b - */ 0, -/* 134c - */ 0, -/* 134d - _V_66_0F_38_DD */ 0x4133, -/* 134e - */ 0, -/* 134f - */ 0, -/* 1350 - */ 0, -/* 1351 - */ 0, -/* 1352 - */ 0, -/* 1353 - */ 0, -/* 1354 - */ 0, -/* 1355 - _66_0F_38_DE */ 0x24ba, -/* 1356 - */ 0, -/* 1357 - */ 0, -/* 1358 - */ 0, -/* 1359 - _V_66_0F_38_DE */ 0x4134, -/* 135a - */ 0, -/* 135b - */ 0, -/* 135c - */ 0, -/* 135d - */ 0, -/* 135e - */ 0, -/* 135f - */ 0, -/* 1360 - */ 0, -/* 1361 - _66_0F_38_DF */ 0x24bb, -/* 1362 - */ 0, -/* 1363 - */ 0, -/* 1364 - */ 0, -/* 1365 - _V_66_0F_38_DF */ 0x4135, -/* 1366 - */ 0, -/* 1367 - */ 0, -/* 1368 - */ 0, -/* 1369 - */ 0, -/* 136a - */ 0, -/* 136b - */ 0, -/* 136c - _0F_38_F0 */ 0x24bc, -/* 136d - */ 0, -/* 136e - */ 0, -/* 136f - _F2_0F_38_F0 */ 0x24bd, -/* 1370 - */ 0, -/* 1371 - */ 0, -/* 1372 - */ 0, -/* 1373 - */ 0, -/* 1374 - */ 0, -/* 1375 - */ 0, -/* 1376 - */ 0, -/* 1377 - */ 0, -/* 1378 - _0F_38_F1 */ 0x24be, -/* 1379 - */ 0, -/* 137a - */ 0, -/* 137b - _F2_0F_38_F1 */ 0x24bf, -/* 137c - */ 0, -/* 137d - */ 0, -/* 137e - */ 0, -/* 137f - */ 0, -/* 1380 - */ 0, -/* 1381 - */ 0, -/* 1382 - */ 0, -/* 1383 - */ 0, -/* 1384 - */ 0, -/* 1385 - */ 0, -/* 1386 - */ 0, -/* 1387 - */ 0, -/* 1388 - */ 0, -/* 1389 - _V_66_0F_3A_04 */ 0x4136, -/* 138a - */ 0, -/* 138b - */ 0, -/* 138c - */ 0, -/* 138d - */ 0, -/* 138e - */ 0, -/* 138f - */ 0, -/* 1390 - */ 0, -/* 1391 - */ 0, -/* 1392 - */ 0, -/* 1393 - */ 0, -/* 1394 - */ 0, -/* 1395 - _V_66_0F_3A_05 */ 0x4137, -/* 1396 - */ 0, -/* 1397 - */ 0, -/* 1398 - */ 0, -/* 1399 - */ 0, -/* 139a - */ 0, -/* 139b - */ 0, -/* 139c - */ 0, -/* 139d - */ 0, -/* 139e - */ 0, -/* 139f - */ 0, -/* 13a0 - */ 0, -/* 13a1 - _V_66_0F_3A_06 */ 0x4138, -/* 13a2 - */ 0, -/* 13a3 - */ 0, -/* 13a4 - */ 0, -/* 13a5 - */ 0, -/* 13a6 - */ 0, -/* 13a7 - */ 0, -/* 13a8 - */ 0, -/* 13a9 - _66_0F_3A_08 */ 0x4139, -/* 13aa - */ 0, -/* 13ab - */ 0, -/* 13ac - */ 0, -/* 13ad - _V_66_0F_3A_08 */ 0x413a, -/* 13ae - */ 0, -/* 13af - */ 0, -/* 13b0 - */ 0, -/* 13b1 - */ 0, -/* 13b2 - */ 0, -/* 13b3 - */ 0, -/* 13b4 - */ 0, -/* 13b5 - _66_0F_3A_09 */ 0x413b, -/* 13b6 - */ 0, -/* 13b7 - */ 0, -/* 13b8 - */ 0, -/* 13b9 - _V_66_0F_3A_09 */ 0x413c, -/* 13ba - */ 0, -/* 13bb - */ 0, -/* 13bc - */ 0, -/* 13bd - */ 0, -/* 13be - */ 0, -/* 13bf - */ 0, -/* 13c0 - */ 0, -/* 13c1 - _66_0F_3A_0A */ 0x413d, -/* 13c2 - */ 0, -/* 13c3 - */ 0, -/* 13c4 - */ 0, -/* 13c5 - _V_66_0F_3A_0A */ 0x413e, -/* 13c6 - */ 0, -/* 13c7 - */ 0, -/* 13c8 - */ 0, -/* 13c9 - */ 0, -/* 13ca - */ 0, -/* 13cb - */ 0, -/* 13cc - */ 0, -/* 13cd - _66_0F_3A_0B */ 0x413f, -/* 13ce - */ 0, -/* 13cf - */ 0, -/* 13d0 - */ 0, -/* 13d1 - _V_66_0F_3A_0B */ 0x4140, -/* 13d2 - */ 0, -/* 13d3 - */ 0, -/* 13d4 - */ 0, -/* 13d5 - */ 0, -/* 13d6 - */ 0, -/* 13d7 - */ 0, -/* 13d8 - */ 0, -/* 13d9 - _66_0F_3A_0C */ 0x4141, -/* 13da - */ 0, -/* 13db - */ 0, -/* 13dc - */ 0, -/* 13dd - _V_66_0F_3A_0C */ 0x4142, -/* 13de - */ 0, -/* 13df - */ 0, -/* 13e0 - */ 0, -/* 13e1 - */ 0, -/* 13e2 - */ 0, -/* 13e3 - */ 0, -/* 13e4 - */ 0, -/* 13e5 - _66_0F_3A_0D */ 0x4143, -/* 13e6 - */ 0, -/* 13e7 - */ 0, -/* 13e8 - */ 0, -/* 13e9 - _V_66_0F_3A_0D */ 0x4144, -/* 13ea - */ 0, -/* 13eb - */ 0, -/* 13ec - */ 0, -/* 13ed - */ 0, -/* 13ee - */ 0, -/* 13ef - */ 0, -/* 13f0 - */ 0, -/* 13f1 - _66_0F_3A_0E */ 0x4145, -/* 13f2 - */ 0, -/* 13f3 - */ 0, -/* 13f4 - */ 0, -/* 13f5 - _V_66_0F_3A_0E */ 0x4146, -/* 13f6 - */ 0, -/* 13f7 - */ 0, -/* 13f8 - */ 0, -/* 13f9 - */ 0, -/* 13fa - */ 0, -/* 13fb - */ 0, -/* 13fc - _0F_3A_0F */ 0x4147, -/* 13fd - _66_0F_3A_0F */ 0x4148, -/* 13fe - */ 0, -/* 13ff - */ 0, -/* 1400 - */ 0, -/* 1401 - _V_66_0F_3A_0F */ 0x4149, -/* 1402 - */ 0, -/* 1403 - */ 0, -/* 1404 - */ 0, -/* 1405 - */ 0, -/* 1406 - */ 0, -/* 1407 - */ 0, -/* 1408 - */ 0, -/* 1409 - _66_0F_3A_14 */ 0x414a, -/* 140a - */ 0, -/* 140b - */ 0, -/* 140c - */ 0, -/* 140d - _V_66_0F_3A_14 */ 0x414b, -/* 140e - */ 0, -/* 140f - */ 0, -/* 1410 - */ 0, -/* 1411 - */ 0, -/* 1412 - */ 0, -/* 1413 - */ 0, -/* 1414 - */ 0, -/* 1415 - _66_0F_3A_15 */ 0x414c, -/* 1416 - */ 0, -/* 1417 - */ 0, -/* 1418 - */ 0, -/* 1419 - _V_66_0F_3A_15 */ 0x414d, -/* 141a - */ 0, -/* 141b - */ 0, -/* 141c - */ 0, -/* 141d - */ 0, -/* 141e - */ 0, -/* 141f - */ 0, -/* 1420 - */ 0, -/* 1421 - _66_0F_3A_16 */ 0x414e, -/* 1422 - */ 0, -/* 1423 - */ 0, -/* 1424 - */ 0, -/* 1425 - _V_66_0F_3A_16 */ 0x414f, -/* 1426 - */ 0, -/* 1427 - */ 0, -/* 1428 - */ 0, -/* 1429 - */ 0, -/* 142a - */ 0, -/* 142b - */ 0, -/* 142c - */ 0, -/* 142d - _66_0F_3A_17 */ 0x4150, -/* 142e - */ 0, -/* 142f - */ 0, -/* 1430 - */ 0, -/* 1431 - _V_66_0F_3A_17 */ 0x4151, -/* 1432 - */ 0, -/* 1433 - */ 0, -/* 1434 - */ 0, -/* 1435 - */ 0, -/* 1436 - */ 0, -/* 1437 - */ 0, -/* 1438 - */ 0, -/* 1439 - */ 0, -/* 143a - */ 0, -/* 143b - */ 0, -/* 143c - */ 0, -/* 143d - _V_66_0F_3A_18 */ 0x4152, -/* 143e - */ 0, -/* 143f - */ 0, -/* 1440 - */ 0, -/* 1441 - */ 0, -/* 1442 - */ 0, -/* 1443 - */ 0, -/* 1444 - */ 0, -/* 1445 - */ 0, -/* 1446 - */ 0, -/* 1447 - */ 0, -/* 1448 - */ 0, -/* 1449 - _V_66_0F_3A_19 */ 0x4153, -/* 144a - */ 0, -/* 144b - */ 0, -/* 144c - */ 0, -/* 144d - */ 0, -/* 144e - */ 0, -/* 144f - */ 0, -/* 1450 - */ 0, -/* 1451 - _66_0F_3A_20 */ 0x4154, -/* 1452 - */ 0, -/* 1453 - */ 0, -/* 1454 - */ 0, -/* 1455 - _V_66_0F_3A_20 */ 0x4155, -/* 1456 - */ 0, -/* 1457 - */ 0, -/* 1458 - */ 0, -/* 1459 - */ 0, -/* 145a - */ 0, -/* 145b - */ 0, -/* 145c - */ 0, -/* 145d - _66_0F_3A_21 */ 0x4156, -/* 145e - */ 0, -/* 145f - */ 0, -/* 1460 - */ 0, -/* 1461 - _V_66_0F_3A_21 */ 0x4157, -/* 1462 - */ 0, -/* 1463 - */ 0, -/* 1464 - */ 0, -/* 1465 - */ 0, -/* 1466 - */ 0, -/* 1467 - */ 0, -/* 1468 - */ 0, -/* 1469 - _66_0F_3A_22 */ 0x4158, -/* 146a - */ 0, -/* 146b - */ 0, -/* 146c - */ 0, -/* 146d - _V_66_0F_3A_22 */ 0x4159, -/* 146e - */ 0, -/* 146f - */ 0, -/* 1470 - */ 0, -/* 1471 - */ 0, -/* 1472 - */ 0, -/* 1473 - */ 0, -/* 1474 - */ 0, -/* 1475 - _66_0F_3A_40 */ 0x415a, -/* 1476 - */ 0, -/* 1477 - */ 0, -/* 1478 - */ 0, -/* 1479 - _V_66_0F_3A_40 */ 0x415b, -/* 147a - */ 0, -/* 147b - */ 0, -/* 147c - */ 0, -/* 147d - */ 0, -/* 147e - */ 0, -/* 147f - */ 0, -/* 1480 - */ 0, -/* 1481 - _66_0F_3A_41 */ 0x415c, -/* 1482 - */ 0, -/* 1483 - */ 0, -/* 1484 - */ 0, -/* 1485 - _V_66_0F_3A_41 */ 0x415d, -/* 1486 - */ 0, -/* 1487 - */ 0, -/* 1488 - */ 0, -/* 1489 - */ 0, -/* 148a - */ 0, -/* 148b - */ 0, -/* 148c - */ 0, -/* 148d - _66_0F_3A_42 */ 0x415e, -/* 148e - */ 0, -/* 148f - */ 0, -/* 1490 - */ 0, -/* 1491 - _V_66_0F_3A_42 */ 0x415f, -/* 1492 - */ 0, -/* 1493 - */ 0, -/* 1494 - */ 0, -/* 1495 - */ 0, -/* 1496 - */ 0, -/* 1497 - */ 0, -/* 1498 - */ 0, -/* 1499 - _66_0F_3A_44 */ 0x4160, -/* 149a - */ 0, -/* 149b - */ 0, -/* 149c - */ 0, -/* 149d - _V_66_0F_3A_44 */ 0x4161, -/* 149e - */ 0, -/* 149f - */ 0, -/* 14a0 - */ 0, -/* 14a1 - */ 0, -/* 14a2 - */ 0, -/* 14a3 - */ 0, -/* 14a4 - */ 0, -/* 14a5 - */ 0, -/* 14a6 - */ 0, -/* 14a7 - */ 0, -/* 14a8 - */ 0, -/* 14a9 - _V_66_0F_3A_4A */ 0x4162, -/* 14aa - */ 0, -/* 14ab - */ 0, -/* 14ac - */ 0, -/* 14ad - */ 0, -/* 14ae - */ 0, -/* 14af - */ 0, -/* 14b0 - */ 0, -/* 14b1 - */ 0, -/* 14b2 - */ 0, -/* 14b3 - */ 0, -/* 14b4 - */ 0, -/* 14b5 - _V_66_0F_3A_4B */ 0x4163, -/* 14b6 - */ 0, -/* 14b7 - */ 0, -/* 14b8 - */ 0, -/* 14b9 - */ 0, -/* 14ba - */ 0, -/* 14bb - */ 0, -/* 14bc - */ 0, -/* 14bd - */ 0, -/* 14be - */ 0, -/* 14bf - */ 0, -/* 14c0 - */ 0, -/* 14c1 - _V_66_0F_3A_4C */ 0x4164, -/* 14c2 - */ 0, -/* 14c3 - */ 0, -/* 14c4 - */ 0, -/* 14c5 - */ 0, -/* 14c6 - */ 0, -/* 14c7 - */ 0, -/* 14c8 - */ 0, -/* 14c9 - _66_0F_3A_60 */ 0x4165, -/* 14ca - */ 0, -/* 14cb - */ 0, -/* 14cc - */ 0, -/* 14cd - _V_66_0F_3A_60 */ 0x4166, -/* 14ce - */ 0, -/* 14cf - */ 0, -/* 14d0 - */ 0, -/* 14d1 - */ 0, -/* 14d2 - */ 0, -/* 14d3 - */ 0, -/* 14d4 - */ 0, -/* 14d5 - _66_0F_3A_61 */ 0x4167, -/* 14d6 - */ 0, -/* 14d7 - */ 0, -/* 14d8 - */ 0, -/* 14d9 - _V_66_0F_3A_61 */ 0x4168, -/* 14da - */ 0, -/* 14db - */ 0, -/* 14dc - */ 0, -/* 14dd - */ 0, -/* 14de - */ 0, -/* 14df - */ 0, -/* 14e0 - */ 0, -/* 14e1 - _66_0F_3A_62 */ 0x4169, -/* 14e2 - */ 0, -/* 14e3 - */ 0, -/* 14e4 - */ 0, -/* 14e5 - _V_66_0F_3A_62 */ 0x416a, -/* 14e6 - */ 0, -/* 14e7 - */ 0, -/* 14e8 - */ 0, -/* 14e9 - */ 0, -/* 14ea - */ 0, -/* 14eb - */ 0, -/* 14ec - */ 0, -/* 14ed - _66_0F_3A_63 */ 0x416b, -/* 14ee - */ 0, -/* 14ef - */ 0, -/* 14f0 - */ 0, -/* 14f1 - _V_66_0F_3A_63 */ 0x416c, -/* 14f2 - */ 0, -/* 14f3 - */ 0, -/* 14f4 - */ 0, -/* 14f5 - */ 0, -/* 14f6 - */ 0, -/* 14f7 - */ 0, -/* 14f8 - */ 0, -/* 14f9 - _66_0F_3A_DF */ 0x416d, -/* 14fa - */ 0, -/* 14fb - */ 0, -/* 14fc - */ 0, -/* 14fd - _V_66_0F_3A_DF */ 0x416e, -/* 14fe - */ 0, -/* 14ff - */ 0, -/* 1500 - */ 0, -/* 1501 - */ 0, -/* 1502 - */ 0, -/* 1503 - */ 0, -/* 1504 - _0F_71_02 */ 0x24c0, -/* 1505 - _66_0F_71_02 */ 0x24c1, -/* 1506 - */ 0, -/* 1507 - */ 0, -/* 1508 - */ 0, -/* 1509 - _V_66_0F_71_02 */ 0x416f, -/* 150a - */ 0, -/* 150b - */ 0, -/* 150c - */ 0, -/* 150d - */ 0, -/* 150e - */ 0, -/* 150f - */ 0, -/* 1510 - _0F_71_04 */ 0x24c2, -/* 1511 - _66_0F_71_04 */ 0x24c3, -/* 1512 - */ 0, -/* 1513 - */ 0, -/* 1514 - */ 0, -/* 1515 - _V_66_0F_71_04 */ 0x4170, -/* 1516 - */ 0, -/* 1517 - */ 0, -/* 1518 - */ 0, -/* 1519 - */ 0, -/* 151a - */ 0, -/* 151b - */ 0, -/* 151c - _0F_71_06 */ 0x24c4, -/* 151d - _66_0F_71_06 */ 0x24c5, -/* 151e - */ 0, -/* 151f - */ 0, -/* 1520 - */ 0, -/* 1521 - _V_66_0F_71_06 */ 0x4171, -/* 1522 - */ 0, -/* 1523 - */ 0, -/* 1524 - */ 0, -/* 1525 - */ 0, -/* 1526 - */ 0, -/* 1527 - */ 0, -/* 1528 - _0F_72_02 */ 0x24c6, -/* 1529 - _66_0F_72_02 */ 0x24c7, -/* 152a - */ 0, -/* 152b - */ 0, -/* 152c - */ 0, -/* 152d - _V_66_0F_72_02 */ 0x4172, -/* 152e - */ 0, -/* 152f - */ 0, -/* 1530 - */ 0, -/* 1531 - */ 0, -/* 1532 - */ 0, -/* 1533 - */ 0, -/* 1534 - _0F_72_04 */ 0x24c8, -/* 1535 - _66_0F_72_04 */ 0x24c9, -/* 1536 - */ 0, -/* 1537 - */ 0, -/* 1538 - */ 0, -/* 1539 - _V_66_0F_72_04 */ 0x4173, -/* 153a - */ 0, -/* 153b - */ 0, -/* 153c - */ 0, -/* 153d - */ 0, -/* 153e - */ 0, -/* 153f - */ 0, -/* 1540 - _0F_72_06 */ 0x24ca, -/* 1541 - _66_0F_72_06 */ 0x24cb, -/* 1542 - */ 0, -/* 1543 - */ 0, -/* 1544 - */ 0, -/* 1545 - _V_66_0F_72_06 */ 0x4174, -/* 1546 - */ 0, -/* 1547 - */ 0, -/* 1548 - */ 0, -/* 1549 - */ 0, -/* 154a - */ 0, -/* 154b - */ 0, -/* 154c - _0F_73_02 */ 0x24cc, -/* 154d - _66_0F_73_02 */ 0x24cd, -/* 154e - */ 0, -/* 154f - */ 0, -/* 1550 - */ 0, -/* 1551 - _V_66_0F_73_02 */ 0x4175, -/* 1552 - */ 0, -/* 1553 - */ 0, -/* 1554 - */ 0, -/* 1555 - */ 0, -/* 1556 - */ 0, -/* 1557 - */ 0, -/* 1558 - */ 0, -/* 1559 - _66_0F_73_03 */ 0x24ce, -/* 155a - */ 0, -/* 155b - */ 0, -/* 155c - */ 0, -/* 155d - _V_66_0F_73_03 */ 0x4176, -/* 155e - */ 0, -/* 155f - */ 0, -/* 1560 - */ 0, -/* 1561 - */ 0, -/* 1562 - */ 0, -/* 1563 - */ 0, -/* 1564 - _0F_73_06 */ 0x24cf, -/* 1565 - _66_0F_73_06 */ 0x24d0, -/* 1566 - */ 0, -/* 1567 - */ 0, -/* 1568 - */ 0, -/* 1569 - _V_66_0F_73_06 */ 0x4177, -/* 156a - */ 0, -/* 156b - */ 0, -/* 156c - */ 0, -/* 156d - */ 0, -/* 156e - */ 0, -/* 156f - */ 0, -/* 1570 - */ 0, -/* 1571 - _66_0F_73_07 */ 0x24d1, -/* 1572 - */ 0, -/* 1573 - */ 0, -/* 1574 - */ 0, -/* 1575 - _V_66_0F_73_07 */ 0x4178, -/* 1576 - */ 0, -/* 1577 - */ 0, -/* 1578 - */ 0, -/* 1579 - */ 0, -/* 157a - */ 0, -/* 157b - */ 0, -/* 157c - _0F_AE_00 */ 0x4179, -/* 157d - */ 0, -/* 157e - _F3_0F_AE_00 */ 0x24d2, -/* 157f - */ 0, -/* 1580 - */ 0, -/* 1581 - */ 0, -/* 1582 - */ 0, -/* 1583 - */ 0, -/* 1584 - */ 0, -/* 1585 - */ 0, -/* 1586 - */ 0, -/* 1587 - */ 0, -/* 1588 - _0F_AE_01 */ 0x417a, -/* 1589 - */ 0, -/* 158a - _F3_0F_AE_01 */ 0x24d3, -/* 158b - */ 0, -/* 158c - */ 0, -/* 158d - */ 0, -/* 158e - */ 0, -/* 158f - */ 0, -/* 1590 - */ 0, -/* 1591 - */ 0, -/* 1592 - */ 0, -/* 1593 - */ 0, -/* 1594 - _0F_AE_02 */ 0x24d4, -/* 1595 - */ 0, -/* 1596 - _F3_0F_AE_02 */ 0x24d5, -/* 1597 - */ 0, -/* 1598 - _V_0F_AE_02 */ 0x417b, -/* 1599 - */ 0, -/* 159a - */ 0, -/* 159b - */ 0, -/* 159c - */ 0, -/* 159d - */ 0, -/* 159e - */ 0, -/* 159f - */ 0, -/* 15a0 - _0F_AE_03 */ 0x24d6, -/* 15a1 - */ 0, -/* 15a2 - _F3_0F_AE_03 */ 0x24d7, -/* 15a3 - */ 0, -/* 15a4 - _V_0F_AE_03 */ 0x417c, -/* 15a5 - */ 0, -/* 15a6 - */ 0, -/* 15a7 - */ 0, -/* 15a8 - */ 0, -/* 15a9 - */ 0, -/* 15aa - */ 0, -/* 15ab - */ 0, -/* 15ac - _0F_C7_06 */ 0x417d, -/* 15ad - _66_0F_C7_06 */ 0x24d8, -/* 15ae - _F3_0F_C7_06 */ 0x24d9, -/* 15af - */ 0, -/* 15b0 - */ 0, -/* 15b1 - */ 0, -/* 15b2 - */ 0, -/* 15b3 - */ 0, -/* 15b4 - */ 0, -/* 15b5 - */ 0, -/* 15b6 - */ 0, -/* 15b7 - */ 0 -}; - -uint16_t CmpMnemonicOffsets[8] = { -0, 9, 18, 27, 39, 49, 59, 69 -}; -uint16_t VCmpMnemonicOffsets[32] = { -0, 10, 20, 30, 43, 54, 65, 76, 87, 100, 111, 122, 135, 149, 159, 169, 181, -194, 207, 220, 235, 249, 263, 277, 290, 303, 317, 331, 347, 361, 374, 387 -}; diff --git a/distorm3.2-package/src/insts.h b/distorm3.2-package/src/insts.h deleted file mode 100644 index 0cdf2ef..0000000 --- a/distorm3.2-package/src/insts.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -insts.h - -diStorm3 - Powerful disassembler for X86/AMD64 -http://ragestorm.net/distorm/ -distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see -*/ - - -#ifndef INSTS_H -#define INSTS_H - -#include "instructions.h" - - -/* Flags Table */ -extern _iflags FlagsTable[]; - -/* Root Trie DB */ -extern _InstInfo InstInfos[]; -extern _InstInfoEx InstInfosEx[]; -extern _InstNode InstructionsTree[]; - -/* 3DNow! Trie DB */ -extern _InstNode Table_0F_0F; -/* AVX related: */ -extern _InstNode Table_0F, Table_0F_38, Table_0F_3A; - -/* Helper tables for pesudo compare mnemonics. */ -extern uint16_t CmpMnemonicOffsets[8]; /* SSE */ -extern uint16_t VCmpMnemonicOffsets[32]; /* AVX */ - -#endif /* INSTS_H */ diff --git a/distorm3.2-package/src/operands.h b/distorm3.2-package/src/operands.h deleted file mode 100644 index e1beb6f..0000000 --- a/distorm3.2-package/src/operands.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -operands.h - -diStorm3 - Powerful disassembler for X86/AMD64 -http://ragestorm.net/distorm/ -distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see -*/ - - -#ifndef OPERANDS_H -#define OPERANDS_H - -#include "config.h" -#include "decoder.h" -#include "prefix.h" -#include "instructions.h" - - -extern uint16_t _REGISTERTORCLASS[]; - -int operands_extract(_CodeInfo* ci, _DInst* di, _InstInfo* ii, - _OpType type, _OperandNumberType opNum, - unsigned int modrm, _PrefixState* ps, _DecodeType effOpSz, - _DecodeType effAdrSz, int* lockableInstruction); - -#endif /* OPERANDS_H */ diff --git a/distorm3.2-package/src/x86defs.c b/distorm3.2-package/src/x86defs.c deleted file mode 100644 index 4ee7e42..0000000 --- a/distorm3.2-package/src/x86defs.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -x86defs.c - -diStorm3 - Powerful disassembler for X86/AMD64 -http://ragestorm.net/distorm/ -distorm at gmail dot com -Copyright (C) 2003-2012 Gil Dabah - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see -*/ - - -#include "x86defs.h" -#include "instructions.h" -#include "../include/mnemonics.h" - - -/* - * The first field of an _InstInfo is the flagsInex, which goes into FlagsTable in insts.c - * Since this table is auto generated in disOps, we have to make sure that the first 5 entries - * are reserved for our use here. - * The following defined inst-infos have to be synced manually every time you change insts.c. - */ - -_InstInfo II_arpl = {0 /* INST_MODRM_REQUIRED */, OT_REG16, OT_RM16, ISC_INTEGER << 3, I_ARPL}; -/* - * MOVSXD: - * This is the worst defined instruction ever. It has so many variations. - * I decided after a third review, to make it like MOVSXD RAX, EAX when there IS a REX.W. - * Otherwise it will be MOVSXD EAX, EAX, which really zero extends to RAX. - * Completely ignoring DB 0x66, which is possible by the docs, BTW. - */ -_InstInfo II_movsxd = {1 /* INST_MODRM_REQUIRED | INST_PRE_REX | INST_64BITS */, OT_RM32, OT_REG32_64, ISC_INTEGER << 3, I_MOVSXD}; - -_InstInfo II_nop = {2 /* INST_FLAGS_NONE */, OT_NONE, OT_NONE, ISC_INTEGER << 3, I_NOP}; - -_InstInfo II_pause = {3 /* INST_FLAGS_NONE */, OT_NONE, OT_NONE, ISC_INTEGER << 3, I_PAUSE}; - -_InstInfo II_3dnow = {4 /* INST_32BITS | INST_MODRM_REQUIRED | INST_3DNOW_FETCH */, OT_MM64, OT_MM, ISC_3DNOW << 3, I_UNDEFINED}; diff --git a/hook_crypto.c b/hook_crypto.c index acf3bbb..31036b8 100644 --- a/hook_crypto.c +++ b/hook_crypto.c @@ -351,3 +351,22 @@ HOOKDEF(BOOL, WINAPI, CryptEnumProvidersW, LOQ_bool("crypto", "iu", "Index", dwIndex, "ProviderName", pszProvName); return ret; } + +HOOKDEF(BOOL, WINAPI, CryptHashSessionKey, + _In_ HCRYPTHASH hHash, + _In_ HCRYPTKEY hKey, + _In_ DWORD dwFlags +) { + BOOL ret = Old_CryptHashSessionKey(hHash, hKey, dwFlags); + LOQ_bool("crypto", "pph", "CryptHash", hHash, "CryptKey", hKey, "Flags", dwFlags); + return ret; +} + +HOOKDEF(DWORD, WINAPI, QueryUsersOnEncryptedFile, + LPCWSTR lpFileName, + PVOID *pUsers +) { + DWORD ret = Old_QueryUsersOnEncryptedFile(lpFileName, pUsers); + LOQ_nonzero("crypto", "up", "FileName", lpFileName, "pUsers", pUsers); + return ret; +} \ No newline at end of file diff --git a/hook_file.c b/hook_file.c index cf165fa..c718804 100644 --- a/hook_file.c +++ b/hook_file.c @@ -1222,9 +1222,6 @@ HOOKDEF(BOOL, WINAPI, GetVolumeInformationA, *lpVolumeSerialNumber = 0x46e70ca9; debug_message("Changed Volume Serial Number."); } - - - } #endif return ret; diff --git a/hook_misc.c b/hook_misc.c index 7767708..7170d87 100644 --- a/hook_misc.c +++ b/hook_misc.c @@ -26,6 +26,10 @@ along with this program. If not, see . #include "hook_sleep.h" #include "config.h" #include "ignore.h" +#include "CAPE\CAPE.h" +#include "CAPE\Debugger.h" + +extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); HOOKDEF(HHOOK, WINAPI, SetWindowsHookExA, __in int idHook, @@ -84,7 +88,18 @@ HOOKDEF(LPTOP_LEVEL_EXCEPTION_FILTER, WINAPI, SetUnhandledExceptionFilter, BOOL ret = 1; LPTOP_LEVEL_EXCEPTION_FILTER res; - if (g_config.debug) + if (DEBUGGER_ENABLED && !VECTORED_HANDLER) + { + DoOutputDebugString("SetUnhandledExceptionFilter hook: switching CAPE debugger to vectored handler.\n"); + AddVectoredExceptionHandler(1, CAPEExceptionFilter); + VECTORED_HANDLER = TRUE; + OriginalExceptionHandler = lpTopLevelExceptionFilter; + if (g_config.debug) + res = NULL; + else + res = Old_SetUnhandledExceptionFilter(lpTopLevelExceptionFilter); + } + else if (g_config.debug) res = NULL; else res = Old_SetUnhandledExceptionFilter(lpTopLevelExceptionFilter); @@ -93,6 +108,41 @@ HOOKDEF(LPTOP_LEVEL_EXCEPTION_FILTER, WINAPI, SetUnhandledExceptionFilter, return res; } +HOOKDEF(PVOID, WINAPI, RtlAddVectoredExceptionHandler, + __in ULONG First, + __out PVECTORED_EXCEPTION_HANDLER Handler +) { + PVOID ret = 0; + + if (DEBUGGER_ENABLED && VECTORED_HANDLER && First) + { + if (!CAPEExceptionFilterHandle) + { + DoOutputDebugString("RtlAddVectoredExceptionHandler hook: Error - CAPE vectored handler not registered.\n"); + ret = Old_RtlAddVectoredExceptionHandler(First, Handler); + LOQ_nonnull("hooking", "ip", "First", First, "Handler", Handler); + return ret; + } + + // We register the handler at the bottom, this minimizes + // our interference and means the handle is valid + ret = Old_RtlAddVectoredExceptionHandler(0, Handler); + + if (ret == NULL) + return ret; + + // We record the handler address so that + // CAPEExceptionFilter can call it directly + SampleVectoredHandler = (SAMPLE_HANDLER)Handler; + } + else + ret = Old_RtlAddVectoredExceptionHandler(First, Handler); + + LOQ_nonnull("hooking", "ip", "First", First, "Handler", Handler); + + return ret; +} + HOOKDEF(UINT, WINAPI, SetErrorMode, _In_ UINT uMode ) { @@ -1025,7 +1075,7 @@ HOOKDEF(void, WINAPIV, memcpy, size_t count ) { - int ret = 0; // seems this is needed for LOQ_void. TODO: fix this lameness + int ret = 0; // seems this is needed for LOQ_void. Old_memcpy(dest, src, count); @@ -1038,9 +1088,27 @@ HOOKDEF(void, WINAPIV, srand, unsigned int seed ) { - int ret = 0; // seems this is needed for LOQ_void. TODO: fix this lameness + int ret = 0; // seems this is needed for LOQ_void. Old_srand(seed); LOQ_void("misc", "h", "seed", seed); } + +#define MSGFLT_ADD 1 +#define MSGFLT_REMOVE 2 +HOOKDEF(BOOL, WINAPI, ChangeWindowMessageFilter, + UINT message, + DWORD dwFlag +) +{ + BOOL ret; + if (dwFlag != MSGFLT_REMOVE && dwFlag != MSGFLT_ADD) { + ret = FALSE; + SetLastError(ERROR_INVALID_PARAMETER); + } + else + ret = Old_ChangeWindowMessageFilter(message, dwFlag); + LOQ_bool("misc", "ii", "message", message, "dwFlag", dwFlag); + return ret; +} diff --git a/hook_process.c b/hook_process.c index c75edb2..fdbfd41 100644 --- a/hook_process.c +++ b/hook_process.c @@ -27,8 +27,17 @@ along with this program. If not, see . #include "hook_sleep.h" #include "unhook.h" #include "config.h" +#include "CAPE\CAPE.h" +#include "CAPE\Debugger.h" -extern int DumpCurrentProcessFixImports(DWORD NewEP); +extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); +extern void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); + +extern struct GuardPages *GuardPageList; +extern void AllocationHandler(PVOID BaseAddress, SIZE_T RegionSize, ULONG AllocationType, ULONG Protect); +extern void ProtectionHandler(PVOID BaseAddress, SIZE_T RegionSize, ULONG Protect); +extern void FreeHandler(PVOID BaseAddress, SIZE_T RegionSize); +extern void TerminateHandler(void); HOOKDEF(HANDLE, WINAPI, CreateToolhelp32Snapshot, __in DWORD dwFlags, @@ -306,10 +315,54 @@ HOOKDEF(NTSTATUS, WINAPI, NtOpenProcess, HOOKDEF(NTSTATUS, WINAPI, NtResumeProcess, __in HANDLE ProcessHandle ) { - NTSTATUS ret; + CONTEXT Context; + DWORD_PTR ChildNewEP; + HANDLE ThreadHandle; + NTSTATUS ret; DWORD pid = pid_from_process_handle(ProcessHandle); pipe("RESUME:%d", pid); + if (pid == ChildProcessId) + { + ThreadHandle = OpenThread(THREAD_ALL_ACCESS, TRUE, ChildThreadId); + + if (ThreadHandle == NULL) + { + DoOutputErrorString("NtResumeProcess hook: OpenThread failed"); + } + else + { + Context.ContextFlags = CONTEXT_ALL; + + if (GetThreadContext(ThreadHandle, &Context)) + { +#ifdef _WIN64 + if (Context.Rcx != DebuggerEP) + { + ChildNewEP = Context.Rcx; + Context.Rcx = DebuggerEP; +#else + if (Context.Eax != DebuggerEP) + { + ChildNewEP = Context.Eax; + Context.Eax = DebuggerEP; +#endif + if (SetThreadContext(ThreadHandle, &Context)) + { + SendDebuggerMessage((DWORD_PTR)ChildNewEP); + DoOutputDebugString("NtResumeProcess: Reset Debugger entry (0x%x) in child process, updated EP to 0x%x.\n", DebuggerEP, ChildNewEP); + } + else + DoOutputDebugString("NtResumeProcess: Error - failed to ensure Debugger entry in child process.\n"); + } + } + else + { + DoOutputDebugString("NtResumeProcess: GetThreadContext failed.\n"); + } + } + } + ret = Old_NtResumeProcess(ProcessHandle); LOQ_ntstatus("process", "p", "ProcessHandle", ProcessHandle); return ret; @@ -323,20 +376,20 @@ HOOKDEF(NTSTATUS, WINAPI, NtTerminateProcess, __in NTSTATUS ExitStatus ) { // Process will terminate. Default logging will not work. Be aware: return value not valid - NTSTATUS ret = 0; lasterror_t lasterror; + NTSTATUS ret = 0; get_lasterrors(&lasterror); if (ProcessHandle == NULL) { // we mark this here as this termination type will kill all threads but ours, including // the logging thread. By setting this, we'll switch into a direct logging mode // for the subsequent call to NtTerminateProcess against our own process handle - DumpCurrentProcessFixImports(0); - process_shutting_down = 1; + TerminateHandler(); + process_shutting_down = 1; LOQ_ntstatus("process", "ph", "ProcessHandle", ProcessHandle, "ExitCode", ExitStatus); } else if (GetCurrentProcessId() == our_getprocessid(ProcessHandle)) { - DumpCurrentProcessFixImports(0); + TerminateHandler(); process_shutting_down = 1; LOQ_ntstatus("process", "ph", "ProcessHandle", ProcessHandle, "ExitCode", ExitStatus); pipe("KILL:%d", GetCurrentProcessId()); @@ -419,20 +472,16 @@ HOOKDEF(NTSTATUS, WINAPI, NtUnmapViewOfSection, ) { SIZE_T map_size = 0; MEMORY_BASIC_INFORMATION mbi; DWORD pid = pid_from_process_handle(ProcessHandle); - DWORD protect = PAGE_READWRITE; NTSTATUS ret; if (VirtualQueryEx(ProcessHandle, BaseAddress, &mbi, sizeof(mbi)) == sizeof(mbi)) { map_size = mbi.RegionSize; - protect = mbi.Protect; } ret = Old_NtUnmapViewOfSection(ProcessHandle, BaseAddress); - if (pid != GetCurrentProcessId() || protect != PAGE_READWRITE) { - LOQ_ntstatus("process", "ppp", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, - "RegionSize", map_size); - } + LOQ_ntstatus("process", "ppp", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, + "RegionSize", map_size); return ret; } @@ -453,11 +502,10 @@ HOOKDEF(NTSTATUS, WINAPI, NtMapViewOfSection, BaseAddress, ZeroBits, CommitSize, SectionOffset, ViewSize, InheritDisposition, AllocationType, Win32Protect); DWORD pid = pid_from_process_handle(ProcessHandle); - - if ((pid != GetCurrentProcessId()) || Win32Protect != PAGE_READWRITE) - LOQ_ntstatus("process", "ppPpPhs", "SectionHandle", SectionHandle, - "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, - "SectionOffset", SectionOffset, "ViewSize", ViewSize, "Win32Protect", Win32Protect, "StackPivoted", is_stack_pivoted() ? "yes" : "no"); + + LOQ_ntstatus("process", "ppPpPhs", "SectionHandle", SectionHandle, + "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, + "SectionOffset", SectionOffset, "ViewSize", ViewSize, "Win32Protect", Win32Protect, "StackPivoted", is_stack_pivoted() ? "yes" : "no"); if (NT_SUCCESS(ret)) { if (pid != GetCurrentProcessId()) { @@ -477,14 +525,32 @@ HOOKDEF(NTSTATUS, WINAPI, NtAllocateVirtualMemory, __in ULONG AllocationType, __in ULONG Protect ) { + BOOL GuardedPages = FALSE; + + if (GUARD_PAGES_ENABLED && !called_by_hook() && (Protect & (Protect & EXECUTABLE_FLAGS)) && !(Protect & (PAGE_GUARD)) && GetCurrentProcessId() == our_getprocessid(ProcessHandle) && (*RegionSize >= EXTRACTION_MIN_SIZE)) + { + Protect |= PAGE_GUARD; + GuardedPages = TRUE; + } + NTSTATUS ret = Old_NtAllocateVirtualMemory(ProcessHandle, BaseAddress, ZeroBits, RegionSize, AllocationType, Protect); - if (ret != STATUS_CONFLICTING_ADDRESSES && (Protect != PAGE_READWRITE || GetCurrentProcessId() != our_getprocessid(ProcessHandle))) { - LOQ_ntstatus("process", "pPPhs", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, - "RegionSize", RegionSize, "Protection", Protect, "StackPivoted", is_stack_pivoted() ? "yes" : "no"); - } - + if (NT_SUCCESS(ret) && GuardedPages && !called_by_hook()) + { + DoOutputDebugString("NtAllocateVirtualMemory hook: Guarding page with BaseAddress: 0x%x, RegionSize: 0x%x.\n", *BaseAddress, *RegionSize); + Protect &= ~PAGE_GUARD; + AddGuardPages(*BaseAddress, *RegionSize, Protect); + } + + if (NT_SUCCESS(ret) && !called_by_hook() && GetCurrentProcessId() == our_getprocessid(ProcessHandle)) + { + AllocationHandler(*BaseAddress, *RegionSize, AllocationType, Protect); + } + + LOQ_ntstatus("process", "pPPhs", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, + "RegionSize", RegionSize, "Protection", Protect, "StackPivoted", is_stack_pivoted() ? "yes" : "no"); + return ret; } @@ -501,10 +567,8 @@ HOOKDEF(NTSTATUS, WINAPI, NtReadVirtualMemory, ret = Old_NtReadVirtualMemory(ProcessHandle, BaseAddress, Buffer, NumberOfBytesToRead, NumberOfBytesRead); - if (pid_from_process_handle(ProcessHandle) != GetCurrentProcessId()) { - LOQ_ntstatus("process", "ppB", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, - "Buffer", NumberOfBytesRead, Buffer); - } + LOQ_ntstatus("process", "ppB", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, + "Buffer", NumberOfBytesRead, Buffer); return ret; } @@ -516,16 +580,14 @@ HOOKDEF(BOOL, WINAPI, ReadProcessMemory, _In_ SIZE_T nSize, _Out_ PSIZE_T lpNumberOfBytesRead ) { - BOOL ret; + BOOL ret; ENSURE_SIZET(lpNumberOfBytesRead); ret = Old_ReadProcessMemory(hProcess, lpBaseAddress, lpBuffer, nSize, lpNumberOfBytesRead); - if (pid_from_process_handle(hProcess) != GetCurrentProcessId()) { - LOQ_bool("process", "ppB", "ProcessHandle", hProcess, "BaseAddress", lpBaseAddress, - "Buffer", lpNumberOfBytesRead, lpBuffer); - } + LOQ_bool("process", "ppB", "ProcessHandle", hProcess, "BaseAddress", lpBaseAddress, + "Buffer", lpNumberOfBytesRead, lpBuffer); return ret; } @@ -546,17 +608,16 @@ HOOKDEF(NTSTATUS, WINAPI, NtWriteVirtualMemory, pid = pid_from_process_handle(ProcessHandle); - if (pid != GetCurrentProcessId()) { - LOQ_ntstatus("process", "ppBhs", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, - "Buffer", NumberOfBytesWritten, Buffer, "BufferLength", *NumberOfBytesWritten, "StackPivoted", is_stack_pivoted() ? "yes" : "no"); + LOQ_ntstatus("process", "ppBhs", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, + "Buffer", NumberOfBytesWritten, Buffer, "BufferLength", *NumberOfBytesWritten, "StackPivoted", is_stack_pivoted() ? "yes" : "no"); + if (pid != GetCurrentProcessId()) { if (NT_SUCCESS(ret)) { pipe("PROCESS:%d:%d", is_suspended(pid, 0), pid); disable_sleep_skip(); } } - return ret; } @@ -576,10 +637,10 @@ HOOKDEF(BOOL, WINAPI, WriteProcessMemory, pid = pid_from_process_handle(hProcess); - if (pid != GetCurrentProcessId()) { - LOQ_bool("process", "ppBhs", "ProcessHandle", hProcess, "BaseAddress", lpBaseAddress, - "Buffer", lpNumberOfBytesWritten, lpBuffer, "BufferLength", *lpNumberOfBytesWritten, "StackPivoted", is_stack_pivoted() ? "yes" : "no"); + LOQ_bool("process", "ppBhs", "ProcessHandle", hProcess, "BaseAddress", lpBaseAddress, + "Buffer", lpNumberOfBytesWritten, lpBuffer, "BufferLength", *lpNumberOfBytesWritten, "StackPivoted", is_stack_pivoted() ? "yes" : "no"); + if (pid != GetCurrentProcessId()) { if (ret) { pipe("PROCESS:%d:%d", is_suspended(pid, 0), pid); disable_sleep_skip(); @@ -625,10 +686,10 @@ HOOKDEF(NTSTATUS, WINAPI, NtWow64WriteVirtualMemory64, pid = pid_from_process_handle(ProcessHandle); - if (pid != GetCurrentProcessId()) { - LOQ_bool("process", "pxbhs", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, - "Buffer", NumberOfBytesWritten->LowPart, Buffer, "BufferLength", NumberOfBytesWritten->LowPart, "StackPivoted", is_stack_pivoted() ? "yes" : "no"); + LOQ_bool("process", "pxbhs", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, + "Buffer", NumberOfBytesWritten->LowPart, Buffer, "BufferLength", NumberOfBytesWritten->LowPart, "StackPivoted", is_stack_pivoted() ? "yes" : "no"); + if (pid != GetCurrentProcessId()) { if (ret) { pipe("PROCESS:%d:%d", is_suspended(pid, 0), pid); disable_sleep_skip(); @@ -651,18 +712,31 @@ HOOKDEF(NTSTATUS, WINAPI, NtProtectVirtualMemory, ) { NTSTATUS ret; MEMORY_BASIC_INFORMATION meminfo; + BOOL GuardedPages = FALSE; if (NewAccessProtection == PAGE_EXECUTE_READ && BaseAddress && NumberOfBytesToProtect && GetCurrentProcessId() == our_getprocessid(ProcessHandle) && is_in_dll_range((ULONG_PTR)*BaseAddress)) restore_hooks_on_range((ULONG_PTR)*BaseAddress, (ULONG_PTR)*BaseAddress + *NumberOfBytesToProtect); - ret = Old_NtProtectVirtualMemory(ProcessHandle, BaseAddress, - NumberOfBytesToProtect, NewAccessProtection, OldAccessProtection); - - /* Don't log an uninteresting case */ - if (OldAccessProtection && *OldAccessProtection == NewAccessProtection) - return ret; + if (GUARD_PAGES_ENABLED && !called_by_hook() && ((NewAccessProtection & EXECUTABLE_FLAGS) && !(NewAccessProtection & (PAGE_GUARD)) && GetCurrentProcessId() == our_getprocessid(ProcessHandle) && (*NumberOfBytesToProtect >= EXTRACTION_MIN_SIZE))) + { + DoOutputDebugString("NtProtectVirtualMemory hook: Guarding page with BaseAddress: 0x%x, RegionSize: 0x%x.\n", *BaseAddress, *NumberOfBytesToProtect); + NewAccessProtection |= PAGE_GUARD; + AddGuardPages(*BaseAddress, *NumberOfBytesToProtect, NewAccessProtection); + GuardedPages = TRUE; + } + ret = Old_NtProtectVirtualMemory(ProcessHandle, BaseAddress, NumberOfBytesToProtect, NewAccessProtection, OldAccessProtection); + + if (GuardedPages) + { + NewAccessProtection &= ~PAGE_GUARD; + *OldAccessProtection &= ~PAGE_GUARD; + } + + if (NT_SUCCESS(ret) && !called_by_hook() && GetCurrentProcessId() == our_getprocessid(ProcessHandle)) + ProtectionHandler(*BaseAddress, *NumberOfBytesToProtect, NewAccessProtection); + memset(&meminfo, 0, sizeof(meminfo)); if (NT_SUCCESS(ret)) { lasterror_t lasterrors; @@ -698,18 +772,31 @@ HOOKDEF(BOOL, WINAPI, VirtualProtectEx, ) { BOOL ret; MEMORY_BASIC_INFORMATION meminfo; + BOOL GuardedPages = FALSE; if (flNewProtect == PAGE_EXECUTE_READ && GetCurrentProcessId() == our_getprocessid(hProcess) && is_in_dll_range((ULONG_PTR)lpAddress)) restore_hooks_on_range((ULONG_PTR)lpAddress, (ULONG_PTR)lpAddress + dwSize); - ret = Old_VirtualProtectEx(hProcess, lpAddress, dwSize, flNewProtect, - lpflOldProtect); + if (GUARD_PAGES_ENABLED && !called_by_hook() && ((flNewProtect & EXECUTABLE_FLAGS) && !(flNewProtect & (PAGE_GUARD)) && GetCurrentProcessId() == our_getprocessid(hProcess) && (dwSize >= EXTRACTION_MIN_SIZE))) + { + flNewProtect |= PAGE_GUARD; + DoOutputDebugString("VirtualProtectEx hook: Guarding page with BaseAddress: 0x%x, RegionSize: 0x%x.\n", lpAddress, dwSize); + AddGuardPages(lpAddress, dwSize, flNewProtect); + GuardedPages = TRUE; + } + + ret = Old_VirtualProtectEx(hProcess, lpAddress, dwSize, flNewProtect, lpflOldProtect); - /* Don't log an uninteresting case */ - if (lpflOldProtect && *lpflOldProtect == flNewProtect) - return ret; + if (GuardedPages) + { + flNewProtect &= ~PAGE_GUARD; + *lpflOldProtect &= ~PAGE_GUARD; + } + if (NT_SUCCESS(ret) && !called_by_hook() && GetCurrentProcessId() == our_getprocessid(hProcess)) + ProtectionHandler(lpAddress, dwSize, flNewProtect); + memset(&meminfo, 0, sizeof(meminfo)); if (ret) { lasterror_t lasterrors; @@ -737,13 +824,34 @@ HOOKDEF(NTSTATUS, WINAPI, NtFreeVirtualMemory, IN OUT PSIZE_T RegionSize, IN ULONG FreeType ) { + PGUARDPAGES CurrentGuardPages; + + if (!called_by_hook() && GetCurrentProcessId() == our_getprocessid(ProcessHandle) && *RegionSize == 0 && (FreeType & MEM_RELEASE)) + FreeHandler(*BaseAddress, *RegionSize); + NTSTATUS ret = Old_NtFreeVirtualMemory(ProcessHandle, BaseAddress, RegionSize, FreeType); - if (GetCurrentProcessId() != our_getprocessid(ProcessHandle)) { - LOQ_ntstatus("process", "pPPh", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, - "RegionSize", RegionSize, "FreeType", FreeType); - } + if (NT_SUCCESS(ret) && !called_by_hook() && GetCurrentProcessId() == our_getprocessid(ProcessHandle)){ + + //DoOutputDebugString("NtFreeVirtualMemory hook, *BaseAddress:0x%x, RegionSize: 0x%x\n", *BaseAddress, RegionSize); + CurrentGuardPages = GuardPageList; + + while (CurrentGuardPages) + { + if (!CurrentGuardPages->PagesDumped && CurrentGuardPages->ReadDetected && CurrentGuardPages->WriteDetected) + CurrentGuardPages->PagesDumped = DumpPEsInRange(CurrentGuardPages->BaseAddress, CurrentGuardPages->RegionSize); + + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + // TODO: to fix this we need to filter out calls that are made + // from within NtAllocateVirtualMemory + //DropGuardPages(GetGuardPages(*BaseAddress)); + } + + LOQ_ntstatus("process", "pPPh", "ProcessHandle", ProcessHandle, "BaseAddress", BaseAddress, + "RegionSize", RegionSize, "FreeType", FreeType); return ret; } @@ -858,3 +966,25 @@ HOOKDEF_NOTAIL(WINAPI, NtRaiseException, return 0; } + +HOOKDEF(HANDLE, WINAPI, GetProcessHeap, + void +) { + HANDLE ret = Old_GetProcessHeap(); + + LOQ_handle("process", "");//, "Handle", ret); + + return ret; +} + +HOOKDEF(LPVOID, WINAPI, HeapAlloc, + HANDLE hHeap, + DWORD dwFlags, + SIZE_T dwBytes +) { + LPVOID ret = Old_HeapAlloc(hHeap, dwFlags, dwBytes); + + //LOQ_nonnull("process", "phh", "HeapHandle", hHeap, "Flags", dwFlags, "Size", dwBytes); + + return ret; +} diff --git a/hook_special.c b/hook_special.c index 39bd639..ca71812 100644 --- a/hook_special.c +++ b/hook_special.c @@ -24,6 +24,8 @@ along with this program. If not, see . #include "hook_sleep.h" #include "misc.h" #include "config.h" +#include "CAPE\CAPE.h" +#include "CAPE\Debugger.h" HOOKDEF_NOTAIL(WINAPI, LdrLoadDll, __in_opt PWCHAR PathToFile, @@ -132,7 +134,7 @@ HOOKDEF(BOOL, WINAPI, CreateProcessInternalW, BOOL ret; hook_info_t saved_hookinfo; - memcpy(&saved_hookinfo, hook_info(), sizeof(saved_hookinfo)); + memcpy(&saved_hookinfo, hook_info(), sizeof(saved_hookinfo)); ret = Old_CreateProcessInternalW(lpUnknown1, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags | CREATE_SUSPENDED, lpEnvironment, @@ -140,20 +142,30 @@ HOOKDEF(BOOL, WINAPI, CreateProcessInternalW, memcpy(hook_info(), &saved_hookinfo, sizeof(saved_hookinfo)); if(ret != FALSE) { - BOOL dont_monitor = FALSE; - if (g_config.file_of_interest && g_config.suspend_logging && lpApplicationName && !wcsicmp(lpApplicationName, L"c:\\windows\\splwow64.exe")) - dont_monitor = TRUE; - - if (!dont_monitor) - pipe("PROCESS:%d:%d,%d", (dwCreationFlags & CREATE_SUSPENDED) ? 1 : 0, lpProcessInformation->dwProcessId, - lpProcessInformation->dwThreadId); - - // if the CREATE_SUSPENDED flag was not set, then we have to resume - // the main thread ourself - if((dwCreationFlags & CREATE_SUSPENDED) == 0) { - ResumeThread(lpProcessInformation->hThread); + if (DEBUGGER_LAUNCHER) { + DebugNewProcess(lpProcessInformation->dwProcessId, lpProcessInformation->dwThreadId, dwCreationFlags); + if((dwCreationFlags & CREATE_SUSPENDED) == 0) { + ResumeThread(lpProcessInformation->hThread); + } + else { + ChildProcessId = lpProcessInformation->dwProcessId; + ChildThreadId = lpProcessInformation->dwThreadId; + } + } + else { + BOOL dont_monitor = FALSE; + if (g_config.file_of_interest && g_config.suspend_logging && lpApplicationName && !wcsicmp(lpApplicationName, L"c:\\windows\\splwow64.exe")) + dont_monitor = TRUE; + + if (!dont_monitor) + pipe("PROCESS:%d:%d,%d", (dwCreationFlags & CREATE_SUSPENDED) ? 1 : 0, lpProcessInformation->dwProcessId, + lpProcessInformation->dwThreadId); + // if the CREATE_SUSPENDED flag was not set, then we have to resume + // the main thread ourself + if((dwCreationFlags & CREATE_SUSPENDED) == 0) { + ResumeThread(lpProcessInformation->hThread); + } } - disable_sleep_skip(); } diff --git a/hook_sync.c b/hook_sync.c index 81ed723..762a3b1 100644 --- a/hook_sync.c +++ b/hook_sync.c @@ -104,3 +104,43 @@ HOOKDEF(NTSTATUS, WINAPI, NtCreateNamedPipeFile, "ShareAccess", ShareAccess); return ret; } + +HOOKDEF(NTSTATUS, WINAPI, NtAddAtom, + IN PWCHAR AtomName, + IN ULONG AtomNameLength, + OUT PRTL_ATOM Atom +) { + NTSTATUS ret = Old_NtAddAtom(AtomName, AtomNameLength, Atom); + LOQ_ntstatus("synchronization", "uh", "AtomName", AtomName, "Atom", *Atom); + return ret; +} + +HOOKDEF(NTSTATUS, WINAPI, NtDeleteAtom, + IN RTL_ATOM Atom +) { + NTSTATUS ret = Old_NtDeleteAtom(Atom); + LOQ_ntstatus("synchronization", "h", "Atom", Atom); + return ret; +} + +HOOKDEF(NTSTATUS, WINAPI, NtFindAtom, + IN PWCHAR AtomName, + IN ULONG AtomNameLength, + OUT PRTL_ATOM Atom OPTIONAL +) { + ENSURE_RTL_ATOM(Atom); + NTSTATUS ret = Old_NtFindAtom(AtomName, AtomNameLength, Atom); + LOQ_ntstatus("synchronization", "uh", "AtomName", AtomName, "Atom", *Atom); + return ret; +} + +HOOKDEF(NTSTATUS, WINAPI, NtAddAtomEx, + IN PWCHAR AtomName, + IN ULONG AtomNameLength, + OUT PRTL_ATOM Atom, + IN PVOID Unknown +) { + NTSTATUS ret = Old_NtAddAtomEx(AtomName, AtomNameLength, Atom, Unknown); + LOQ_ntstatus("synchronization", "uh", "AtomName", AtomName, "Atom", *Atom); + return ret; +} diff --git a/hook_thread.c b/hook_thread.c index 1c00795..3ae48dd 100644 --- a/hook_thread.c +++ b/hook_thread.c @@ -25,9 +25,15 @@ along with this program. If not, see . #include "hook_sleep.h" #include "unhook.h" #include "lookup.h" +#include "CAPE\CAPE.h" +#include "CAPE\Debugger.h" + +extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); static lookup_t g_ignored_threads; +extern DWORD ChildProcessId; + void ignored_threads_init(void) { lookup_init(&g_ignored_threads); @@ -224,13 +230,40 @@ HOOKDEF(NTSTATUS, WINAPI, NtGetContextThread, __in HANDLE ThreadHandle, __inout LPCONTEXT Context ) { + DWORD pid = pid_from_thread_handle(ThreadHandle); + NTSTATUS ret = Old_NtGetContextThread(ThreadHandle, Context); - if (Context->ContextFlags & CONTEXT_CONTROL) + + if (called_by_hook()) + return ret; + + if (Context->ContextFlags & CONTEXT_CONTROL) + { + if + ( + DEBUGGER_ENABLED && + pid == ChildProcessId && + OEP && #ifdef _WIN64 - LOQ_ntstatus("threading", "pp", "ThreadHandle", ThreadHandle, "InstructionPointer", Context->Rip); + DebuggerEP == Context->Rcx #else - LOQ_ntstatus("threading", "pp", "ThreadHandle", ThreadHandle, "InstructionPointer", Context->Eip); + DebuggerEP == Context->Eax #endif + ) + { +#ifdef _WIN64 + Context->Rcx = (DWORD_PTR)OEP; +#else + Context->Eax = (DWORD)OEP; +#endif + } + +#ifdef _WIN64 + LOQ_ntstatus("threading", "pp", "ThreadHandle", ThreadHandle, "InstructionPointer", Context->Rcx); +#else + LOQ_ntstatus("threading", "pp", "ThreadHandle", ThreadHandle, "InstructionPointer", Context->Eax); +#endif + } else LOQ_ntstatus("threading", "p", "ThreadHandle", ThreadHandle); return ret; @@ -238,19 +271,41 @@ HOOKDEF(NTSTATUS, WINAPI, NtGetContextThread, HOOKDEF(NTSTATUS, WINAPI, NtSetContextThread, __in HANDLE ThreadHandle, - __in const CONTEXT *Context + __in CONTEXT *Context ) { NTSTATUS ret; DWORD pid = pid_from_thread_handle(ThreadHandle); DWORD tid = tid_from_thread_handle(ThreadHandle); pipe("PROCESS:%d:%d,%d", is_suspended(pid, tid), pid, tid); - ret = Old_NtSetContextThread(ThreadHandle, Context); + if (DEBUGGER_ENABLED && pid == ChildProcessId && Context->ContextFlags & CONTEXT_CONTROL) + { + if (!DebuggerEP) + DoOutputDebugString("NtSetContextThread hook: Error - DebuggerEP not set.\n"); + else + { +#ifdef _WIN64 + SendDebuggerMessage((DWORD_PTR)Context->Rcx); + DoOutputDebugString("NtSetContextThread hook: Sent new child EP to Debugger - 0x%x\n", Context->Rcx); +#else + SendDebuggerMessage((DWORD_PTR)Context->Eax); + DoOutputDebugString("NtSetContextThread hook: Sent new child EP to Debugger - 0x%x\n", Context->Eax); +#endif + Context->ContextFlags = Context->ContextFlags |~ CONTEXT_CONTROL; + + ret = Old_NtSetContextThread(ThreadHandle, Context); + + Context->ContextFlags = Context->ContextFlags & CONTEXT_CONTROL; + } + } + else + ret = Old_NtSetContextThread(ThreadHandle, Context); + if (Context->ContextFlags & CONTEXT_CONTROL) #ifdef _WIN64 - LOQ_ntstatus("threading", "pp", "ThreadHandle", ThreadHandle, "InstructionPointer", Context->Rip); + LOQ_ntstatus("threading", "pp", "ThreadHandle", ThreadHandle, "InstructionPointer", Context->Rcx); #else - LOQ_ntstatus("threading", "pp", "ThreadHandle", ThreadHandle, "InstructionPointer", Context->Eip); + LOQ_ntstatus("threading", "pp", "ThreadHandle", ThreadHandle, "InstructionPointer", Context->Eax); #endif else LOQ_ntstatus("threading", "p", "ThreadHandle", ThreadHandle); @@ -279,7 +334,7 @@ HOOKDEF(NTSTATUS, WINAPI, NtSuspendThread, pipe("PROCESS:%d:%d,%d", is_suspended(pid, tid), pid, tid); ret = Old_NtSuspendThread(ThreadHandle, PreviousSuspendCount); - LOQ_ntstatus("threading", "pL", "ThreadHandle", ThreadHandle, + LOQ_ntstatus("threadingb", "pL", "ThreadHandle", ThreadHandle, "SuspendCount", PreviousSuspendCount); } return ret; @@ -289,11 +344,49 @@ HOOKDEF(NTSTATUS, WINAPI, NtResumeThread, __in HANDLE ThreadHandle, __out_opt ULONG *SuspendCount ) { + CONTEXT Context; + DWORD_PTR ChildNewEP; DWORD pid = pid_from_thread_handle(ThreadHandle); DWORD tid = tid_from_thread_handle(ThreadHandle); NTSTATUS ret; ENSURE_ULONG(SuspendCount); pipe("RESUME:%d,%d", pid, tid); + + if (DEBUGGER_ENABLED && pid == ChildProcessId && tid == ChildThreadId) + { + Context.ContextFlags = CONTEXT_ALL; + + ret = Old_NtGetContextThread(ThreadHandle, &Context); + + if (NT_SUCCESS(ret)) + { +#ifdef _WIN64 + if (Context.Rcx != DebuggerEP) + { + ChildNewEP = Context.Rcx; + Context.Rcx = DebuggerEP; +#else + if (Context.Eax != DebuggerEP) + { + ChildNewEP = Context.Eax; + Context.Eax = DebuggerEP; +#endif + ret = Old_NtSetContextThread(ThreadHandle, &Context); + + if (NT_SUCCESS(ret)) + { + SendDebuggerMessage((DWORD_PTR)ChildNewEP); + DoOutputDebugString("NtResumeThread: Reset Debugger entry (0x%x) in child process, updated EP to 0x%x.\n", DebuggerEP, ChildNewEP); + } + else + DoOutputDebugString("NtResumeThread: Error - failed to ensure Debugger entry in child process.\n"); + } + } + else + { + DoOutputDebugString("NtResumeThread: NtGetContextThread failed.\n"); + } + } ret = Old_NtResumeThread(ThreadHandle, SuspendCount); LOQ_ntstatus("threading", "pI", "ThreadHandle", ThreadHandle, "SuspendCount", SuspendCount); @@ -369,7 +462,16 @@ HOOKDEF(HANDLE, WINAPI, CreateRemoteThread, ENSURE_DWORD(lpThreadId); pid = pid_from_process_handle(hProcess); - ret = Old_CreateRemoteThread(hProcess, lpThreadAttributes, + + if (pid == ChildProcessId) + { + DoOutputDebugString("CreateRemoteThread: RemoteThread created in child process, sending address to debugger: 0x%x", lpStartAddress); + SendDebuggerMessage((DWORD_PTR)lpStartAddress); + ret = Old_CreateRemoteThread(hProcess, lpThreadAttributes, + dwStackSize, (LPTHREAD_START_ROUTINE)DebuggerEP, lpParameter, dwCreationFlags | CREATE_SUSPENDED, + lpThreadId); + } + else ret = Old_CreateRemoteThread(hProcess, lpThreadAttributes, dwStackSize, lpStartAddress, lpParameter, dwCreationFlags | CREATE_SUSPENDED, lpThreadId); @@ -410,9 +512,18 @@ HOOKDEF(NTSTATUS, WINAPI, RtlCreateUserThread, pid = pid_from_process_handle(ProcessHandle); - ret = Old_RtlCreateUserThread(ProcessHandle, SecurityDescriptor, - TRUE, StackZeroBits, StackReserved, StackCommit, - StartAddress, StartParameter, ThreadHandle, ClientId); + if (pid == ChildProcessId) + { + DoOutputDebugString("RtlCreateUserThread: RemoteThread created in child process, sending address to debugger: 0x%x", StartAddress); + SendDebuggerMessage((DWORD_PTR)StartAddress); + ret = Old_RtlCreateUserThread(ProcessHandle, SecurityDescriptor, + TRUE, StackZeroBits, StackReserved, StackCommit, + (LPTHREAD_START_ROUTINE)DebuggerEP, StartParameter, ThreadHandle, ClientId); + } + else ret = Old_RtlCreateUserThread(ProcessHandle, SecurityDescriptor, + TRUE, StackZeroBits, StackReserved, StackCommit, + StartAddress, StartParameter, ThreadHandle, ClientId); + LOQ_ntstatus("threading", "pippPi", "ProcessHandle", ProcessHandle, "CreateSuspended", CreateSuspended, "StartAddress", StartAddress, "StartParameter", StartParameter, "ThreadHandle", ThreadHandle, @@ -423,7 +534,7 @@ HOOKDEF(NTSTATUS, WINAPI, RtlCreateUserThread, if (CreateSuspended == FALSE) { lasterror_t lasterror; get_lasterrors(&lasterror); - ResumeThread(ThreadHandle); + ResumeThread(*ThreadHandle); set_lasterrors(&lasterror); } } diff --git a/hooks.h b/hooks.h index f144ec1..cffea59 100644 --- a/hooks.h +++ b/hooks.h @@ -248,7 +248,7 @@ extern HOOKDEF(BOOL, WINAPI, CopyFileW, __in BOOL bFailIfExists ); -extern HOOKDEF(BOOL, WINAPI, CopyFileExW, +extern HOOKDEF_NOTAIL(WINAPI, CopyFileExW, _In_ LPWSTR lpExistingFileName, _In_ LPWSTR lpNewFileName, _In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine, @@ -257,6 +257,15 @@ extern HOOKDEF(BOOL, WINAPI, CopyFileExW, _In_ DWORD dwCopyFlags ); +extern HOOKDEF_ALT(BOOL, WINAPI, CopyFileExW, + _In_ LPWSTR lpExistingFileName, + _In_ LPWSTR lpNewFileName, + _In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine, + _In_opt_ LPVOID lpData, + _In_opt_ LPBOOL pbCancel, + _In_ DWORD dwCopyFlags +); + extern HOOKDEF(BOOL, WINAPI, DeleteFileA, __in LPCSTR lpFileName ); @@ -761,6 +770,20 @@ extern HOOKDEF(BOOL, WINAPI, EnumWindows, _In_ LPARAM lParam ); +extern HOOKDEF(BOOL, WINAPI, PostMessageA, + _In_ HWND hWnd, + _In_ UINT Msg, + _In_ WPARAM wParam, + _In_ LPARAM lParam +); + +extern HOOKDEF(BOOL, WINAPI, PostMessageW, + _In_ HWND hWnd, + _In_ UINT Msg, + _In_ WPARAM wParam, + _In_ LPARAM lParam +); + extern HOOKDEF(BOOL, WINAPI, SendNotifyMessageA, _In_ HWND hWnd, _In_ UINT Msg, @@ -848,6 +871,29 @@ extern HOOKDEF(NTSTATUS, WINAPI, NtCreateNamedPipeFile, IN PLARGE_INTEGER DefaultTimeOut ); +extern HOOKDEF(NTSTATUS, WINAPI, NtAddAtom, + IN PWCHAR AtomName, + IN ULONG AtomNameLength, + OUT PRTL_ATOM Atom +); + +extern HOOKDEF(NTSTATUS, WINAPI, NtDeleteAtom, + IN RTL_ATOM Atom +); + +extern HOOKDEF(NTSTATUS, WINAPI, NtFindAtom, + IN PWCHAR AtomName, + IN ULONG AtomNameLength, + OUT PRTL_ATOM Atom OPTIONAL +); + +extern HOOKDEF(NTSTATUS, WINAPI, NtAddAtomEx, + IN PWCHAR AtomName, + IN ULONG AtomNameLength, + OUT PRTL_ATOM Atom, + IN PVOID Unknown +); + // // Process Hooks // @@ -1226,7 +1272,7 @@ extern HOOKDEF(NTSTATUS, WINAPI, NtGetContextThread, extern HOOKDEF(NTSTATUS, WINAPI, NtSetContextThread, __in HANDLE ThreadHandle, - __in const CONTEXT *Context + __in CONTEXT *Context ); extern HOOKDEF(NTSTATUS, WINAPI, NtSuspendThread, @@ -1359,6 +1405,11 @@ extern HOOKDEF(LPTOP_LEVEL_EXCEPTION_FILTER, WINAPI, SetUnhandledExceptionFilter _In_ LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter ); +extern HOOKDEF(PVOID, WINAPI, RtlAddVectoredExceptionHandler, + __in ULONG First, + __out PVECTORED_EXCEPTION_HANDLER Handler +); + extern HOOKDEF(UINT, WINAPI, SetErrorMode, _In_ UINT uMode ); @@ -1543,6 +1594,16 @@ extern HOOKDEF(void, WINAPIV, memcpy, size_t count ); +extern HOOKDEF(HANDLE, WINAPI, GetProcessHeap, + void +); + +extern HOOKDEF(LPVOID, WINAPI, HeapAlloc, + _In_ HANDLE hHeap, + _In_ DWORD dwFlags, + _In_ SIZE_T dwBytes +); + extern HOOKDEF(HDEVINFO, WINAPI, SetupDiGetClassDevsA, _In_opt_ const GUID *ClassGuid, _In_opt_ PCSTR Enumerator, @@ -1787,6 +1848,15 @@ extern HOOKDEF(HRESULT, WINAPI, URLDownloadToFileW, LPVOID lpfnCB ); +extern HOOKDEF(HRESULT, WINAPI, URLDownloadToCacheFileW, + _In_ LPUNKNOWN lpUnkcalled, + _In_ LPCWSTR szURL, + _Out_ LPWSTR szFilename, + _In_ DWORD cchFilename, + _Reserved_ DWORD dwReserved, + _In_opt_ VOID *pBSC +); + extern HOOKDEF(BOOL, WINAPI, InternetGetConnectedState, _Out_ LPDWORD lpdwFlags, _In_ DWORD dwReserved @@ -2656,6 +2726,12 @@ extern HOOKDEF(BOOL, WINAPI, CryptImportPublicKeyInfo, _Out_ HCRYPTKEY *phKey ); +extern HOOKDEF(BOOL, WINAPI, CryptHashSessionKey, + _In_ HCRYPTHASH hHash, + _In_ HCRYPTKEY hKey, + _In_ DWORD dwFlags +); + // // Special Hooks // @@ -2741,3 +2817,13 @@ extern HOOKDEF(NTSTATUS, WINAPI, NtQuerySystemInformation, extern HOOKDEF(void, WINAPIV, srand, unsigned int seed ); + +HOOKDEF(DWORD, WINAPI, QueryUsersOnEncryptedFile, + LPCWSTR lpFileName, + PVOID *pUsers +); + +extern HOOKDEF(BOOL, WINAPI, ChangeWindowMessageFilter, + UINT message, + DWORD dwFlag +); diff --git a/loader/loader/Loader.c b/loader/loader/Loader.c index 8cefa0b..6792af3 100644 --- a/loader/loader/Loader.c +++ b/loader/loader/Loader.c @@ -1,502 +1,958 @@ -// Copyright 2014-2015 Optiv, Inc. (brad.spengler@optiv.com) -// This file is published under the GNU GPL v3 -// http://www.gnu.org/licenses/gpl.html - +/* +CAPE - Config And Payload Extraction +Copyright(C) 2015 - 2018 Context Information Security. (kevin.oreilly@contextis.com) + +This program is free software : you can redistribute it and / or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program.If not, see . +*/ #include "Loader.h" -#include -#include -#include +#include +#include -typedef HRESULT (WINAPI *PDLLREGRSRV)(void); -typedef void (cdecl *PPLUGXPAYLOAD)(void); +#pragma warning(push ) +#pragma warning(disable : 4996) -#define BUFSIZE 512 +SYSTEM_INFO SystemInfo; -static int grant_debug_privileges(void) +void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...) { - HANDLE token = NULL; - TOKEN_PRIVILEGES priv; - LUID privval; - int ret; + char DebugOutput[MAX_PATH]; + va_list args; + va_start(args, lpOutputString); - if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token)) - return 0; + memset(DebugOutput, 0, MAX_PATH*sizeof(char)); + _vsnprintf_s(DebugOutput, MAX_PATH, MAX_PATH, lpOutputString, args); + OutputDebugString(DebugOutput); + + va_end(args); + + return; +} - if (!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &privval)) { - CloseHandle(token); - return 0; +void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...) +{ + char DebugOutput[MAX_PATH], ErrorOutput[MAX_PATH]; + va_list args; + LPVOID lpMsgBuf; + DWORD ErrorCode; + + ErrorCode = GetLastError(); + va_start(args, lpOutputString); + + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + ErrorCode, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&lpMsgBuf, + 0, + NULL); + + memset(DebugOutput, 0, MAX_PATH*sizeof(char)); + _vsnprintf_s(DebugOutput, MAX_PATH, MAX_PATH, lpOutputString, args); + memset(ErrorOutput, 0, MAX_PATH*sizeof(char)); + _snprintf_s(ErrorOutput, MAX_PATH, MAX_PATH, "Error %d (0x%x) - %s: %s", ErrorCode, ErrorCode, DebugOutput, (char*)lpMsgBuf); + OutputDebugString(ErrorOutput); + + va_end(args); + + return; +} + +PVOID GetProcessImageBase(HANDLE ProcessHandle) +{ + _NtQueryInformationProcess pNtQueryInformationProcess; + PROCESS_BASIC_INFORMATION ProcessBasicInformation; + ULONG ulSize; + PEB Peb; + SIZE_T dwBytesRead; + PVOID pPEB = 0; + + if (ProcessHandle == GetCurrentProcess()) + { + return GetModuleHandle(NULL); + } + + pNtQueryInformationProcess = (_NtQueryInformationProcess)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtQueryInformationProcess"); + + memset(&ProcessBasicInformation, 0, sizeof(ProcessBasicInformation)); + + if (pNtQueryInformationProcess(ProcessHandle, 0, &ProcessBasicInformation, sizeof(ProcessBasicInformation), &ulSize) >= 0 && ulSize == sizeof(ProcessBasicInformation)) + { + pPEB = ProcessBasicInformation.PebBaseAddress; + + if (ReadProcessMemory(ProcessHandle, pPEB, &Peb, sizeof(Peb), &dwBytesRead)) + return Peb.ImageBaseAddress; } - priv.PrivilegeCount = 1; - priv.Privileges[0].Luid = privval; - priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; + + return NULL; +} - ret = AdjustTokenPrivileges(token, FALSE, &priv, sizeof(priv), NULL, NULL); - CloseHandle(token); +DWORD GetProcessInitialThreadId(HANDLE ProcessHandle) +{ + DWORD ThreadId; + + __try + { + PTEB Teb = (PTEB)NtCurrentTeb(); - return ret; + if (!ReadProcessMemory(ProcessHandle, &Teb->ClientId.UniqueThread, &ThreadId, sizeof(DWORD), NULL)) + { + DoOutputErrorString("GetProcessInitialThreadId: Failed to read from process"); + return 0; + } + + if (ThreadId) + return ThreadId; + + return 0; + } + __except (EXCEPTION_EXECUTE_HANDLER) + { + return 0; + } } -static BOOLEAN is_suspended(int pid, int tid) +static int GrantDebugPrivileges(void) { - ULONG length; - PSYSTEM_PROCESS_INFORMATION pspi = NULL, proc; - ULONG requestedlen = 16384; - _NtQuerySystemInformation pNtQuerySystemInformation = (_NtQuerySystemInformation)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtQuerySystemInformation"); - BOOLEAN ret = FALSE; - - pspi = malloc(requestedlen); - if (pspi == NULL) - goto out; - - while (pNtQuerySystemInformation(SystemProcessInformation, pspi, requestedlen, &length) == STATUS_INFO_LENGTH_MISMATCH) { - free(pspi); - requestedlen <<= 1; - pspi = malloc(requestedlen); - if (pspi == NULL) - goto out; - } - // now we have a valid list of process information - proc = pspi; - while (1) { - ULONG i; - if ((int)(ULONG_PTR)proc->UniqueProcessId != pid) - goto next; - for (i = 0; i < proc->NumberOfThreads; i++) { - PSYSTEM_THREAD thread = &proc->Threads[i]; - if (tid && (int)(ULONG_PTR)thread->ClientId.UniqueThread != tid) - continue; - if (thread->WaitReason != Suspended) - goto out; - } -next: - if (!proc->NextEntryOffset) - break; - proc = (PSYSTEM_PROCESS_INFORMATION)((PCHAR)proc + proc->NextEntryOffset); - } - ret = TRUE; -out: - if (pspi) - free(pspi); - return ret; + HANDLE Token = NULL; + TOKEN_PRIVILEGES TokenPrivileges; + LUID PrivilegeValue; + int RetVal; + + if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &Token)) + return 0; + + if (!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &PrivilegeValue)) + { + CloseHandle(Token); + return 0; + } + + TokenPrivileges.PrivilegeCount = 1; + TokenPrivileges.Privileges[0].Luid = PrivilegeValue; + TokenPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; + + RetVal = AdjustTokenPrivileges(Token, FALSE, &TokenPrivileges, sizeof(TokenPrivileges), NULL, NULL); + CloseHandle(Token); + + return RetVal; } -static unsigned int get_shellcode(unsigned char *buf, PVOID injstruct) +__declspec(noinline) DWORD WINAPI LoadLibraryThreadFunc(LoadLibraryThread *Pointers) { -#ifndef _WIN64 - buf[0] = 0xb8; // mov eax, injstructaddr - memcpy(&buf[1], &injstruct, sizeof(injstruct)); - buf[5] = 0x53; // push ebx - buf[6] = 0x8d; // lea ebx, injstructaddr+offsetof(INJECT_STRUCT.OutHandle) - buf[7] = 0x58; - buf[8] = (UCHAR)offsetof(INJECT_STRUCT, OutHandle); - buf[9] = 0x53; // push ebx ; ModuleHandle arg - buf[10] = 0x8d; // lea ebx, injstructaddr+offsetof(INJECT_STRUCT.DllName) - buf[11] = 0x58; - buf[12] = (UCHAR)offsetof(INJECT_STRUCT, DllName); - buf[13] = 0x53; // push ebx ; ModuleFileName arg - buf[14] = 0x6a; // push 0 (flags arg) - buf[15] = 0x00; - buf[16] = 0x6a; // push 0 (PathToFile arg) - buf[17] = 0x00; - buf[18] = 0x8b; // mov ebx, injstructaddr+offsetof(INJECT_STRUCT.LdrLoadDllAddress) - buf[19] = 0x58; - buf[20] = (UCHAR)offsetof(INJECT_STRUCT, LdrLoadDllAddress); - buf[21] = 0xff; // call ebx - buf[22] = 0xd3; - buf[23] = 0x5b; // pop ebx - buf[24] = 0xc2; // retn 0x4 - buf[25] = 0x04; - buf[26] = 0x00; - return 27; -#else - buf[0] = 0x53; // push rbx - buf[1] = 0x48; // sub rsp, 0x20 - buf[2] = 0x83; - buf[3] = 0xec; - buf[4] = 0x20; - buf[5] = 0x48; // mov rax, rcx (injection address) - buf[6] = 0x8b; - buf[7] = 0xc1; - buf[8] = 0x48; // lea rbx, injstructaddr+offsetof(INJECT_STRUCT.OutHandle) - buf[9] = 0x8d; - buf[10] = 0x58; - buf[11] = (UCHAR)offsetof(INJECT_STRUCT, OutHandle); - buf[12] = 0x49; // mov r9, rbx ; ModuleHandle arg - buf[13] = 0x89; - buf[14] = 0xd9; - buf[15] = 0x48; // lea rbx, injstructaddr+offsetof(INJECT_STRUCT.DllName) - buf[16] = 0x8d; - buf[17] = 0x58; - buf[18] = (UCHAR)offsetof(INJECT_STRUCT, DllName); - buf[19] = 0x49; // mov r8, rbx ; ModuleFileName arg - buf[20] = 0x89; - buf[21] = 0xd8; - buf[22] = 0x48; // xor rdx, rdx ; Flags arg - buf[23] = 0x31; - buf[24] = 0xd2; - buf[25] = 0x48; // xor rcx, rcx ; PathToFile arg - buf[26] = 0x31; - buf[27] = 0xd1; - buf[28] = 0x48; // mov rbx, injstructaddr+offsetof(INJECT_STRUCT.LdrLoadDllAddress) - buf[29] = 0x8b; - buf[30] = 0x58; - buf[31] = (UCHAR)offsetof(INJECT_STRUCT, LdrLoadDllAddress); - buf[32] = 0xff; // call ebx - buf[33] = 0xd3; - buf[34] = 0x48; // add rsp, 0x20 - buf[35] = 0x83; - buf[36] = 0xc4; - buf[37] = 0x20; - buf[38] = 0x5b; // pop rbx - buf[39] = 0xc3; // ret - return 40; -#endif + HMODULE ModuleHandle; + + ModuleHandle = (HMODULE)Pointers->LoadLibrary(Pointers->DllPath); + + if (ModuleHandle == NULL) + return (DWORD)Pointers->GetLastError(); + + return 0; } -// returns < 0 if injection failed, 0 if injection succeeded and process is alive, and 1 if we injected but the process is suspended, so we shouldn't wait for it -static int inject(int pid, int tid, const char *dllpath, BOOLEAN suspended, int injectmode) +static int InjectDllViaThread(HANDLE ProcessHandle, HANDLE ThreadHandle, const char *DllPath, BOOLEAN ForceLoad) { - HANDLE prochandle = NULL; - HANDLE ThreadHandlele = NULL; - LPVOID dllpathbuf; - LPVOID injstructbuf; - LPVOID loadlibraryaddr; - LPVOID shellcodeaddr; - unsigned int shellcodelen; - unsigned char shellcodebuf[64]; - PWSTR wbuf = NULL; - INJECT_STRUCT inj; - int pathlen; - int i; - - SIZE_T byteswritten = 0; - int ret = ERROR_INVALID_PARAM; - - if (pid <= 0 || tid < 0 || (tid == 0 && suspended)) - goto out; + SIZE_T DllPathLength; + LoadLibraryThread Pointers; + void *PointersAddress; + void *RemoteFuncAddress; + OSVERSIONINFO OSVersion; + SIZE_T BytesWritten; + HANDLE RemoteThreadHandle; + DWORD ExitCode; + _RtlCreateUserThread pRtlCreateUserThread; + int RetVal = 0; + + if (!SystemInfo.dwPageSize) + GetSystemInfo(&SystemInfo); + + if (!SystemInfo.dwPageSize) + { + DoOutputErrorString("InjectDllViaThread: Failed to obtain system page size"); + return 0; + } + + DllPathLength = strlen(DllPath) + 1; + + if (DllPathLength == 0) + { + DoOutputDebugString("InjectDllViaThread: Dll argument bad.\n"); + return 0; + } - if (tid == 0) - injectmode = INJECT_CREATEREMOTETHREAD; + memset(&Pointers, 0, sizeof(Pointers)); - prochandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); - if (prochandle == NULL) { - ret = ERROR_PROCESS_OPEN; - goto out; + Pointers.LoadLibrary = GetProcAddress(LoadLibrary("kernel32"), "LoadLibraryA"); + Pointers.GetLastError = GetProcAddress(LoadLibrary("kernel32"), "GetLastError"); + + if (!Pointers.LoadLibrary || !Pointers.GetLastError) + { + DoOutputDebugString("InjectDllViaThread: Failed to get function pointers.\n"); + return 0; } - if (tid > 0) { - ThreadHandlele = OpenThread(THREAD_ALL_ACCESS, FALSE, tid); - if (ThreadHandlele == NULL) { - ret = ERROR_THREAD_OPEN; - goto out; + Pointers.DllPath = (PCHAR)VirtualAllocEx(ProcessHandle, NULL, SystemInfo.dwPageSize, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); + + if (Pointers.DllPath == NULL) + { + DoOutputErrorString("InjectDllViaThread: Failed to allocate buffer in target"); + return ERROR_ALLOCATE; + } + + if (WriteProcessMemory(ProcessHandle, Pointers.DllPath, DllPath, DllPathLength, &BytesWritten) == FALSE || BytesWritten != DllPathLength) + { + DoOutputErrorString("InjectDllViaThread: Failed to write to DllPath in target"); + return ERROR_WRITEMEMORY; + } + + PointersAddress = (PBYTE)Pointers.DllPath + BytesWritten; + + if (WriteProcessMemory(ProcessHandle, PointersAddress, &Pointers, sizeof(Pointers), &BytesWritten) == FALSE || BytesWritten != sizeof(Pointers)) + { + DoOutputErrorString("InjectDllViaThread: Failed to write to PointersAddress in target"); + return ERROR_WRITEMEMORY; + } + + RemoteFuncAddress = (PBYTE)PointersAddress + BytesWritten; + + if (WriteProcessMemory(ProcessHandle, RemoteFuncAddress, (PBYTE)(&LoadLibraryThreadFunc), 0x100, &BytesWritten) == FALSE || BytesWritten != 0x100) + { + DoOutputErrorString("InjectDllViaThread: Failed to write to RemoteFuncAddress in target"); + return ERROR_WRITEMEMORY; + } + + // If we aren't going to force immediate loading, we queue an APC thread + if (!ForceLoad && ThreadHandle) + { + if (QueueUserAPC((PAPCFUNC)RemoteFuncAddress, ThreadHandle, (ULONG_PTR)PointersAddress) == 0) + { + DoOutputErrorString("InjectDllViaThread: QueueUserAPC failed"); + return 0; } + + DoOutputDebugString("InjectDllViaThread: APC injection queued.\n"); + + return 1; } - pathlen = (int)strlen(dllpath); - wbuf = calloc(1, (pathlen + 1) * sizeof(WCHAR)); - if (wbuf == NULL) { - ret = ERROR_ALLOCATE; - goto out; + OSVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + if (!GetVersionEx(&OSVersion)) + { + DoOutputErrorString("InjectDllViaThread: Failed to get OS version"); + return 0; + } + + if (OSVersion.dwMajorVersion < 6) + { + RemoteThreadHandle = CreateRemoteThread(ProcessHandle, NULL, 0, RemoteFuncAddress, PointersAddress, 0, NULL); + + if (!RemoteThreadHandle) + { + DoOutputErrorString("InjectDllViaThread: CreateRemoteThread failed"); + return ERROR_CREATEREMOTETHREAD; + } + else + { + WaitForSingleObject(RemoteThreadHandle, INFINITE); + GetExitCodeThread(RemoteThreadHandle, &ExitCode); + CloseHandle(RemoteThreadHandle); + VirtualFreeEx(ProcessHandle, Pointers.DllPath, SystemInfo.dwPageSize, MEM_RELEASE); + + if (ExitCode) + { + SetLastError(ExitCode); + DoOutputErrorString("InjectDllViaThread: CreateRemoteThread injection failed"); + return ERROR_CREATEREMOTETHREAD; + } + + DoOutputDebugString("InjectDllViaThread: Successfully injected Dll into process via CreateRemoteThread.\n"); + + return 0; + } + } + else + { + pRtlCreateUserThread = (_RtlCreateUserThread)GetProcAddress(GetModuleHandle("ntdll.dll"), "RtlCreateUserThread"); + + RetVal = pRtlCreateUserThread(ProcessHandle, NULL, 0, 0, 0, 0, (PTHREAD_START_ROUTINE)RemoteFuncAddress, PointersAddress, &RemoteThreadHandle, NULL); + + if (!NT_SUCCESS(RetVal)) + { + RemoteThreadHandle = NULL; + DoOutputErrorString("InjectDllViaThread: RtlCreateUserThread failed"); + return ERROR_RTLCREATEUSERTHREAD; + } + else if (RemoteThreadHandle) + { + WaitForSingleObject(RemoteThreadHandle, INFINITE); + GetExitCodeThread(RemoteThreadHandle, &ExitCode); + CloseHandle(RemoteThreadHandle); + VirtualFreeEx(ProcessHandle, Pointers.DllPath, SystemInfo.dwPageSize, MEM_RELEASE); + + if (ExitCode) + { + SetLastError(ExitCode); + DoOutputErrorString("InjectDllViaThread: RtlCreateUserThread injection failed"); + return ERROR_RTLCREATEUSERTHREAD; + } + } + + DoOutputDebugString("InjectDllViaThread: Successfully injected Dll into process via RtlCreateUserThread.\n"); + + return 0; } - for (i = 0; i < pathlen; i++) { - wbuf[i] = (unsigned short)dllpath[i]; +} + +static int InjectDllViaIAT(HANDLE ProcessHandle, HANDLE ThreadHandle, const char *DllPath) +{ + SIZE_T DllPathLength; + IMAGE_DOS_HEADER DosHeader; + IMAGE_NT_HEADERS NtHeader; + CONTEXT Context; + MEMORY_BASIC_INFORMATION MemoryInfo; + DWORD NewImportDirectorySize, OriginalNumberOfDescriptors, NewNumberOfDescriptors, NewSizeOfImportDescriptors, SizeOfTables, NewImportsRVA, dwProtect, SizeOfHeaders; + PBYTE BaseAddress, FreeAddress, EndOfImage, TargetImportTable, AllocationAddress, NewImportDirectory; + IMAGE_SECTION_HEADER ImportsSection; + PIMAGE_IMPORT_DESCRIPTOR pImageDescriptor; + PIMAGE_THUNK_DATAXX pOriginalFirstThunk, pFirstThunk; + unsigned int i, OrdinalValue; + SIZE_T BytesRead; + int RetVal = 0; + + NewImportDirectorySize = 0; + NewImportDirectory = NULL; + + memset(&DosHeader, 0, sizeof(DosHeader)); + memset(&NtHeader, 0, sizeof(NtHeader)); + memset(&MemoryInfo, 0, sizeof(MemoryInfo)); + + if (!SystemInfo.dwPageSize) + GetSystemInfo(&SystemInfo); + + if (!SystemInfo.dwPageSize) + { + DoOutputErrorString("InjectDllViaIAT: Failed to obtain system page size"); + return 0; } - dllpathbuf = VirtualAllocEx(prochandle, NULL, (wcslen(wbuf) + 1) * sizeof(WCHAR), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); - if (dllpathbuf == NULL) { - ret = ERROR_ALLOCATE; - goto out; + DllPathLength = strlen(DllPath) + 1; + + if (DllPathLength == 0) + { + DoOutputDebugString("InjectDllViaIAT: Dll argument bad.\n"); + return ERROR_INVALID_PARAM; } - if (!WriteProcessMemory(prochandle, dllpathbuf, wbuf, (wcslen(wbuf) + 1) * sizeof(WCHAR), &byteswritten)) { - ret = ERROR_WRITEMEMORY; + BaseAddress = GetProcessImageBase(ProcessHandle); + + if (BaseAddress == NULL) + { + DoOutputDebugString("InjectDllViaIAT: GetProcessImageBase failed.\n"); goto out; } + + DoOutputDebugString("Process image base: 0x%p\n", BaseAddress); - loadlibraryaddr = GetProcAddress(GetModuleHandleA("ntdll.dll"), "LdrLoadDll"); - - inj.LdrLoadDllAddress = (ULONG_PTR)loadlibraryaddr; - inj.DllName.Buffer = dllpathbuf; - inj.DllName.Length = inj.DllName.MaximumLength = (USHORT)(wcslen(wbuf) * sizeof(WCHAR)); + if (!VirtualQueryEx(ProcessHandle, (PVOID)BaseAddress, &MemoryInfo, sizeof(MemoryInfo))) + { + DoOutputDebugString("InjectDllViaIAT: Failed to query target process image base.\n"); + goto out; + } + + if (!ReadProcessMemory(ProcessHandle, BaseAddress, &DosHeader, sizeof(DosHeader), NULL)) + { + DoOutputErrorString("InjectDllViaIAT: Failed to read DOS header from 0x%p - 0x%p", BaseAddress, BaseAddress + sizeof(DosHeader)); + RetVal = ERROR_READMEMORY; + goto out; + } - injstructbuf = VirtualAllocEx(prochandle, NULL, sizeof(INJECT_STRUCT), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); - if (injstructbuf == NULL) { - ret = ERROR_ALLOCATE; + if (DosHeader.e_magic != IMAGE_DOS_SIGNATURE || (DWORD)DosHeader.e_lfanew < sizeof(DosHeader)) + { + DoOutputDebugString("InjectDllViaIAT: Executable DOS header invalid.\n"); goto out; } - if (!WriteProcessMemory(prochandle, injstructbuf, &inj, sizeof(INJECT_STRUCT), &byteswritten)) { - ret = ERROR_WRITEMEMORY; + if (!ReadProcessMemory(ProcessHandle, BaseAddress + DosHeader.e_lfanew, &NtHeader, sizeof(NtHeader), NULL)) + { + DoOutputErrorString("InjectDllViaIAT: Failed to read NT headers from 0x%p - 0x%p", BaseAddress + DosHeader.e_lfanew, BaseAddress + DosHeader.e_lfanew + sizeof(NtHeader)); + RetVal = ERROR_READMEMORY; goto out; } - shellcodelen = get_shellcode(shellcodebuf, injstructbuf); +#ifdef _WIN64 + if (NtHeader.Signature != IMAGE_NT_SIGNATURE || NtHeader.OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC || NtHeader.FileHeader.Machine == 0) +#else + if (NtHeader.Signature != IMAGE_NT_SIGNATURE || NtHeader.OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC || NtHeader.FileHeader.Machine == 0) +#endif + { + DoOutputDebugString("InjectDllViaIAT: Executable image invalid.\n"); + goto out; + } - shellcodeaddr = VirtualAllocEx(prochandle, NULL, shellcodelen, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); - if (shellcodeaddr == NULL) { - ret = ERROR_ALLOCATE; + Context.ContextFlags = CONTEXT_ALL; + + if (!GetThreadContext(ThreadHandle, &Context)) + { + DoOutputDebugString("InjectDllViaIAT: GetThreadContext failed"); goto out; } + +#ifdef _WIN64 + if (Context.Rcx != (DWORD_PTR)(BaseAddress + NtHeader.OptionalHeader.AddressOfEntryPoint)) +#else + if (Context.Eax != (DWORD)(BaseAddress + NtHeader.OptionalHeader.AddressOfEntryPoint)) +#endif + { + DoOutputDebugString("InjectDllViaIAT: Not a new process, bailing.\n"); + goto out; + } + + DoOutputDebugString("InjectDllViaIAT: IAT patching with dll name %s.\n", DllPath); - if (!WriteProcessMemory(prochandle, shellcodeaddr, shellcodebuf, shellcodelen, &byteswritten)) { - ret = ERROR_WRITEMEMORY; + SizeOfHeaders = DosHeader.e_lfanew + FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + NtHeader.FileHeader.SizeOfOptionalHeader; + + OriginalNumberOfDescriptors = NtHeader.IMPORT_DIRECTORY.Size / sizeof(IMAGE_IMPORT_DESCRIPTOR); + + NewNumberOfDescriptors = OriginalNumberOfDescriptors + 1; + + NewSizeOfImportDescriptors = NewNumberOfDescriptors * sizeof(IMAGE_IMPORT_DESCRIPTOR); + if (NewSizeOfImportDescriptors % sizeof(DWORD_PTR)) + NewSizeOfImportDescriptors += sizeof(DWORD_PTR); + + // Two for OriginalFirstThunk, NULL, then two for FirstThunk, NULL. + SizeOfTables = NewSizeOfImportDescriptors + (4 * sizeof(IMAGE_THUNK_DATAXX)); + + NewImportDirectorySize = (DWORD)(SizeOfTables + DllPathLength + sizeof(DWORD) - (DllPathLength % sizeof(DWORD))); + + // Allocate the memory for our new import directory + NewImportDirectory = (PBYTE)calloc(NewImportDirectorySize, 1); + + if (NewImportDirectory == NULL) + { + DoOutputDebugString("InjectDllViaIAT: Failed to allocate memory for new import directory.\n"); + RetVal = ERROR_ALLOCATE; goto out; } - if (injectmode == INJECT_QUEUEUSERAPC) { - if (!QueueUserAPC(shellcodeaddr, ThreadHandlele, (ULONG_PTR)injstructbuf)) { - ret = ERROR_QUEUEUSERAPC; + // Check which section (if any) contains the import table. + memset(&ImportsSection, 0, sizeof(ImportsSection)); + + for (i = 0; i < NtHeader.FileHeader.NumberOfSections; i++) + { + IMAGE_SECTION_HEADER SectionHeader; + memset(&SectionHeader, 0, sizeof(SectionHeader)); + + if (!ReadProcessMemory(ProcessHandle, (BYTE*)BaseAddress + SizeOfHeaders + sizeof(SectionHeader) * i, &SectionHeader, sizeof(SectionHeader), &BytesRead) || BytesRead < sizeof(SectionHeader)) + { + DoOutputErrorString("InjectDllViaIAT: Failed to read section header from 0x%p - 0x%p", (BYTE*)BaseAddress + SizeOfHeaders + sizeof(SectionHeader) * i, (BYTE*)BaseAddress + SizeOfHeaders + sizeof(SectionHeader) * (i + 1)); + RetVal = ERROR_READMEMORY; goto out; } + + if (NtHeader.IMPORT_DIRECTORY.VirtualAddress >= SectionHeader.VirtualAddress && + NtHeader.IMPORT_DIRECTORY.VirtualAddress < SectionHeader.VirtualAddress + SectionHeader.SizeOfRawData) + ImportsSection = SectionHeader; + } + + // If none, it looks like this image has already been patched, + // so we bail. + if (ImportsSection.VirtualAddress == 0) + { + DoOutputDebugString("InjectDllViaIAT: This image appears to have already been patched - aborting.\n"); + goto out; } - else if (injectmode == INJECT_CREATEREMOTETHREAD) { - DWORD threadid; - HANDLE newhandle; - newhandle = CreateRemoteThread(prochandle, NULL, 0, shellcodeaddr, injstructbuf, 0, &threadid); - if (newhandle) - CloseHandle(newhandle); - else { - if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) { - /* Bypass Vista+ userland session restrictions on thread injection */ - PVOID pCsrClientCallServer = (PVOID)GetProcAddress(GetModuleHandleA("ntdll.dll"), "CsrClientCallServer"); - DWORD oldprot; - unsigned char origbuf[16]; - // we hardcode the offsets obtained from reversing because all the definitions of - // PORT_MESSAGE/CSRSS_MESSAGE/etc available online are incorrect for x64, assuming ULONG size of various fields - // due to copy+pasting from Gary Nebbet's Windows 2000 Native API Reference book + + // Scan address space from EXE image base for a free region to contain our new import directory + EndOfImage = BaseAddress + NtHeader.OptionalHeader.BaseOfCode + NtHeader.OptionalHeader.SizeOfCode + NtHeader.OptionalHeader.SizeOfInitializedData + NtHeader.OptionalHeader.SizeOfUninitializedData; + + TargetImportTable = NULL; + + for (FreeAddress = EndOfImage;; FreeAddress = (PBYTE)MemoryInfo.BaseAddress + MemoryInfo.RegionSize) + { + memset(&MemoryInfo, 0, sizeof(MemoryInfo)); + + if (VirtualQueryEx(ProcessHandle, (PVOID)FreeAddress, &MemoryInfo, sizeof(MemoryInfo)) == 0) + { + if (GetLastError() == ERROR_INVALID_PARAMETER) + break; + + DoOutputErrorString("InjectDllViaIAT: Failed to query target process memory at address 0x%p", FreeAddress); + break; + } + + // This indicates the end of user-mode address space + if ((MemoryInfo.RegionSize & 0xFFF) == 0xFFF) + break; + + if (MemoryInfo.State != MEM_FREE) + continue; + DoOutputDebugString("InjectDllViaIAT: Found a free region from 0x%p - 0x%p\n", MemoryInfo.BaseAddress, (PBYTE)MemoryInfo.BaseAddress + MemoryInfo.RegionSize); + + for (AllocationAddress = (PBYTE)(((DWORD_PTR)MemoryInfo.BaseAddress + 0xFFFF) & ~(DWORD_PTR)0xFFFF); AllocationAddress < (PBYTE)MemoryInfo.BaseAddress + MemoryInfo.RegionSize; AllocationAddress += SystemInfo.dwPageSize) + { + TargetImportTable = (PBYTE)VirtualAllocEx(ProcessHandle, AllocationAddress, NewImportDirectorySize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + + if (TargetImportTable == NULL) + { + DoOutputErrorString("InjectDllViaIAT: Failed to allocate new memory region at 0x%p.\n", AllocationAddress); + continue; + } + #ifdef _WIN64 - const unsigned char payload[] = { 0x33, 0xc0, 0x89, 0x41, 0x34, 0xc3 }; // xor eax, eax / mov dword ptr [rcx+], eax / ret -#else - const unsigned char payload[] = { 0x33, 0xc0, 0x8b, 0x4c, 0x24, 0x04, 0x89, 0x41, 0x20, 0xc2, 0x10, 0x00 }; // xor eax, eax, / mov ecx, [esp+4] / mov [ecx+], eax / retn 0x10 + if ((SIZE_T)(TargetImportTable - EndOfImage) > 0xFFFFFFFF) + { + DoOutputDebugString("InjectDllViaIAT: Error - free region for import table too far from image base: 0x%p\n", TargetImportTable); + goto out; + } #endif - VirtualProtect(pCsrClientCallServer, sizeof(payload), PAGE_EXECUTE_READWRITE, &oldprot); + + DoOutputDebugString("InjectDllViaIAT: Allocated 0x%x bytes for new import table at 0x%p.\n", NewImportDirectorySize, TargetImportTable); + break; + } + + if (TargetImportTable) + break; + } - memcpy(origbuf, pCsrClientCallServer, sizeof(payload)); - memcpy(pCsrClientCallServer, payload, sizeof(payload)); + if (TargetImportTable == NULL) + { + DoOutputDebugString("InjectDllViaIAT: Failed to allocate region in target process for new import table.\n"); + goto out; + } - newhandle = CreateRemoteThread(prochandle, NULL, 0, shellcodeaddr, injstructbuf, 0, &threadid); + pImageDescriptor = (PIMAGE_IMPORT_DESCRIPTOR)NewImportDirectory; + NewImportsRVA = (DWORD)(TargetImportTable - (BYTE*)BaseAddress); + + if (StringCchCopyA((char*)NewImportDirectory + SizeOfTables, NewImportDirectorySize - SizeOfTables, DllPath)) + { + DoOutputErrorString("InjectDllViaIAT: Failed to copy DLL path to new import directory"); + goto out; + } + + // We fill our new import descriptor with required values + pImageDescriptor->OriginalFirstThunk = NewImportsRVA + NewSizeOfImportDescriptors; + pImageDescriptor->FirstThunk = NewImportsRVA + NewSizeOfImportDescriptors + (sizeof(IMAGE_THUNK_DATAXX) * 2); + pImageDescriptor->Name = NewImportsRVA + SizeOfTables; - memcpy(pCsrClientCallServer, origbuf, sizeof(payload)); + // We will use an ordinal value of 1 + OrdinalValue = 1; + + // We write the ordinal value & flag to OriginalFirstThunk + pOriginalFirstThunk = (PIMAGE_THUNK_DATAXX)(NewImportDirectory + NewSizeOfImportDescriptors); + pOriginalFirstThunk->u1.Ordinal = OrdinalValue | IMAGE_ORDINAL_FLAG_XX; - if (newhandle) - CloseHandle(newhandle); + // We write to FirstThunk in the same way + pFirstThunk = pOriginalFirstThunk+2; + pFirstThunk->u1.Ordinal = OrdinalValue | IMAGE_ORDINAL_FLAG_XX; - VirtualProtect(pCsrClientCallServer, sizeof(payload), oldprot, &oldprot); - if (newhandle) - goto success; - } - ret = ERROR_CREATEREMOTETHREAD; + // Append the original import descriptors (if any) after our created one + if (NtHeader.IMPORT_DIRECTORY.VirtualAddress != 0) + { + if (!ReadProcessMemory(ProcessHandle, (BYTE*)BaseAddress + NtHeader.IMPORT_DIRECTORY.VirtualAddress, pImageDescriptor+1, OriginalNumberOfDescriptors * sizeof(IMAGE_IMPORT_DESCRIPTOR), &BytesRead) + || BytesRead < OriginalNumberOfDescriptors * sizeof(IMAGE_IMPORT_DESCRIPTOR)) + { + DoOutputDebugString("InjectDllViaIAT: Failed to read import descriptors"); + RetVal = ERROR_READMEMORY; goto out; } } -// else if (injectmode == INJECT_NTCREATETHREADEX) { -// } -// else if (injectmode == INJECT_RTLCREATEUSERTHREAD) { -// } -// else { -// ret = ERROR_INJECTMODE; -// goto out; -// } - -success: - if (suspended) - ret = 1; - else - ret = 0; -out: - if (prochandle) - CloseHandle(prochandle); - if (ThreadHandlele) - CloseHandle(ThreadHandlele); - if (wbuf) - free(wbuf); - - return ret; -} -static void fixpe(ULONG_PTR base, char *buf, DWORD bufsize) -{ - PIMAGE_DOS_HEADER doshdr; - PIMAGE_NT_HEADERS nthdr; - PIMAGE_NT_HEADERS32 nthdr32; - PIMAGE_NT_HEADERS64 nthdr64; - PIMAGE_SECTION_HEADER sechdr; - unsigned short numsecs; - unsigned short i; - - doshdr = (PIMAGE_DOS_HEADER)buf; - - if (doshdr->e_magic != IMAGE_DOS_SIGNATURE) - return; - - if (doshdr->e_magic > bufsize - (sizeof(IMAGE_NT_HEADERS64) + sizeof(IMAGE_DOS_HEADER))) - return; - - nthdr = (PIMAGE_NT_HEADERS)(buf + doshdr->e_lfanew); - if (nthdr->Signature != IMAGE_NT_SIGNATURE) - return; - - if (nthdr->FileHeader.Machine == IMAGE_FILE_MACHINE_I386) { - nthdr32 = (PIMAGE_NT_HEADERS32)nthdr; - nthdr32->OptionalHeader.ImageBase = (DWORD)base; - numsecs = nthdr32->FileHeader.NumberOfSections; - if (bufsize < sizeof(IMAGE_NT_HEADERS32) - sizeof(IMAGE_OPTIONAL_HEADER32) + sizeof(IMAGE_DOS_HEADER) + nthdr32->FileHeader.SizeOfOptionalHeader + (numsecs * sizeof(IMAGE_SECTION_HEADER))) - return; - sechdr = (PIMAGE_SECTION_HEADER)((PCHAR)&nthdr32->OptionalHeader + nthdr32->FileHeader.SizeOfOptionalHeader); - for (i = 0; i < numsecs; i++) { - sechdr[i].PointerToRawData = sechdr[i].VirtualAddress; - sechdr[i].SizeOfRawData = sechdr[i].Misc.VirtualSize; - } - // zero out the relocation table since relocations have already been applied - if (nthdr32->OptionalHeader.NumberOfRvaAndSizes > IMAGE_DIRECTORY_ENTRY_BASERELOC) { - nthdr32->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = 0; - nthdr32->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = 0; - nthdr32->FileHeader.Characteristics |= IMAGE_FILE_RELOCS_STRIPPED; - } + // Write the new table to the process + if (!WriteProcessMemory(ProcessHandle, TargetImportTable, NewImportDirectory, NewImportDirectorySize, NULL)) + { + DoOutputErrorString("InjectDllViaIAT: Failed to write new import descriptor table to target process"); + RetVal = ERROR_WRITEMEMORY; + goto out; } - else if (nthdr->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64) { - nthdr64 = (PIMAGE_NT_HEADERS64)nthdr; - nthdr64->OptionalHeader.ImageBase = base; - numsecs = nthdr64->FileHeader.NumberOfSections; - if (bufsize < sizeof(IMAGE_NT_HEADERS64) - sizeof(IMAGE_OPTIONAL_HEADER64) + sizeof(IMAGE_DOS_HEADER) + nthdr64->FileHeader.SizeOfOptionalHeader + (numsecs * sizeof(IMAGE_SECTION_HEADER))) - return; - sechdr = (PIMAGE_SECTION_HEADER)((PCHAR)&nthdr64->OptionalHeader + nthdr64->FileHeader.SizeOfOptionalHeader); - for (i = 0; i < numsecs; i++) { - sechdr[i].PointerToRawData = sechdr[i].VirtualAddress; - sechdr[i].SizeOfRawData = sechdr[i].Misc.VirtualSize; - } - // zero out the relocation table since relocations have already been applied - if (nthdr64->OptionalHeader.NumberOfRvaAndSizes > IMAGE_DIRECTORY_ENTRY_BASERELOC) { - nthdr64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = 0; - nthdr64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = 0; - nthdr64->FileHeader.Characteristics |= IMAGE_FILE_RELOCS_STRIPPED; - } + + // If IAT zero, set it to section that contains original import table to prevent LdrpSnapIAT failure + if (NtHeader.IAT_DIRECTORY.VirtualAddress == 0) + { + NtHeader.IAT_DIRECTORY.VirtualAddress = ImportsSection.VirtualAddress; + if (ImportsSection.Misc.VirtualSize) + NtHeader.IAT_DIRECTORY.Size = ImportsSection.Misc.VirtualSize; + else + NtHeader.IAT_DIRECTORY.Size = ImportsSection.SizeOfRawData; } - return; + // Now set the import table directory entry to point to the new table + NtHeader.IMPORT_DIRECTORY.VirtualAddress = NewImportsRVA; + NtHeader.IMPORT_DIRECTORY.Size = NewImportDirectorySize; + + // Set bound imports values to zero to prevent them overriding our new import table + NtHeader.BOUND_DIRECTORY.VirtualAddress = 0; + NtHeader.BOUND_DIRECTORY.Size = 0; + + // Zero out any checksum + NtHeader.OptionalHeader.CheckSum = 0; + + // Set target image page permissions to allow writing of new headers + if (!VirtualProtectEx(ProcessHandle, (BYTE*)BaseAddress, NtHeader.OptionalHeader.SizeOfHeaders, PAGE_EXECUTE_READWRITE, &dwProtect)) + { + DoOutputErrorString("InjectDllViaIAT: Failed to modify memory page protection of NtHeader"); + goto out; + } + + // Copy the new NT headers back to the target process + if (!WriteProcessMemory(ProcessHandle, (BYTE*)BaseAddress + DosHeader.e_lfanew, &NtHeader, sizeof(NtHeader), NULL)) + { + DoOutputErrorString("InjectDllViaIAT: Failed to write new NtHeader"); + RetVal = ERROR_WRITEMEMORY; + goto out; + } + + DoOutputDebugString("InjectDllViaIAT: NtHeaders written to 0x%p.\n", (BYTE*)BaseAddress + DosHeader.e_lfanew); + + // Restore original protection + if (!VirtualProtectEx(ProcessHandle, (BYTE*)BaseAddress, NtHeader.OptionalHeader.SizeOfHeaders, dwProtect, &dwProtect)) + { + DoOutputErrorString("InjectDllViaIAT: Failed to restore previous memory page protection"); + goto out; + } + + RetVal = 1; + +out: + return RetVal; + } -static int dump(int pid, char *dumpfile) +static int InjectDll(int ProcessId, int ThreadId, const char *DllPath, BOOLEAN ForceLoad) { - SYSTEM_INFO sysinfo; - PUCHAR addr; - MEMORY_BASIC_INFORMATION meminfo; - HANDLE f; - HANDLE proc = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid); - if (proc == NULL) - return ERROR_PROCESS_OPEN; - - f = CreateFileA(dumpfile, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL); - if (f == INVALID_HANDLE_VALUE) { - CloseHandle(proc); - return ERROR_FILE_OPEN; + HANDLE ProcessHandle = NULL, ThreadHandle = NULL; + int RetVal = 0, InitialThreadId; + + ProcessHandle = NULL; + ThreadHandle = NULL; + + if (!ProcessId) + { + DoOutputDebugString("InjectDll: Error, no process identifier supplied.\n"); + goto out; + } + + ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcessId); + + if (ProcessHandle == NULL) + { + DoOutputErrorString("InjectDll: Failed to open process"); + RetVal = ERROR_PROCESS_OPEN; + goto out; } - GetSystemInfo(&sysinfo); - - // for now just do this the lame way, later we'll dump processes properly - // in a way that's compatible with copymemII/shrinker/etc by communicating - // with a dumper thread in our hooked process - for (addr = (PUCHAR)sysinfo.lpMinimumApplicationAddress; addr < (PUCHAR)sysinfo.lpMaximumApplicationAddress;) { - if (VirtualQueryEx(proc, addr, &meminfo, sizeof(meminfo))) { - if ((meminfo.State & MEM_COMMIT) && (meminfo.Type & (MEM_IMAGE | MEM_MAPPED | MEM_PRIVATE))) { - char *buf; - LARGE_INTEGER bufaddr; - DWORD bufsize; - DWORD byteswritten; - SIZE_T bytesread; - bufaddr.QuadPart = (ULONGLONG)addr; - bufsize = (DWORD)meminfo.RegionSize; - buf = calloc(1, bufsize); - if (buf == NULL) { - CloseHandle(f); - CloseHandle(proc); - return ERROR_ALLOCATE; - } - if (ReadProcessMemory(proc, addr, buf, bufsize, &bytesread) || GetLastError() == ERROR_PARTIAL_COPY) { - WriteFile(f, &bufaddr, sizeof(bufaddr), &byteswritten, NULL); - WriteFile(f, &bufsize, sizeof(bufsize), &byteswritten, NULL); - WriteFile(f, &meminfo.State, sizeof(meminfo.State), &byteswritten, NULL); - WriteFile(f, &meminfo.Type, sizeof(meminfo.Type), &byteswritten, NULL); - WriteFile(f, &meminfo.Protect, sizeof(meminfo.Protect), &byteswritten, NULL); - fixpe((ULONG_PTR)addr, buf, bufsize); - WriteFile(f, buf, bufsize, &byteswritten, NULL); - } - free(buf); - } - addr += meminfo.RegionSize; + // If no thread id supplied, we fetch the initial thread id from the TEB's CLIENT_ID + if (!ThreadId) + { + InitialThreadId = GetProcessInitialThreadId(ProcessHandle); + + if (!InitialThreadId) + { + DoOutputDebugString("InjectDll: No thread ID supplied, GetProcessInitialThreadId failed.\n"); + //RetVal = ERROR_THREAD_OPEN; + //goto out; + //ForceLoad = TRUE; } - else { - addr += 0x1000; + else + { + ThreadHandle = OpenThread(THREAD_ALL_ACCESS, FALSE, InitialThreadId); + DoOutputDebugString("InjectDll: No thread ID supplied. Initial thread ID %d, handle 0x%x\n", InitialThreadId, ThreadHandle); + } + } + else + { + ThreadHandle = OpenThread(THREAD_ALL_ACCESS, FALSE, ThreadId); + + if (ThreadId && ThreadHandle == NULL) + { + DoOutputDebugString("InjectDll: OpenThread failed"); + //RetVal = ERROR_THREAD_OPEN; + //goto out; + ForceLoad = TRUE; } } - CloseHandle(f); - CloseHandle(proc); - return 1; + + // We try to use IAT patching in case this is a new process. + // If it's not, this function is expected to fail. + if (!ForceLoad) + { + RetVal = InjectDllViaIAT(ProcessHandle, ThreadHandle, DllPath); + if (RetVal) + { + DoOutputDebugString("InjectDll: Successfully patched new process IAT.\n"); + goto out; + } + else + { + DoOutputDebugString("InjectDll: IAT patching failed, falling back to thread injection.\n"); + //ForceLoad = TRUE; + } + } + + RetVal = InjectDllViaThread(ProcessHandle, ThreadHandle, DllPath, ForceLoad); + + if (RetVal >= 0) + DoOutputDebugString("InjectDll: Successfully injected DLL via thread.\n"); + else + DoOutputDebugString("InjectDll: DLL injection via thread failed.\n"); + +out: + if (ProcessHandle) + CloseHandle(ProcessHandle); + if (ThreadHandle) + CloseHandle(ThreadHandle); + + return RetVal; } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) -{ +{ + DoOutputDebugString("CAPE loader.\n"); + if (__argc < 2) + { + DoOutputDebugString("Loader: Error - too few arguments!\n"); return ERROR_ARGCOUNT; + } - if (!grant_debug_privileges()) + if (!GrantDebugPrivileges()) + { + DoOutputDebugString("Loader: Error - unable to obtain debug privileges.\n"); return ERROR_DEBUGPRIV; + } - if (!strcmp(__argv[1], "inject")) { - int pid, tid, injectmode; - if (__argc != 6) + if (!strcmp(__argv[1], "inject")) + { + // usage: loader.exe inject + int ProcessId, ThreadId, ret; + char *DllName; + if (__argc != 6) // this includes a dummy for now to maintain compartibility with old loader + { + DoOutputDebugString("Loader: Error - too few arguments for injection (%d)\n", __argc); return ERROR_ARGCOUNT; - pid = atoi(__argv[2]); - tid = atoi(__argv[3]); - injectmode = atoi(__argv[5]); - return inject(pid, tid, __argv[4], is_suspended(pid, tid), injectmode); - } else if (!strcmp(__argv[1], "load")) { + } + + ProcessId = atoi(__argv[2]); + ThreadId = atoi(__argv[3]); + DllName = __argv[4]; + + DoOutputDebugString("Loader: Injecting process %d (thread %d) with %s.\n", ProcessId, ThreadId, DllName); + + ret = InjectDll(ProcessId, ThreadId, DllName, FALSE); + + if (ret >= 0) + DoOutputDebugString("Successfully injected DLL %s.\n", __argv[4]); + else + DoOutputDebugString("Failed to inject DLL %s.\n", __argv[4]); + + return ret; + } + else if (!strcmp(__argv[1], "load")) + { // usage: loader.exe load + STARTUPINFO si; PROCESS_INFORMATION pi; - STARTUPINFOA si; + HANDLE ThreadHandle; int ret; + char szCommand[2048]; + szCommand[0] = L'\0'; + memset(&si, 0, sizeof(si)); - if (__argc != 5) - return ERROR_ARGCOUNT; - CreateProcessA(__argv[2], __argv[3], NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi); - ret = inject(pi.dwProcessId, pi.dwThreadId, __argv[4], TRUE, INJECT_QUEUEUSERAPC); - if (ret == 1) { - HANDLE ThreadHandle = OpenThread(THREAD_SUSPEND_RESUME, FALSE, pi.dwThreadId); - if (ThreadHandle) { - ResumeThread(ThreadHandle); - CloseHandle(ThreadHandle); - } + memset(&pi, 0, sizeof(pi)); + si.cb = sizeof(si); + + StringCchCat(szCommand, sizeof(szCommand), __argv[2]); + StringCchCat(szCommand, sizeof(szCommand), " "); + StringCchCat(szCommand, sizeof(szCommand), __argv[3]); + + DoOutputDebugString("Loader: Loading %s (%s) with DLL %s.\n", __argv[2], szCommand, __argv[3]); + + CreateProcess(__argv[2], szCommand, NULL, NULL, FALSE, CREATE_DEFAULT_ERROR_MODE | CREATE_SUSPENDED, NULL, NULL, &si, &pi); + + ret = InjectDll(pi.dwProcessId, pi.dwThreadId, __argv[4], FALSE); + + if (ret) + DoOutputDebugString("Successfully injected DLL %s.\n", __argv[4]); + else + DoOutputDebugString("Failed to inject DLL %s.\n", __argv[4]); + + ThreadHandle = OpenThread(THREAD_SUSPEND_RESUME, FALSE, pi.dwThreadId); + + if (ThreadHandle) + { + ResumeThread(ThreadHandle); + CloseHandle(ThreadHandle); } + else + DoOutputDebugString("There was a problem resuming the new process %s.\n", __argv[2]); + } - else if (!strcmp(__argv[1], "plugx")) + else if (!strcmp(__argv[1], "service")) + { + // usage: loader.exe service <32-bit dll> <64-bit dll> + int RetVal; + SC_HANDLE hSCManager, hService; + HANDLE hProcessSnapshot, hProcess; + PROCESSENTRY32 ProcessEntry32; + char ServicesName[] = "services.exe", ServiceName[] = "NewService", ServiceDisplayName[] = "New Service"; + DWORD ServicesPID = 0; + + // Get a handle to the SCM database + hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + + if (!hSCManager) + { + DoOutputErrorString("OpenSCManager failed"); + return 0; + } + + // Check the service doesn't already exist + hService = OpenService(hSCManager, ServiceName, SERVICE_ALL_ACCESS); + + if (hService) + { + DoOutputDebugString("Service alerady exists.\n"); + CloseServiceHandle(hSCManager); + return 0; + } + + hService = CreateService(hSCManager, ServiceName, ServiceDisplayName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS | + SERVICE_INTERACTIVE_PROCESS, SERVICE_DEMAND_START, SERVICE_ERROR_IGNORE, __argv[2], + NULL, NULL, NULL, NULL, NULL); + + if (!hService) + { + DoOutputDebugString("Failed to create service.\n"); + CloseServiceHandle(hSCManager); + return 0; + } + + // Now we need to find the PID for services.exe + hProcessSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); + + if (hProcessSnapshot == INVALID_HANDLE_VALUE) + { + DoOutputErrorString("CreateToolhelp32Snapshot (of processes)"); + return FALSE; + } + + // Set the size of the structure before using it. + ProcessEntry32.dwSize = sizeof(PROCESSENTRY32); + + // Retrieve information about the first process, and exit if unsuccessful + if (!Process32First(hProcessSnapshot, &ProcessEntry32)) + { + DoOutputErrorString("Process32First"); + CloseHandle(hProcessSnapshot); + return FALSE; + } + + // Now walk the snapshot + do + { + if (!strncmp(ProcessEntry32.szExeFile, ServicesName, strlen(ServicesName)+1)) + { + ServicesPID = ProcessEntry32.th32ProcessID; + } + } + while (Process32Next(hProcessSnapshot, &ProcessEntry32)); + + if (!ServicesPID) + { + DoOutputDebugString("Failed to find PID for services.exe.\n"); + CloseHandle(hProcessSnapshot); + return FALSE; + } + + hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, ServicesPID); + + if (hProcess == NULL) + { + DoOutputErrorString("OpenProcess failed"); + return -18; + } + + GetNativeSystemInfo(&SystemInfo); + + if (SystemInfo.dwProcessorType == PROCESSOR_AMD_X8664) + { + BOOL IsWow64 = FALSE; + + if (IsWow64Process(hProcess, &IsWow64) && IsWow64) + { + RetVal = InjectDllViaThread(hProcess, 0, __argv[3], FALSE); + } + else + { + RetVal = InjectDllViaThread(hProcess, 0, __argv[4], FALSE); + } + } + else + { + RetVal = InjectDllViaThread(hProcess, 0, __argv[3], FALSE); + } + + CloseHandle(hProcess); + + if (RetVal) + { + DoOutputErrorString("Sucessfully injected monitor into services.exe."); + + RetVal = StartService(hService, 0, NULL); + + if (RetVal) + DoOutputErrorString("Sucessfully started service."); + else + DoOutputErrorString("Failed to start service."); + } + else + DoOutputErrorString("Failed to inject monitor into services.exe."); + + CloseServiceHandle(hService); + CloseServiceHandle(hSCManager); + + return RetVal; + + } + else if (!strcmp(__argv[1], "shellcode")) { - // usage: loader.exe plugx + // usage: loader.exe shellcode HANDLE hInputFile; LARGE_INTEGER InputFileSize; BYTE *PayloadBuffer = NULL; DWORD dwBytesRead, dwBytesToWrite; - PPLUGXPAYLOAD Payload; + PSHELLCODE Payload; hInputFile = CreateFile(__argv[2], GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (!hInputFile || hInputFile == INVALID_HANDLE_VALUE) { - //Error opening input file + DoOutputErrorString("Error opening input file"); return 0; } if (!GetFileSizeEx(hInputFile, &InputFileSize)) { - //GetFileSizeEx error on input file + DoOutputErrorString("Error getting file size"); return 0; } if (InputFileSize.HighPart) { - //Input file is too big! + DoOutputDebugString("Input file is too big!.\n"); return 0; } @@ -506,7 +962,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (PayloadBuffer == NULL) { - //Error allocating memory for file buffer + DoOutputDebugString("Error allocating memory for file buffer.\n"); return 0; } @@ -514,94 +970,94 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (FALSE == ReadFile(hInputFile, PayloadBuffer, InputFileSize.LowPart, &dwBytesRead, NULL)) { - //ReadFile error on input file + DoOutputDebugString("ReadFile error on input file.\n"); return 0; } - Payload = (PPLUGXPAYLOAD)PayloadBuffer; - - Payload(); + Payload = (PSHELLCODE)PayloadBuffer; + __try + { + Payload(); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + DoOutputDebugString("Exception executing payload at 0x%p.\n", PayloadBuffer); + } + free(PayloadBuffer); CloseHandle(hInputFile); return 1; } - else if (!strcmp(__argv[1], "derusbi")) + else if (!strcmp(__argv[1], "debug")) { - PDLLREGRSRV pDllRegisterServer; - HRESULT ReturnVal; - BOOL UnregisterServer = FALSE; - HMODULE hDerusbi; + // usage: loader.exe debug + int ProcessId, ThreadId; + int RetVal; + HANDLE hProcess, hThread; - if (__argc == 4 && !strncmp(__argv[2], "-u", 2)) - UnregisterServer = TRUE; - - hDerusbi = LoadLibrary(__argv[__argc-1]); - - if (hDerusbi != NULL) + if (__argc != 7) + return ERROR_ARGCOUNT; + ProcessId = atoi(__argv[2]); + ThreadId = atoi(__argv[3]); + + hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, ProcessId); + if (hProcess == NULL) { - if (UnregisterServer == TRUE) - pDllRegisterServer = (PDLLREGRSRV) GetProcAddress(hDerusbi, "DllUnregisterServer"); - else - pDllRegisterServer = (PDLLREGRSRV) GetProcAddress(hDerusbi, "DllRegisterServer"); - - if (!pDllRegisterServer) - { - // handle the error - FreeLibrary(hDerusbi); - return 0; - } - else - { - // call the function - ReturnVal = pDllRegisterServer(); - } - + DoOutputErrorString("OpenProcess failed"); + return -18; } - else + + hThread = OpenThread(THREAD_ALL_ACCESS, TRUE, ThreadId); + if (hThread == NULL) { - //ErrorDisplay(TEXT("LoadLibrary")); + DoOutputErrorString("OpenThread failed"); + return -19; } - return ReturnVal; - } - else if (!strcmp(__argv[1], "debug")) + + RetVal = InjectDll(ProcessId, ThreadId, __argv[6], TRUE); + + CloseHandle(hProcess); + CloseHandle(hThread); + + return RetVal; + } + else if (!strcmp(__argv[1], "debug_load")) { - // usage: loader.exe debug - int pid, tid; - //PROCESS_INFORMATION pi; - //STARTUPINFOA si; + // usage: loader.exe debug_load + // called by: \analyzer\windows\lib\api\process.py::debug_inject + // This is for the initial process, as it performs the full debugger + // launch. "debug" is used for child processes as the parent process' + // monitor/debugger dll does the pipe stuff. + int ProcessId, ThreadId; BOOL fSuccess, fConnected; int RetVal; CONTEXT ctx; - TCHAR DebugOutput[MAX_PATH]; - DWORD cbBytesRead, cbWritten, cbReplyBytes, OEP, RemoteFuncAddress; + DWORD cbBytesRead, cbWritten, cbReplyBytes; + DWORD_PTR OEP, RemoteFuncAddress; HANDLE hPipe, hProcess, hThread; char lpszPipename[MAX_PATH]; - - + if (__argc != 7) return ERROR_ARGCOUNT; - pid = atoi(__argv[2]); - tid = atoi(__argv[3]); + + ProcessId = atoi(__argv[2]); + ThreadId = atoi(__argv[3]); memset(lpszPipename, 0, MAX_PATH*sizeof(CHAR)); - sprintf_s(lpszPipename, MAX_PATH, "\\\\.\\pipe\\CAPEpipe_%x", pid); + sprintf_s(lpszPipename, MAX_PATH, "\\\\.\\pipe\\CAPEpipe_%x", ProcessId); - hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid); + hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, ProcessId); if (hProcess == NULL) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("OpenProcess failed, GLE=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); + DoOutputErrorString("Loader: OpenProcess failed"); return -18; } - hThread = OpenThread(THREAD_ALL_ACCESS, TRUE, tid); + hThread = OpenThread(THREAD_ALL_ACCESS, TRUE, ThreadId); if (hThread == NULL) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("OpenThread failed, GLE=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); + DoOutputErrorString("Loader: OpenThread failed"); return -19; } @@ -625,42 +1081,33 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (hPipe == INVALID_HANDLE_VALUE) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("CreateNamedPipe failed, GLE=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); + DoOutputErrorString("Loader: CreateNamedPipe failed"); return -14; } - RetVal = inject(pid, tid, __argv[6], TRUE, INJECT_CREATEREMOTETHREAD); - - // Wait for the client to connect; if it succeeds, - // the function returns a nonzero value. If the function - // returns zero, GetLastError returns ERROR_PIPE_CONNECTED. + RetVal = InjectDll(ProcessId, ThreadId, __argv[6], TRUE); + // Wait for the client to connect fConnected = ConnectNamedPipe(hPipe, NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); fSuccess = FALSE; cbBytesRead = 0; if (fConnected) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Client connected\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("Loader: Client connected\n"); fSuccess = ReadFile ( - hPipe, // handle to pipe - &RemoteFuncAddress, // buffer to receive data - sizeof(DWORD), // size of buffer - &cbBytesRead, // number of bytes read - NULL // not overlapped I/O + hPipe, // handle to pipe + &RemoteFuncAddress, // buffer to receive data + sizeof(DWORD_PTR), // size of buffer + &cbBytesRead, // number of bytes read + NULL // not overlapped I/O ); } else { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("The client could not connect, closing pipe.\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("Loader: The client could not connect, closing pipe.\n"); CloseHandle(hPipe); return -15; } @@ -668,55 +1115,36 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (!fSuccess || cbBytesRead == 0) { if (GetLastError() == ERROR_BROKEN_PIPE) - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Client disconnected, GLE=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); - } + DoOutputErrorString("Loader: Client disconnected"); else - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("ReadFile failed, last error=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); - } + DoOutputErrorString("Loader: ReadFile failed"); } if (!RemoteFuncAddress) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Successfully read from pipe, however RemoteFuncAddress = 0, last error=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); + DoOutputErrorString("Loader: Successfully read from pipe, however RemoteFuncAddress = 0"); return -16; } - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Successfully received debugger init address: 0x%x.\n"), RemoteFuncAddress); - OutputDebugString(DebugOutput); + DoOutputDebugString("Loader: Successfully received debugger init address: 0x%x.\n", RemoteFuncAddress); ctx.ContextFlags = CONTEXT_ALL; if (!GetThreadContext(hThread, &ctx)) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("GetThreadContext failed - FATAL\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("GetThreadContext failed - FATAL\n"); return -17; } #ifndef _WIN64 - OEP = ctx.Eax; -#else - OEP = ctx.Rax; -#endif - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); -#ifndef _WIN64 - _stprintf_s(DebugOutput, MAX_PATH, TEXT("GetThreadContext gives OEP=0x%x\n"), ctx.Eax); + OEP = ctx.Eax; // eax holds eip on 32-bit + DoOutputDebugString("GetThreadContext gives OEP=0x%x\n", ctx.Eax); #else - _stprintf_s(DebugOutput, MAX_PATH, TEXT("GetThreadContext gives OEP=0x%x\n"), ctx.Rax); + OEP = ctx.Rcx; // rcx holds rip on 64-bit + DoOutputDebugString("GetThreadContext gives OEP=0x%x\n", ctx.Rcx); #endif - OutputDebugString(DebugOutput); cbWritten = 0; - cbReplyBytes = sizeof(DWORD); + cbReplyBytes = sizeof(DWORD_PTR); // Write the reply to the pipe. fSuccess = WriteFile @@ -727,47 +1155,30 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine &cbWritten, // number of bytes written NULL // not overlapped I/O ); + if (!fSuccess || cbReplyBytes != cbWritten) - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Failed to send OEP via pipe, last error=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); - } + DoOutputErrorString("Failed to send OEP via pipe"); else - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Sent OEP 0x%x via pipe\n"), OEP); - OutputDebugString(DebugOutput); - } + DoOutputDebugString("Sent OEP 0x%x via pipe\n", OEP); if (RetVal == 1) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Loader: Child process created, suspended, DLL successfully injected\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("Loader: Child process created, suspended, DLL successfully injected\n"); ctx.ContextFlags = CONTEXT_ALL; #ifndef _WIN64 ctx.Eax = RemoteFuncAddress; // eax holds new entry point #else - ctx.Rax = RemoteFuncAddress; // eax holds new entry point + ctx.Rcx = RemoteFuncAddress; // rcx holds new entry point #endif if (!SetThreadContext(hThread, &ctx)) - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Failed to set new EP\n")); - OutputDebugString(DebugOutput); - } + DoOutputDebugString("Failed to set new EP\n"); else - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); #ifndef _WIN64 - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Set new EP to 0x%x\n"), ctx.Eax); + DoOutputDebugString("Set new EP to 0x%x\n", ctx.Eax); #else - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Set new EP to 0x%x\n"), ctx.Rax); + DoOutputDebugString("Set new EP to 0x%x\n", ctx.Rcx); #endif - OutputDebugString(DebugOutput); - } } CloseHandle(hPipe); CloseHandle(hProcess); @@ -775,7 +1186,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine return 1; - } else if (!strcmp(__argv[1], "test")) + } + else if (!strcmp(__argv[1], "test")) { // usage: loader.exe test PROCESS_INFORMATION pi; @@ -783,11 +1195,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine BOOL fSuccess, fConnected; int RetVal; CONTEXT ctx; - TCHAR DebugOutput[MAX_PATH]; - DWORD dwThreadId, cbBytesRead, cbWritten, cbReplyBytes, OEP, RemoteFuncAddress, ExitCode; + char DebugOutput[MAX_PATH]; + DWORD dwThreadId, cbBytesRead, cbWritten, cbReplyBytes, ExitCode; + DWORD_PTR OEP, RemoteFuncAddress; HANDLE hPipe; char lpszPipename[MAX_PATH]; - + HANDLE ThreadHandle = NULL; + HANDLE ProcessHandle = NULL; RemoteFuncAddress = 0; fConnected = FALSE; dwThreadId = 0; @@ -799,16 +1213,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (!CreateProcessA(__argv[2], __argv[3], NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi)) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Failed to create process, last error=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); + DoOutputErrorString("Failed to create process"); return -6; } else { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("CreateProcess succeeded.\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("CreateProcess succeeded.\n"); } memset(lpszPipename, 0, MAX_PATH*sizeof(CHAR)); @@ -830,23 +1240,17 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (hPipe == INVALID_HANDLE_VALUE) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("CreateNamedPipe failed, GLE=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); + DoOutputErrorString("CreateNamedPipe failed"); return -5; } else { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("CreateNamedPipe succeeded.\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("CreateNamedPipe succeeded.\n"); } - RetVal = inject(pi.dwProcessId, pi.dwThreadId, __argv[4], TRUE, INJECT_CREATEREMOTETHREAD); + RetVal = InjectDll(pi.dwProcessId, pi.dwThreadId, __argv[4], TRUE); - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Returned from inject, about to call ConnectNamedPipe.\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("Returned from inject, about to call ConnectNamedPipe.\n"); // Wait for the client to connect; if it succeeds, // the function returns a nonzero value. If the function @@ -858,24 +1262,20 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (fConnected) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Client connected\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("Client connected\n"); fSuccess = ReadFile ( - hPipe, // handle to pipe - &RemoteFuncAddress, // buffer to receive data - sizeof(DWORD), // size of buffer - &cbBytesRead, // number of bytes read - NULL // not overlapped I/O + hPipe, // handle to pipe + &RemoteFuncAddress, // buffer to receive data + sizeof(DWORD_PTR), // size of buffer + &cbBytesRead, // number of bytes read + NULL // not overlapped I/O ); } else { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("The client could not connect, closing pipe.\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("The client could not connect, closing pipe.\n"); CloseHandle(hPipe); return -7; } @@ -883,56 +1283,41 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (!fSuccess || cbBytesRead == 0) { if (GetLastError() == ERROR_BROKEN_PIPE) - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Client disconnected, GLE=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); - } + DoOutputErrorString("Client disconnected"); else - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("ReadFile failed, last error=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); - } + DoOutputErrorString("ReadFile failed"); } if (!RemoteFuncAddress) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Successfully read from pipe, however RemoteFuncAddress = 0, last error=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); + DoOutputErrorString("Successfully read from pipe, however RemoteFuncAddress = 0"); return -8; } - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Successfully received debugger init address: 0x%x.\n"), RemoteFuncAddress); - OutputDebugString(DebugOutput); + DoOutputDebugString("Successfully received debugger init address: 0x%x.\n", RemoteFuncAddress); ctx.ContextFlags = CONTEXT_ALL; if (!GetThreadContext(pi.hThread, &ctx)) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("GetThreadContext failed - FATAL\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("GetThreadContext failed - FATAL\n"); return -9; } #ifndef _WIN64 - OEP = ctx.Eax; -#else - OEP = ctx.Rax; + OEP = ctx.Eax; // eax holds eip on 32-bit +#else + OEP = ctx.Rcx; // rcx holds rip on 64-bit #endif - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); + memset(DebugOutput, 0, MAX_PATH*sizeof(char)); #ifndef _WIN64 - _stprintf_s(DebugOutput, MAX_PATH, TEXT("GetThreadContext gives OEP=0x%x\n"), ctx.Eax); + DoOutputDebugString("GetThreadContext gives OEP=0x%x\n", ctx.Eax); #else - _stprintf_s(DebugOutput, MAX_PATH, TEXT("GetThreadContext gives OEP=0x%x\n"), ctx.Rax); + DoOutputDebugString("GetThreadContext gives OEP=0x%x\n", ctx.Rcx); #endif - OutputDebugString(DebugOutput); cbWritten = 0; - cbReplyBytes = sizeof(DWORD); + cbReplyBytes = sizeof(DWORD_PTR); // Write the reply to the pipe. fSuccess = WriteFile @@ -943,47 +1328,30 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine &cbWritten, // number of bytes written NULL // not overlapped I/O ); + if (!fSuccess || cbReplyBytes != cbWritten) - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Failed to send OEP via pipe, last error=%d.\n"), GetLastError()); - OutputDebugString(DebugOutput); - } + DoOutputErrorString("Failed to send OEP via pipe"); else - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Sent OEP 0x%x via pipe\n"), OEP); - OutputDebugString(DebugOutput); - } + DoOutputDebugString("Sent OEP 0x%x via pipe\n", OEP); if (RetVal == 1) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Loader: Child process created, suspended, DLL successfully injected\n")); - OutputDebugString(DebugOutput); + DoOutputDebugString("Loader: Child process created, suspended, DLL successfully injected\n"); ctx.ContextFlags = CONTEXT_ALL; #ifndef _WIN64 ctx.Eax = RemoteFuncAddress; // eax holds new entry point #else - ctx.Rax = RemoteFuncAddress; // eax holds new entry point + ctx.Rcx = RemoteFuncAddress; // rcx holds new entry point #endif if (!SetThreadContext(pi.hThread, &ctx)) - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Failed to set new EP\n")); - OutputDebugString(DebugOutput); - } + DoOutputDebugString("Failed to set new EP\n"); else - { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); #ifndef _WIN64 - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Set new EP to 0x%x\n"), ctx.Eax); + DoOutputDebugString("Set new EP to 0x%x\n", ctx.Eax); #else - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Set new EP to 0x%x\n"), ctx.Rax); + DoOutputDebugString("Set new EP to 0x%x\n", ctx.Rcx); #endif - OutputDebugString(DebugOutput); - } } Sleep(1000); @@ -996,73 +1364,70 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if (GetExitCodeProcess(pi.hProcess, &ExitCode)) { - memset(DebugOutput, 0, MAX_PATH*sizeof(TCHAR)); - _stprintf_s(DebugOutput, MAX_PATH, TEXT("Exit code: 0x%x\n"), ExitCode); - OutputDebugString(DebugOutput); + DoOutputDebugString("Exit code: 0x%x\n", ExitCode); } return 1; } - else if (!strcmp(__argv[1], "dump")) + else if (!strcmp(__argv[1], "pipe")) { - int pid; - char *dumpfile; - - if (__argc != 4) - return ERROR_ARGCOUNT; - pid = atoi(__argv[2]); - dumpfile = __argv[3]; - return dump(pid, dumpfile); - } -#ifdef CUCKOODBG - else if (!strcmp(__argv[1], "pipe")) { // usage: loader.exe pipe - HANDLE pipehandle; - char pipe_name[512]; - FILE *f = fopen("c:\\cmds.log", "a"); + HANDLE PipeHandle; + char PipeName[BUFSIZE]; + int LastPid = 0; if (__argc != 4) return ERROR_ARGCOUNT; - _snprintf(pipe_name, sizeof(pipe_name)-1, "\\\\.\\PIPE\\%s", __argv[2]); + sprintf_s(PipeName, sizeof(PipeName)-1, "\\\\.\\PIPE\\%s", __argv[2]); - while (1) { - pipehandle = CreateNamedPipeA(pipe_name, PIPE_ACCESS_DUPLEX, + DoOutputDebugString("Loader: Starting pipe %s (DLL to inject %s).\n", PipeName, __argv[3]); + + while (1) + { + PipeHandle = CreateNamedPipeA(PipeName, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, - 16384, - 16384, + PIPEBUFSIZE, + PIPEBUFSIZE, 0, NULL); - if (ConnectNamedPipe(pipehandle, NULL) || GetLastError() == ERROR_PIPE_CONNECTED) { - char buf[16384]; - char response[16384]; + + if (ConnectNamedPipe(PipeHandle, NULL) || GetLastError() == ERROR_PIPE_CONNECTED) + { + char buf[PIPEBUFSIZE]; + char response[PIPEBUFSIZE]; int response_len = 0; int bytes_read = 0; - int bytes_written = 0; + int BytesWritten = 0; + memset(buf, 0, sizeof(buf)); - ReadFile(pipehandle, buf, sizeof(buf), &bytes_read, NULL); - fprintf(f, "%s\n", buf); - fflush(f); + memset(response, 0, sizeof(response)); + + ReadFile(PipeHandle, buf, sizeof(buf), &bytes_read, NULL); + DoOutputDebugString("%s\n", buf); if (!strncmp(buf, "PROCESS:", 8)) { - int pid = -1, tid = -1; + int ProcessId = -1, ThreadId = -1; char *p; if ((p = strchr(buf, ','))) { *p = '\0'; - pid = atoi(&buf[8]); - tid = atoi(p + 1); + ProcessId = atoi(&buf[10]); // skipping the '0:' or '1:' suspended flag + ThreadId = atoi(p + 1); } else { - pid = atoi(&buf[8]); + ProcessId = atoi(&buf[10]); } - inject(pid, tid, __argv[3], is_suspended(pid, tid), INJECT_QUEUEUSERAPC); + if (ProcessId && ThreadId && ProcessId != LastPid) + { + DoOutputDebugString("About to call InjectDll on process %d, thread 5%d.\n", ProcessId, ThreadId); + if (InjectDll(ProcessId, ThreadId, __argv[3], FALSE)) + LastPid = ProcessId; + } } - WriteFile(pipehandle, response, response_len, &bytes_written, NULL); - CloseHandle(pipehandle); + WriteFile(PipeHandle, response, response_len, &BytesWritten, NULL); + CloseHandle(PipeHandle); } } - fclose(f); } -#endif return ERROR_MODE; } \ No newline at end of file diff --git a/loader/loader/Loader.h b/loader/loader/Loader.h index 750e0d9..f8f7a74 100644 --- a/loader/loader/Loader.h +++ b/loader/loader/Loader.h @@ -1,75 +1,155 @@ -// Copyright 2014-2015 Optiv, Inc. (brad.spengler@optiv.com) -// This file is published under the GNU GPL v3 -// http://www.gnu.org/licenses/gpl.html +/* +CAPE - Config And Payload Extraction +Copyright(C) 2015 - 2018 Context Information Security. (kevin.oreilly@contextis.com) +This program is free software : you can redistribute it and / or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program.If not, see . +*/ #define _CRT_SECURE_NO_WARNINGS 1 #include #include -enum { - INJECT_CREATEREMOTETHREAD, - INJECT_QUEUEUSERAPC -}; +#define BOUND_DIRECTORY OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT] +#define IAT_DIRECTORY OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT] +#define IMPORT_DIRECTORY OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT] -#define SystemProcessInformation 5 -#define Suspended 5 -#define STATUS_INFO_LENGTH_MISMATCH 0xc0000004 +#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) -typedef struct _CLIENT_ID { - PVOID UniqueProcess; - PVOID UniqueThread; -} CLIENT_ID, *PCLIENT_ID; +#define BUFSIZE 512 +#define PIPEBUFSIZE 16384 + +#ifndef _WIN64 +#define DWORD_XX DWORD32 +#define IMAGE_ORDINAL_FLAG_XX IMAGE_ORDINAL_FLAG32 +#define IMAGE_THUNK_DATAXX IMAGE_THUNK_DATA32 +#define PIMAGE_THUNK_DATAXX PIMAGE_THUNK_DATA32 +#else +#define DWORD_XX DWORD64 +#define IMAGE_ORDINAL_FLAG_XX IMAGE_ORDINAL_FLAG64 +#define IMAGE_THUNK_DATAXX IMAGE_THUNK_DATA64 +#define PIMAGE_THUNK_DATAXX PIMAGE_THUNK_DATA64 +#endif -typedef struct _LSA_UNICODE_STRING { +typedef struct _LSA_UNICODE_STRING +{ USHORT Length; USHORT MaximumLength; PWSTR Buffer; } LSA_UNICODE_STRING, *PLSA_UNICODE_STRING, UNICODE_STRING, *PUNICODE_STRING; -typedef LONG KPRIORITY; - -typedef struct _SYSTEM_THREAD { - LARGE_INTEGER KernelTime; - LARGE_INTEGER UserTime; - LARGE_INTEGER CreateTime; - ULONG WaitTime; - PVOID StartAddress; - CLIENT_ID ClientId; - KPRIORITY Priority; - LONG BasePriority; - ULONG ContextSwitchCount; - ULONG State; - ULONG WaitReason; -} SYSTEM_THREAD, *PSYSTEM_THREAD; - -typedef struct _SYSTEM_PROCESS_INFORMATION { - ULONG NextEntryOffset; - ULONG NumberOfThreads; - LARGE_INTEGER Reserved[3]; - LARGE_INTEGER CreateTime; - LARGE_INTEGER UserTime; - LARGE_INTEGER KernelTime; - UNICODE_STRING ImageName; - KPRIORITY BasePriority; - HANDLE UniqueProcessId; - HANDLE InheritedFromProcessId; - ULONG HandleCount; - BYTE Reserved4[4]; - PVOID Reserved5[11]; - SIZE_T PeakPagefileUsage; - SIZE_T PrivatePageCount; - LARGE_INTEGER Reserved6[6]; - SYSTEM_THREAD Threads[0]; -} SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION; - -typedef NTSTATUS(WINAPI * _NtQuerySystemInformation)( +typedef struct _CLIENT_ID { + HANDLE UniqueProcess; + HANDLE UniqueThread; +} CLIENT_ID; +typedef CLIENT_ID *PCLIENT_ID; + +typedef struct _PROCESS_BASIC_INFORMATION +{ + PVOID Reserved1; + PVOID PebBaseAddress; + PVOID Reserved2[2]; + ULONG_PTR UniqueProcessId; + ULONG_PTR ParentProcessId; +} PROCESS_BASIC_INFORMATION; + +typedef struct _PEB_LDR_DATA +{ + ULONG Length; + BOOLEAN Initialized; + PVOID SsHandle; + LIST_ENTRY InLoadOrderModuleList; + LIST_ENTRY InMemoryOrderModuleList; + LIST_ENTRY InInitializationOrderModuleList; +} PEB_LDR_DATA, *PPEB_LDR_DATA; + +typedef struct _RTL_USER_PROCESS_PARAMETERS +{ + BYTE Reserved1[16]; + PVOID Reserved2[10]; + UNICODE_STRING ImagePathName; + UNICODE_STRING CommandLine; +} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS; + +typedef void (NTAPI *PPS_POST_PROCESS_INIT_ROUTINE) +( + void +); + +typedef struct _PEB +{ + BYTE Reserved1[2]; + BYTE BeingDebugged; + BOOLEAN Spare; + HANDLE Mutant; + PVOID ImageBaseAddress; + PPEB_LDR_DATA Ldr; + PRTL_USER_PROCESS_PARAMETERS ProcessParameters; + BYTE Reserved4[104]; + PVOID Reserved5[52]; + PPS_POST_PROCESS_INIT_ROUTINE PostProcessInitRoutine; + BYTE Reserved6[128]; + PVOID Reserved7[1]; + ULONG SessionId; +} PEB, *PPEB; + +typedef struct _TEB +{ + NT_TIB NtTib; + PVOID EnvironmentPointer; + CLIENT_ID ClientId; + PVOID ActiveRpcHandle; + PVOID ThreadLocalStoragePointer; + PPEB ProcessEnvironmentBlock; + ULONG LastErrorValue; +// truncated +} TEB, *PTEB; + +typedef NTSTATUS(WINAPI * _NtQuerySystemInformation) +( _In_ ULONG SystemInformationClass, _Inout_ PVOID SystemInformation, _In_ ULONG SystemInformationLength, _Out_opt_ PULONG ReturnLength ); -enum { +typedef NTSTATUS(WINAPI * _NtContinue) +( + void +); + +typedef LONG(WINAPI *_NtQueryInformationProcess)(HANDLE ProcessHandle, + ULONG ProcessInformationClass, PVOID ProcessInformation, + ULONG ProcessInformationLength, PULONG ReturnLength); + +typedef NTSTATUS (NTAPI *_RtlCreateUserThread) +( + HANDLE, + PSECURITY_DESCRIPTOR, + BOOLEAN, + ULONG, + PULONG, + PULONG, + PVOID, + PVOID, + PHANDLE, + PVOID +); + +typedef HRESULT (WINAPI *PDLLREGRSRV)(void); +typedef void (cdecl *PSHELLCODE)(void); + +enum +{ ERROR_INVALID_PARAM = -1, ERROR_PROCESS_OPEN = -2, ERROR_THREAD_OPEN = -3, @@ -77,16 +157,20 @@ enum { ERROR_WRITEMEMORY = -5, ERROR_QUEUEUSERAPC = -6, ERROR_CREATEREMOTETHREAD = -7, - ERROR_INJECTMODE = -8, - ERROR_MODE = -9, - ERROR_DEBUGPRIV = -10, - ERROR_ARGCOUNT = -11, - ERROR_FILE_OPEN = -12, - ERROR_DLL_PATH = -13 + ERROR_RTLCREATEUSERTHREAD = -8, + ERROR_INJECTMODE = -9, + ERROR_MODE = -10, + ERROR_DEBUGPRIV = -11, + ERROR_ARGCOUNT = -12, + ERROR_FILE_OPEN = -13, + ERROR_DLL_PATH = -14, + ERROR_READMEMORY = -15 }; -typedef struct _INJECT_STRUCT { - ULONG_PTR LdrLoadDllAddress; - UNICODE_STRING DllName; - HANDLE OutHandle; -} INJECT_STRUCT, *PINJECT_STRUCT; +typedef struct _LoadLibraryThread { + FARPROC LoadLibrary; + FARPROC GetLastError; + PCHAR DllPath; +} LoadLibraryThread; + +SYSTEM_INFO SystemInfo; diff --git a/loader/loader/loader.vcxproj b/loader/loader/loader.vcxproj index 34ca643..b878bb2 100644 --- a/loader/loader/loader.vcxproj +++ b/loader/loader/loader.vcxproj @@ -22,34 +22,34 @@ {52D1444F-0B18-4F98-BC62-3D11046190CC} Win32Proj loader - 8.1 + 10.0.17134.0 Application true - v140_xp - Unicode + v141 + MultiByte Application true - v140_xp - Unicode + v141_xp + MultiByte Application false - v140_xp + v141 true NotSet Application false - v140_xp + v141_xp true - Unicode + NotSet diff --git a/log.h b/log.h index b5dbe69..a211632 100644 --- a/log.h +++ b/log.h @@ -126,6 +126,9 @@ do { \ #define ENSURE_LARGE_INTEGER(param) \ LARGE_INTEGER _##param; _##param.QuadPart = 0; if(param == NULL) param = &_##param +#define ENSURE_RTL_ATOM(param) \ + RTL_ATOM _##param = 0; if(param == NULL) param = &_##param + #define ENSURE_DWORD(param) \ DWORD _##param = 0; if(param == NULL) param = &_##param diff --git a/misc.c b/misc.c index 01367f6..51e7f1f 100644 --- a/misc.c +++ b/misc.c @@ -26,8 +26,18 @@ along with this program. If not, see . #include "log.h" #include "pipe.h" #include "config.h" +#include "CAPE\CAPE.h" +#include "CAPE\Debugger.h" extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); +extern void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); +extern BOOL SetInitialBreakpoint(PVOID *Address, SIZE_T RegionSize); +extern BOOL AllocationWriteDetected; +extern BOOL PeImageDetected; +extern BOOL AllocationDumped; +extern PVOID AllocationBase; +extern SIZE_T AllocationSize; +extern void ExtractionClearAll(void); static _NtQueryInformationProcess pNtQueryInformationProcess; static _NtQueryInformationThread pNtQueryInformationThread; @@ -594,7 +604,7 @@ BOOL is_in_dll_range(ULONG_PTR addr) return FALSE; } -static ULONG_PTR base_of_dll_of_interest; +ULONG_PTR base_of_dll_of_interest; void set_dll_of_interest(ULONG_PTR BaseAddress) { @@ -1246,8 +1256,10 @@ extern int process_shutting_down; int is_shutting_down() { lasterror_t lasterror; - int ret = 0; HANDLE mutex_handle; + PGUARDPAGES CurrentGuardPages; + MEMORY_BASIC_INFORMATION meminfo; + int ret = 0; if (process_shutting_down) return 1; @@ -1255,7 +1267,58 @@ int is_shutting_down() get_lasterrors(&lasterror); mutex_handle = OpenMutex(SYNCHRONIZE, FALSE, g_config.shutdown_mutex); + if(mutex_handle != NULL) { + + CurrentGuardPages = GuardPageList; + + while (CurrentGuardPages) + { + if (!CurrentGuardPages->PagesDumped && CurrentGuardPages->ReadDetected && CurrentGuardPages->WriteDetected) + CurrentGuardPages->PagesDumped = DumpPEsInRange(CurrentGuardPages->BaseAddress, CurrentGuardPages->RegionSize); + + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + if (AllocationBase && AllocationSize && !AllocationDumped) + { + memset(&meminfo, 0, sizeof(meminfo)); + + if (!VirtualQuery(AllocationBase, &meminfo, sizeof(meminfo))) + { + DoOutputErrorString("Shutdown mutex: unable to query memory region 0x%x", AllocationBase); + } + else if (ScanForNonZero(meminfo.AllocationBase, meminfo.RegionSize)) + { + AllocationDumped = DumpPEsInRange(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + DoOutputDebugString("Shutdown mutex: PE image(s) detected and dumped.\n"); + else + { + SetCapeMetaData(EXTRACTION_SHELLCODE, 0, NULL, meminfo.AllocationBase); + + AllocationDumped = DumpMemory(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + DoOutputDebugString("Shutdown mutex: successfully dumped memory range at 0x%x.\n", AllocationBase); + else + DoOutputDebugString("Shutdown mutex: failed to dump memory range at 0x%x.\n", AllocationBase); + } + + if (!AllocationDumped) + { + DoOutputDebugString("Shutdown mutex: Previously marked memory range at: 0x%x is empty or inaccessible.\n", AllocationBase); + ClearAllBreakpoints((DWORD)NULL); + } + else + { + DoOutputDebugString("Shutdown mutex: CAPE ignoring region: 0x%x as it is empty.\n", AllocationBase); + ExtractionClearAll(); + } + } + } + log_flush(); CloseHandle(mutex_handle); ret = 1; @@ -1783,10 +1846,10 @@ unsigned int address_is_in_stack(DWORD Address) PNT_TIB pTib = (PNT_TIB)(NtCurrentTeb()); if ((Address < (DWORD)pTib->StackBase) && (Address > (DWORD)pTib->StackLimit)) - DoOutputDebugString("Address:0x%x within stack base = %p, limit = %p\r\n", Address, pTib->StackBase, pTib->StackLimit); + //DoOutputDebugString("Address 0x%x within stack base = %p, limit = %p\r\n", Address, pTib->StackBase, pTib->StackLimit); return 1; - DoOutputDebugString("Address:0x%x not within stack base = %p, limit = %p\r\n", Address, pTib->StackBase, pTib->StackLimit); + //DoOutputDebugString("Address 0x%x not within stack base = %p, limit = %p\r\n", Address, pTib->StackBase, pTib->StackLimit); return 0; } __except (EXCEPTION_EXECUTE_HANDLER) { @@ -1794,3 +1857,54 @@ unsigned int address_is_in_stack(DWORD Address) } #endif } + +PVOID get_process_image_base(HANDLE process_handle) +{ + PROCESS_BASIC_INFORMATION pbi; + ULONG ulSize; + HANDLE dup_handle = process_handle; + PVOID pPEB = 0, ImageBase = 0; + PEB Peb; + SIZE_T dwBytesRead; + lasterror_t lasterror; + + get_lasterrors(&lasterror); + + if (process_handle == GetCurrentProcess()) + { + ImageBase = GetModuleHandle(NULL); + goto out; + } + + memset(&pbi, 0, sizeof(pbi)); + + if(pNtQueryInformationProcess(process_handle, 0, &pbi, sizeof(pbi), &ulSize) >= 0 && ulSize == sizeof(pbi)) + { + pPEB = pbi.PebBaseAddress; + + if (ReadProcessMemory(process_handle, pPEB, &Peb, sizeof(Peb), &dwBytesRead)) + { + ImageBase = Peb.ImageBaseAddress; + } + else return NULL; + } + +out: + set_lasterrors(&lasterror); + + return ImageBase; +} + +PEXCEPTION_ROUTINE get_thread_seh_list() +{ +#ifdef _WIN64 + return 0; +#else + PNT_TIB pTib = (PNT_TIB)(NtCurrentTeb()); + + if (pTib && pTib->ExceptionList && pTib->ExceptionList->Handler) + return pTib->ExceptionList->Handler; + else + return 0; +#endif +} diff --git a/misc.h b/misc.h index 2f57996..27b456a 100644 --- a/misc.h +++ b/misc.h @@ -155,6 +155,8 @@ void specialname_map_init(void); char *convert_address_to_dll_name_and_offset(ULONG_PTR addr, unsigned int *offset); int is_wow64_fs_redirection_disabled(void); +//int wow64_disable_stack_copy(void); + void set_dll_of_interest(ULONG_PTR BaseAddress); PWCHAR get_dll_basename(PUNICODE_STRING library); @@ -198,3 +200,5 @@ wchar_t *ascii_to_unicode_dup(char *str); int is_stack_pivoted(void); LONG WINAPI cuckoomon_exception_handler(__in struct _EXCEPTION_POINTERS *ExceptionInfo); + +PVOID get_process_image_base(HANDLE process_handle); diff --git a/ntapi.h b/ntapi.h index 9d62ab3..ac59afa 100644 --- a/ntapi.h +++ b/ntapi.h @@ -476,9 +476,12 @@ typedef struct _LDR_MODULE { #ifdef _WIN64 typedef struct _PEB { - BYTE Reserved1[2]; - BYTE BeingDebugged; - BYTE Reserved2[21]; + BOOLEAN InheritedAddressSpace; + BOOLEAN ReadImageFileExecOptions; + BOOLEAN BeingDebugged; + BOOLEAN Spare; + HANDLE Mutant; + PVOID ImageBaseAddress; PPEB_LDR_DATA LoaderData; PRTL_USER_PROCESS_PARAMETERS ProcessParameters; BYTE Reserved3[520]; @@ -661,6 +664,8 @@ static inline void __writefsdword(unsigned int index, unsigned int value) (( HKEY ) (ULONG_PTR)((LONG)0x80000007) ) #endif +typedef unsigned short RTL_ATOM, *PRTL_ATOM; + typedef struct _SECTION_IMAGE_INFORMATION { VOID* TransferAddress; uint32_t ZeroBits; diff --git a/unhook.c b/unhook.c index 8bc443f..7db3a53 100644 --- a/unhook.c +++ b/unhook.c @@ -24,11 +24,21 @@ along with this program. If not, see . #include "misc.h" #include "config.h" #include +#include "CAPE\CAPE.h" +#include "CAPE\Debugger.h" #define UNHOOK_MAXCOUNT 2048 #define UNHOOK_BUFSIZE 32 -extern int DumpCurrentProcessFixImports(DWORD NewEP); +extern void DoOutputDebugString(_In_ LPCTSTR lpOutputString, ...); +extern void DoOutputErrorString(_In_ LPCTSTR lpOutputString, ...); +extern BOOL SetInitialBreakpoint(PVOID *Address, SIZE_T RegionSize); +extern BOOL AllocationWriteDetected; +extern BOOL PeImageDetected; +extern BOOL AllocationDumped; +extern PVOID AllocationBase; +extern SIZE_T AllocationSize; +extern void ExtractionClearAll(void); static HANDLE g_unhook_thread_handle, g_watcher_thread_handle; @@ -249,11 +259,63 @@ static HANDLE g_terminate_event_handle; static DWORD WINAPI _terminate_event_thread(LPVOID param) { - hook_disable(); + PGUARDPAGES CurrentGuardPages; + MEMORY_BASIC_INFORMATION meminfo; + + hook_disable(); while (1) { WaitForSingleObject(g_terminate_event_handle, INFINITE); - DumpCurrentProcessFixImports(0); + + CurrentGuardPages = GuardPageList; + + while (CurrentGuardPages) + { + if (!CurrentGuardPages->PagesDumped && CurrentGuardPages->ReadDetected && CurrentGuardPages->WriteDetected) + CurrentGuardPages->PagesDumped = DumpPEsInRange(CurrentGuardPages->BaseAddress, CurrentGuardPages->RegionSize); + + CurrentGuardPages = CurrentGuardPages->NextGuardPages; + } + + if (AllocationBase && AllocationSize && !AllocationDumped) + { + memset(&meminfo, 0, sizeof(meminfo)); + + if (!VirtualQuery(AllocationBase, &meminfo, sizeof(meminfo))) + { + DoOutputErrorString("Terminate event: unable to query memory region 0x%x", AllocationBase); + } + else if (ScanForNonZero(meminfo.AllocationBase, meminfo.RegionSize)) + { + AllocationDumped = DumpPEsInRange(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + DoOutputDebugString("Terminate event: PE image(s) detected and dumped.\n"); + else + { + SetCapeMetaData(EXTRACTION_SHELLCODE, 0, NULL, meminfo.AllocationBase); + + AllocationDumped = DumpMemory(meminfo.AllocationBase, meminfo.RegionSize); + + if (AllocationDumped) + DoOutputDebugString("Terminate event: successfully dumped memory range at 0x%x.\n", AllocationBase); + else + DoOutputDebugString("Terminate event: failed to dump memory range at 0x%x.\n", AllocationBase); + } + + if (!AllocationDumped) + { + DoOutputDebugString("Terminate event: Successfully dumped previously marked memory range at: 0x%x is empty or inaccessible.\n", AllocationBase); + ClearAllBreakpoints((DWORD)NULL); + } + else + { + DoOutputDebugString("Terminate event: CAPE ignoring region: 0x%x as it is empty.\n", AllocationBase); + ExtractionClearAll(); + } + } + } + log_flush(); }