]> Dogcows Code - chaz/thecheat/blob - Cheater.h
The Cheat 1.2
[chaz/thecheat] / Cheater.h
1
2 // **********************************************************************
3 // The Cheat - A universal game cheater for Mac OS X
4 // (C) 2003-2005 Chaz McGarvey (BrokenZipper)
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 1, or (at your option)
9 // any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 //
20
21 #import <Cocoa/Cocoa.h>
22 #import "ChazLog.h"
23
24 #import "CheaterTypes.h"
25
26 #import "Process.h"
27 #import "Variable.h"
28
29
30 // The network protocol The Cheat uses is way simple. the header is
31 // a fixed size: 24 bytes. Immediately following the header is the
32 // packet data.
33
34 typedef struct _TCPacketHeader
35 {
36 unsigned nifty; // always the same: 'DENT' or 0x44454E54.
37 unsigned size; // the size of the packet (excluding this header).
38 char name[16]; // NULL-terminated string describing the packet.
39 } TCPacketHeader;
40
41
42 // network definitions
43 #define TC_NIFTY (0x44454E54)
44
45
46 @interface Cheater : NSObject
47 {
48 BOOL _isConnected;
49 BOOL _isAuthenticated;
50 id _delegate;
51 }
52
53 // #############################################################################
54 #pragma mark Initialization
55 // #############################################################################
56
57 - (id)initWithDelegate:(id)delegate;
58
59 // delegation
60 - (id)delegate;
61 - (void)setDelegate:(id)delegate;
62
63 // accessors
64 - (BOOL)isConnected;
65 - (BOOL)isAuthenticated;
66 - (NSString *)hostAddress;
67
68 // #############################################################################
69 #pragma mark Cheating Control
70 // #############################################################################
71
72 // Methods with AUTH require authentication.
73
74 - (void)connect;
75 - (void)disconnect;
76 - (void)authenticateWithPassword:(NSString *)password;
77
78 - (void)getProcessList;
79
80 - (void)setTarget:(Process *)target;
81 - (void)pauseTarget; // AUTH
82 - (void)resumeTarget; // AUTH
83
84 - (void)limitReturnedResults:(unsigned)limit;
85 - (void)searchForVariable:(Variable *)var comparison:(TCSearchOperator)op; // AUTH
86 - (void)searchLastValuesComparison:(TCSearchOperator)op; // AUTH
87 - (void)cancelSearch; // AUTH
88 - (void)clearSearch; // AUTH
89
90 - (void)getMemoryDump; // AUTH
91 - (void)cancelMemoryDump; // AUTH
92
93 - (void)makeVariableChanges:(NSArray *)variables repeat:(BOOL)doRepeat interval:(NSTimeInterval)repeatInterval; // AUTH
94 - (void)stopChangingVariables; // AUTH
95
96 - (void)undo; // AUTH
97 - (void)redo; // AUTH
98
99 - (void)watchVariablesAtIndex:(unsigned)index count:(unsigned)count interval:(NSTimeInterval)checkInterval; // AUTH
100 - (void)stopWatchingVariables; // AUTH
101
102 @end
103
104
105 // #############################################################################
106 @protocol CheaterDelegate
107 // #############################################################################
108
109 - (void)cheaterDidConnect:(Cheater *)cheater;
110 - (void)cheaterDidDisconnect:(Cheater *)cheater;
111
112 - (void)cheaterRequiresAuthentication:(Cheater *)cheater;
113 - (void)cheaterRejectedPassword:(Cheater *)cheater;
114 - (void)cheaterAcceptedPassword:(Cheater *)cheater;
115
116 - (void)cheater:(Cheater *)cheater didFindProcesses:(NSArray *)processes;
117 - (void)cheater:(Cheater *)cheater didAddProcess:(Process *)process;
118 - (void)cheater:(Cheater *)cheater didRemoveProcess:(Process *)process;
119
120 - (void)cheater:(Cheater *)cheater didSetTarget:(Process *)target;
121 - (void)cheaterPausedTarget:(Cheater *)cheater;
122 - (void)cheaterResumedTarget:(Cheater *)cheater;
123
124 - (void)cheater:(Cheater *)cheater didFindVariables:(TCArray)variables actualAmount:(unsigned)count;
125 - (void)cheater:(Cheater *)cheater didFindValues:(TCArray)values;
126 - (void)cheaterDidCancelSearch:(Cheater *)cheater;
127 - (void)cheaterDidClearSearch:(Cheater *)cheater;
128
129 - (void)cheater:(Cheater *)cheater didDumpMemory:(NSData *)memoryDump;
130 - (void)cheaterDidCancelMemoryDump:(Cheater *)cheater;
131
132 - (void)cheater:(Cheater *)cheater didChangeVariables:(unsigned)changeCount;
133 - (void)cheaterDidStopChangingVariables:(Cheater *)cheater;
134
135 - (void)cheater:(Cheater *)cheater didReportProgress:(int)progress;
136
137 - (void)cheater:(Cheater *)cheater didRevertToVariables:(TCArray)variables actualAmount:(unsigned)count;
138
139 - (void)cheaterDidUndo:(Cheater *)cheater;
140 - (void)cheaterDidRedo:(Cheater *)cheater;
141
142 - (void)cheater:(Cheater *)cheater variableAtIndex:(unsigned)index didChangeTo:(Variable *)variable;
143
144 - (void)cheater:(Cheater *)cheater didFailLastRequest:(NSString *)reason;
145 - (void)cheater:(Cheater *)cheater echo:(NSString *)message;
146
147 @end
This page took 0.038666 seconds and 5 git commands to generate.