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>
23 #import "CheaterTypes.h"
29 #define TC_MAX_VAR_SIZE (256)
31 @interface Variable
: NSObject
< NSCoding
>
42 // use the accessor methods unless you need fast access
43 // do not change these variables directly or things will be screwed.
45 TCIntegerSign _integerSign
;
51 // #############################################################################
52 #pragma mark Initialization
53 // #############################################################################
55 // type and sign can't be changed once variable is created.
57 - (id
)init
; // default: TCInt32
58 - (id
)initWithType
:(TCVariableType
)type
; // default: TCSigned
59 - (id
)initWithType
:(TCVariableType
)type integerSign
:(TCIntegerSign
)sign
;
61 - (void)setProcess
:(Process
*)process
;
66 // #############################################################################
68 // #############################################################################
70 - (id
)initWithCoder
:(NSCoder
*)coder
;
71 - (void)encodeWithCoder
:(NSCoder
*)coder
;
73 // #############################################################################
74 #pragma mark Accessors
75 // #############################################################################
77 - (TCVariableType
)type
;
78 - (TCIntegerSign
)integerSign
;
79 - (NSString
*)typeString
;
82 - (void)setAddress
:(TCAddress
)addr
;
83 - (NSString
*)addressString
;
84 - (BOOL
)setAddressString
:(NSString
*)string
;
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
;
92 void bigEndianValue(void *buffer
, Variable
*variable
);
94 - (unsigned)valueSize
;
98 - (void)setEnabled
:(BOOL
)enabled
;
101 - (void)setTag
:(int)tag
;