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;
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
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 *);
|
2008-08-20 19:27:03 +00:00
|
|
|
DWORD WINAPI listenJutsu(LPVOID lpvParam);
|
|
|
|
void parseJutsu(char *, ULONG);
|
|
|
|
void identBufJutsu(char *, char *);
|
|
|
|
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);
|
2008-08-20 19:27:03 +00:00
|
|
|
ULONG64 searchMemory(unsigned char * byteBuffer, unsigned long length);
|
2009-01-07 17:50:31 +00:00
|
|
|
DWORD findAllVals(unsigned char *byteBuffer, BYTE size, struct valInstance **instance);
|
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 *);
|