-
Notifications
You must be signed in to change notification settings - Fork 13
/
Cheater.h
138 lines (97 loc) · 4.27 KB
/
Cheater.h
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
* The Cheat - The legendary universal game trainer for Mac OS X.
* http://www.brokenzipper.com/trac/wiki/TheCheat
*
* Copyright (c) 2003-2011, Charles McGarvey et al.
*
* Distributable under the terms and conditions of the 2-clause BSD
* license; see the file COPYING for the legal text of the license.
*/
#import <Cocoa/Cocoa.h>
#import "ChazLog.h"
#import "CheaterTypes.h"
#import "Process.h"
#import "Variable.h"
// The network protocol The Cheat uses is way simple. the header is
// a fixed size: 24 bytes. Immediately following the header is the
// packet data.
typedef struct _TCPacketHeader
{
unsigned nifty; // always the same: 'DENT' or 0x44454E54.
unsigned size; // the size of the packet (excluding this header).
char name[16]; // NULL-terminated string describing the packet.
} TCPacketHeader;
// network definitions
#define TC_NIFTY (0x44454E54)
@interface Cheater : NSObject
{
BOOL _isConnected;
BOOL _isAuthenticated;
id _delegate;
}
// #############################################################################
#pragma mark Initialization
// #############################################################################
- (id)initWithDelegate:(id)delegate;
// delegation
- (id)delegate;
- (void)setDelegate:(id)delegate;
// accessors
- (BOOL)isConnected;
- (BOOL)isAuthenticated;
- (NSString *)hostAddress;
// #############################################################################
#pragma mark Cheating Control
// #############################################################################
// Methods with AUTH require authentication.
- (void)connect;
- (void)disconnect;
- (void)authenticateWithPassword:(NSString *)password;
- (void)getProcessList;
- (void)setTarget:(Process *)target;
- (void)pauseTarget; // AUTH
- (void)resumeTarget; // AUTH
- (void)limitReturnedResults:(unsigned)limit;
- (void)searchForVariable:(Variable *)var comparison:(TCSearchOperator)op; // AUTH
- (void)searchLastValuesComparison:(TCSearchOperator)op; // AUTH
- (void)cancelSearch; // AUTH
- (void)clearSearch; // AUTH
- (void)getMemoryDump; // AUTH
- (void)cancelMemoryDump; // AUTH
- (void)makeVariableChanges:(NSArray *)variables repeat:(BOOL)doRepeat interval:(NSTimeInterval)repeatInterval; // AUTH
- (void)stopChangingVariables; // AUTH
- (void)undo; // AUTH
- (void)redo; // AUTH
- (void)watchVariablesAtIndex:(unsigned)index count:(unsigned)count interval:(NSTimeInterval)checkInterval; // AUTH
- (void)stopWatchingVariables; // AUTH
@end
// #############################################################################
@protocol CheaterDelegate
// #############################################################################
- (void)cheaterDidConnect:(Cheater *)cheater;
- (void)cheaterDidDisconnect:(Cheater *)cheater;
- (void)cheaterRequiresAuthentication:(Cheater *)cheater;
- (void)cheaterRejectedPassword:(Cheater *)cheater;
- (void)cheaterAcceptedPassword:(Cheater *)cheater;
- (void)cheater:(Cheater *)cheater didFindProcesses:(NSArray *)processes;
- (void)cheater:(Cheater *)cheater didAddProcess:(Process *)process;
- (void)cheater:(Cheater *)cheater didRemoveProcess:(Process *)process;
- (void)cheater:(Cheater *)cheater didSetTarget:(Process *)target;
- (void)cheaterPausedTarget:(Cheater *)cheater;
- (void)cheaterResumedTarget:(Cheater *)cheater;
- (void)cheater:(Cheater *)cheater didFindVariables:(TCArray)variables actualAmount:(unsigned)count;
- (void)cheater:(Cheater *)cheater didFindValues:(TCArray)values;
- (void)cheaterDidCancelSearch:(Cheater *)cheater;
- (void)cheaterDidClearSearch:(Cheater *)cheater;
- (void)cheater:(Cheater *)cheater didDumpMemory:(NSData *)memoryDump;
- (void)cheaterDidCancelMemoryDump:(Cheater *)cheater;
- (void)cheater:(Cheater *)cheater didChangeVariables:(unsigned)changeCount;
- (void)cheaterDidStopChangingVariables:(Cheater *)cheater;
- (void)cheater:(Cheater *)cheater didReportProgress:(int)progress;
- (void)cheater:(Cheater *)cheater didRevertToVariables:(TCArray)variables actualAmount:(unsigned)count;
- (void)cheaterDidUndo:(Cheater *)cheater;
- (void)cheaterDidRedo:(Cheater *)cheater;
- (void)cheater:(Cheater *)cheater variableAtIndex:(unsigned)index didChangeTo:(Variable *)variable;
- (void)cheater:(Cheater *)cheater didFailLastRequest:(NSString *)reason;
- (void)cheater:(Cheater *)cheater echo:(NSString *)message;
@end