2008-08-20 19:27:03 +00:00
|
|
|
#define DEFAULT_BUFLEN 2096
|
|
|
|
#define DEFAULT_PORT "1911"
|
|
|
|
|
|
|
|
// Request Types
|
|
|
|
#define EXECUTE 0x0
|
|
|
|
#define GO 0x1
|
|
|
|
#define BREAK 0x2
|
|
|
|
#define RESTART 0x3
|
|
|
|
#define ADDBUF 0x4
|
|
|
|
|
|
|
|
// Corruption Types
|
|
|
|
#define CLEAN 0x0
|
|
|
|
#define TOUPPER 0x1
|
|
|
|
#define TOLOWER 0x2
|
|
|
|
#define TOUNICODE 0x3
|
|
|
|
#define NONSTD 0x4
|
|
|
|
#define TRUNCATED 0x5
|
|
|
|
|
|
|
|
struct debugState {
|
|
|
|
ULONG currentState;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct requestQueue {
|
|
|
|
ULONG length;
|
|
|
|
struct request *head;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct request {
|
|
|
|
USHORT type;
|
|
|
|
USHORT length;
|
|
|
|
BYTE *data;
|
|
|
|
|
|
|
|
struct request *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct requestHeader {
|
|
|
|
USHORT type;
|
|
|
|
USHORT length;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct trackedBuf {
|
|
|
|
char *bufName;
|
|
|
|
char *bufPatt;
|
2009-01-16 17:14:46 +00:00
|
|
|
DWORD bufSize;
|
2008-08-20 19:27:03 +00:00
|
|
|
USHORT found;
|
|
|
|
|
|
|
|
struct bufInstance *instances;
|
|
|
|
struct trackedBuf *next;
|
|
|
|
struct trackedBuf *prev;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct bufInstance {
|
|
|
|
ULONG64 address;
|
|
|
|
USHORT corruption;
|
|
|
|
ULONG truncLength;
|
|
|
|
|
|
|
|
struct bufInstance *next;
|
|
|
|
};
|
|
|
|
|
2009-01-07 17:50:31 +00:00
|
|
|
struct trackedVal {
|
|
|
|
char *valName;
|
|
|
|
BYTE valSize;
|
|
|
|
ULONG candidates;
|
|
|
|
|
|
|
|
struct valInstance *instances;
|
|
|
|
struct trackedVal *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct valInstance {
|
|
|
|
ULONG64 address;
|
|
|
|
|
|
|
|
struct valInstance *next;
|
|
|
|
};
|
|
|
|
|
2009-01-15 20:25:44 +00:00
|
|
|
struct corruption {
|
|
|
|
DWORD offset;
|
|
|
|
BYTE value;
|
|
|
|
BOOL seenAgain;
|
|
|
|
BOOL seenBefore;
|
|
|
|
};
|
|
|
|
|
2008-08-20 19:27:03 +00:00
|
|
|
|
|
|
|
void helpJutsu(void);
|
|
|
|
void bindJutsu(char *);
|
2008-08-25 20:51:17 +00:00
|
|
|
void searchOpcodes(char *);
|
2009-08-12 21:31:45 +00:00
|
|
|
void searchVtptr(DWORD, char *);
|
2008-08-20 19:27:03 +00:00
|
|
|
DWORD WINAPI listenJutsu(LPVOID lpvParam);
|
|
|
|
void parseJutsu(char *, ULONG);
|
2009-11-09 19:56:33 +00:00
|
|
|
void identBufJutsu(char *, char *, char *, DWORD, DWORD);
|
2008-08-20 19:27:03 +00:00
|
|
|
void rmBufJutsu(char *);
|
|
|
|
void listTrackedBufJutsu(void);
|
|
|
|
void showRequestsJutsu(void);
|
|
|
|
void hunterJutsu(void);
|
|
|
|
void returnAddressHuntJutsu(void);
|
2009-01-07 17:50:31 +00:00
|
|
|
void trackValJutsu(char *name, DWORD size, DWORD value);
|
2009-01-07 21:21:16 +00:00
|
|
|
void listTrackedVals(void);
|
|
|
|
void listTrackedValByName(char *name);
|
2009-01-07 17:50:31 +00:00
|
|
|
ULONG64 allocateMemoryBlock(unsigned long);
|
2009-08-06 20:09:38 +00:00
|
|
|
ULONG64 searchMemory(unsigned char * byteBuffer, unsigned long length, ULONG64 *addressHit);
|
2009-01-07 17:50:31 +00:00
|
|
|
DWORD findAllVals(unsigned char *byteBuffer, BYTE size, struct valInstance **instance);
|
2009-01-15 20:25:44 +00:00
|
|
|
void memDiffJutsu(char *inputType, DWORD size, char *input, ULONG64 address);
|
2008-08-20 19:27:03 +00:00
|
|
|
|
|
|
|
// Handlers
|
|
|
|
void executeJutsu(struct request *);
|
|
|
|
void goJutsu(struct request *);
|
|
|
|
void breakJutsu(struct request *);
|
|
|
|
void restartJutsu(struct request *);
|
|
|
|
void addbufJutsu(struct request *);
|