3 * The Cheat - The legendary universal game trainer for Mac OS X.
4 * http://www.dogcows.com/chaz/wiki/TheCheat
6 * Copyright (c) 2003-2010, Charles McGarvey et al.
8 * Distributable under the terms and conditions of the 2-clause BSD
9 * license; see the file COPYING for the legal text of the license.
12 #import <Cocoa/Cocoa.h>
15 #import "CheaterTypes.h"
21 // The network protocol The Cheat uses is way simple. the header is
22 // a fixed size: 24 bytes. Immediately following the header is the
25 typedef struct _TCPacketHeader
27 unsigned nifty
; // always the same: 'DENT' or 0x44454E54.
28 unsigned size
; // the size of the packet (excluding this header).
29 char name
[16]; // NULL-terminated string describing the packet.
33 // network definitions
34 #define TC_NIFTY (0x44454E54)
37 @interface Cheater
: NSObject
40 BOOL _isAuthenticated
;
44 // #############################################################################
45 #pragma mark Initialization
46 // #############################################################################
48 - (id
)initWithDelegate
:(id
)delegate
;
52 - (void)setDelegate
:(id
)delegate
;
56 - (BOOL
)isAuthenticated
;
57 - (NSString
*)hostAddress
;
59 // #############################################################################
60 #pragma mark Cheating Control
61 // #############################################################################
63 // Methods with AUTH require authentication.
67 - (void)authenticateWithPassword
:(NSString
*)password
;
69 - (void)getProcessList
;
71 - (void)setTarget
:(Process
*)target
;
72 - (void)pauseTarget
; // AUTH
73 - (void)resumeTarget
; // AUTH
75 - (void)limitReturnedResults
:(unsigned)limit
;
76 - (void)searchForVariable
:(Variable
*)var comparison
:(TCSearchOperator
)op
; // AUTH
77 - (void)searchLastValuesComparison
:(TCSearchOperator
)op
; // AUTH
78 - (void)cancelSearch
; // AUTH
79 - (void)clearSearch
; // AUTH
81 - (void)getMemoryDump
; // AUTH
82 - (void)cancelMemoryDump
; // AUTH
84 - (void)makeVariableChanges
:(NSArray
*)variables repeat
:(BOOL
)doRepeat interval
:(NSTimeInterval
)repeatInterval
; // AUTH
85 - (void)stopChangingVariables
; // AUTH
90 - (void)watchVariablesAtIndex
:(unsigned)index count
:(unsigned)count interval
:(NSTimeInterval
)checkInterval
; // AUTH
91 - (void)stopWatchingVariables
; // AUTH
96 // #############################################################################
97 @protocol CheaterDelegate
98 // #############################################################################
100 - (void)cheaterDidConnect
:(Cheater
*)cheater
;
101 - (void)cheaterDidDisconnect
:(Cheater
*)cheater
;
103 - (void)cheaterRequiresAuthentication
:(Cheater
*)cheater
;
104 - (void)cheaterRejectedPassword
:(Cheater
*)cheater
;
105 - (void)cheaterAcceptedPassword
:(Cheater
*)cheater
;
107 - (void)cheater
:(Cheater
*)cheater didFindProcesses
:(NSArray
*)processes
;
108 - (void)cheater
:(Cheater
*)cheater didAddProcess
:(Process
*)process
;
109 - (void)cheater
:(Cheater
*)cheater didRemoveProcess
:(Process
*)process
;
111 - (void)cheater
:(Cheater
*)cheater didSetTarget
:(Process
*)target
;
112 - (void)cheaterPausedTarget
:(Cheater
*)cheater
;
113 - (void)cheaterResumedTarget
:(Cheater
*)cheater
;
115 - (void)cheater
:(Cheater
*)cheater didFindVariables
:(TCArray
)variables actualAmount
:(unsigned)count
;
116 - (void)cheater
:(Cheater
*)cheater didFindValues
:(TCArray
)values
;
117 - (void)cheaterDidCancelSearch
:(Cheater
*)cheater
;
118 - (void)cheaterDidClearSearch
:(Cheater
*)cheater
;
120 - (void)cheater
:(Cheater
*)cheater didDumpMemory
:(NSData
*)memoryDump
;
121 - (void)cheaterDidCancelMemoryDump
:(Cheater
*)cheater
;
123 - (void)cheater
:(Cheater
*)cheater didChangeVariables
:(unsigned)changeCount
;
124 - (void)cheaterDidStopChangingVariables
:(Cheater
*)cheater
;
126 - (void)cheater
:(Cheater
*)cheater didReportProgress
:(int)progress
;
128 - (void)cheater
:(Cheater
*)cheater didRevertToVariables
:(TCArray
)variables actualAmount
:(unsigned)count
;
130 - (void)cheaterDidUndo
:(Cheater
*)cheater
;
131 - (void)cheaterDidRedo
:(Cheater
*)cheater
;
133 - (void)cheater
:(Cheater
*)cheater variableAtIndex
:(unsigned)index didChangeTo
:(Variable
*)variable
;
135 - (void)cheater
:(Cheater
*)cheater didFailLastRequest
:(NSString
*)reason
;
136 - (void)cheater
:(Cheater
*)cheater echo
:(NSString
*)message
;