2 // **********************************************************************
3 // The Cheat - A universal game cheater for Mac OS X
4 // (C) 2003-2005 Chaz McGarvey (BrokenZipper)
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)
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.
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.
21 #import "LocalCheater.h"
24 @implementation Cheater
27 // #############################################################################
28 #pragma mark Initialization
29 // #############################################################################
31 - (id)initWithDelegate
:(id)delegate
33 if ( self = [self init
] ) {
35 [self setDelegate
:delegate
];
36 ChazLog( @
"init Cheater %p", self );
43 ChazLog( @
"dealloc Cheater %p", self );
53 - (void)setDelegate
:(id)delegate
55 // make sure the delegate is not nil and that it conforms to the CheaterDelegate
56 if ( [delegate conformsToProtocol
:@protocol(CheaterDelegate
)] ) {
70 - (BOOL)isAuthenticated
72 return _isAuthenticated
;
75 - (NSString
*)hostAddress
81 // #############################################################################
82 #pragma mark Cheating Control
83 // #############################################################################
87 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
88 NSStringFromClass(isa
),
89 NSStringFromSelector(_cmd
)];
94 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
95 NSStringFromClass(isa
),
96 NSStringFromSelector(_cmd
)];
99 - (void)authenticateWithPassword
:(NSString
*)password
101 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
102 NSStringFromClass(isa
),
103 NSStringFromSelector(_cmd
)];
107 - (void)getProcessList
109 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
110 NSStringFromClass(isa
),
111 NSStringFromSelector(_cmd
)];
115 - (void)setTarget
:(Process
*)target
117 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
118 NSStringFromClass(isa
),
119 NSStringFromSelector(_cmd
)];
124 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
125 NSStringFromClass(isa
),
126 NSStringFromSelector(_cmd
)];
131 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
132 NSStringFromClass(isa
),
133 NSStringFromSelector(_cmd
)];
137 - (void)limitReturnedResults
:(unsigned)limit
139 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
140 NSStringFromClass(isa
),
141 NSStringFromSelector(_cmd
)];
144 - (void)searchForVariable
:(Variable
*)data comparison
:(TCSearchOperator
)op
146 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
147 NSStringFromClass(isa
),
148 NSStringFromSelector(_cmd
)];
151 - (void)searchLastValuesComparison
:(TCSearchOperator
)op
153 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
154 NSStringFromClass(isa
),
155 NSStringFromSelector(_cmd
)];
160 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
161 NSStringFromClass(isa
),
162 NSStringFromSelector(_cmd
)];
167 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
168 NSStringFromClass(isa
),
169 NSStringFromSelector(_cmd
)];
172 - (void)getMemoryDump
174 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
175 NSStringFromClass(isa
),
176 NSStringFromSelector(_cmd
)];
179 - (void)cancelMemoryDump
181 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
182 NSStringFromClass(isa
),
183 NSStringFromSelector(_cmd
)];
187 - (void)makeVariableChanges
:(NSArray
*)variables repeat
:(BOOL)doRepeat interval
:(NSTimeInterval
)repeatInterval
189 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
190 NSStringFromClass(isa
),
191 NSStringFromSelector(_cmd
)];
194 - (void)stopChangingVariables
196 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
197 NSStringFromClass(isa
),
198 NSStringFromSelector(_cmd
)];
204 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
205 NSStringFromClass(isa
),
206 NSStringFromSelector(_cmd
)];
211 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
212 NSStringFromClass(isa
),
213 NSStringFromSelector(_cmd
)];
217 - (void)watchVariablesAtIndex
:(unsigned)index count
:(unsigned)count interval
:(NSTimeInterval
)checkInterval
219 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
220 NSStringFromClass(isa
),
221 NSStringFromSelector(_cmd
)];
224 - (void)stopWatchingVariables
226 [NSException raise
:@
"TCNotImplemented" format
:@
"The subclass of Cheater (%@) needs to implement selector %@.",
227 NSStringFromClass(isa
),
228 NSStringFromSelector(_cmd
)];