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 <Cocoa/Cocoa.h>
24 #import "CheaterTypes.h"
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
34 typedef struct _TCPacketHeader
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.
42 // network definitions
43 #define TC_NIFTY (0x44454E54)
46 @interface Cheater
: NSObject
49 BOOL _isAuthenticated
;
53 // #############################################################################
54 #pragma mark Initialization
55 // #############################################################################
57 - (id
)initWithDelegate
:(id
)delegate
;
61 - (void)setDelegate
:(id
)delegate
;
65 - (BOOL
)isAuthenticated
;
66 - (NSString
*)hostAddress
;
68 // #############################################################################
69 #pragma mark Cheating Control
70 // #############################################################################
72 // Methods with AUTH require authentication.
76 - (void)authenticateWithPassword
:(NSString
*)password
;
78 - (void)getProcessList
;
80 - (void)setTarget
:(Process
*)target
;
81 - (void)pauseTarget
; // AUTH
82 - (void)resumeTarget
; // AUTH
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
90 - (void)getMemoryDump
; // AUTH
91 - (void)cancelMemoryDump
; // AUTH
93 - (void)makeVariableChanges
:(NSArray
*)variables repeat
:(BOOL
)doRepeat interval
:(NSTimeInterval
)repeatInterval
; // AUTH
94 - (void)stopChangingVariables
; // AUTH
99 - (void)watchVariablesAtIndex
:(unsigned)index count
:(unsigned)count interval
:(NSTimeInterval
)checkInterval
; // AUTH
100 - (void)stopWatchingVariables
; // AUTH
105 // #############################################################################
106 @protocol CheaterDelegate
107 // #############################################################################
109 - (void)cheaterDidConnect
:(Cheater
*)cheater
;
110 - (void)cheaterDidDisconnect
:(Cheater
*)cheater
;
112 - (void)cheaterRequiresAuthentication
:(Cheater
*)cheater
;
113 - (void)cheaterRejectedPassword
:(Cheater
*)cheater
;
114 - (void)cheaterAcceptedPassword
:(Cheater
*)cheater
;
116 - (void)cheater
:(Cheater
*)cheater didFindProcesses
:(NSArray
*)processes
;
117 - (void)cheater
:(Cheater
*)cheater didAddProcess
:(Process
*)process
;
118 - (void)cheater
:(Cheater
*)cheater didRemoveProcess
:(Process
*)process
;
120 - (void)cheater
:(Cheater
*)cheater didSetTarget
:(Process
*)target
;
121 - (void)cheaterPausedTarget
:(Cheater
*)cheater
;
122 - (void)cheaterResumedTarget
:(Cheater
*)cheater
;
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
;
129 - (void)cheater
:(Cheater
*)cheater didDumpMemory
:(NSData
*)memoryDump
;
130 - (void)cheaterDidCancelMemoryDump
:(Cheater
*)cheater
;
132 - (void)cheater
:(Cheater
*)cheater didChangeVariables
:(unsigned)changeCount
;
133 - (void)cheaterDidStopChangingVariables
:(Cheater
*)cheater
;
135 - (void)cheater
:(Cheater
*)cheater didReportProgress
:(int)progress
;
137 - (void)cheater
:(Cheater
*)cheater didRevertToVariables
:(TCArray
)variables actualAmount
:(unsigned)count
;
139 - (void)cheaterDidUndo
:(Cheater
*)cheater
;
140 - (void)cheaterDidRedo
:(Cheater
*)cheater
;
142 - (void)cheater
:(Cheater
*)cheater variableAtIndex
:(unsigned)index didChangeTo
:(Variable
*)variable
;
144 - (void)cheater
:(Cheater
*)cheater didFailLastRequest
:(NSString
*)reason
;
145 - (void)cheater
:(Cheater
*)cheater echo
:(NSString
*)message
;