XX = 0x11 is officially the wildcard

This commit is contained in:
Akash Mozumdar 2019-06-13 03:19:08 -04:00
parent ce88341cce
commit e7fff79f8f
5 changed files with 7 additions and 6 deletions

View File

@ -270,7 +270,7 @@ void MainWindow::LaunchProcess()
std::wstring path = std::wstring(process).erase(process.rfind(L'\\'));
PROCESS_INFORMATION info = {};
if (QMessageBox::question(this, SELECT_PROCESS, USE_JP_LOCALE) == QMessageBox::Yes)
if (!x64 && QMessageBox::question(this, SELECT_PROCESS, USE_JP_LOCALE) == QMessageBox::Yes)
{
if (HMODULE localeEmulator = LoadLibraryOnce(L"LoaderDll"))
{
@ -405,7 +405,7 @@ void MainWindow::FindHooks()
connect(save, &QPushButton::clicked, this, &QDialog::accept);
connect(save, &QPushButton::clicked, [this, patternInput, filterInput]
{
QByteArray pattern = QByteArray::fromHex(patternInput->text().replace("??", "11").toUtf8());
QByteArray pattern = QByteArray::fromHex(patternInput->text().replace("??", QString::number(XX, 16)).toUtf8());
if (pattern.size() < 3) return;
std::wregex filter(L".");
if (!filterInput->text().isEmpty()) try { filter = std::wregex(S(filterInput->text())); } catch (std::regex_error) {};

View File

@ -4,7 +4,8 @@
// 8/23/2013 jichi
// Branch: ITH/common.h, rev 128
enum Misc { STRING = 12, MESSAGE_SIZE = 500, PIPE_BUFFER_SIZE = 2000, SHIFT_JIS = 932, MAX_MODULE_SIZE = 120, HOOK_NAME_SIZE = 30, FIXED_SPLIT_VALUE = 0x10001 };
enum { STRING = 12, MESSAGE_SIZE = 500, PIPE_BUFFER_SIZE = 2000, SHIFT_JIS = 932, MAX_MODULE_SIZE = 120, HOOK_NAME_SIZE = 30, FIXED_SPLIT_VALUE = 0x10001 };
enum WildcardByte { XX = 0x11 };
enum HostCommandType { HOST_COMMAND_NEW_HOOK, HOST_COMMAND_REMOVE_HOOK, HOST_COMMAND_FIND_HOOK, HOST_COMMAND_MODIFY_HOOK, HOST_COMMAND_HIJACK_PROCESS, HOST_COMMAND_DETACH };

View File

@ -95,7 +95,6 @@ enum : DWORD {
//, step = 0x00010000 // crash otoboku PSP on 0.9.9 since 5pb is wrongly inserted
};
enum : BYTE { XX = 0x11 }; // 0x11
#define XX2 XX,XX // WORD
#define XX4 XX2,XX2 // DWORD
#define XX8 XX4,XX4 // QWORD

View File

@ -7,6 +7,7 @@
// - Move my old create remote thread for ITH2 here
#include "ithsys/ithsys.h"
#include "const.h"
// - Global variables -
@ -51,7 +52,7 @@ DWORD SearchPattern(DWORD base, DWORD base_length, LPCVOID search, DWORD search_
for (int i = 0; i < base_length - search_length; ++i)
for (int j = 0; j <= search_length; ++j)
if (j == search_length) return i; // not sure about this algorithm...
else if (*((BYTE*)base + i + j) != *((BYTE*)search + j) && *((BYTE*)search + j) != 0x11) break; // 0x11 = wildcard
else if (*((BYTE*)base + i + j) != *((BYTE*)search + j) && *((BYTE*)search + j) != XX) break;
//if (memcmp((void*)(base + i), search, search_length) == 0)
//return i;

View File

@ -31,7 +31,7 @@ uint64_t SafeSearchMemory(uint64_t startAddr, uint64_t endAddr, const BYTE* byte
for (int i = 0; i < endAddr - startAddr - length; ++i)
for (int j = 0; j <= length; ++j)
if (j == length) return startAddr + i; // not sure about this algorithm...
else if (*((BYTE*)startAddr + i + j) != *(bytes + j) && *(bytes + j) != 0x11) break; // 0x11 = wildcard
else if (*((BYTE*)startAddr + i + j) != *(bytes + j) && *(bytes + j) != XX) break;
}
__except (EXCEPTION_EXECUTE_HANDLER)
{