mirror of
https://github.com/Light-Speech/C-Android-Memory-Tool.git
synced 2024-10-23 09:33:45 +08:00
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:
parent
a737348721
commit
b6f778f214
597
MemoryTool.cpp
597
MemoryTool.cpp
File diff suppressed because it is too large
Load Diff
93
MemoryTool.h
93
MemoryTool.h
@ -7,25 +7,25 @@ struct MAPS {
|
|||||||
long int addr;
|
long int addr;
|
||||||
long int taddr;
|
long int taddr;
|
||||||
int type;
|
int type;
|
||||||
struct MAPS *next;
|
struct MAPS* next;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RESULT {
|
struct RESULT {
|
||||||
long int addr;
|
long int addr;
|
||||||
struct RESULT *next;
|
struct RESULT* next;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FREEZE {
|
struct FREEZE {
|
||||||
long int addr; // address
|
long int addr; // address
|
||||||
char *value; // value
|
char* value; // value
|
||||||
int type; // type
|
int type; // type
|
||||||
struct FREEZE *next; // pointer to the next node
|
struct FREEZE* next; // pointer to the next node
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef int BOOLEAN;
|
typedef int BOOLEAN;
|
||||||
typedef struct MAPS *PMAPS; //A linked list that stores maps
|
typedef struct MAPS* PMAPS; //A linked list that stores maps
|
||||||
typedef struct RESULT *PRES; // linked list to store results
|
typedef struct RESULT* PRES; // linked list to store results
|
||||||
typedef struct FREEZE *PFREEZE; // Linked list to store frozen data
|
typedef struct FREEZE* PFREEZE; // Linked list to store frozen data
|
||||||
|
|
||||||
typedef int TYPE;
|
typedef int TYPE;
|
||||||
typedef int RANGE;
|
typedef int RANGE;
|
||||||
@ -103,8 +103,8 @@ public:
|
|||||||
int ms = 0;
|
int ms = 0;
|
||||||
|
|
||||||
int SetTextColor(int);
|
int SetTextColor(int);
|
||||||
int getPID(char [64]); // get pid
|
int getPID(char[64]); // get pid
|
||||||
void initXMemoryTools(char *, char *);
|
void initXMemoryTools(char*, char*);
|
||||||
int SetSearchRange(int); // Set search scope
|
int SetSearchRange(int); // Set search scope
|
||||||
PMAPS readmaps(int);
|
PMAPS readmaps(int);
|
||||||
PMAPS readmaps_all(); // read maps file
|
PMAPS readmaps_all(); // read maps file
|
||||||
@ -119,16 +119,16 @@ public:
|
|||||||
PMAPS readmaps_stack(); // read maps file
|
PMAPS readmaps_stack(); // read maps file
|
||||||
PMAPS readmaps_ashmem(); // 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_DWORD(DWORD, long int, PMAPS); // DWORD
|
||||||
PMAPS BaseAddressSearch_FLOAT(FLOAT , long int, PMAPS ); // FLOAT
|
PMAPS BaseAddressSearch_FLOAT(FLOAT, long int, PMAPS); // FLOAT
|
||||||
PMAPS BaseAddressSearch_DOUBLE(DOUBLE , long int , PMAPS); // DOUBLE
|
PMAPS BaseAddressSearch_DOUBLE(DOUBLE, long int, PMAPS); // DOUBLE
|
||||||
PMAPS BaseAddressSearch_WORD(WORD, long int, PMAPS); // WORD
|
PMAPS BaseAddressSearch_WORD(WORD, long int, PMAPS); // WORD
|
||||||
PMAPS BaseAddressSearch_BYTE(BYTE, long int, PMAPS); // BYTE
|
PMAPS BaseAddressSearch_BYTE(BYTE, long int, PMAPS); // BYTE
|
||||||
PMAPS BaseAddressSearch_QWORD(QWORD, long int, PMAPS); // QWORD
|
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_DWORD(DWORD, DWORD, PMAPS); // DWORD
|
||||||
PMAPS RangeMemorySearch_FLOAT(FLOAT, FLOAT, PMAPS); // FLOAT
|
PMAPS RangeMemorySearch_FLOAT(FLOAT, FLOAT, PMAPS); // FLOAT
|
||||||
PMAPS RangeMemorySearch_DOUBLE(DOUBLE, DOUBLE, PMAPS); // WORD
|
PMAPS RangeMemorySearch_DOUBLE(DOUBLE, DOUBLE, PMAPS); // WORD
|
||||||
@ -144,23 +144,23 @@ public:
|
|||||||
PMAPS MemorySearch_BYTE(BYTE, PMAPS); // Memory Search BYTE
|
PMAPS MemorySearch_BYTE(BYTE, PMAPS); // Memory Search BYTE
|
||||||
PMAPS MemorySearch_QWORD(QWORD, PMAPS); // Memory Search QWORD
|
PMAPS MemorySearch_QWORD(QWORD, PMAPS); // Memory Search QWORD
|
||||||
|
|
||||||
void MemoryOffset(char *, long int, int ); // search offset
|
void MemoryOffset(char*, long int, int); // search offset
|
||||||
PMAPS MemoryOffset_DWORD(DWORD , long int, PMAPS); // search offset DWORD
|
PMAPS MemoryOffset_DWORD(DWORD, long int, PMAPS); // search offset DWORD
|
||||||
PMAPS MemoryOffset_FLOAT(FLOAT , long int, PMAPS); // search offset FLOAT
|
PMAPS MemoryOffset_FLOAT(FLOAT, long int, PMAPS); // search offset FLOAT
|
||||||
PMAPS MemoryOffset_DOUBLE(DOUBLE , long int , PMAPS); // search offset DOUBLE
|
PMAPS MemoryOffset_DOUBLE(DOUBLE, long int, PMAPS); // search offset DOUBLE
|
||||||
PMAPS MemoryOffset_WORD(WORD , long int , PMAPS); // search offset WORD
|
PMAPS MemoryOffset_WORD(WORD, long int, PMAPS); // search offset WORD
|
||||||
PMAPS MemoryOffset_BYTE(BYTE , long int , PMAPS); // search offset BYTE
|
PMAPS MemoryOffset_BYTE(BYTE, long int, PMAPS); // search offset BYTE
|
||||||
PMAPS MemoryOffset_QWORD(QWORD , long int, PMAPS); // search offset QWORD
|
PMAPS MemoryOffset_QWORD(QWORD, long int, PMAPS); // search offset QWORD
|
||||||
|
|
||||||
void RangeMemoryOffset(char *, char *, long int, int); // range offset
|
void RangeMemoryOffset(char*, char*, long int, int); // range offset
|
||||||
PMAPS RangeMemoryOffset_DWORD(DWORD, DWORD , long int, PMAPS); // range offset DWORD
|
PMAPS RangeMemoryOffset_DWORD(DWORD, DWORD, long int, PMAPS); // range offset DWORD
|
||||||
PMAPS RangeMemoryOffset_FLOAT(FLOAT , FLOAT, long int , PMAPS); // range offset FLOAT
|
PMAPS RangeMemoryOffset_FLOAT(FLOAT, FLOAT, long int, PMAPS); // range offset FLOAT
|
||||||
PMAPS RangeMemoryOffset_DOUBLE(DOUBLE, DOUBLE, long int, PMAPS); // range offset DOUBLE
|
PMAPS RangeMemoryOffset_DOUBLE(DOUBLE, DOUBLE, long int, PMAPS); // range offset DOUBLE
|
||||||
PMAPS RangeMemoryOffset_WORD(WORD, WORD, long int, PMAPS); // range offset WORD
|
PMAPS RangeMemoryOffset_WORD(WORD, WORD, long int, PMAPS); // range offset WORD
|
||||||
PMAPS RangeMemoryOffset_BYTE(BYTE, BYTE, long int, PMAPS); // range offset BYTE
|
PMAPS RangeMemoryOffset_BYTE(BYTE, BYTE, long int, PMAPS); // range offset BYTE
|
||||||
PMAPS RangeMemoryOffset_QWORD(QWORD, QWORD, long int, PMAPS); // range offset QWORD
|
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_DWORD(DWORD, PMAPS, long int); // memory write DWORD
|
||||||
int MemoryWrite_FLOAT(FLOAT, PMAPS, long int); // memory write FLOAT
|
int MemoryWrite_FLOAT(FLOAT, PMAPS, long int); // memory write FLOAT
|
||||||
int MemoryWrite_DOUBLE(DOUBLE, PMAPS, long int); // memory write DOUBLE
|
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 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_DWORD(ADDRESS, DWORD);
|
||||||
int WriteAddress_FLOAT(ADDRESS, FLOAT);
|
int WriteAddress_FLOAT(ADDRESS, FLOAT);
|
||||||
int WriteAddress_DOUBLE(ADDRESS, DOUBLE);
|
int WriteAddress_DOUBLE(ADDRESS, DOUBLE);
|
||||||
@ -182,27 +182,27 @@ public:
|
|||||||
void ClearMaps(PMAPS); // Clear maps
|
void ClearMaps(PMAPS); // Clear maps
|
||||||
int GetResultCount(); //Get the number of search results
|
int GetResultCount(); //Get the number of search results
|
||||||
|
|
||||||
int isapkinstalled(char *); // Check if the app is installed
|
int isapkinstalled(char*); // Check if the app is installed
|
||||||
int isapkrunning(char *); // Check if the app is running
|
int isapkrunning(char*); // Check if the app is running
|
||||||
int killprocess(char *); // kill the process
|
int killprocess(char*); // kill the process
|
||||||
char GetProcessState(char *); // Get process state
|
char GetProcessState(char*); // Get process state
|
||||||
int killGG(); // kill the gg modifier
|
int killGG(); // kill the gg modifier
|
||||||
int killXs(); // kill xs
|
int killXs(); // kill xs
|
||||||
int uninstallapk(char *); // silently remove software
|
int uninstallapk(char*); // silently remove software
|
||||||
int installapk(char *); // silently uninstall the software
|
int installapk(char*); // silently uninstall the software
|
||||||
int rebootsystem(); // reboot the system (phone)
|
int rebootsystem(); // reboot the system (phone)
|
||||||
int PutDate(); // output system date
|
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
|
PMAPS GetResults(); // Get the result, return the head pointer
|
||||||
int AddFreezeItem_All(char *, int , long int); // Freeze all results
|
int AddFreezeItem_All(char*, int, long int); // Freeze all results
|
||||||
int AddFreezeItem(long int , char *, int , long int); // add frozen data
|
int AddFreezeItem(long int, char*, int, long int); // add frozen data
|
||||||
int AddFreezeItem_DWORD(long int , char *); // DWORD
|
int AddFreezeItem_DWORD(long int, char*); // DWORD
|
||||||
int AddFreezeItem_FLOAT(long int, char *); // FLOAT
|
int AddFreezeItem_FLOAT(long int, char*); // FLOAT
|
||||||
int AddFreezeItem_DOUBLE(long int, char *); // DOUBLE
|
int AddFreezeItem_DOUBLE(long int, char*); // DOUBLE
|
||||||
int AddFreezeItem_WORD(long int, char *); // WORD
|
int AddFreezeItem_WORD(long int, char*); // WORD
|
||||||
int AddFreezeItem_BYTE(long int, char *); // BYTE
|
int AddFreezeItem_BYTE(long int, char*); // BYTE
|
||||||
int AddFreezeItem_QWORD(long int, char *); // QWORD
|
int AddFreezeItem_QWORD(long int, char*); // QWORD
|
||||||
|
|
||||||
int RemoveFreezeItem(long int); // clear fixed freeze data
|
int RemoveFreezeItem(long int); // clear fixed freeze data
|
||||||
int RemoveFreezeItem_All(); // clear all frozen data
|
int RemoveFreezeItem_All(); // clear all frozen data
|
||||||
@ -211,7 +211,7 @@ public:
|
|||||||
int SetFreezeDelay(long int); // set the freeze delay
|
int SetFreezeDelay(long int); // set the freeze delay
|
||||||
int PrintFreezeItems(); // print the freeze list
|
int PrintFreezeItems(); // print the freeze list
|
||||||
|
|
||||||
char *GetAddressValue(ADDRESS,int);
|
char* GetAddressValue(ADDRESS, int);
|
||||||
DWORD GetAddressValue_DWORD(ADDRESS);
|
DWORD GetAddressValue_DWORD(ADDRESS);
|
||||||
FLOAT GetAddressValue_FLOAT(ADDRESS);
|
FLOAT GetAddressValue_FLOAT(ADDRESS);
|
||||||
DOUBLE GetAddressValue_DOUBLE(ADDRESS);
|
DOUBLE GetAddressValue_DOUBLE(ADDRESS);
|
||||||
@ -219,14 +219,13 @@ public:
|
|||||||
BYTE GetAddressValue_BYTE(ADDRESS);
|
BYTE GetAddressValue_BYTE(ADDRESS);
|
||||||
QWORD GetAddressValue_QWORD(ADDRESS);
|
QWORD GetAddressValue_QWORD(ADDRESS);
|
||||||
|
|
||||||
char *getRightText(char *,char *,int);//Get the right text
|
char* getRightText(char*, char*, int);//Get the right text
|
||||||
bool getMask(long int ,char *);//Judgment mask
|
bool getMask(long int, char*);//Judgment mask
|
||||||
void MaskSearch(char *, int );//Mask search
|
void MaskSearch(char*, int);//Mask search
|
||||||
|
|
||||||
bool snowpd(long int);
|
bool snowpd(long int);
|
||||||
long int GetModuleBase(char *,char * ,int);
|
long int GetModuleBase(char*, char*, int);
|
||||||
void FreezeThread();
|
void FreezeThread();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
20
main.cpp
20
main.cpp
@ -1,22 +1,22 @@
|
|||||||
#include <iostream>
|
# include "MemoryTool.h"
|
||||||
#include "MemoryTools.h"
|
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int arc, char argv[]) {
|
||||||
/* 1. Package Name of the game
|
/* 1. Package Name of the game
|
||||||
2. ROOT_MODE (tells you are using rooted device (not reooted device not implimented yet))
|
2. ROOT_MODE (tells you are using rooted device (not reooted device not implimented yet))
|
||||||
*/
|
*/
|
||||||
MemoryTools memoryTools("com.tencent.ig", MODE_ROOT);
|
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)
|
// Initialize the search range to global (check other ranges in header file of memory tool)
|
||||||
memoryTools.SetSearchRange(ALL);
|
memory_tool.SetSearchRange(ALL);
|
||||||
// Search for 1 in whole memory of type byte
|
// Search for 1 in whole memory of type byte
|
||||||
memoryTools.MemorySearch("1", 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
|
// 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);
|
memory_tool.MemoryOffset("2", 2, /*offset*/ TYPE_BYTE);
|
||||||
// Finally write the value to the memory
|
// Finally write the value to the memory
|
||||||
memoryTools.MemoryWrite("0", 2, /*offset*/ TYPE_BYTE);
|
memory_tool.MemoryWrite("0", 2, /*offset*/ TYPE_BYTE);
|
||||||
// clear results function clean all the offsets/values from memory
|
// clear results function clean all the offsets/values from memory
|
||||||
memoryTools.ClearResults();
|
memory_tool.ClearResults();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user