-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathmain.mm
More file actions
89 lines (82 loc) · 2.83 KB
/
main.mm
File metadata and controls
89 lines (82 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/sysctl.h>
#import <Foundation/Foundation.h>
#import "MemoryCheat.h"
#import "RunningProces.h"
#import "Process.h"
#import "Thread.h"
#import "Write.h"
#import "Util.h"
#ifdef __LP64__
#import "Map_64.h"
#import "MemRead_64.h"
#else
#import "Map.h"
#import "MemRead.h"
#endif
int main(int argc, char **argv, char **envp) {
char cmd[BUFSIZE];
@autoreleasepool {
while (1) {
printf("%s",COMMAND);
scanf("%29[^\n]s",cmd);
getchar();
char command1[BUFSIZE] = {'\0',};
char command2[BUFSIZE] = {'\0',};
char command3[BUFSIZE] = {'\0',};
sscanf(cmd,"%s%s%s", command1, command2, command3);
printf("%s %s %s\n",command1, command2, command3);
//Process List Print
if (!strcmp(PROCESS,strupr(command1))) {
ProcessList();
//Process Attach
}else if(!strcmp(ATTACH,strupr(command1))){
//sscanf(command2,"%d",&pid);
pid = atoi(command2);
setPid();
findWriteableRegions();
//Value Search
}else if (!strcmp(SEARCH,strupr(command1))) {
printf("%s, %s\n",strupr(command1),command2);
long value;
sscanf(command2,"%ld",&value);
SearchProcess(value);
//Pick
}else if (!strcmp(PICK,strupr(command1))) {
printf("%s, %s\n",strupr(command1),command2);
long value;
sscanf(command2,"%ld",&value);
getValueAddress(value);
//Write
}else if(!strcmp(WRITE,strupr(command1))){
long address, value;
sscanf(command2,"%ld",&address);
sscanf(command3,"%ld",&value);
MemoryWrite(address,value);
//THREAD CONTROL
}else if(!strcmp(CONTROL,strupr(command1))){
thread_t target_thread;
sscanf(command3,"%u",&target_thread);
if(!strcmp(ENABLE,strupr(command2))){
resumeThread(target_thread);
}else if(!strcmp(DISABLE,strupr(command2))){
suspendThread(target_thread);
}
//Find data list
}else if(!strcmp(SHOWLIST,strupr(command1))){
showDataList();
//Thread list
}else if(!strcmp(THREADLIST,strupr(command1))){
showThreadList();
//Clear data list
}else if(!strcmp(CLEAR,strupr(command1))){
MemoryClear();
}else if(!strcmp(EXIT,strupr(command1))){
exit(0);
}
}
}
return 0;
}