]> Dogcows Code - chaz/thecheat/blob - Variable.h
The Cheat 1.2.4
[chaz/thecheat] / Variable.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
23 #import "CheaterTypes.h"
24 #import "Process.h"
25
26 #include <string.h>
27
28
29 #define TC_MAX_VAR_SIZE (256)
30
31 @interface Variable : NSObject < NSCoding >
32 {
33 TCAddress _address;
34 BOOL _isValueValid;
35 BOOL _enabled;
36
37 int _tag;
38
39 Process *process;
40
41 @public;
42 // use the accessor methods unless you need fast access
43 // do not change these variables directly or things will be screwed.
44 TCVariableType _type;
45 TCIntegerSign _integerSign;
46 unsigned _size;
47 void *_value;
48 BOOL _isEmulated;
49 }
50
51 // #############################################################################
52 #pragma mark Initialization
53 // #############################################################################
54
55 // type and sign can't be changed once variable is created.
56
57 - (id)init; // default: TCInt32
58 - (id)initWithType:(TCVariableType)type; // default: TCSigned
59 - (id)initWithType:(TCVariableType)type integerSign:(TCIntegerSign)sign;
60
61 - (void)setProcess:(Process *)process;
62 - (Process *)process;
63
64 - (BOOL)isEmulated;
65
66 // #############################################################################
67 #pragma mark NSCoding
68 // #############################################################################
69
70 - (id)initWithCoder:(NSCoder *)coder;
71 - (void)encodeWithCoder:(NSCoder *)coder;
72
73 // #############################################################################
74 #pragma mark Accessors
75 // #############################################################################
76
77 - (TCVariableType)type;
78 - (TCIntegerSign)integerSign;
79 - (NSString *)typeString;
80
81 - (TCAddress)address;
82 - (void)setAddress:(TCAddress)addr;
83 - (NSString *)addressString;
84 - (BOOL)setAddressString:(NSString *)string;
85
86 - (void const *)value;
87 - (void)setValue:(void const *)value;
88 - (void)setValue:(void const *)value size:(unsigned)size;
89 - (NSString *)stringValue;
90 - (BOOL)setStringValue:(NSString *)value;
91
92 void bigEndianValue(void *buffer, Variable *variable);
93
94 - (unsigned)valueSize;
95 - (BOOL)isValueValid;
96
97 - (BOOL)isEnabled;
98 - (void)setEnabled:(BOOL)enabled;
99
100 - (int)tag;
101 - (void)setTag:(int)tag;
102
103 @end
This page took 0.035249 seconds and 4 git commands to generate.