--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
176 lines
7.2 KiB
C++
176 lines
7.2 KiB
C++
#include "classes.h"
|
|
|
|
// 009efa10
|
|
RichText::~RichText()
|
|
{
|
|
uint32_t *this_00;
|
|
int iVar1;
|
|
int iVar2;
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
ANM2 *iconSprite;
|
|
char *imageMap;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b0feb0;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>((GHIDRA_INT(this) + 0x18)))))->Font::Unload();
|
|
iVar1 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 100));
|
|
if (iVar1 != 0) {
|
|
iVar2 = *GHIDRA_CAST<int *>((iVar1 + 0x120));
|
|
msvc::map<unsigned_int_ImagePtr>::_Erase_tree(iVar1 + 0x120,*GHIDRA_CAST<uint32_t *>((iVar2 + 4)));
|
|
*GHIDRA_CAST<int *>((iVar2 + 4)) = iVar2;
|
|
*GHIDRA_CAST<int *>(iVar2) = iVar2;
|
|
*GHIDRA_CAST<int *>((iVar2 + 8)) = iVar2;
|
|
*GHIDRA_CAST<uint32_t *>((iVar1 + 0x124)) = 0;
|
|
iconSprite = *GHIDRA_CAST<ANM2 **>((GHIDRA_CAST<char *>(this) + 100));
|
|
if (iconSprite != GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
imageMap = iconSprite[1]._filename._buf + 0xc;
|
|
local_8 = 0;
|
|
iVar1 = *GHIDRA_CAST<int *>(imageMap);
|
|
msvc::map<unsigned_int_ImagePtr>::_Erase_tree(imageMap,*GHIDRA_CAST<uint32_t *>((iVar1 + 4)));
|
|
*GHIDRA_CAST<int *>((iVar1 + 4)) = iVar1;
|
|
*GHIDRA_CAST<int *>(iVar1) = iVar1;
|
|
*GHIDRA_CAST<int *>((iVar1 + 8)) = iVar1;
|
|
iconSprite[1]._filename._size = 0;
|
|
(GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::Reset();
|
|
msvc::map<unsigned_int_ImagePtr>::_Erase_tree(imageMap,*GHIDRA_CAST<uint32_t *>((*GHIDRA_CAST<int *>(imageMap) + 4)));
|
|
operator_delete(*(void **)imageMap,0x1c);
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),1);
|
|
(GHIDRA_CAST<ANM2 *>((iconSprite)))->ANM2::Reset();
|
|
(GHIDRA_CAST<AnimationState *>((&iconSprite->_overlayAnimState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<AnimationState *>((&iconSprite->_animState)))->AnimationState::~AnimationState();
|
|
(GHIDRA_CAST<msvc::string *>(((iconSprite->_animDefaultName)._buf)))->msvc::string::_Tidy_deallocate();
|
|
(GHIDRA_CAST<msvc::string *>((GHIDRA_CAST<char *>(iconSprite))))->msvc::string::_Tidy_deallocate();
|
|
operator_delete(iconSprite,0x128);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 100)) = 0;
|
|
}
|
|
}
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>((GHIDRA_INT(this) + 0x18)))))->Font::Unload();
|
|
this_00 = GHIDRA_CAST<uint32_t *>((GHIDRA_INT(this) + 0x58));
|
|
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<msvc::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
|
(this_00,(fuzzer_allocator<msvc::_Tree_node<unsigned_int,void*>_> *)this_00,
|
|
*(_Tree_node<unsigned_int,void*> **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x58)) + 4));
|
|
operator_delete((void *)*this_00,0x18);
|
|
FUN_004b3950();
|
|
this->msvc::string::_Tidy_deallocate();
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|
|
|
|
// 009efb60
|
|
void RichText::load_font(std_string *fontPath)
|
|
{
|
|
void *newIconsAnm = this;
|
|
ANM2 *pAVar1;
|
|
uint8_t *pbVar2;
|
|
char extraout_AL;
|
|
ANM2 *newIconsAnm;
|
|
void *mapHead;
|
|
char *pcVar3;
|
|
int iconsAnm;
|
|
uint32_t size;
|
|
std_string anmPath;
|
|
uint8_t fontPathLocal [268];
|
|
uint32_t local_24;
|
|
uint8_t *puStack_20;
|
|
void *local_1c;
|
|
uint8_t *puStack_18;
|
|
uint32_t local_14;
|
|
uint32_t *srcSize;
|
|
|
|
puStack_20 = fontPathLocal + 300;
|
|
local_14 = 0xffffffff;
|
|
puStack_18 = &LAB_00b0ff00;
|
|
local_1c = ExceptionList;
|
|
local_24 = __security_cookie ^ GHIDRA_UINT((fontPathLocal + 0x120));
|
|
ExceptionList = &local_1c;
|
|
pbVar2 = fontPathLocal + 300;
|
|
if (newIconsAnm != fontPath) {
|
|
srcSize = &fontPath->_size;
|
|
if (0xf < fontPath->_capacity) {
|
|
fontPath = *GHIDRA_CAST<std_string **>(fontPath->_buf);
|
|
}
|
|
(GHIDRA_CAST<msvc::string *>((newIconsAnm)))->msvc::string::assign(GHIDRA_CAST<uint8_t *>(fontPath),*srcSize);
|
|
pbVar2 = puStack_20;
|
|
}
|
|
puStack_20 = pbVar2;
|
|
sprintf_s(fontPathLocal,0x104,&DAT_00b62fdc);
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>((GHIDRA_INT(newIconsAnm) + 0x18)))))->Font::Unload();
|
|
(GHIDRA_CAST<Font *>((GHIDRA_CAST<Font *>((GHIDRA_INT(newIconsAnm) + 0x18)))))->Font::Load(fontPathLocal,0);
|
|
if (extraout_AL == '\0') {
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("Failed to load font: %s \n"));
|
|
}
|
|
iconsAnm = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(newIconsAnm) + 100));
|
|
if (iconsAnm == 0) {
|
|
newIconsAnm = operator_new(0x128);
|
|
local_14 = 0;
|
|
if (newIconsAnm == GHIDRA_CAST<ANM2 *>(0x0)) {
|
|
newIconsAnm = GHIDRA_CAST<ANM2 *>(0x0);
|
|
}
|
|
else {
|
|
(GHIDRA_CAST<ANM2 *>((newIconsAnm)))->ANM2::constructor();
|
|
local_14 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),1);
|
|
newIconsAnm[1]._filename._buf[0] = '\0';
|
|
newIconsAnm[1]._filename._buf[1] = '\0';
|
|
newIconsAnm[1]._filename._buf[2] = '\0';
|
|
newIconsAnm[1]._filename._buf[3] = '\0';
|
|
pAVar1 = newIconsAnm + 1;
|
|
(pAVar1->_filename)._buf[4] = '\0';
|
|
(pAVar1->_filename)._buf[5] = '\0';
|
|
(pAVar1->_filename)._buf[6] = '\0';
|
|
(pAVar1->_filename)._buf[7] = '\0';
|
|
pAVar1 = newIconsAnm + 1;
|
|
(pAVar1->_filename)._buf[8] = '\0';
|
|
(pAVar1->_filename)._buf[9] = '\0';
|
|
(pAVar1->_filename)._buf[10] = '\0';
|
|
(pAVar1->_filename)._buf[0xb] = '\0';
|
|
pcVar3 = newIconsAnm[1]._filename._buf + 0xc;
|
|
pcVar3[0] = '\0';
|
|
pcVar3[1] = '\0';
|
|
pcVar3[2] = '\0';
|
|
pcVar3[3] = '\0';
|
|
newIconsAnm[1]._filename._size = 0;
|
|
mapHead = operator_new(0x1c);
|
|
*(void **)mapHead = mapHead;
|
|
*(void **)(GHIDRA_CAST<char *>(mapHead) + 4) = mapHead;
|
|
*(void **)(GHIDRA_CAST<char *>(mapHead) + 8) = mapHead;
|
|
*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(mapHead) + 0xc)) = 0x101;
|
|
*(void **)pcVar3 = mapHead;
|
|
}
|
|
local_14 = 0xffffffff;
|
|
*GHIDRA_CAST<ANM2 **>((GHIDRA_CAST<char *>(newIconsAnm) + 100)) = newIconsAnm;
|
|
anmPath._size = 0;
|
|
anmPath._capacity = 0xf;
|
|
anmPath._buf[0] = '\0';
|
|
anmPath._buf[1] = '\0';
|
|
anmPath._buf[2] = '\0';
|
|
anmPath._buf[3] = '\0';
|
|
(*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) = msvc::_Allocate(0x20);
|
|
anmPath._size = 0x16;
|
|
anmPath._capacity = 0x1f;
|
|
builtin_strncpy((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anmPath._buf))) + 0x0))),"gfx/ui/text_icons.anm2",0x17);
|
|
local_14 = 2;
|
|
(GHIDRA_CAST<ANM2 *>((newIconsAnm)))->ANM2::Load(&anmPath,1);
|
|
if (0xf < anmPath._capacity) {
|
|
size = anmPath._capacity + 1;
|
|
pcVar3 = (*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anmPath._buf))) + 0x0)));
|
|
if (0xfff < size) {
|
|
pcVar3 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) + -4));
|
|
size = anmPath._capacity + 0x24;
|
|
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(&(anmPath._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar3))))) {
|
|
/* WARNING: Subroutine does not return */
|
|
_invalid_parameter_noinfo_noreturn();
|
|
}
|
|
}
|
|
operator_delete(pcVar3,size);
|
|
}
|
|
iconsAnm = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(newIconsAnm) + 100));
|
|
}
|
|
*GHIDRA_CAST<float *>((iconsAnm + 0x114)) = (float)*GHIDRA_CAST<uint16_t *>((GHIDRA_CAST<char *>(newIconsAnm) + 0x2c));
|
|
ExceptionList = local_1c;
|
|
return;
|
|
}
|