]> Dogcows Code - chaz/thecheat/blob - Cheater.h
update contact information and project URL
[chaz/thecheat] / Cheater.h
1
2 /*
3 * The Cheat - The legendary universal game trainer for Mac OS X.
4 * http://www.brokenzipper.com/trac/wiki/TheCheat
5 *
6 * Copyright (c) 2003-2011, Charles McGarvey et al.
7 *
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.
10 */
11
12 #import <Cocoa/Cocoa.h>
13 #import "ChazLog.h"
14
15 #import "CheaterTypes.h"
16
17 #import "Process.h"
18 #import "Variable.h"
19
20
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
23 // packet data.
24
25 typedef struct _TCPacketHeader
26 {
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.
30 } TCPacketHeader;
31
32
33 // network definitions
34 #define TC_NIFTY (0x44454E54)
35
36
37 @interface Cheater : NSObject
38 {
39 BOOL _isConnected;
40 BOOL _isAuthenticated;
41 id _delegate;
42 }
43
44 // #############################################################################
45 #pragma mark Initialization
46 // #############################################################################
47
48 - (id)initWithDelegate:(id)delegate;
49
50 // delegation
51 - (id)delegate;
52 - (void)setDelegate:(id)delegate;
53
54 // accessors
55 - (BOOL)isConnected;
56 - (BOOL)isAuthenticated;
57 - (NSString *)hostAddress;
58
59 // #############################################################################
60 #pragma mark Cheating Control
61 // #############################################################################
62
63 // Methods with AUTH require authentication.
64
65 - (void)connect;
66 - (void)disconnect;
67 - (void)authenticateWithPassword:(NSString *)password;
68
69 - (void)getProcessList;
70
71 - (void)setTarget:(Process *)target;
72 - (void)pauseTarget; // AUTH
73 - (void)resumeTarget; // AUTH
74
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
80
81 - (void)getMemoryDump; // AUTH
82 - (void)cancelMemoryDump; // AUTH
83
84 - (void)makeVariableChanges:(NSArray *)variables repeat:(BOOL)doRepeat interval:(NSTimeInterval)repeatInterval; // AUTH
85 - (void)stopChangingVariables; // AUTH
86
87 - (void)undo; // AUTH
88 - (void)redo; // AUTH
89
90 - (void)watchVariablesAtIndex:(unsigned)index count:(unsigned)count interval:(NSTimeInterval)checkInterval; // AUTH
91 - (void)stopWatchingVariables; // AUTH
92
93 @end
94
95
96 // #############################################################################
97 @protocol CheaterDelegate
98 // #############################################################################
99
100 - (void)cheaterDidConnect:(Cheater *)cheater;
101 - (void)cheaterDidDisconnect:(Cheater *)cheater;
102
103 - (void)cheaterRequiresAuthentication:(Cheater *)cheater;
104 - (void)cheaterRejectedPassword:(Cheater *)cheater;
105 - (void)cheaterAcceptedPassword:(Cheater *)cheater;
106
107 - (void)cheater:(Cheater *)cheater didFindProcesses:(NSArray *)processes;
108 - (void)cheater:(Cheater *)cheater didAddProcess:(Process *)process;
109 - (void)cheater:(Cheater *)cheater didRemoveProcess:(Process *)process;
110
111 - (void)cheater:(Cheater *)cheater didSetTarget:(Process *)target;
112 - (void)cheaterPausedTarget:(Cheater *)cheater;
113 - (void)cheaterResumedTarget:(Cheater *)cheater;
114
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;
119
120 - (void)cheater:(Cheater *)cheater didDumpMemory:(NSData *)memoryDump;
121 - (void)cheaterDidCancelMemoryDump:(Cheater *)cheater;
122
123 - (void)cheater:(Cheater *)cheater didChangeVariables:(unsigned)changeCount;
124 - (void)cheaterDidStopChangingVariables:(Cheater *)cheater;
125
126 - (void)cheater:(Cheater *)cheater didReportProgress:(int)progress;
127
128 - (void)cheater:(Cheater *)cheater didRevertToVariables:(TCArray)variables actualAmount:(unsigned)count;
129
130 - (void)cheaterDidUndo:(Cheater *)cheater;
131 - (void)cheaterDidRedo:(Cheater *)cheater;
132
133 - (void)cheater:(Cheater *)cheater variableAtIndex:(unsigned)index didChangeTo:(Variable *)variable;
134
135 - (void)cheater:(Cheater *)cheater didFailLastRequest:(NSString *)reason;
136 - (void)cheater:(Cheater *)cheater echo:(NSString *)message;
137
138 @end
This page took 0.03955 seconds and 4 git commands to generate.