small refactors

This commit is contained in:
Akash Mozumdar 2018-12-21 09:34:01 -05:00
parent 7cd464661b
commit e0507b85d3
6 changed files with 21 additions and 30 deletions

View File

@ -8,6 +8,7 @@ project(Textractor)
add_compile_options( add_compile_options(
/std:c++17 /std:c++17
/MP /MP
/wd4018 # signed/unsigned mismatch
) )
add_definitions( add_definitions(

View File

@ -20,9 +20,9 @@ public:
private: private:
void Add(QFileInfo extenFile); void Add(QFileInfo extenFile);
void Sync(); void Sync();
bool eventFilter(QObject* target, QEvent* event); bool eventFilter(QObject* target, QEvent* event) override;
void dragEnterEvent(QDragEnterEvent* event); void dragEnterEvent(QDragEnterEvent* event) override;
void dropEvent(QDropEvent* event); void dropEvent(QDropEvent* event) override;
Ui::ExtenWindow* ui; Ui::ExtenWindow* ui;
}; };

View File

@ -6,24 +6,6 @@
enum { MESSAGE_SIZE = 500, PIPE_BUFFER_SIZE = 2000, SHIFT_JIS = 932, MAX_MODULE_SIZE = 120, HOOK_NAME_SIZE = 30 }; enum { MESSAGE_SIZE = 500, PIPE_BUFFER_SIZE = 2000, SHIFT_JIS = 932, MAX_MODULE_SIZE = 120, HOOK_NAME_SIZE = 30 };
// jichi 375/2014: Add offset of pusha/pushad
// http://faydoc.tripod.com/cpu/pushad.htm
// http://agth.wikia.com/wiki/Cheat_Engine_AGTH_Tutorial
//
// Warning: The offset in ITH has -4 offset comparing to pusha and AGTH
enum pusha_off
{
pusha_eax_off = -0x4,
pusha_ecx_off = -0x8,
pusha_edx_off = -0xc,
pusha_ebx_off = -0x10,
pusha_esp_off = -0x14,
pusha_ebp_off = -0x18,
pusha_esi_off = -0x1c,
pusha_edi_off = -0x20,
pusha_off = -0x24 // pushad offset
};
enum HostCommandType enum HostCommandType
{ {
HOST_COMMAND = -1, // null type HOST_COMMAND = -1, // null type

View File

@ -25,6 +25,23 @@
#include <cstdio> #include <cstdio>
#include <string> #include <string>
// jichi 375/2014: Add offset of pusha/pushad
// http://faydoc.tripod.com/cpu/pushad.htm
// http://agth.wikia.com/wiki/Cheat_Engine_AGTH_Tutorial
//
// Warning: The offset in ITH has -4 offset comparing to pusha and AGTH
enum pusha_off
{
pusha_eax_off = -0x4,
pusha_ecx_off = -0x8,
pusha_edx_off = -0xc,
pusha_ebx_off = -0x10,
pusha_esp_off = -0x14,
pusha_ebp_off = -0x18,
pusha_esi_off = -0x1c,
pusha_edi_off = -0x20,
pusha_off = -0x24 // pushad offset
};
// jichi 7/6/2014: read esp_base // jichi 7/6/2014: read esp_base
#define retof(esp_base) *(DWORD *)(esp_base) // return address #define retof(esp_base) *(DWORD *)(esp_base) // return address

View File

@ -3,12 +3,6 @@
// Branch: ITH_DLL/texthook.cpp, rev 128 // Branch: ITH_DLL/texthook.cpp, rev 128
// 8/24/2013 TODO: Clean up this file // 8/24/2013 TODO: Clean up this file
#ifdef _MSC_VER
# pragma warning (disable:4100) // C4100: unreference formal parameter
# pragma warning (disable:4018) // C4018: sign/unsigned mismatch
//# pragma warning (disable:4733) // C4733: Inline asm assigning to 'FS:0' : handler not registered as safe handler
#endif // _MSC_VER
#include "texthook.h" #include "texthook.h"
#include "MinHook.h" #include "MinHook.h"
#include "engine/match.h" #include "engine/match.h"
@ -17,8 +11,6 @@
#include "defs.h" #include "defs.h"
#include "text.h" #include "text.h"
#include "ithsys/ithsys.h" #include "ithsys/ithsys.h"
#include "growl.h"
#include <Psapi.h>
extern std::unique_ptr<WinMutex> viewMutex; extern std::unique_ptr<WinMutex> viewMutex;

View File

@ -37,7 +37,6 @@ uint64_t SafeSearchMemory(uint64_t startAddr, uint64_t endAddr, const BYTE* byte
__except (EXCEPTION_EXECUTE_HANDLER) __except (EXCEPTION_EXECUTE_HANDLER)
{ {
ConsoleOutput("Textractor: SearchMemory ERROR (Textractor will likely still work fine, but please let Artikash know if this happens a lot!)"); ConsoleOutput("Textractor: SearchMemory ERROR (Textractor will likely still work fine, but please let Artikash know if this happens a lot!)");
return 0;
} }
return 0; return 0;
} }