Curation round 2, wave B: ItemConfig, EntityConfig, mods, Manager and the KAGE platform on SDL3; boots to LuaEngine::Init
- item_config, entity_config and mod_manager take over their families as idiomatic classes (std containers, unique_ptr, bitset tear flags). Every big loader reads the imported JSON: entities2.xml gives 1349 entities. - manager.h/.cpp take over Manager (g_manager) and IsaacStartup. Members are the curated subsystems by value. - kage_graphics, kage_input and kage_sound take over KAGE's graphics (shaders, render targets, batches, PNG through stb_image), input (SDL3 keyboard, mouse, gamepads) and sound (SDL3 audio, wav and stb_vorbis ogg, pitch and volume). - source_tree.py: classes inside a namespace block in src/ headers count as taken over, and a still-generated class's vtable slot keeps its stub unless src/ defines that exact method. build/isaac opens the window, sets up GL 4.6, framebuffers and PulseAudio, logs the version, and stops at LuaEngine::Init. 522 functions taken over, boot path 156/615. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
346dc95e13
commit
28e2e48842
105 files changed
+7008
-31418
No files matched your search
@@ -1,65 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00a12430
|
||||
void KAGE::Graphics::ImageBase::set_palette(uint32_t param_1, uint32_t param_2)
|
||||
{
|
||||
char cVar1;
|
||||
void *pvVar2;
|
||||
int *in_ECX;
|
||||
int *extraout_ECX;
|
||||
int *piVar3;
|
||||
uint8_t **stream;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t local_8;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00b10b9d;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
cVar1 = (**(code **)(*in_ECX + 8))(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
|
||||
if (cVar1 == '\0') {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Attempting to set palette on an image that isn\'t indexed\n"));
|
||||
}
|
||||
if (0x100 < param_2) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Specified palette is larger than 256 texels in size\n"));
|
||||
}
|
||||
sprintf(&DAT_00c943d8,GHIDRA_CAST<uint8_t *>("%s - Palette"));
|
||||
if (GHIDRA_CAST<int *>(in_ECX[0xb]) != GHIDRA_CAST<int *>(0x0)) {
|
||||
(**(code **)(*GHIDRA_CAST<int *>(in_ECX[0xb]) + 0x34))(1);
|
||||
in_ECX[0xb] = 0;
|
||||
}
|
||||
pvVar2 = operator_new(0x60);
|
||||
if (pvVar2 == (void *)0x0) {
|
||||
piVar3 = GHIDRA_CAST<int *>(0x0);
|
||||
}
|
||||
else {
|
||||
FUN_00a69950();
|
||||
*extraout_ECX = GHIDRA_INT(ImagePalette)::vftable;
|
||||
extraout_ECX[2] = extraout_ECX[2] | 4;
|
||||
extraout_ECX[3] = extraout_ECX[3];
|
||||
piVar3 = extraout_ECX;
|
||||
}
|
||||
in_ECX[0xb] = GHIDRA_INT(piVar3);
|
||||
stream = Filesys::BufferedStream::vftable;
|
||||
local_8 = 0;
|
||||
cVar1 = (**(code **)(*piVar3 + 0x38))(&stream,&DAT_00c943d8);
|
||||
if ((cVar1 == '\0') && (GHIDRA_CAST<int *>(in_ECX[0xb]) != GHIDRA_CAST<int *>(0x0))) {
|
||||
(**(code **)(*GHIDRA_CAST<int *>(in_ECX[0xb]) + 0x34))(1);
|
||||
in_ECX[0xb] = 0;
|
||||
}
|
||||
piVar3 = GHIDRA_CAST<int *>(in_ECX[0xb]);
|
||||
if ((piVar3[0xc] != 0) || (piVar3[0xd] != 0)) {
|
||||
(**(code **)(*piVar3 + 0x44))(0,0);
|
||||
piVar3[0xc] = 0;
|
||||
piVar3[0xd] = 0;
|
||||
piVar3 = GHIDRA_CAST<int *>(in_ECX[0xb]);
|
||||
}
|
||||
if ((piVar3[0xe] != 1) || (piVar3[0xf] != 1)) {
|
||||
(**(code **)(*piVar3 + 0x48))(1,1);
|
||||
piVar3[0xe] = 1;
|
||||
piVar3[0xf] = 1;
|
||||
}
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
@@ -1,236 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00a18aa0
|
||||
KAGE::Graphics::Manager::Manager()
|
||||
{
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t local_8;
|
||||
|
||||
puStack_c = &DAT_00b11133;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
g_graphicsManager_flags = 0;
|
||||
local_8 = 0;
|
||||
DAT_00c798e0 = ManagerBase::vftable;
|
||||
(GHIDRA_CAST<KColor *>((GHIDRA_CAST<KColor *>(&DAT_00c798e8))))->KColor::SetFromARGB(0xffffffff);
|
||||
g_graphicsManager_blendMode[1] = 1;
|
||||
DAT_00c798fc = &DAT_bf800000;
|
||||
if ((g_graphicsManager_flags & 4) == 0) {
|
||||
g_graphicsManager_blendMode[1] = 6;
|
||||
}
|
||||
g_graphicsManager_blendMode[0] = 0;
|
||||
g_graphicsManager_blendMode[2] = 7;
|
||||
g_graphicsManager_blendMode[3] = 1;
|
||||
g_graphicsManager_blendMode[4] = 7;
|
||||
_DAT_00c79914 = GHIDRA_CAST<uint32_t *>(0x0);
|
||||
_DAT_00c79918 = 0;
|
||||
_DAT_00c7991c = 0;
|
||||
_DAT_00c79920 = 0;
|
||||
_DAT_00c79924 = 0;
|
||||
_DAT_00c79914 = operator_new(8);
|
||||
_DAT_00c79914[1] = 0;
|
||||
*_DAT_00c79914 = &DAT_00c79914;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
||||
_DAT_00c7994c = GHIDRA_CAST<uint32_t *>(0x0);
|
||||
DAT_00c79950 = 0;
|
||||
DAT_00c79954 = 0;
|
||||
DAT_00c79958 = 0;
|
||||
DAT_00c7995c = 0;
|
||||
_DAT_00c7994c = operator_new(8);
|
||||
_DAT_00c7994c[1] = 0;
|
||||
*_DAT_00c7994c = &DAT_00c7994c;
|
||||
_DAT_00c79960 = 0;
|
||||
DAT_00c79964 = 0;
|
||||
DAT_00c79968 = 0;
|
||||
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),3);
|
||||
DAT_00c7996c = (void *)0x0;
|
||||
DAT_00c79970 = 0;
|
||||
DAT_00c7996c = operator_new(0x18);
|
||||
*(void **)DAT_00c7996c = DAT_00c7996c;
|
||||
*(void **)(GHIDRA_CAST<char *>(DAT_00c7996c) + 4) = DAT_00c7996c;
|
||||
*(void **)(GHIDRA_CAST<char *>(DAT_00c7996c) + 8) = DAT_00c7996c;
|
||||
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(DAT_00c7996c) + 0xc)) = 0x101;
|
||||
g_graphicsManager_flags = g_graphicsManager_flags | 0x12;
|
||||
DAT_00c79974 = 0;
|
||||
_DAT_00c79978 = 1;
|
||||
DAT_00c79988 = 0;
|
||||
DAT_00c79984 = 0;
|
||||
DAT_00c79928 = 0;
|
||||
DAT_00c7992c = 0;
|
||||
uRam00c79930 = 0;
|
||||
uRam00c79934 = 0;
|
||||
DAT_00c7997c = 0x44f00000;
|
||||
_DAT_00c79938 = 0;
|
||||
uRam00c7993c = 0;
|
||||
uRam00c79940 = 0;
|
||||
uRam00c79944 = 0;
|
||||
DAT_00c79980 = 0x44870000;
|
||||
_DAT_00c7998c = 0;
|
||||
_DAT_00c79990 = 0;
|
||||
_DAT_00c79994 = 0xffffffff;
|
||||
_DAT_00c79998 = 0xffffffff;
|
||||
local_8 = 4;
|
||||
DAT_00c798e0 = vftable;
|
||||
g_glfwWindow = (void *)0x0;
|
||||
DAT_00c799a4 = 0;
|
||||
DAT_00c799a0 = 0;
|
||||
DAT_00c799ac = 0;
|
||||
DAT_00c799a8 = 0;
|
||||
DAT_00c799b4 = 0;
|
||||
DAT_00c799b0 = 0;
|
||||
DAT_00c799b8 = (void *)0x0;
|
||||
_DAT_00c799bc = 0;
|
||||
DAT_00c799b8 = operator_new(0x10);
|
||||
*(void **)DAT_00c799b8 = DAT_00c799b8;
|
||||
*(void **)(GHIDRA_CAST<char *>(DAT_00c799b8) + 4) = DAT_00c799b8;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
|
||||
_DAT_00c799c0 = (void *)0x0;
|
||||
_DAT_00c799c4 = 0;
|
||||
_DAT_00c799c0 = operator_new(0x10);
|
||||
*(void **)_DAT_00c799c0 = _DAT_00c799c0;
|
||||
*(void **)(GHIDRA_CAST<char *>(_DAT_00c799c0) + 4) = _DAT_00c799c0;
|
||||
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
|
||||
_DAT_00c799c8 = (void *)0x0;
|
||||
_DAT_00c799cc = 0;
|
||||
_DAT_00c799c8 = operator_new(0x10);
|
||||
*(void **)_DAT_00c799c8 = _DAT_00c799c8;
|
||||
*(void **)(GHIDRA_CAST<char *>(_DAT_00c799c8) + 4) = _DAT_00c799c8;
|
||||
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),7);
|
||||
DAT_00c799d0 = (void *)0x0;
|
||||
_DAT_00c799d4 = 0;
|
||||
DAT_00c799d0 = operator_new(0x10);
|
||||
*(void **)DAT_00c799d0 = DAT_00c799d0;
|
||||
*(void **)(GHIDRA_CAST<char *>(DAT_00c799d0) + 4) = DAT_00c799d0;
|
||||
g_graphicsManager_flags = g_graphicsManager_flags | 0x200;
|
||||
ExceptionList = local_10;
|
||||
return &DAT_00c798e0;
|
||||
}
|
||||
|
||||
// 00a18e90
|
||||
uint8_t KAGE::Graphics::Manager::FUN_00a649b0()
|
||||
{
|
||||
char cVar1;
|
||||
int iVar2;
|
||||
HWND hwnd;
|
||||
uint32_t windowStyle;
|
||||
uint32_t uVar3;
|
||||
int *in_ECX;
|
||||
KColor clearColor;
|
||||
char *indexedTextureShaderSource;
|
||||
uint32_t local_40;
|
||||
char *local_3c;
|
||||
uint32_t local_38;
|
||||
char *colorTextureShaderSource;
|
||||
uint32_t local_30;
|
||||
char *local_2c;
|
||||
uint32_t local_28;
|
||||
char *colorShaderSource;
|
||||
uint32_t local_20;
|
||||
char *local_1c;
|
||||
uint32_t local_18;
|
||||
void *bufferObject;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t local_8;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00b11164;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
DAT_00c7de7c = FUN_00a19dd0;
|
||||
iVar2 = glfwInit(__security_cookie ^ GHIDRA_INT(register0x00000010) - 4U);
|
||||
if (iVar2 != 1) {
|
||||
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("GLFW failed to initialize\n"));
|
||||
}
|
||||
KAGE_Graphics::set_window_size(&DAT_00c79a34);
|
||||
in_ECX[0x32] = DAT_00c79a34;
|
||||
in_ECX[0x33] = DAT_00c79a38;
|
||||
cVar1 = DAT_00c79a3c;
|
||||
uVar3 = in_ECX[1] | 0x400;
|
||||
if (DAT_00c79a3c == '\0') {
|
||||
uVar3 = in_ECX[1] & 0xfffffbff;
|
||||
}
|
||||
in_ECX[1] = uVar3;
|
||||
if (in_ECX[0x2f] != 0) {
|
||||
iVar2 = -0x10;
|
||||
hwnd = (HWND)FUN_00a5f090(in_ECX[0x2f]);
|
||||
windowStyle = GetWindowLongA(hwnd,iVar2);
|
||||
uVar3 = windowStyle & 0xfffeffff;
|
||||
if (cVar1 != '\0') {
|
||||
uVar3 = windowStyle | 0x10000;
|
||||
}
|
||||
iVar2 = -0x10;
|
||||
hwnd = (HWND)FUN_00a5f090();
|
||||
SetWindowLongA(hwnd,iVar2,uVar3);
|
||||
}
|
||||
cVar1 = KAGE_Graphics::create_window();
|
||||
if (cVar1 == '\0') {
|
||||
ExceptionList = local_10;
|
||||
return 0;
|
||||
}
|
||||
iVar2 = in_ECX[0x2f];
|
||||
if (iVar2 == 0) {
|
||||
_wassert(L"window != NULL",
|
||||
L"C:\\nicalis\\builderbob\\projects\\KAGE\\Source\\Platforms\\PC\\Shared\\Source\\External\\gl\\GLFW_3.4\\src\\window.c"
|
||||
,0x333);
|
||||
}
|
||||
if (_glfw == 0) {
|
||||
_glfwInputError(0x10001,0);
|
||||
}
|
||||
else if (*GHIDRA_CAST<int *>((iVar2 + 0x40)) == 0) {
|
||||
(*DAT_00c73748)(iVar2);
|
||||
if (*GHIDRA_CAST<int *>((iVar2 + 0x14)) != 0) {
|
||||
(*DAT_00c73754)(iVar2);
|
||||
}
|
||||
}
|
||||
colorShaderSource =
|
||||
"\n\nattribute\tvec3\t\t\tPosition;\nattribute\tvec4\t\t\tColor;\n\nvarying\t\tvec4\t\t\tColor0;\n\nuniform\t\tmat4\t\t\tTransform;\n\nvoid\t\tmain( void )\n{\n\tColor0 = Color;\n\tgl_Position = Transform * vec4( Position.xyz, 1.0 );\n}\n\n"
|
||||
;
|
||||
local_20 = 0xca;
|
||||
local_1c =
|
||||
"\n\n#ifndef GL_ES\n\t#define lowp\n#endif\n\nvarying\t\tlowp vec4\t\tColor0;\n\nvoid\t\tmain( void )\n{\n\tgl_FragColor = Color0;\n\tif( gl_FragColor.a == 0.0 )\t\tdiscard;\n}\n\n"
|
||||
;
|
||||
local_18 = 0x9a;
|
||||
FUN_00a13fa0("KAGE_ColorShader",&PTR_s_Position_00c0f8c0,&colorShaderSource);
|
||||
colorTextureShaderSource =
|
||||
"\n\nattribute\tvec3\t\t\tPosition;\nattribute\tvec4\t\t\tColor;\nattribute\tvec2\t\t\tTexCoord;\n\nvarying\t\tvec4\t\t\tColor0;\nvarying\t\tvec2\t\t\tTexCoord0;\n\nuniform\t\tmat4\t\t\tTransform;\n\nvoid\t\tmain( void )\n{\n\tgl_Position = Transform * vec4( Position.xyz, 1.0 );\n\tColor0 = Color;\n\tTexCoord0 = TexCoord;\n}\n\n"
|
||||
;
|
||||
local_30 = 0x117;
|
||||
local_2c =
|
||||
"\n\n#ifndef GL_ES\n\t#define lowp\n\t#define highp\n#endif\n\nvarying\t\tlowp vec4\t\tColor0;\nvarying\t\thighp vec2\t\tTexCoord0;\n\nuniform\t\tsampler2D\t\tTexture0;\n\nvoid\t\tmain( void )\n{\n\tgl_FragColor = texture2D( Texture0, TexCoord0 ) * Color0;\n\tif( gl_FragColor.a == 0.0 )\t\tdiscard;\n}\n\n"
|
||||
;
|
||||
local_28 = 0x10b;
|
||||
FUN_00a13fa0("KAGE_ColorTextureShader",&PTR_s_Position_00c0f8f0,&colorTextureShaderSource);
|
||||
indexedTextureShaderSource =
|
||||
"\n\nattribute\tvec3\t\t\tPosition;\nattribute\tvec4\t\t\tColor;\nattribute\tvec2\t\t\tTexCoord;\n\nvarying\t\tvec4\t\t\tColor0;\nvarying\t\tvec2\t\t\tTexCoord0;\n\nuniform\t\tmat4\t\t\tTransform;\n\nvoid\t\tmain( void )\n{\n\tgl_Position = Transform * vec4( Position.xyz, 1.0 );\n\tColor0 = Color;\n\tTexCoord0 = TexCoord;\n}\n\n"
|
||||
;
|
||||
local_40 = 0x117;
|
||||
local_3c =
|
||||
"\n\n#ifndef GL_ES\n\t#define lowp\n\t#define highp\n#endif\n\nvarying\t\tlowp vec4\t\tColor0;\nvarying\t\thighp vec2\t\tTexCoord0;\n\nuniform\t\tsampler2D\t\tTexture0;\nuniform\t\tsampler2D\t\tTexture1;\n\nvoid\t\tmain( void )\n{\n\tvec4\tPaletteIndex = texture2D( Texture0, TexCoord0 );\n\tvec4\tOutputColor = texture2D( Texture1, PaletteIndex.xy ) * Color0;\n\tif( OutputColor.w == 0.0 )\t\tdiscard;\n\tgl_FragColor = OutputColor;\n}\n\n"
|
||||
;
|
||||
local_38 = 0x186;
|
||||
FUN_00a13fa0("KAGE_IndexedTextureShader",&PTR_s_Position_00c0f8f0,&indexedTextureShaderSource);
|
||||
(**(code **)(*in_ECX + 0x78))();
|
||||
(**(code **)(*in_ECX + 0x18))(0,1);
|
||||
bufferObject = operator_new(0x10);
|
||||
local_8 = 0;
|
||||
if (bufferObject == (void *)0x0) {
|
||||
DAT_00c7367c = (void *)0x0;
|
||||
}
|
||||
else {
|
||||
DAT_00c7367c = GraphicsBufferObject::GraphicsBufferObject(bufferObject);
|
||||
}
|
||||
local_8 = 0xffffffff;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(DAT_00c7367c) + 0xc)) = 1;
|
||||
(GHIDRA_CAST<KColor *>((&clearColor)))->KColor::SetFromARGB(0xff000000);
|
||||
(**(code **)(*in_ECX + 0x58))(clearColor._red,clearColor._green,clearColor._blue);
|
||||
_DAT_00c379b4 = _DAT_00c379b4 | 1;
|
||||
(**(code **)(DAT_00c37990 + 4))();
|
||||
_DAT_00c37984 = _DAT_00c37984 | 1;
|
||||
in_ECX[1] = in_ECX[1] | 1;
|
||||
g_imageReleaseFn = FUN_00a12240;
|
||||
g_renderTargetReleaseFn = FUN_00a12240;
|
||||
ExceptionList = local_10;
|
||||
return 1;
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 00a149a0
|
||||
void KAGE::Graphics::ShaderBase::free_uniforms()
|
||||
{
|
||||
int iVar1;
|
||||
uint64_t *allocatedBytes;
|
||||
uint32_t uVar2;
|
||||
uint32_t uVar3;
|
||||
int iVar4;
|
||||
int *bufferSlot;
|
||||
code *freeFn;
|
||||
int iVar5;
|
||||
int uniformOffset;
|
||||
uint32_t uniformIndex;
|
||||
void *local_10;
|
||||
uint8_t *puStack_c;
|
||||
uint32_t uStack_8;
|
||||
uint32_t blockSize;
|
||||
uint64_t previousAllocatedBytes;
|
||||
|
||||
uStack_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00b10d90;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
uVar2 = 0;
|
||||
if (*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x10)) != 0) {
|
||||
do {
|
||||
iVar5 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xc)) + uVar2 * 8));
|
||||
if (iVar5 != 0) {
|
||||
if (g_mainHeap == (void *)0x0) {
|
||||
allocatedBytes = &g_allocatedBytesNoHeap;
|
||||
}
|
||||
else {
|
||||
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
||||
}
|
||||
uVar3 = *GHIDRA_CAST<uint32_t *>((iVar5 + -4));
|
||||
previousAllocatedBytes = *allocatedBytes;
|
||||
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar3;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(previousAllocatedBytes) < uVar3));
|
||||
free((void *)(iVar5 + -4));
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xc)) + uVar2 * 8)) = 0;
|
||||
}
|
||||
uVar2 = uVar2 + 1;
|
||||
} while (uVar2 < *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x10)));
|
||||
}
|
||||
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x38));
|
||||
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x34));
|
||||
uniformIndex = 0;
|
||||
iVar1 = iVar5 - iVar4 >> 0x1f;
|
||||
if ((iVar5 - iVar4) / 0x18 + iVar1 != iVar1) {
|
||||
uniformOffset = 0;
|
||||
do {
|
||||
iVar5 = uniformOffset + iVar4;
|
||||
iVar1 = *GHIDRA_CAST<int *>((iVar5 + 0xc));
|
||||
uVar3 = 0;
|
||||
uVar2 = *GHIDRA_CAST<int *>((uniformOffset + 0x10 + iVar4)) - iVar1 >> 2;
|
||||
if (uVar2 != 0) {
|
||||
do {
|
||||
if ((7 < *GHIDRA_CAST<int *>((iVar5 + 8))) &&
|
||||
(iVar4 = *GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((iVar5 + 0xc)) + uVar3 * 4)), iVar4 != 0)) {
|
||||
if (g_mainHeap == (void *)0x0) {
|
||||
allocatedBytes = &g_allocatedBytesNoHeap;
|
||||
}
|
||||
else {
|
||||
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
||||
}
|
||||
blockSize = *GHIDRA_CAST<uint32_t *>((iVar4 + -4));
|
||||
previousAllocatedBytes = *allocatedBytes;
|
||||
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - blockSize;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) -
|
||||
GHIDRA_UINT((GHIDRA_UINT(previousAllocatedBytes) < blockSize));
|
||||
free((void *)(iVar4 + -4));
|
||||
*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>((iVar5 + 0xc)) + uVar3 * 4)) = 0;
|
||||
}
|
||||
uVar3 = uVar3 + 1;
|
||||
} while (uVar3 < uVar2);
|
||||
iVar1 = *GHIDRA_CAST<int *>((iVar5 + 0xc));
|
||||
}
|
||||
uniformIndex = uniformIndex + 1;
|
||||
uniformOffset = uniformOffset + 0x18;
|
||||
*GHIDRA_CAST<int *>((iVar5 + 0x10)) = iVar1;
|
||||
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x38));
|
||||
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x34));
|
||||
} while (uniformIndex < GHIDRA_UINT(((iVar5 - iVar4) / 0x18)));
|
||||
}
|
||||
if (iVar4 != iVar5) {
|
||||
do {
|
||||
FID_conflict__Tidy((void *)(iVar4 + 0xc));
|
||||
iVar4 = iVar4 + 0x18;
|
||||
} while (iVar4 != iVar5);
|
||||
iVar4 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x34));
|
||||
}
|
||||
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x38)) = iVar4;
|
||||
iVar5 = 8;
|
||||
bufferSlot = GHIDRA_CAST<int *>((GHIDRA_INT(this) + 0x14));
|
||||
do {
|
||||
iVar4 = *bufferSlot;
|
||||
if (iVar4 != 0) {
|
||||
if (g_mainHeap == (void *)0x0) {
|
||||
allocatedBytes = &g_allocatedBytesNoHeap;
|
||||
}
|
||||
else {
|
||||
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
||||
}
|
||||
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar4 + -4));
|
||||
previousAllocatedBytes = *allocatedBytes;
|
||||
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar2;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(previousAllocatedBytes) < uVar2));
|
||||
free((void *)(iVar4 + -4));
|
||||
*bufferSlot = 0;
|
||||
}
|
||||
bufferSlot = bufferSlot + 1;
|
||||
iVar5 = iVar5 + -1;
|
||||
} while (iVar5 != 0);
|
||||
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 8));
|
||||
if (iVar5 == 0) {
|
||||
freeFn = free_exref;
|
||||
}
|
||||
else {
|
||||
if (g_mainHeap == (void *)0x0) {
|
||||
allocatedBytes = &g_allocatedBytesNoHeap;
|
||||
}
|
||||
else {
|
||||
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
||||
}
|
||||
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar5 + -4));
|
||||
previousAllocatedBytes = *allocatedBytes;
|
||||
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar2;
|
||||
freeFn = free_exref;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(previousAllocatedBytes) < uVar2));
|
||||
free((void *)(iVar5 + -4));
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 8)) = 0;
|
||||
}
|
||||
iVar5 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0xc));
|
||||
if (iVar5 != 0) {
|
||||
if (g_mainHeap == (void *)0x0) {
|
||||
allocatedBytes = &g_allocatedBytesNoHeap;
|
||||
}
|
||||
else {
|
||||
allocatedBytes = GHIDRA_CAST<uint64_t *>((GHIDRA_INT(g_mainHeap) + 0x30));
|
||||
}
|
||||
uVar2 = *GHIDRA_CAST<uint32_t *>((iVar5 + -4));
|
||||
previousAllocatedBytes = *allocatedBytes;
|
||||
*GHIDRA_CAST<uint32_t *>(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) - uVar2;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) =
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(allocatedBytes) + 4)) - GHIDRA_UINT((GHIDRA_UINT(previousAllocatedBytes) < uVar2));
|
||||
(*freeFn)(iVar5 + -4);
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0xc)) = 0;
|
||||
}
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 4)) = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 4)) & 0xfffffffe;
|
||||
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x10)) = 0;
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
Reference in new issue
Block a user