You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reversing/rsz/non-native-dumper.py
+268-6Lines changed: 268 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ def als(align, size):
27
27
"C16": als(2, 2),
28
28
"S16": als(2, 2),
29
29
"U16": als(2, 2),
30
+
"F16": als(2, 2),
30
31
31
32
"S32": als(4, 4),
32
33
"U32": als(4, 4),
@@ -41,19 +42,230 @@ def als(align, size):
41
42
"Resource": als(4, 4),
42
43
"String": als(4, 4),
43
44
"RuntimeType": als(4, 4),
45
+
46
+
"Quaternion": als(16, 16),
47
+
"Guid": als(8, 16),
48
+
"GameObjectRef": als(8, 16),
49
+
"Color": als(4, 4),
50
+
"DateTime": als(8, 8),
51
+
# Enum could have variable size and alignment, so we fallback to its base type and never use it.
52
+
53
+
"Uint2": als(4, 8),
54
+
"Uint3": als(4, 12),
55
+
"Uint4": als(4, 16),
56
+
"Int2": als(4, 8),
57
+
"Int3": als(4, 12),
58
+
"Int4": als(4, 16),
59
+
"Float2": als(4, 8),
60
+
"Float3": als(4, 12),
61
+
"Float4": als(4, 16),
62
+
"Mat4": als(16, 64),
63
+
"Vec2": als(16, 16),
64
+
"Vec3": als(16, 16),
65
+
"Vec4": als(16, 16),
66
+
67
+
"AABB": als(16, 32),
68
+
"Capsule": als(16, 48),
69
+
"Cone": als(16, 32),
70
+
"LineSegment": als(16, 32),
71
+
"OBB": als(16, 80),
72
+
"Plane": als(16, 16),
73
+
"Point": als(4, 8),
74
+
"Range": als(4, 8),
75
+
"RangeI": als(4, 8),
76
+
"Size": als(4, 8),
77
+
"Sphere": als(16, 16),
78
+
"Triangle": als(16, 48),
79
+
"Cylinder": als(16, 48),
80
+
"Area": als(16, 48),
81
+
"Rect": als(4, 16),
82
+
"Frustum": als(16, 96),
83
+
"KeyFrame": als(16, 16),
84
+
85
+
"Sfix": als(4, 4),
86
+
"Sfix2": als(4, 8),
87
+
"Sfix3": als(4, 12),
88
+
"Sfix4": als(4, 16),
89
+
}
90
+
91
+
hardcoded_native_type_to_TypeCode= {
92
+
'float': 'F32',
93
+
'int': 'S32',
94
+
'size_t': 'U32',
95
+
96
+
'via.GameObject': 'Object',
97
+
98
+
'System.Boolean': 'Bool',
99
+
'System.Char': 'C8',
100
+
'System.SByte': 'S8',
101
+
'System.Byte': 'U8',
102
+
'System.Int16': 'S16',
103
+
'System.UInt16': 'U16',
104
+
'System.Int32': 'S32',
105
+
'System.UInt32': 'U32',
106
+
'System.Int64': 'S64',
107
+
'System.UInt64': 'U64',
108
+
'System.Single': 'F32',
109
+
'System.Double': 'F64',
44
110
}
45
111
46
-
defgenerate_native_name(element):
112
+
TypeCode= [
113
+
# "Undefined",
114
+
"Object",
115
+
"Action",
116
+
"Struct",
117
+
"NativeObject",
118
+
"Resource",
119
+
"UserData",
120
+
"Bool",
121
+
"C8",
122
+
"C16",
123
+
"S8",
124
+
"U8",
125
+
"S16",
126
+
"U16",
127
+
"S32",
128
+
"U32",
129
+
"S64",
130
+
"U64",
131
+
"F32",
132
+
"F64",
133
+
"String",
134
+
"MBString",
135
+
"Enum",
136
+
"Uint2",
137
+
"Uint3",
138
+
"Uint4",
139
+
"Int2",
140
+
"Int3",
141
+
"Int4",
142
+
"Float2",
143
+
"Float3",
144
+
"Float4",
145
+
"Float3x3",
146
+
"Float3x4",
147
+
"Float4x3",
148
+
"Float4x4",
149
+
"Half2",
150
+
"Half4",
151
+
"Mat3",
152
+
"Mat4",
153
+
"Vec2",
154
+
"Vec3",
155
+
"Vec4",
156
+
"VecU4",
157
+
"Quaternion",
158
+
"Guid",
159
+
"Color",
160
+
"DateTime",
161
+
"AABB",
162
+
"Capsule",
163
+
"TaperedCapsule",
164
+
"Cone",
165
+
"Line",
166
+
"LineSegment",
167
+
"OBB",
168
+
"Plane",
169
+
"PlaneXZ",
170
+
"Point",
171
+
"Range",
172
+
"RangeI",
173
+
"Ray",
174
+
"RayY",
175
+
"Segment",
176
+
"Size",
177
+
"Sphere",
178
+
"Triangle",
179
+
"Cylinder",
180
+
"Ellipsoid",
181
+
"Area",
182
+
"Torus",
183
+
"Rect",
184
+
"Rect3D",
185
+
"Frustum",
186
+
"KeyFrame",
187
+
"Uri",
188
+
"GameObjectRef",
189
+
"RuntimeType",
190
+
"Sfix",
191
+
"Sfix2",
192
+
"Sfix3",
193
+
"Sfix4",
194
+
"Position",
195
+
"F16",
196
+
"Decimal",
197
+
# "End",
198
+
]
199
+
200
+
TypeCodeSearch=dict([(k.lower(),v) fork,vinhardcoded_native_type_to_TypeCode.items()] + [(a.lower(), a) forainTypeCode] + [("via."+a.lower(), a) forainTypeCode] + [("system."+a.lower(), a) forainTypeCode])
0 commit comments