-
Notifications
You must be signed in to change notification settings - Fork 1
/
ReversedStructsDenuvo.h
3993 lines (3622 loc) · 98.3 KB
/
ReversedStructsDenuvo.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
#ifndef __REVERSEDSTRUCTSDENUVO_H__
#define __REVERSEDSTRUCTSDENUVO_H__
#include <d3d11.h>
#include <dinput.h>
#include "SteamApi.h"
#include "Math.h"
#define PURE = 0
#define SAVE_FLAGS_READ_SLOTS 0x00000001
#define SAVE_FLAGS_READ 0x00000002
#define SAVE_FLAGS_WRITE 0x00000003
#define SAVE_FLAGS_DELETE 0x00000004
#define SAVE_SYSTEMDATA -2
#define SAVE_GAMEDATA -1
#define SAVE_SLOT0DATA 0
#define SAVE_SLOT1DATA 1
#define SAVE_SLOT2DATA 2
#define FLAGS_FREE 1
#define FILTER_UI_NOISE_MAX 0x20000
#define FILTER_UI_NOISE_LV3 0x1000000
#define FILTER_UI_NOISE_LV2 0x2000000
#define FILTER_UI_NOISE_LV1 0x4000000
#define FILTER_UI_NOISE_LV0 0x8000000
#define FILTER_2B_DIE_LV0 FILTER_UI_NOISE_LV0
#define FILTER_2B_DIE_LV1 FILTER_UI_NOISE_LV1
#define FILTER_2B_DIE_LV2 (FILTER_UI_NOISE_LV2 | 0x400)
#define FILTER_2B_DIE_LV3 (FILTER_UI_NOISE_LV3 | 0x400)
#define FILTER_2B_DIE_CLEAR // 0xF07DFFFF
#define DATAFILE_DATA 0
#define DATAFILE_MODEL 1
#define _MM_RSHUFFLE(mask, x, y, z, w) \
(x) = ((mask & 0xC) >> 2); \
(y) = ((mask & 0x30) >> 4); \
(z) = ((mask & 0xC0) >> 6); \
(w) = (mask & 0x3)
#define IS_SAVE_SLOTDATA(s) ((s) > -1 && (s) < 3)
// visual studio says correct offsets are wrong before compalation on interfaces rifk
#define VALIDATE_OFFSET(s, m, offset) static_assert(offsetof(s, m) == (offset),#s"::"#m" is not at "#offset)
#define VALIDATE_SIZE(s, size) static_assert(sizeof(s) == (size), #s" is not of size "#size)
#define ALIGN(size, align) (((size) + (align) - 1) & ~(align))
#define ENTITY_REAL_VTABLE
// used inthe update func
#define MODELSHADERMODULE_DONT_UPDATE 0x00080002
#define MAX_MATERIAL_TEXTURES 16
// defines for bone ids
#define BONE_ROOT 4094
#define BONE_ROOT_CHILD 4095
#define BONE_SPINE0 0
#define BONE_SPINE1 1
#define BONE_SPINE2 2
#define BONE_SPINE3 3
#define BONE_NECK 4
#define BONE_HEAD 5
#define BONE_R_SHOULDER 6
#define BONE_R_ARM 7
#define BONE_R_FOREARM 8
#define BONE_R_WRIST 9
#define BONE_L_SHOULDER 10
#define BONE_L_ARM 11
#define BONE_L_FOREARM 12
#define BONE_L_WRIST 13
#define BONE_HIP 14
#define BONE_R_UPPERLEG 15
#define BONE_R_LEG 16
#define BONE_R_ANKLE 17
#define BONE_R_TOES 18
#define BONE_L_UPPERLEG 19
#define BONE_L_LEG 20
#define BONE_L_ANKLE 21
#define BONE_L_TOES 22
#define BONE_BOOBS 3136
#define BIG_ENDIAN
typedef ULONGLONG QWORD;
//
// EntityHandles are 32 bit values laid out as follows:
//
// SSSSSSSS IIIIIIIIIIIIIIII RRRRRRRR
// +-------------------------+--------+
// | Shift | Index | |
// +--------+----------------+--------+
//
// where
//
// S - Shift - 8 bit shift value (unknown use)
//
// I - Index - 16 unsigned value
// Index into the CEntiyList::m_pItems
//
// R - reserved bits of the handle
//
typedef unsigned long EntityHandle;
enum TypeId {};
class Pl0000;
/*
Nier Automata's lib::Array<T>
*/
template<typename T>
class Array
{
public:
virtual Array<T>* Clear(BYTE flags);
virtual QWORD GetSize();
virtual bool GetItem(OUT T* pItem);
virtual T* Find(IN T* pSearchItem, OUT T* pFound);
T* m_pItems; //0x0008
QWORD m_count; //0x0010
QWORD m_size; //0x0018
};
/*
Nier Automata's lib::StaticArray<T, size, element_size>
*/
template<typename T, size_t size, size_t element_size = sizeof(T)>
class StaticArray : public Array<T>
{
public:
T m_items[size]; //0x0020
};
/*
Nier Automata's lib::AllocatedArray<T>
*/
template<typename T>
class AllocatedArray
{
public:
T* m_pItems; //0x0008
QWORD m_count; //0x0010
QWORD m_size; //0x0018
};
/*
Used to convert from object id to object name
Can be also used to convert from object name to object id
*/
struct ObjectIdConvert
{
int m_ObjectIdBase;
const char* m_szPrefix;
};
/*
Nier Automata's BannedWord::cChecker
*/
class BannedWordChecker
{
public:
struct BannedWordBinaryHeader
{
DWORD uWordCount;
};
struct WordEntry
{
DWORD dwLength;
LPWSTR lpszBannedWord;
};
virtual void* function0(BYTE flags);
void* m_pBuffer;
QWORD m_qwBufferSize;
WordEntry* m_pEntries;
DWORD m_uWordCount;
};
struct Sound
{
const char* m_szName;
DWORD m_dwFNV1Hash;
DWORD m_Flags; //probably a bitflag - (values I've seen, 0x05000000, 0x7000000, 0x00000000, 0x800000 [mute probably])
};
struct ItemHashEntry
{
int GroupID;
int Idx;
DWORD Crc32;
};
struct SoundEmitter
{
Pl0000* m_pEntity; // this is some lower interface like behaviour
int m_iBoneId;
};
class CUnknown_t
{
DWORD id; //0x0000 idk?
char aligment[4]; //0x0004
void* punk; //0x0008
void* punk2; //0x0010
void* pFunction; //0x0018
};
struct Unknown_t;
struct DatafileDesc
{
void* pDatafiles[2]; //0x00
char pad[8];
int m_ObjectId2;
int m_ObjectId;
char m_szObjectName2[16];
char m_szObjectName[16]; //0x30
};
struct DATHeader
{
union {
char Signature[4]; //0x00
DWORD dwMagic; //0x00
};
DWORD dwFileCount; //0x04
DWORD dwFileTableOffset;//0x08
DWORD dwExtensionOffset;//0x0C
DWORD dwNameTableOffset;//0x10
DWORD dwSizeTableOffset;
DWORD dwUnknownOffset;
DWORD dwNull;
};
// Size of structiure is 0x30 (48) bytes
struct CReadWriteLock
{
CRITICAL_SECTION m_CriticalSection;
BOOL m_bCriticalSectionInitialized;
CReadWriteLock()
{
InitializeCriticalSection(&m_CriticalSection);
m_bCriticalSectionInitialized = TRUE;
}
CReadWriteLock(DWORD dwSpinCount)
{
InitializeCriticalSectionAndSpinCount(&m_CriticalSection, dwSpinCount);
m_bCriticalSectionInitialized = TRUE;
}
~CReadWriteLock()
{
DeleteCriticalSection(&m_CriticalSection);
m_bCriticalSectionInitialized = FALSE;
}
bool Lock(void)
{
if (m_bCriticalSectionInitialized)
EnterCriticalSection(&m_CriticalSection);
return m_bCriticalSectionInitialized;
}
void Unlock(void)
{
if (m_bCriticalSectionInitialized)
LeaveCriticalSection(&m_CriticalSection);
}
};
struct CHeapInstance;
struct BXMHeader
{
union
{
char m_szSignature[4];
UINT m_uMagic;
};
UINT m_uUnk4;
BIG_ENDIAN USHORT m_usNameOrdinalCount; // this is used times 8 for mem allocation
BIG_ENDIAN USHORT m_usNameCount;
BIG_ENDIAN UINT m_uEntryCount;
};
struct BXMEntry
{
BIG_ENDIAN USHORT m_usCatMax;
BIG_ENDIAN USHORT m_usCatOffset;
BIG_ENDIAN USHORT m_usMax;
BIG_ENDIAN USHORT m_usOffset;
};
struct BXMNameOridinal
{
union
{
struct
{
BIG_ENDIAN UINT m_uNameIndex;
BIG_ENDIAN UINT m_u04;
};
struct
{
BIG_ENDIAN USHORT m_usNameIndex;
BIG_ENDIAN USHORT m_us04;
};
};
};
/*
CXML is a pure virtual interface with all 82 vfuncs pure virtuals
Size of struct is ?? (??) bytes
*/
struct CXMLBinary //: CXML
{
void* lpVtbl;
QWORD m_pHeap; // don't exactly know what heap struct this is
QWORD* m_pData;
void* m_pBXM;
BXMEntry* m_pEntries; // m_pBXM + 16
BXMNameOridinal* m_pNameOridinals; // m_dwFlags & 1 ? 8 * nQWords : 4 * nQWords;
const char** m_pszNames;
DWORD m_dwFlags; // 1u = m_uQWordCount >= 0xFFFF
};
struct CObjReadSystem
{
struct Work
{
struct Desc
{
DWORD dword0; //0x00
QWORD qword4; //0x04
CObjReadSystem::Work::Desc* m_pPrevious; //0x0C
CObjReadSystem::Work::Desc* m_pNext; //0x14
int int1c; //0x1C
INT m_0x20; //0x20
int gap2c;
DWORD m_dw0x30;
DWORD m_dwType;
char m_szFilename[64];
int m_objectId;
DWORD m_dw0x78;
QWORD m_qw0x80;
SIZE_T m_nBytes;
CHeapInstance* m_pHeap;
DWORD m_dwFlags98;
DWORD m_dw0x9C;
DWORD m_dw0xA0;
DWORD m_dw0xA4;
CObjReadSystem::Work* m_pWork;
char pad[8];
};
struct Info
{
BYTE gap0[32];
DWORD m_crc32;
CObjReadSystem::Work::Desc* m_pDescription;
};
void* m_pVtbl;
char gap8[16];
struct CObjReadSystem::Work* m_pPrev;
struct CObjReadSystem::Work* m_pNext;
DWORD m_flags;
int m_objectid;
int m_objectid2;
int m_objectid3;
CObjReadSystem::Work::Desc* m_pUnknown;
QWORD ptr40;
void* m_pDatPtr;
void* m_pDatPtr2;
void* m_unk1;
void* m_unk2;
};
};
enum TextureDimension
{
TEXTURE_DIMENSION_CUBEMAP = 2
};
struct CTextureD3D
{
union {
ID3D11Texture1D* m_pTexture1D;
ID3D11Texture2D* m_pTexture2D;
ID3D11Texture3D* m_pTexture3D;
};
ID3D11ShaderResourceView* m_pDefaultShaderResourceView;
QWORD qword10;
ID3D11ShaderResourceView* m_pShaderResourceViews[16];
};
/*
Size of struct is 0xB0 (176)
*/
struct CTexture
{
void* m_vtbl; //0x00
int m_iWidth; //0x08
int m_iHeight; //0x0C
int m_Depth; //0x10
BYTE gap14[8]; //0x14
BOOL m_bForceSRGB; //0x1C
UINT m_uMipMapCount; //0x20
DXGI_FORMAT m_Format; //0x24
BYTE gap28[8]; //0x28
TextureDimension m_Dimension; //0x30
BYTE gap34[60]; //0x34
CTextureD3D* m_pTexture; //0x70
char gap78[56]; //0x78
};
VALIDATE_OFFSET(CTexture, m_Depth, 0x10);
VALIDATE_OFFSET(CTexture, m_Dimension, 0x30);
struct CTargetTexture
{
void* m_vtbl;
CTexture* m_pTexture;
BOOL m_bInitalized;
};
struct CTextureBatch;
// size of struct 96 (0x60) bytes
struct CTextureData
{
DATHeader* m_pHeaders[2];
struct CTextureData* m_pPrevious;
struct CTextureData* m_pNext;
BYTE gap20[8];
void* m_pWTAFile;
void* m_pWTPFile;
CTextureBatch* m_pTextures;
DWORD m_dwTextureCount;
BOOL m_bUnk;
DWORD dword48;
DWORD dword4C;
char pad0x50[16];
};
VALIDATE_SIZE(CTextureData, 96);
struct CTextureBatch
{
CTextureData* m_pData;
CTargetTexture m_Texture;
BOOL m_bLast;
char pad24[4];
};
VALIDATE_SIZE(CTextureBatch, 40);
struct DDS_PIXELFORMAT
{
uint32_t size;
uint32_t flags;
uint32_t fourCC;
uint32_t RGBBitCount;
uint32_t RBitMask;
uint32_t GBitMask;
uint32_t BBitMask;
uint32_t ABitMask;
};
struct DDS_HEADER
{
uint32_t size;
uint32_t flags;
uint32_t height;
uint32_t width;
uint32_t pitchOrLinearSize;
uint32_t depth;
uint32_t mipMapCount;
uint32_t reserved1[11];
DDS_PIXELFORMAT ddspf;
uint32_t caps;
uint32_t caps2;
uint32_t caps3;
uint32_t caps4;
uint32_t reserved2;
};
/*
Size of struct 0x14 (20) bytes
*/
struct DDS_HEADER_DXT10
{
DXGI_FORMAT dxgiFormat; //0x00
uint32_t resourceDimension; //0x04
uint32_t miscFlag; //0x08 see D3D11_RESOURCE_MISC_FLAG
uint32_t arraySize; //0x0C
uint32_t miscFlags2; //0x10
};
struct TextureFile;
struct CTextureDescription
{
DDS_HEADER_DXT10* m_pHeaderDX10;
TextureFile* m_pDDS;
unsigned int m_uTextureSize; //size of dds file
DWORD gap14; // 0,2
DWORD dword18; // 1-4
BOOL m_b1C;
BOOL m_b20;
DWORD dword24;
BOOL m_bHasDX10Header;
};
struct TextureFile
{
uint32_t magic;
DDS_HEADER hdr;
CTextureDescription m_Desc; //might be just DDS_HEADER_DXT10
};
// Struct at least 0x1A8 bytes
struct CEntityInfo
{
Unknown_t* m_pUnknown; //0x0000 | i don't really know what this is (confirmed a struct pointer) maybe a void*
char m_szEntityType[32]; //0x0008
unsigned int m_ObjectId; //0x0028
BYTE m_Flags; //0x002C | An Entity cannot have this flag or'd with 3 game crashes (possibly a destroyed flag)
char alignment[3]; //0x002D
EntityHandle m_hEntity; //0x0030
char _0x0038[4]; //0x0034
CTextureData* m_pTextureData[2]; //0x0038
Pl0000* m_pEntity; //0x0048
DatafileDesc* m_pDatDesc; //0x0050 | m_pWMB
DWORD* m_pUnk; //0x0058 | m_pWTA (debug build) dword array 2 members (0x1415F6B50) CSceneEntitySystem::qword10
Pl0000* m_pParent; //0x0060 | m_pWTP (debug build)
BOOL m_bDataExists; //0x0068
UINT m_uEntityId; //0x006C
UINT m_uSetType; //0x0070
char _0x0x0074[68]; //0x0074
EntityHandle m_hUnk; //0x00B8
};
VALIDATE_OFFSET(CEntityInfo, m_pParent, 0x60);
VALIDATE_OFFSET(CEntityInfo, m_hUnk, 0xB8);
struct CEntityListEntry
{
EntityHandle m_hEntity;
CEntityInfo* m_pInfo;
};
/*
Address = 14160DF88
*/
struct CEntityList
{
DWORD m_uItems; //0x0000
DWORD m_uSize; //0x0004
DWORD m_uBase; //0x0008
DWORD m_uShift; //0x000C
std::pair<EntityHandle, CEntityInfo*>* m_pItems;//0x0010
CReadWriteLock m_Lock; //0x0018
};
struct CCollisionDataObject
{
void* vtbl;
char pad[8];
Vector3Aligned m_vMax;
Vector3Aligned m_vMin;
DWORD dword30;
DWORD m_uScenePropIndex; // changes when a scene is loaded therefore appears to be an index
DWORD dword38;
BYTE gap3C[20];
DWORD dword50;
DWORD dword54;
DWORD dword58;
};
struct CCollisionDataObjectManager
{
CReadWriteLock m_Lock;
char pad[32];
CCollisionDataObject** m_ppData; // [6] maybe?
};
class CModelShader;
struct MaterialShaderInfo
{
int m_iShader;
CModelShader* m_pShader;
};
struct WMBBone;
/*
Mesh struct used by the engine
size = 0x70 (112) bytes
*/
struct CMeshPart
{
Vector4 m_vColor; //0x0000
Vector4 m_vColorReadOnly; //0x0010
Vector3Aligned m_vMax; //0x0020
Vector3Aligned m_vMin; //0x0030
const char* m_szMeshName; //0x0040
MaterialShaderInfo* m_pShaderInfo; //0x0048 | important pointer
int m_nShaderInfo; //0x0050
WMBBone* m_pBones; //0x0058
int m_nBones; //0x0060
BOOL m_bShow; //0x0064 | ? need to be synced with the other modifing threads
BOOL m_bUpdate; //0x0068 | ? fucks with color vec
float m_flUnknown6C; //0x006C
};
class BehaviorAppBase
{
public:
typedef DWORD TimeLimitedFlag;
};
class CBehaviorExtension
{
public:
//void* m_vtable; //0x0000
};
class ExWaypoint : public CBehaviorExtension
{
};
class ExBaseInfo : public CBehaviorExtension
{
public:
virtual void function0();
virtual void function1();
virtual void function2();
virtual void function3();
virtual void function4();
virtual void function5();
};
/*
Level structure used for level and when you level up
size = 28 bytes
*/
struct Level_t
{
int m_iMinimumExperience; //0x0000
int m_iHealth; //0x0004 new max health
int m_iBaseAttack; //0x0008 idk about this one for sure
int m_iDefense; //0x000C
int m_iLevel; //0x0010 new level
int unk0x14; //0x0014
int unk0x18; //0x0018
};
/*
Size [8 byte aligned] = 2808 (0xAF8) bytes
Size [4 byte aligned] = 2804 (0xAF4) bytes
*/
struct ExExpInfo
{
void* m_vtable; //0x0000
void** unk; //0x0008
QWORD unk0x10; //0x0010
QWORD unk0x18; //0x0018
Level_t m_levels[99]; //0x0020 ordered 1 - 99 (99 is max level)
int m_nLevels; //0x0AF4
};
class ExCollision : public CBehaviorExtension
{
public:
void* m_vtbl; //0x0000
StaticArray<std::pair<TypeId, CBehaviorExtension*>, 16, 8>* m_pBehaviourExtensions; //0x0008
EntityHandle m_hOwner; //0x0010
BOOL m_bEnabled; //0x0014
BOOL m_bCollison; //0x0018
BOOL dword1C; //0x001C
Vector4 m_vPosition; //0x0020
float m_boundingbox[6]; //0x0030
BYTE gap48[64]; //0x0048
DWORD dword88;
int m_iBoneId;
DWORD dword90;
DWORD dword94;
DWORD dword98;
DWORD dword9C;
Vector4 v0xA0;
Vector4 v0xB0;
Vector4 v0xC0;
Vector4 v0xD0;
Vector3Aligned m_vMin;
void* unk[2];
Vector3Aligned m_vMax;
DWORD dword110;
DWORD dword114;
DWORD dword118;
DWORD dword11C;
Vector4 vec120;
};
VALIDATE_SIZE(ExCollision, 0x130);
VALIDATE_OFFSET(ExCollision, v0xA0, 0xA0);
class ExLockOn : public CBehaviorExtension
{
void* m_vtable; //0x0000
void* m_pEntity; //0x0008
};
class ExCatch : public CBehaviorExtension
{
void* m_vtable; //0x0000
};
class ExAttack : public CBehaviorExtension
{
void* m_vtable; //0x0000
};
class ExDamage : public CBehaviorExtension
{
void* m_vtable; //0x0000
};
class ExAttackCombo : public CBehaviorExtension
{
void* m_vtable; //0x0000
};
class ExActionState : public CBehaviorExtension
{
void* m_vtable; //0x0000
};
class CXmlBinary
{
void* m_vTable;
};
typedef struct WTBHeader
{
union {
char id[4]; // 0x00
unsigned int magic;
};
int unknown;
int uTexCount;
unsigned int ofsTexOfs;
unsigned int ofsTexSizes;
unsigned int ofsTexFlags;
unsigned int uTexIdxOffset;
unsigned int uTexInfoOffset;
} WTBHeader, WTBHdr, WTAHeader, WTAHdr;
enum TextureFlags
{
USE_ID_ZERO = 0x20, // SINGLE TEXTURE IN BATCH???
LAST_TEXTURE = 0x40, // 1<<6
HAS_DX10_HEADER = (1 << 25),
FORCE_SRGB = (1 << 26),
TEXTURE3D = (1 << 27),
TEXTURE2D = (1 << 28),
TEXTUREBUFFER = (1 << 29),
};
/*
Size of struct 0x88 (136) bytes
dummy.wmb is just this header structure
*/
typedef struct WMBHeader
{
union {
char id[4]; // 0x00
unsigned int magic;
};
unsigned int version; // 4
int unknown8; // 8
short unknownC; // C Seems related to vertex index size
short unknownE; // E
float boundingBox[6]; //10
unsigned int ofsBones; //28
int numBones; //2C
unsigned int ofsBoneIndexTT; //30
int sizeBoneIndexTT; //34
unsigned int ofsVertexGroups; //38
int numVertexGroups; //3C
unsigned int ofsBatches; //40
int numBatches; //44
unsigned int ofsLods; //48
int numLods; //4C
unsigned int ofsHitboxes; //50
int numHitboxes; //54
unsigned int ofsBoneMap; //58
int sizeBoneMap; //5C
unsigned int ofsBoneSets; //60
int numBoneSets; //64
unsigned int ofsMaterials; //68
int numMaterials; //6C
unsigned int ofsMeshes; //70
int numMeshes; //74
unsigned int ofsMeshMaterial; //78
int numMeshMaterial; //7C
unsigned int ofsUnknownF; //80
int numUnknownG; //84
} WMBHeader, WMBHdr;
// Size of struct 0x58 (88) bytes
typedef struct WMBBone
{
short m_sId; //0x00
short m_sParentIndex; //0x02 | parent id
Vector3 m_vLocalPosition; //0x04
Vector3 m_vLocalRotation; //0x10
Vector3 m_vLocalScale; //0x1C
Vector3 m_vPosition; //0x28
Vector3 m_vRotation; //0x34
Vector3 m_vScale; //0x40
Vector3 m_vTPosition; //0x4C
} WMBBone;
// Size of struct 0xB0 (176) bytes
typedef struct CBone
{
Vector3Aligned m_vLocalPosition; //0x00
Vector3Aligned m_vLocalRotation; //0x10
Vector3Aligned m_vLocalScale; //0x20
Vector3Aligned m_vPosition; //0x30
Vector3Aligned m_vRotation; //0x40
Vector3Aligned m_vScale; //0x50
Vector3Aligned m_vTPosition; //0x60
Vector3Aligned m_vUnk; //0x70 | maybe min, max?
Vector3Aligned m_vUnk2; //0x80
CBone* m_pUnk; //0x90
int m_iFlags; //0x98 | bones in head and feathers are m_iFlags > 512 (0x200) { 0x208 (origin bone), 0x220 }
char _0x8C[4]; //0x9C
CBone* m_pParent; //0xA0
short m_Id; //0xA8
char _0x9A[6]; //0xAA
} Bone;
VALIDATE_SIZE(CBone, 0xB0);
struct CBoneSets
{
short* m_pSets;
int m_nSets;
};
struct WMBHitbox
{
Vector3 m_vMax;
Vector3 m_vMin;
int m_iBone1;
int m_iBone2;
};
struct CHitbox
{
Vector3Aligned m_vMax;
Vector3Aligned m_vMin;
int m_iBone1;
int m_iBone2;
};
struct WMBSamplerParameterGroup
{
int m_iIndex; //0x00
unsigned int m_uParametersOffset; //0x04 float*
int m_nParameters; //0x08
};
struct WMBVariable
{
unsigned int m_uNameOffset; //0x00
float m_flValue; //0x04
};
struct CConstantBufferContext
{
int m_iConstantBufferGroup;
int m_iSize; //0x04 idk not sure set to 40 in COtManager::DrawModel
int m_iConstantBufferIndex;
BYTE gapC[8];
};
/*
Cannot have size of zero
Must be 16 byte aligned
Size cannot exceed 0x10000 (65536) bytes
*/
class CConstantBuffer
{
void* m_vtbl;
BYTE gap8[8];
volatile signed __int32 volatile10;
BYTE gap14[20];
void* m_pResources;
SIZE_T m_size; //aligned to 16 bytes
SIZE_T m_size2; //aligned to 16 bytes
__int64 m_aligned_size;
BYTE gap48[16];
signed int m_index;
BYTE gap5C[12];
ID3D11Buffer** m_ppBuffer;
};
typedef struct CSamplerParam
{
CConstantBuffer* m_pBuffer;
BOOL m_bInitalized;
} CModelMatrix;
struct CSamplerParameterGroup
{
CSamplerParam* m_pParameters;
int m_nParameters;
int m_iIndex;
};
struct WMBMaterial
{
short m_sVersion[4]; //0x00
unsigned int m_uNameOffset; //0x08
unsigned int m_uShaderNameOffset; //0x0C
unsigned int m_uTechniqueOffset; //0x10
int m_nShaderParameters; //0x14
unsigned int m_uTexturesOffset; //0x18
int m_nTextures; //0x1C
unsigned int m_uParameterGroupsOffset; //0x20
int m_nParameterGroups; //0x24
unsigned int m_uVariablesOffset; //0x28
int m_nVariables; //0x2C
};
VALIDATE_SIZE(WMBMaterial, 0x30);
// Size of struct is 120 (0x78) bytes
struct CMaterial
{
void* m_pHeap;
const char* m_szName;
const char* m_szShaderName;
const char* m_szTechniqueName;
unsigned int m_TextureIds[16];
CSamplerParameterGroup* m_pParameterGroups;
int m_nParameterGroups;
int m_nShaderParameters;
CSamplerParam* m_pParameters;
};
VALIDATE_SIZE(CMaterial, 0x78);
struct CBatchInfo
{
int m_iVertexGroupIndex;
int m_iMeshIndex;
int m_iMaterialIndex;
int m_iUnk;
int m_iMeshMaterialIndex;
int m_iUnk2;
};
struct CDrawGroupInfo
{
DWORD dword0;
int m_iLODLevel;
DWORD m_uBatchStart;
BYTE gapC[4];
CBatchInfo* m_pBatchInfos;
unsigned int m_nBatchInfos;
};
struct WMBMesh
{
unsigned int m_uNameOffset;
Vector3 m_vMax;
Vector3 m_vMin;
unsigned int m_uMaterialsOffset;
int m_nMaterials;
unsigned int m_uBonesOffset;
int m_nBones;
};
VALIDATE_SIZE(WMBMesh, 0x2C);