Threading errors and non decleared variables patch

There was error on Freeze threading part and one function was out of boundery which was causing the program to crash. Created working main.cpp file
This commit is contained in:
Abdul Moez 2023-09-22 15:02:32 +05:00 committed by GitHub
parent a737348721
commit b6f778f214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3610 additions and 3548 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7,25 +7,25 @@ struct MAPS {
long int addr;
long int taddr;
int type;
struct MAPS *next;
struct MAPS* next;
};
struct RESULT {
long int addr;
struct RESULT *next;
};
struct RESULT* next;
};
struct FREEZE {
long int addr; // address
char *value; // value
char* value; // value
int type; // type
struct FREEZE *next; // pointer to the next node
struct FREEZE* next; // pointer to the next node
};
typedef int BOOLEAN;
typedef struct MAPS *PMAPS; //A linked list that stores maps
typedef struct RESULT *PRES; // linked list to store results
typedef struct FREEZE *PFREEZE; // Linked list to store frozen data
typedef struct MAPS* PMAPS; //A linked list that stores maps
typedef struct RESULT* PRES; // linked list to store results
typedef struct FREEZE* PFREEZE; // Linked list to store frozen data
typedef int TYPE;
typedef int RANGE;
@ -43,37 +43,37 @@ typedef float FLOAT;
typedef double DOUBLE;
enum type {
TYPE_DWORD,
TYPE_FLOAT,
TYPE_DOUBLE,
TYPE_WORD,
TYPE_BYTE,
TYPE_QWORD,
TYPE_DWORD,
TYPE_FLOAT,
TYPE_DOUBLE,
TYPE_WORD,
TYPE_BYTE,
TYPE_QWORD,
};
enum Range {
ALL, // all memory
B_BAD, // B memory
C_ALLOC, // Ca memory
C_BSS, // Cb memory
C_DATA, // Cd memory
C_HEAP, // Ch memory
JAVA_HEAP, // Jh memory
A_ANONMYOUS, // A memory
CODE_SYSTEM, // Xs memory
STACK, // S memory
ASHMEM // As memory
ALL, // all memory
B_BAD, // B memory
C_ALLOC, // Ca memory
C_BSS, // Cb memory
C_DATA, // Cd memory
C_HEAP, // Ch memory
JAVA_HEAP, // Jh memory
A_ANONMYOUS, // A memory
CODE_SYSTEM, // Xs memory
STACK, // S memory
ASHMEM // As memory
};
enum Color {
COLOR_SILVERY, // silver
COLOR_RED, // Red
COLOR_GREEN, // Green
COLOR_YELLOW, // Yellow
COLOR_DARK_BLUE, // Blue
COLOR_PINK, // Pink
COLOR_SKY_BLUE, // Sky Blue
COLOR_WHITE // White
COLOR_SILVERY, // silver
COLOR_RED, // Red
COLOR_GREEN, // Green
COLOR_YELLOW, // Yellow
COLOR_DARK_BLUE, // Blue
COLOR_PINK, // Pink
COLOR_SKY_BLUE, // Sky Blue
COLOR_WHITE // White
};
#define MODE_ROOT "MODE_ROOT"
@ -103,8 +103,8 @@ public:
int ms = 0;
int SetTextColor(int);
int getPID(char [64]); // get pid
void initXMemoryTools(char *, char *);
int getPID(char[64]); // get pid
void initXMemoryTools(char*, char*);
int SetSearchRange(int); // Set search scope
PMAPS readmaps(int);
PMAPS readmaps_all(); // read maps file
@ -119,16 +119,16 @@ public:
PMAPS readmaps_stack(); // read maps file
PMAPS readmaps_ashmem(); // read maps file
void BaseAddressSearch(char*, int , long int); // base search
void BaseAddressSearch(char*, int, long int); // base search
PMAPS BaseAddressSearch_DWORD(DWORD, long int, PMAPS); // DWORD
PMAPS BaseAddressSearch_FLOAT(FLOAT , long int, PMAPS ); // FLOAT
PMAPS BaseAddressSearch_DOUBLE(DOUBLE , long int , PMAPS); // DOUBLE
PMAPS BaseAddressSearch_FLOAT(FLOAT, long int, PMAPS); // FLOAT
PMAPS BaseAddressSearch_DOUBLE(DOUBLE, long int, PMAPS); // DOUBLE
PMAPS BaseAddressSearch_WORD(WORD, long int, PMAPS); // WORD
PMAPS BaseAddressSearch_BYTE(BYTE, long int, PMAPS); // BYTE
PMAPS BaseAddressSearch_QWORD(QWORD, long int, PMAPS); // QWORD
void RangeMemorySearch(char*, char *, int); // range search
void RangeMemorySearch(char*, char*, int); // range search
PMAPS RangeMemorySearch_DWORD(DWORD, DWORD, PMAPS); // DWORD
PMAPS RangeMemorySearch_FLOAT(FLOAT, FLOAT, PMAPS); // FLOAT
PMAPS RangeMemorySearch_DOUBLE(DOUBLE, DOUBLE, PMAPS); // WORD
@ -144,23 +144,23 @@ public:
PMAPS MemorySearch_BYTE(BYTE, PMAPS); // Memory Search BYTE
PMAPS MemorySearch_QWORD(QWORD, PMAPS); // Memory Search QWORD
void MemoryOffset(char *, long int, int ); // search offset
PMAPS MemoryOffset_DWORD(DWORD , long int, PMAPS); // search offset DWORD
PMAPS MemoryOffset_FLOAT(FLOAT , long int, PMAPS); // search offset FLOAT
PMAPS MemoryOffset_DOUBLE(DOUBLE , long int , PMAPS); // search offset DOUBLE
PMAPS MemoryOffset_WORD(WORD , long int , PMAPS); // search offset WORD
PMAPS MemoryOffset_BYTE(BYTE , long int , PMAPS); // search offset BYTE
PMAPS MemoryOffset_QWORD(QWORD , long int, PMAPS); // search offset QWORD
void MemoryOffset(char*, long int, int); // search offset
PMAPS MemoryOffset_DWORD(DWORD, long int, PMAPS); // search offset DWORD
PMAPS MemoryOffset_FLOAT(FLOAT, long int, PMAPS); // search offset FLOAT
PMAPS MemoryOffset_DOUBLE(DOUBLE, long int, PMAPS); // search offset DOUBLE
PMAPS MemoryOffset_WORD(WORD, long int, PMAPS); // search offset WORD
PMAPS MemoryOffset_BYTE(BYTE, long int, PMAPS); // search offset BYTE
PMAPS MemoryOffset_QWORD(QWORD, long int, PMAPS); // search offset QWORD
void RangeMemoryOffset(char *, char *, long int, int); // range offset
PMAPS RangeMemoryOffset_DWORD(DWORD, DWORD , long int, PMAPS); // range offset DWORD
PMAPS RangeMemoryOffset_FLOAT(FLOAT , FLOAT, long int , PMAPS); // range offset FLOAT
void RangeMemoryOffset(char*, char*, long int, int); // range offset
PMAPS RangeMemoryOffset_DWORD(DWORD, DWORD, long int, PMAPS); // range offset DWORD
PMAPS RangeMemoryOffset_FLOAT(FLOAT, FLOAT, long int, PMAPS); // range offset FLOAT
PMAPS RangeMemoryOffset_DOUBLE(DOUBLE, DOUBLE, long int, PMAPS); // range offset DOUBLE
PMAPS RangeMemoryOffset_WORD(WORD, WORD, long int, PMAPS); // range offset WORD
PMAPS RangeMemoryOffset_BYTE(BYTE, BYTE, long int, PMAPS); // range offset BYTE
PMAPS RangeMemoryOffset_QWORD(QWORD, QWORD, long int, PMAPS); // range offset QWORD
void MemoryWrite(char *, long int, int); // memory write
void MemoryWrite(char*, long int, int); // memory write
int MemoryWrite_DWORD(DWORD, PMAPS, long int); // memory write DWORD
int MemoryWrite_FLOAT(FLOAT, PMAPS, long int); // memory write FLOAT
int MemoryWrite_DOUBLE(DOUBLE, PMAPS, long int); // memory write DOUBLE
@ -169,7 +169,7 @@ public:
int MemoryWrite_QWORD(QWORD, PMAPS, long int); // memory write QWORD
int WriteAddress(long int, char *, int); // Modify the value in the address
int WriteAddress(long int, char*, int); // Modify the value in the address
int WriteAddress_DWORD(ADDRESS, DWORD);
int WriteAddress_FLOAT(ADDRESS, FLOAT);
int WriteAddress_DOUBLE(ADDRESS, DOUBLE);
@ -182,27 +182,27 @@ public:
void ClearMaps(PMAPS); // Clear maps
int GetResultCount(); //Get the number of search results
int isapkinstalled(char *); // Check if the app is installed
int isapkrunning(char *); // Check if the app is running
int killprocess(char *); // kill the process
char GetProcessState(char *); // Get process state
int isapkinstalled(char*); // Check if the app is installed
int isapkrunning(char*); // Check if the app is running
int killprocess(char*); // kill the process
char GetProcessState(char*); // Get process state
int killGG(); // kill the gg modifier
int killXs(); // kill xs
int uninstallapk(char *); // silently remove software
int installapk(char *); // silently uninstall the software
int uninstallapk(char*); // silently remove software
int installapk(char*); // silently uninstall the software
int rebootsystem(); // reboot the system (phone)
int PutDate(); // output system date
int GetDate(char *); // Get system time
int GetDate(char*); // Get system time
PMAPS GetResults(); // Get the result, return the head pointer
int AddFreezeItem_All(char *, int , long int); // Freeze all results
int AddFreezeItem(long int , char *, int , long int); // add frozen data
int AddFreezeItem_DWORD(long int , char *); // DWORD
int AddFreezeItem_FLOAT(long int, char *); // FLOAT
int AddFreezeItem_DOUBLE(long int, char *); // DOUBLE
int AddFreezeItem_WORD(long int, char *); // WORD
int AddFreezeItem_BYTE(long int, char *); // BYTE
int AddFreezeItem_QWORD(long int, char *); // QWORD
int AddFreezeItem_All(char*, int, long int); // Freeze all results
int AddFreezeItem(long int, char*, int, long int); // add frozen data
int AddFreezeItem_DWORD(long int, char*); // DWORD
int AddFreezeItem_FLOAT(long int, char*); // FLOAT
int AddFreezeItem_DOUBLE(long int, char*); // DOUBLE
int AddFreezeItem_WORD(long int, char*); // WORD
int AddFreezeItem_BYTE(long int, char*); // BYTE
int AddFreezeItem_QWORD(long int, char*); // QWORD
int RemoveFreezeItem(long int); // clear fixed freeze data
int RemoveFreezeItem_All(); // clear all frozen data
@ -211,7 +211,7 @@ public:
int SetFreezeDelay(long int); // set the freeze delay
int PrintFreezeItems(); // print the freeze list
char *GetAddressValue(ADDRESS,int);
char* GetAddressValue(ADDRESS, int);
DWORD GetAddressValue_DWORD(ADDRESS);
FLOAT GetAddressValue_FLOAT(ADDRESS);
DOUBLE GetAddressValue_DOUBLE(ADDRESS);
@ -219,14 +219,13 @@ public:
BYTE GetAddressValue_BYTE(ADDRESS);
QWORD GetAddressValue_QWORD(ADDRESS);
char *getRightText(char *,char *,int);//Get the right text
bool getMask(long int ,char *);//Judgment mask
void MaskSearch(char *, int );//Mask search
char* getRightText(char*, char*, int);//Get the right text
bool getMask(long int, char*);//Judgment mask
void MaskSearch(char*, int);//Mask search
bool snowpd(long int);
long int GetModuleBase(char *,char * ,int);
long int GetModuleBase(char*, char*, int);
void FreezeThread();
};

View File

@ -1,22 +1,22 @@
#include <iostream>
#include "MemoryTools.h"
# include "MemoryTool.h"
int main(int argc, char* argv[]) {
/* 1. Package Name of the game
2. ROOT_MODE (tells you are using rooted device (not reooted device not implimented yet))
*/
MemoryTools memoryTools("com.tencent.ig", MODE_ROOT);
int main(int arc, char argv[]) {
/* 1. Package Name of the game
2. ROOT_MODE (tells you are using rooted device (not reooted device not implimented yet))
*/
char game_package[] = "com.tencent.ig";
MemoryTool memory_tool;
memory_tool.initXMemoryTools(game_package, MODE_ROOT);
// Initialize the search range to global (check other ranges in header file of memory tool)
memoryTools.SetSearchRange(ALL);
// Search for 1 in whole memory of type byte
memoryTools.MemorySearch("1", TYPE_BYTE);
// This is another usage if you want to write a value at given offset you can use below line else above line will write all the data in memory
memoryTools.MemoryOffset("2", 2, /*offset*/ TYPE_BYTE);
// Finally write the value to the memory
memoryTools.MemoryWrite("0", 2, /*offset*/ TYPE_BYTE);
// clear results function clean all the offsets/values from memory
memoryTools.ClearResults();
return 0;
// Initialize the search range to global (check other ranges in header file of memory tool)
memory_tool.SetSearchRange(ALL);
// Search for 1 in whole memory of type byte
memory_tool.MemorySearch("1", TYPE_BYTE);
// This is another usage if you want to write a value at given offset you can use below line else above line will write all the data in memory
memory_tool.MemoryOffset("2", 2, /*offset*/ TYPE_BYTE);
// Finally write the value to the memory
memory_tool.MemoryWrite("0", 2, /*offset*/ TYPE_BYTE);
// clear results function clean all the offsets/values from memory
memory_tool.ClearResults();
return 0;
}