1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
|
#pragma once
/*
This file has been generated by IDA.
It contains local type definitions from
the type library 'server.dll'
*/
struct HSquirrelVM;
struct CallInfo;
struct SQTable;
struct SQString;
struct SQFunctionProto;
struct SQClosure;
struct SQSharedState;
struct StringTable;
struct SQStructInstance;
struct SQStructDef;
struct SQNativeClosure;
struct SQArray;
struct tableNode;
struct SQUserData;
struct CSquirrelVM;
typedef void (*releasehookType)(void* val, int size);
// stolen from ttf2sdk: sqvm types
typedef float SQFloat;
typedef long SQInteger;
typedef unsigned long SQUnsignedInteger;
typedef char SQChar;
typedef SQUnsignedInteger SQBool;
/* 127 */
enum SQObjectType : int
{
_RT_NULL = 0x1,
_RT_INTEGER = 0x2,
_RT_FLOAT = 0x4,
_RT_BOOL = 0x8,
_RT_STRING = 0x10,
_RT_TABLE = 0x20,
_RT_ARRAY = 0x40,
_RT_USERDATA = 0x80,
_RT_CLOSURE = 0x100,
_RT_NATIVECLOSURE = 0x200,
_RT_GENERATOR = 0x400,
OT_USERPOINTER = 0x800,
_RT_USERPOINTER = 0x800,
_RT_THREAD = 0x1000,
_RT_FUNCPROTO = 0x2000,
_RT_CLASS = 0x4000,
_RT_INSTANCE = 0x8000,
_RT_WEAKREF = 0x10000,
OT_VECTOR = 0x40000,
SQOBJECT_CANBEFALSE = 0x1000000,
OT_NULL = 0x1000001,
OT_BOOL = 0x1000008,
SQOBJECT_DELEGABLE = 0x2000000,
SQOBJECT_NUMERIC = 0x4000000,
OT_INTEGER = 0x5000002,
OT_FLOAT = 0x5000004,
SQOBJECT_REF_COUNTED = 0x8000000,
OT_STRING = 0x8000010,
OT_ARRAY = 0x8000040,
OT_CLOSURE = 0x8000100,
OT_NATIVECLOSURE = 0x8000200,
OT_ASSET = 0x8000400,
OT_THREAD = 0x8001000,
OT_FUNCPROTO = 0x8002000,
OT_CLAAS = 0x8004000,
OT_STRUCT = 0x8200000,
OT_WEAKREF = 0x8010000,
OT_TABLE = 0xA000020,
OT_USERDATA = 0xA000080,
OT_INSTANCE = 0xA008000,
OT_ENTITY = 0xA400000,
};
/* 156 */
union SQObjectValue
{
SQString* asString;
SQTable* asTable;
SQClosure* asClosure;
SQFunctionProto* asFuncProto;
SQStructDef* asStructDef;
long long as64Integer;
SQNativeClosure* asNativeClosure;
SQArray* asArray;
HSquirrelVM* asThread;
float asFloat;
int asInteger;
SQUserData* asUserdata;
SQStructInstance* asStructInstance;
};
/* 160 */
struct SQVector
{
SQObjectType _Type;
float x;
float y;
float z;
};
/* 128 */
struct SQObject
{
SQObjectType _Type;
int structNumber;
SQObjectValue _VAL;
};
/* 138 */
struct alignas(8) SQString
{
void* vftable;
int uiRef;
int padding;
SQString* _next_maybe;
SQSharedState* sharedState;
int length;
unsigned char gap_24[4];
char _hash[8];
char _val[1];
};
/* 137 */
struct alignas(8) SQTable
{
void* vftable;
unsigned char gap_08[4];
int uiRef;
unsigned char gap_10[8];
void* pointer_18;
void* pointer_20;
void* _sharedState;
long long field_30;
tableNode* _nodes;
int _numOfNodes;
int size;
int field_48;
int _usedNodes;
unsigned char _gap_50[20];
int field_64;
unsigned char _gap_68[80];
};
/* 140 */
struct alignas(8) SQClosure
{
void* vftable;
unsigned char gap_08[4];
int uiRef;
void* pointer_10;
void* pointer_18;
void* pointer_20;
void* sharedState;
SQObject obj_30;
SQObject _function;
SQObject* _outervalues;
unsigned char gap_58[8];
unsigned char gap_60[96];
SQObject* objectPointer_C0;
unsigned char gap_C8[16];
};
/* 139 */
struct alignas(8) SQFunctionProto
{
void* vftable;
unsigned char gap_08[4];
int uiRef;
unsigned char gap_10[8];
void* pointer_18;
void* pointer_20;
void* sharedState;
void* pointer_30;
SQObjectType _fileNameType;
SQString* _fileName;
SQObjectType _funcNameType;
SQString* _funcName;
SQObject obj_58;
unsigned char gap_68[12];
int _stacksize;
unsigned char gap_78[48];
int nParameters;
unsigned char gap_AC[60];
int nDefaultParams;
unsigned char gap_EC[200];
};
/* 152 */
struct SQStructDef
{
void* vtable;
int uiRef;
unsigned char padding_C[4];
unsigned char unknown[24];
SQSharedState* sharedState;
SQObjectType _nameType;
SQString* _name;
unsigned char gap_38[16];
SQObjectType _variableNamesType;
SQTable* _variableNames;
unsigned char gap_[32];
};
/* 157 */
struct alignas(8) SQNativeClosure
{
void* vftable;
int uiRef;
unsigned char gap_C[4];
long long value_10;
long long value_18;
long long value_20;
SQSharedState* sharedState;
char unknown_30;
unsigned char padding_34[7];
long long value_38;
long long value_40;
long long value_48;
long long value_50;
long long value_58;
SQObjectType _nameType;
SQString* _name;
long long value_70;
long long value_78;
unsigned char justInCaseGap_80[300];
};
/* 162 */
struct SQArray
{
void* vftable;
int uiRef;
unsigned char gap_24[36];
SQObject* _values;
int _usedSlots;
int _allocated;
};
/* 129 */
struct alignas(8) HSquirrelVM
{
void* vftable;
int uiRef;
unsigned char gap_8[12];
void* _toString;
void* _roottable_pointer;
void* pointer_28;
CallInfo* ci;
CallInfo* _callstack;
int _callstacksize;
int _stackbase;
SQObject* _stackOfCurrentFunction;
SQSharedState* sharedState;
void* pointer_58;
void* pointer_60;
int _top;
SQObject* _stack;
unsigned char gap_78[8];
SQObject* _vargvstack;
unsigned char gap_88[8];
SQObject temp_reg;
unsigned char gapA0[8];
void* pointer_A8;
unsigned char gap_B0[8];
SQObject _roottable_object;
SQObject _lasterror;
SQObject _errorHandler;
long long field_E8;
int traps;
unsigned char gap_F4[12];
int _nnativecalls;
int _suspended;
int _suspended_root;
int _unk;
int _suspended_target;
int trapAmount;
int _suspend_varargs;
int unknown_field_11C;
SQObject object_120;
};
/* 150 */
struct SQStructInstance
{
void* vftable;
__int32 uiRef;
BYTE gap_C[4];
__int64 unknown_10;
void* pointer_18;
__int64 unknown_20;
SQSharedState* _sharedState;
unsigned int size;
BYTE gap_34[4];
SQObject data[1]; // This struct is dynamically sized, so this size is unknown
};
/* 148 */
struct SQSharedState
{
unsigned char gap_0[72];
void* unknown;
unsigned char gap_50[16344];
SQObjectType _unknownTableType00;
long long _unknownTableValue00;
unsigned char gap_4038[16];
StringTable* _stringTable;
unsigned char gap_4050[32];
SQObjectType _unknownTableType0;
long long _unknownTableValue0;
SQObjectType _unknownObjectType1;
long long _unknownObjectValue1;
unsigned char gap_4090[8];
SQObjectType _unknownArrayType2;
long long _unknownArrayValue2;
SQObjectType _gobalsArrayType;
SQStructInstance* _globalsArray;
unsigned char gap_40B8[16];
SQObjectType _nativeClosuresType;
SQTable* _nativeClosures;
SQObjectType _typedConstantsType;
SQTable* _typedConstants;
SQObjectType _untypedConstantsType;
SQTable* _untypedConstants;
SQObjectType _globalsMaybeType;
SQTable* _globals;
SQObjectType _functionsType;
SQTable* _functions;
SQObjectType _structsType;
SQTable* _structs;
SQObjectType _typeDefsType;
SQTable* _typeDefs;
SQObjectType unknownTableType;
SQTable* unknownTable;
SQObjectType _squirrelFilesType;
SQTable* _squirrelFiles;
unsigned char gap_4158[80];
SQObjectType _nativeClosures2Type;
SQTable* _nativeClosures2;
SQObjectType _entityTypesMaybeType;
SQTable* _entityTypesMaybe;
SQObjectType unknownTable2Type;
SQTable* unknownTable2;
unsigned char gap_41D8[72];
SQObjectType _compilerKeywordsType;
SQTable* _compilerKeywords;
HSquirrelVM* _currentThreadMaybe;
unsigned char gap_4238[8];
SQObjectType unknownTable3Type;
SQTable* unknownTable3;
unsigned char gap_4250[16];
SQObjectType unknownThreadType;
SQTable* unknownThread;
SQObjectType _tableNativeFunctionsType;
SQTable* _tableNativeFunctions;
SQObjectType _unknownTableType4;
long long _unknownObjectValue4;
SQObjectType _unknownObjectType5;
long long _unknownObjectValue5;
SQObjectType _unknownObjectType6;
long long _unknownObjectValue6;
SQObjectType _unknownObjectType7;
long long _unknownObjectValue7;
SQObjectType _unknownObjectType8;
long long _unknownObjectValue8;
SQObjectType _unknownObjectType9;
long long _unknownObjectValue9;
SQObjectType _unknownObjectType10;
long long _unknownObjectValue10;
SQObjectType _unknownObjectType11;
long long _unknownObjectValue11;
SQObjectType _unknownObjectType12;
long long _unknownObjectValue12;
SQObjectType _unknownObjectType13;
long long _unknownObjectValue13;
SQObjectType _unknownObjectType14;
long long _unknownObjectValue14;
SQObjectType _unknownObjectType15;
long long _unknownObjectValue15;
unsigned char gap_4340[16];
void* printFunction;
unsigned char gap_4358[16];
void* logEntityFunction;
unsigned char gap_4370[40];
SQObjectType _waitStringType;
SQString* _waitStringValue;
SQObjectType _SpinOffAndWaitForStringType;
SQString* _SpinOffAndWaitForStringValue;
SQObjectType _SpinOffAndWaitForSoloStringType;
SQString* _SpinOffAndWaitForSoloStringValue;
SQObjectType _SpinOffStringType;
SQString* _SpinOffStringValue;
SQObjectType _SpinOffDelayedStringType;
SQString* _SpinOffDelayedStringValue;
CSquirrelVM* cSquirrelVM;
bool enableDebugInfo; // functionality stripped
unsigned char gap_43F1[23];
};
/* 165 */
struct tableNode
{
SQObject val;
SQObject key;
tableNode* next;
};
/* 136 */
struct alignas(8) CallInfo
{
long long ip;
SQObject* _literals;
SQObject obj10;
SQObject closure;
int _etraps[4];
int _root;
short _vargs_size;
short _vargs_base;
unsigned char gap[16];
};
/* 149 */
struct StringTable
{
unsigned char gap_0[12];
int _numofslots;
unsigned char gap_10[200];
};
/* 141 */
struct alignas(8) SQStackInfos
{
char* _name;
char* _sourceName;
int _line;
};
/* 151 */
struct alignas(4) SQInstruction
{
int op;
int arg1;
int output;
short arg2;
short arg3;
};
/* 154 */
struct SQLexer
{
unsigned char gap_0[112];
};
/* 153 */
struct SQCompiler
{
unsigned char gap_0[4];
int _token;
unsigned char gap_8[8];
SQObject object_10;
SQLexer lexer;
unsigned char gap_90[752];
HSquirrelVM* sqvm;
unsigned char gap_288[8];
};
/* 155 */
struct CSquirrelVM
{
BYTE gap_0[8];
HSquirrelVM* sqvm;
BYTE gap_10[8];
SQObject unknownObject_18;
__int64 unknown_28;
BYTE gap_30[12];
__int32 vmContext;
BYTE gap_40[648];
char* (*formatString)(__int64 a1, const char* format, ...);
BYTE gap_2D0[24];
};
struct SQUserData
{
void* vftable;
int uiRef;
char gap_12[4];
long long unknown_10;
long long unknown_18;
long long unknown_20;
long long sharedState;
long long unknown_30;
int size;
char padding1[4];
releasehookType releaseHook;
long long typeId;
char data[1];
};
|