-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathMonoClasses.h
2133 lines (2043 loc) · 67.7 KB
/
MonoClasses.h
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
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
#include <math.h>
#define CLASS_MonoBehaviour 68 //0x44
#define CLASS_MonoTransform 120 //0x80
extern wchar_t *szSkillNames[];
enum KeyCode
{
KC_None,
KC_Backspace = 8,
KC_Delete = 127,
KC_Tab = 9,
KC_Clear = 12,
KC_Return,
KC_Pause = 19,
KC_Escape = 27,
KC_Space = 32,
KC_Keypad0 = 256,
KC_Keypad1,
KC_Keypad2,
KC_Keypad3,
KC_Keypad4,
KC_Keypad5,
KC_Keypad6,
KC_Keypad7,
KC_Keypad8,
KC_Keypad9,
KC_KeypadPeriod,
KC_KeypadDivide,
KC_KeypadMultiply,
KC_KeypadMinus,
KC_KeypadPlus,
KC_KeypadEnter,
KC_KeypadEquals,
KC_UpArrow,
KC_DownArrow,
KC_RightArrow,
KC_LeftArrow,
KC_Insert,
KC_Home,
KC_End,
KC_PageUp,
KC_PageDown,
KC_F1,
KC_F2,
KC_F3,
KC_F4,
KC_F5,
KC_F6,
KC_F7,
KC_F8,
KC_F9,
KC_F10,
KC_F11,
KC_F12,
KC_F13,
KC_F14,
KC_F15,
KC_Alpha0 = 48,
KC_Alpha1,
KC_Alpha2,
KC_Alpha3,
KC_Alpha4,
KC_Alpha5,
KC_Alpha6,
KC_Alpha7,
KC_Alpha8,
KC_Alpha9,
KC_Exclaim = 33,
KC_DoubleQuote,
KC_Hash,
KC_Dollar,
KC_Percent,
KC_Ampersand,
KC_Quote,
KC_LeftParen,
KC_RightParen,
KC_Asterisk,
KC_Plus,
KC_Comma,
KC_Minus,
KC_Period,
KC_Slash,
KC_Colon = 58,
KC_Semicolon,
KC_Less,
KC_Equals,
KC_Greater,
KC_Question,
KC_At,
KC_LeftBracket = 91,
KC_Backslash,
KC_RightBracket,
KC_Caret,
KC_Underscore,
KC_BackQuote,
KC_A,
KC_B,
KC_C,
KC_D,
KC_E,
KC_F,
KC_G,
KC_H,
KC_I,
KC_J,
KC_K,
KC_L,
KC_M,
KC_N,
KC_O,
KC_P,
KC_Q,
KC_R,
KC_S,
KC_T,
KC_U,
KC_V,
KC_W,
KC_X,
KC_Y,
KC_Z,
KC_LeftCurlyBracket,
KC_Pipe,
KC_RightCurlyBracket,
KC_Tilde,
KC_Numlock = 300,
KC_CapsLock,
KC_ScrollLock,
KC_RightShift,
KC_LeftShift,
KC_RightControl,
KC_LeftControl,
KC_RightAlt,
KC_LeftAlt,
KC_LeftCommand = 310,
KC_LeftApple = 310,
KC_LeftWindows,
KC_RightCommand = 309,
KC_RightApple = 309,
KC_RightWindows = 312,
KC_AltGr,
KC_Help = 315,
KC_Print,
KC_SysReq,
KC_Break,
KC_Menu,
KC_Mouse0 = 323,
KC_Mouse1,
KC_Mouse2,
KC_Mouse3,
KC_Mouse4,
KC_Mouse5,
KC_Mouse6,
KC_Shift = (KC_RightShift | KC_LeftShift),
KC_Control = (KC_RightControl | KC_LeftControl)
};
struct CUnityKeyCodes
{
KeyCode kc;
wchar_t *KeyName;
};
extern CUnityKeyCodes unityKC[];
enum EHumanBones
{
Empty = 0,
IKController,
Mesh,
Vest_0,
Vest_1,
backpack,
backpack_0,
backpack_1,
backpack_2,
razgruz,
razgruz_0,
razgruz_1,
razgruz_2,
Root_Joint,
HumanPelvis,
HumanLThigh1,
HumanLThigh2,
HumanLCalf,
HumanLFoot,
HumanLToe,
HumanRThigh1,
HumanRThigh2,
HumanRCalf,
HumanRFoot,
HumanRToe,
Bear_Feet,
USEC_Feet,
BEAR_feet_1,
weapon_holster_pistol,
HumanSpine1,
HumanGear1,
HumanGear2,
HumanGear3,
HumanGear4,
HumanGear4_1,
HumanGear5,
HumanSpine2,
HumanSpine3,
IK_S_LForearm1,
IK_S_LForearm2,
IK_S_LForearm3,
IK_S_LPalm,
IK_S_LDigit11,
IK_S_LDigit12,
IK_S_LDigit13,
IK_S_LDigit21,
IK_S_LDigit22,
IK_S_LDigit23,
IK_S_LDigit31,
IK_S_LDigit32,
IK_S_LDigit33,
IK_S_LDigit41,
IK_S_LDigit42,
IK_S_LDigit43,
IK_S_LDigit51,
IK_S_LDigit52,
IK_S_LDigit53,
XYZ,
LCollarbone_anim,
RCollarbone_anim,
RCollarbone_anim_XYZ,
Weapon_root_3rd_anim,
Weapon_root_3rd_anim_XYZ_1,
Bend_Goal_Left,
Bend_Goal_Right,
Bend_Goal_Right_XYZ_1,
HumanRibcage,
IK_LForearm1,
IK_LForearm2,
IK_LForearm3,
IK_LPalm,
IK_LDigit11,
IK_LDigit12,
IK_LDigit13,
IK_LDigit21,
IK_LDigit22,
IK_LDigit23,
IK_LDigit31,
IK_LDigit32,
IK_LDigit33,
IK_LDigit41,
IK_LDigit42,
IK_LDigit43,
IK_LDigit51,
IK_LDigit52,
IK_LDigit53,
Camera_animated,
CameraContainer,
Cam,
HumanLCollarbone,
HumanLUpperarm,
HumanLForearm1,
HumanLForearm2,
HumanLForearm3,
HumanLPalm,
HumanLDigit11,
HumanLDigit12,
HumanLDigit13,
HumanLDigit21,
HumanLDigit22,
HumanLDigit23,
HumanLDigit31,
HumanLDigit32,
HumanLDigit33,
HumanLDigit41,
HumanLDigit42,
HumanLDigit43,
HumanLDigit51,
HumanLDigit52,
HumanLDigit53,
HumanRCollarbone,
HumanRUpperarm,
HumanRForearm1,
HumanRForearm2,
HumanRForearm3,
HumanRPalm,
HumanRDigit11,
HumanRDigit12,
HumanRDigit13,
HumanRDigit21,
HumanRDigit22,
HumanRDigit23,
HumanRDigit31,
HumanRDigit32,
HumanRDigit33,
HumanRDigit41,
HumanRDigit42,
HumanRDigit43,
HumanRDigit51,
HumanRDigit52,
HumanRDigit53,
Weapon_root,
HumanNeck,
HumanHead,
HumanBackpack,
weapon_holster,
weapon_holster1,
Camera_animated_3rd,
BONE_MAX
};
enum CEProceduralAnimationMask
{
Breathing = 1,//0x000000[0x000004]
Walking = 2,//0x000000[0x000004]
MotionReaction = 4,//0x000000[0x000004]
ForceReaction = 8,//0x000000[0x000004]
Shooting = 16,//0x000000[0x000004]
DrawDown = 32,//0x000000[0x000004]
Aiming = 64,//0x000000[0x000004]
};
enum CEDoorState : BYTE
{
DS_Locked = 1,//0x000000[0x000001]
DS_Shut = 2,//0x000000[0x000001]
DS_Open = 4,//0x000000[0x000001]
DS_Interacting = 8,//0x000000[0x000001]
DS_Breaching = 16,//0x000000[0x000001]
};
enum CESkillId : BYTE
{
Endurance = 0,//0x000000[0x000001]
Strength = 1,//0x000000[0x000001]
Vitality = 2,//0x000000[0x000001]
Health = 3,//0x000000[0x000001]
StressResistance = 4,//0x000000[0x000001]
Metabolism = 5,//0x000000[0x000001]
Immunity = 6,//0x000000[0x000001]
Perception = 7,//0x000000[0x000001]
Intellect = 8,//0x000000[0x000001]
Attention = 9,//0x000000[0x000001]
Charisma = 10,//0x000000[0x000001]
Memory = 11,//0x000000[0x000001]
MagDrills = 12,//0x000000[0x000001]
Pistol = 13,//0x000000[0x000001]
Revolver = 14,//0x000000[0x000001]
SMG = 15,//0x000000[0x000001]
Assault = 16,//0x000000[0x000001]
Shotgun = 17,//0x000000[0x000001]
Sniper = 18,//0x000000[0x000001]
LMG = 19,//0x000000[0x000001]
HMG = 20,//0x000000[0x000001]
Launcher = 21,//0x000000[0x000001]
AttachedLauncher = 22,//0x000000[0x000001]
Throwing = 23,//0x000000[0x000001]
Misc = 24,//0x000000[0x000001]
Melee = 25,//0x000000[0x000001]
DMR = 26,//0x000000[0x000001]
DrawMaster = 27,//0x000000[0x000001]
AimMaster = 28,//0x000000[0x000001]
RecoilControl = 29,//0x000000[0x000001]
TroubleShooting = 30,//0x000000[0x000001]
Sniping = 31,//0x000000[0x000001]
CovertMovement = 32,//0x000000[0x000001]
ProneMovement = 33,//0x000000[0x000001]
FirstAid = 34,//0x000000[0x000001]
FieldMedicine = 35,//0x000000[0x000001]
Surgery = 36,//0x000000[0x000001]
LightVests = 37,//0x000000[0x000001]
HeavyVests = 38,//0x000000[0x000001]
WeaponModding = 39,//0x000000[0x000001]
AdvancedModding = 40,//0x000000[0x000001]
NightOps = 41,//0x000000[0x000001]
SilentOps = 42,//0x000000[0x000001]
Lockpicking = 43,//0x000000[0x000001]
Search = 44,//0x000000[0x000001]
WeaponTreatment = 45,//0x000000[0x000001]
Freetrading = 46,//0x000000[0x000001]
Auctions = 47,//0x000000[0x000001]
Cleanoperations = 48,//0x000000[0x000001]
Barter = 49,//0x000000[0x000001]
Shadowconnections = 50,//0x000000[0x000001]
Taskperformance = 51,//0x000000[0x000001]
BearAssaultoperations = 52,//0x000000[0x000001]
BearAuthority = 53,//0x000000[0x000001]
BearAksystems = 54,//0x000000[0x000001]
BearHeavycaliber = 55,//0x000000[0x000001]
BearRawpower = 56,//0x000000[0x000001]
UsecArsystems = 57,//0x000000[0x000001]
UsecDeepweaponmodding = 58,//0x000000[0x000001]
UsecLongrangeoptics = 59,//0x000000[0x000001]
UsecNegotiations = 60,//0x000000[0x000001]
UsecTactics = 61,//0x000000[0x000001]
BotReload = 62,//0x000000[0x000001]
BotSound = 63,//0x000000[0x000001]
AimDrills = 64,//0x000000[0x000001]
HideoutManagement = 65,//0x000000[0x000001]
Crafting = 66,//0x000000[0x000001]
Skills_Max = 67
};
enum CESkillClass
{
Physical = 0,//0x000000[0x000004]
Combat = 1,//0x000000[0x000004]
Special = 2,//0x000000[0x000004]
Practical = 3,//0x000000[0x000004]
Mental = 4,//0x000000[0x000004]
};
static bool FindInCharArray(char *szClassNames, const char *szToFind)
{
char *szFoundClass = strchr(szClassNames, ',');
if (szFoundClass == 0)
return _stricmp(szClassNames, (char*)szToFind) == 0;
char *szHaystack = szClassNames;
while (1)
{
char *szNeedle = strchr(szHaystack, ',');
if (szNeedle == 0)
return (_stricmp(szHaystack, (char*)szToFind) == 0);
if (strncmp(szHaystack, (char*)szToFind, (size_t)(szNeedle - szHaystack)) == 0)
return true;
szHaystack = szNeedle + 1;
}
return false;
}
inline float Clamp(float value, float min, float max)
{
if (value < min)
value = min;
else if (value > max)
value = max;
return value;
}
inline float ClampAngle(float angle, float min, float max)
{
if (angle < -360.0f)
{
angle += 360.0f;
}
if (angle > 360.0f)
{
angle -= 360.0f;
}
return Clamp(angle, min, max);
}
inline float ClampAngle360Sensitive(float angle, float min, float max)
{
if (angle < -360.0f)
{
angle += 360.0f;
}
if (angle > 360.0f)
{
angle -= 360.0f;
}
float num = (angle > 0.0f) ? (angle - 360.0f) : (angle + 360.0f);
if (num > min && num < max)
{
return angle;
}
return Clamp(angle, min, max);
}
class FVec3;
class FVec2
{
public:
float x, y;
FVec2()
{
x = y = 0.0f;
}
FVec2(float xx, float yy)
{
x = xx;
y = yy;
}
FVec2 operator / (float v)
{
return FVec2(x / v, y / v);
}
inline FVec2 operator-(const FVec2& v)
{
FVec2 res;
res.x = x - v.x;
res.y = y - v.y;
return res;
}
inline FVec2 operator / (const FVec2& v)
{
FVec2 res;
res.x = x / v.x;
res.y = y / v.y;
return res;
}
inline FVec3 ForwardVector();
FVec2 NormalizeAngles()
{
while (x > 89.0f)
x -= 180.0f;
while (x < -89.0f)
x += 180.0f;
while (y > 180.0f)
y -= 360.0f;
while (y < -180.0f)
y += 360.0f;
return (*this);
}
};
class FVec3
{
public:
float x, y, z;
FVec3()
{
x = y = z = 0.0f;
}
FVec3(float xx, float yy, float zz)
{
x = xx;
y = yy;
z = zz;
}
FVec3 operator * (float v)
{
return FVec3(x * v, y * v, z * v);
}
inline float Dot(const float v)
{
return (x * v + y * v + z * v);
}
inline float Dot(const FVec3& v)
{
return (x * v.x + y * v.y + z * v.z); //4 1547
}
inline FVec3 operator-(const FVec3& v)
{
FVec3 res;
res.x = x - v.x;
res.y = y - v.y;
res.z = z - v.z;
return res;
}
//static float Angle(FVec3 from, FVec3 to)
//{
// float denominator = (float)sqrt(from.LengthSqt() * to.LengthSqt());
// if (denominator < kEpsilonNormalSqrt)
// return 0.0f;
// float dot = Clamp(from.Dot(to) / denominator, -1.0f, 1.0f);
// return ((float)acosf(dot)) * 57.295779513082320876798154814105f;
//}
inline float GetFOV(FVec3 &vDelta)
{
return D3DXToDegree(acosf((*this).Dot(vDelta)));
}
inline FVec3 Normalize()
{
float fMag_Inv = 1.0f / Length();
return FVec3(x * fMag_Inv, y * fMag_Inv, z *fMag_Inv);
}
inline FVec2 ToRotator()
{
FVec2 rot;
rot.y = (float)-D3DXToDegree(atan2f(y, (float)sqrtf(x * x + z * z)));
rot.x = (float)D3DXToDegree(atan2f(x, z));
if (rot.x > 180.0f)
rot.x -= 360.0f;
return rot;
}
inline float LengthSqt()
{
return (x * x + y * y + z * z);
}
float Length()
{
return sqrtf(LengthSqt());
}
};
inline FVec3 FVec2::ForwardVector()
{
float fCY = cosf(D3DXToRadian(x));
float fSY = sinf(D3DXToRadian(x));
float fCP = cosf(D3DXToRadian(y));
float fSP = sinf(D3DXToRadian(y));
FVec3 res;
res.x = fSP * fCY;
res.y = -fSY;
res.z = fCY * fCP;
return res;
};
class FVec4
{
public:
float x, y, z, w;
FVec4()
{
x = y = z = w = 0.0f;
}
FVec4(float xx, float yy, float zz, float ww)
{
x = xx;
y = yy;
z = zz;
w = ww;
}
FVec3 operator *(FVec3 point)
{
float num = x * 2.0f;
float num2 = y * 2.0f;
float num3 = z * 2.0f;
float num4 = x * num;
float num5 = y * num2;
float num6 = z * num3;
float num7 = x * num2;
float num8 = x * num3;
float num9 = y * num3;
float num10 = w * num;
float num11 = w * num2;
float num12 = w * num3;
FVec3 result;
result.x = (1.0f - (num5 + num6)) * point.x + (num7 - num12) * point.y + (num8 + num11) * point.z;
result.y = (num7 + num12) * point.x + (1.0f - (num4 + num6)) * point.y + (num9 - num10) * point.z;
result.z = (num8 - num11) * point.x + (num9 + num10) * point.y + (1.0f - (num4 + num5)) * point.z;
return result;
}
};
class CObject
{
public:
char _0x0000[0x10];
};
class CMonoTransform
{
public:
char _0x0000[0x010]; //0x0000
DWORD_PTR dwKlass; //0x0010
char _0x0018[0x20]; //0x0018
DWORD_PTR dwMain; //0x0038
public:
bool GetPosition(FVec3* vOutput);
};
template<typename T>class CUnityTArray
{
public:
char _0x0000[0x18]; //0x0000
DWORD dwSize; //0x0018
DWORD dwMaxSize; //0x001C
T lpListArray[1]; //0x0020
};
#define TARRAY_SIZE(T,xCount) sizeof(CUnityTArray<T>) + (sizeof(T) * xCount)
template<typename T, int iCounter>class CUnityTArrayCounter
{
public:
char _0x0000[0x18]; //0x0000
DWORD dwSize; //0x0018
DWORD dwMaxSize; //0x001C
T lpListArray[iCounter];//0x0020
};
template<typename T>class CUnityTList
{
public:
char _0x0000[0x10]; //0x0000
CUnityTList *lpList; //0x0010
DWORD dwSize; //0x0018
DWORD dwMaxSize; //0x001C
T lpListArray[1]; //0x0020
};
#define TLIST_SIZE(T,xCount) sizeof(CUnityTList<T>) + (sizeof(T) * xCount)
template<typename T, int iCounter>class CUnityTListCounter
{
public:
char _0x0000[0x10]; //0x0000
CUnityTList<T> *lpList; //0x0010
DWORD dwSize; //0x0018
DWORD dwMaxSize; //0x001C
T lpListArray[iCounter]; //0x0020
};
template<typename TKeys, typename TValues>class CUnityDictionaryValues
{
public:
DWORD64 m_dwArrayHash; //0x0000
TKeys m_lpKey; //0x0008
TValues m_lpValue; //0x0010
};
template<typename TKeys, typename TValues>class CUnityDictionaryList
{
public:
char _0x0000[0x20]; //0x0000
CUnityDictionaryValues<TKeys, TValues> m_Data[1]; //0x0020
};
template<typename TKeys, typename TValues>class CUnityDictionary
{
public:
char _0x0000[0x18]; //0x0000
CUnityDictionaryList<TKeys, TValues>* m_lpKeys; //0x0018
//CUnityDictionaryValues<TValues>* m_lpValues; //0x0020
char _0x0030[0x20]; //0x0028
DWORD dwSize; //0x0040
DWORD dwMax; //0x0044
char _0x0048[0x08]; //0x0048
};
struct CUnityString
{
DWORD64 dwVTable; //0x0000
DWORD64 Unknown; //0x0008
DWORD dwStringSize; //0x0010
wchar_t szString[512]; //0x0014
};
static bool operator == (CUnityString& a, CUnityString& b)
{
return (a.dwStringSize == b.dwStringSize && wcscmp(a.szString, b.szString) == 0);
}
static bool operator == (CUnityString& a, const wchar_t* b)
{
return (a.dwStringSize == wcslen(b) && wcscmp(a.szString, b) == 0);
}
class CUnityMonoType
{
public:
class CMonoClass *m_lpKlass; //0x0000
char _0x0008[0x10]; //0x0008
DWORD64 m_dwType; //0x0018
};
class CUnityBaseMonoBehaviour
{
public:
CUnityMonoType *m_lpType; //0x0000
char _0x0008[0x08]; //0x0008
};
template<typename T>class CUnityListElement
{
public:
CUnityListElement<T> *m_lpPrev;
CUnityListElement<T> *m_lpNext;
};
template<typename T>class CUnityListNode : public CUnityListElement<T>
{
public:
T *m_lpData;
};
class CUnityObject : public CUnityListNode<class CUnityObject>
{
public:
char _0x0018[0x10]; //0x0018
void *m_lpScriptingObjectPointer; //0x0028
};//Size = 0x0030
class CUnityComponent : public CUnityObject
{
public:
class CUnityGameObject *m_lpGameObject; //0x0030
};//Size = 0x0038
class CMonoClass
{
public:
char _0x0000[0x30]; //0x0000
CMonoClass *m_lpParent; //0x0030
char _0x0038[0x10]; //0x0038
const char *m_szName; //0x0048
const char *m_szNamespace; //0x0050
char _0x0058[0x48]; //0x0058
class CMethod **lpMethod; //0x00A0
char _0x00A8[0x54]; //0x00A8
DWORD m_dwNumOfMethods; //0x00FC
};
template<typename T>class CUnityPair
{
public:
int first;
char _0x0004[4];
T* second;
};
template<typename T>class CUnityDynamicArray
{
public:
CUnityPair<T> *m_lpData; //0x0000
int m_iLabel; //0x0008
char _0x000C[4]; //0x000C
DWORD m_dwSize; //0x0010
char _0x0014[4]; //0x0014
DWORD m_dwCapacity; //0x0018
char _0x001C[4]; //0x001C
FORCEINLINE BOOL ReadListData(CUnityPair<T>* lpOutput)
{
return DMADevice::MemRead(this->m_lpData, lpOutput, sizeof(CUnityPair<T>) * m_dwSize, "List");
}
CMonoTransform* GetTransform()
{
if (m_dwSize == 0 || m_dwSize >= 100 || m_lpData == 0)
return 0;
CUnityPair<CMonoTransform*> lpBuffer = {};
if (!DMADevice::MemRead(this->m_lpData, &lpBuffer, sizeof(CUnityPair<CMonoTransform*>)))
return 0;
CUnityMonoBehaviour monoBehaviour = {};
if (!DMADevice::MemRead(lpBuffer.second, &monoBehaviour, sizeof(CUnityMonoBehaviour)))
return 0;
return (CMonoTransform*)monoBehaviour.m_lpScript;
}
T* operator[](int i)
{
if (i > m_dwSize)
return 0;
CUnityPair<T> lpBuffer[64] = {};
if (!ReadListData(lpBuffer))
return 0;
return lpBuffer[i].second;
}
T* GetById(int iId)
{
if (m_dwSize == 0 || m_dwSize >= 1000 || m_lpData == 0)
return 0;
CUnityPair<T>* lpBuffer = (CUnityPair<T>*)calloc(m_dwSize, sizeof(CUnityPair<T>));
if (!lpBuffer)
return 0;
if (!ReadListData(lpBuffer))
{
free(lpBuffer);
return 0;
}
for (int i = 0; i < m_dwSize; i++)
{
if (lpBuffer[i].first == iId)
{
CUnityMonoBehaviour monoBehaviour = {};
if (!DMADevice::MemRead(lpBuffer[i].second, &monoBehaviour, sizeof(CUnityMonoBehaviour), "List"))
continue;
free(lpBuffer);
return (T*)monoBehaviour.m_lpScript;
}
}
free(lpBuffer);
return 0;
}
T* GetByName(char *szScriptName)
{
if (m_dwSize == 0 || m_dwSize >= 1000 || m_lpData == 0)
return 0;
CUnityPair<T>* lpBuffer = (CUnityPair<T>*)calloc(m_dwSize, sizeof(CUnityPair<T>));
if (!lpBuffer)
return 0;
if (!ReadListData(lpBuffer))
{
free(lpBuffer);
return 0;
}
for (int i = 0; i < m_dwSize; i++)
{
CUnityMonoBehaviour monoBehaviour = {};
if (lpBuffer[i].first != CLASS_MonoBehaviour || !lpBuffer[i].second || !DMADevice::MemRead(lpBuffer[i].second, &monoBehaviour, sizeof(CUnityMonoBehaviour)))
continue;
if (!monoBehaviour.m_lpScript || !monoBehaviour.m_lpScriptCache)
continue;
CUnityScriptCache monoScriptCache = {};
if (!DMADevice::MemRead(monoBehaviour.m_lpScriptCache, &monoScriptCache, sizeof(CUnityScriptCache)) || !monoScriptCache.klass)
continue;
char szClassName[64] = {};
CMonoClass monoKlass = {};
if (!DMADevice::MemRead(monoScriptCache.klass, &monoKlass, sizeof(CMonoClass)) || !monoKlass.m_szName || !DMADevice::MemRead(monoKlass.m_szName, szClassName, 64, false))
continue;
//printf("Name:%s\n", szClassName);
if (FindInCharArray(szScriptName, szClassName))
{
free(lpBuffer);
return (T*)monoBehaviour.m_lpScript;
}
}
free(lpBuffer);
return 0;
}
};
class CUnityScriptCache
{
public:
int refCount; //0x0000
char _0x0004[4]; //0x0004
class CMonoClass *klass; //0x0008
CUnityDynamicArray<class CUnityScriptingMethodMono> methods; //0x0010
int scriptType; //0x0030
};
class CUnityGameObject : public CUnityObject
{
public:
CUnityDynamicArray<CUnityComponent> m_aComponents; //0x0030
char _0x0050[0x10]; //0x0050
const char *m_szObjectName; //0x0060
//char _0x0068[0x10]; //0x0068
const char *GetObjectName(char *szOutput, size_t nSize = 64);
bool IsObject(char *szObjectName);
};
class CUnityMonoBehaviour
{
public:
LPCVOID lpVTable; //0x0000
char _0x0008[0x20]; //0x0008
CUnityMonoBehaviour *m_lpScript; //0x0028
CUnityGameObject *m_lpKlass; //0x0030
char _0x0038[0xB8]; //0x0038
CUnityScriptCache *m_lpScriptCache; //0x00F0
};
class CUnityMonoBehaviourScript : public CUnityBaseMonoBehaviour
{
public:
class CUnityMonoBehaviour *m_lpComponent; //0x0010
void *GetComonent(char* szName);
void *GetComonent(DWORD dwId, int *iErrorCode = 0);
CMonoTransform* GetTransform();
bool GetPosition(FVec3* lpOutput);
bool GetRotation(FVec4* lpOutput);
};
class CUnityGameObjectManager
{
public:
CUnityListElement<CUnityListNode<CUnityGameObject>> m_Tagged;
CUnityListElement<CUnityListNode<CUnityGameObject>> m_Active;
};
template<typename T>class CGClass1103 : public CUnityBaseMonoBehaviour
{
public:
char _0x0010[0x10];//0x0010
DWORD Id;//0x0020
DWORD BuffType;//0x0024
T Value;//0x0028
};
class CGClass1097 : public CUnityBaseMonoBehaviour
{
public: