#include "classes.h" // 0069d290 void Menu_Mods::Update() { std_string *displayName; uint8_t *b; void *freeBlock; uint32_t size; uint8_t *nameSize; int playersBegin; uint8_t *a; int iVar2; int playersEnd; uint8_t local_74 [4]; uint32_t playerIndex; Menu_Mods *self; uint8_t *nameMapHead; uint32_t local_64; uint8_t *local_60; uint32_t local_5c; void *displayNameBuf [3]; uint8_t local_4c [8]; uint8_t *local_44; void *nameKey; uint32_t uStack_3c; uint32_t uStack_38; uint32_t uStack_34; uint32_t nameKeySize; uint32_t nameKeyCapacity; uint32_t local_28; uint32_t securityCookie; uint8_t *puStack_20; void *local_1c; uint8_t *puStack_18; uint32_t local_14; uint32_t *nameSize; EntityConfig_Player *playerConfig; puStack_20 = local_4c + 0x48; local_14 = 0xffffffff; puStack_18 = &LAB_00af9dbd; local_1c = ExceptionList; securityCookie = __security_cookie ^ GHIDRA_UINT((local_4c + 0x3c)); ExceptionList = &local_1c; nameMapHead = GHIDRA_CAST(0x0); local_64 = 0; self = this; nameMapHead = operator_new(0x2c); *GHIDRA_CAST(nameMapHead) = nameMapHead; *GHIDRA_CAST((nameMapHead + 4)) = nameMapHead; *GHIDRA_CAST((nameMapHead + 8)) = nameMapHead; *GHIDRA_CAST((nameMapHead + 0xc)) = 0x101; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x1))) = 0; playersEnd = *GHIDRA_CAST((this + 4)); playersBegin = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[2])) + 0x2)))); local_5c = 0x29; local_60 = nameMapHead; if (0x29 < GHIDRA_UINT(((playersEnd - playersBegin) / 0x148))) { iVar2 = 0x3488; do { playerConfig = GHIDRA_CAST((iVar2 + playersBegin)); if ((*GHIDRA_CAST((iVar2 + 0x128 + playersBegin)) == '\0') && ((playerConfig->_bSkinParentName)._size == 0)) { displayName = EntityConfig_Player::GetDisplayName (playerConfig,GHIDRA_CAST(displayNameBuf),playerConfig); nameKey = *(void **)displayName->_buf; uStack_3c = *GHIDRA_CAST((displayName->_buf + 4)); uStack_38 = *GHIDRA_CAST((displayName->_buf + 8)); uStack_34 = *GHIDRA_CAST((displayName->_buf + 0xc)); nameKeySize = displayName->_size; nameKeyCapacity = displayName->_capacity; displayName->_size = 0; displayName->_capacity = 0xf; displayName->_buf[0] = '\0'; local_28 = local_5c; (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 2; FUN_006a00d0(local_74,&nameKey); (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 1; if (0xf < nameKeyCapacity) { size = nameKeyCapacity + 1; freeBlock = nameKey; if (0xfff < size) { freeBlock = *(void **)(GHIDRA_CAST(nameKey) + -4); size = nameKeyCapacity + 0x24; if (0x1f < GHIDRA_UINT((GHIDRA_INT(nameKey) + (-4 - GHIDRA_INT(freeBlock))))) goto LAB_0069d502; } operator_delete(freeBlock,size); } (*GHIDRA_CAST((GHIDRA_CAST(&(local_14)) + 0x0))) = 0; if (&DAT_0000000f < local_44) { nameSize = local_44 + 1; freeBlock = displayNameBuf[0]; if (GHIDRA_CAST(0xfff) < nameSize) { freeBlock = *(void **)(GHIDRA_INT(displayNameBuf[0]) + -4); nameSize = local_44 + 0x24; if (0x1f < GHIDRA_UINT((GHIDRA_INT(displayNameBuf[0]) + (-4 - GHIDRA_INT(freeBlock))))) { LAB_0069d502: /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(freeBlock,GHIDRA_UINT(nameSize)); } } iVar2 = iVar2 + 0x148; local_5c = local_5c + 1; playersEnd = *GHIDRA_CAST((self + 4)); playersBegin = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(self[2])) + 0x2)))); } while (local_5c < GHIDRA_UINT(((playersEnd - playersBegin) / 0x148))); local_60 = nameMapHead; } playerIndex = 0x29; nameSize = local_60; nameMapHead = local_60; if (0x29 < GHIDRA_UINT(((playersEnd - playersBegin) / 0x148))) { local_5c = 0x3488; do { if ((*GHIDRA_CAST((local_5c + 0x128 + playersBegin)) == '\0') && (*GHIDRA_CAST((local_5c + 0x11c + playersBegin)) != 0)) { a = GHIDRA_CAST((playersBegin + local_5c + 0x10c)); msvc::map::_Find_lower_bound(local_4c,a); nameSize = local_44; if (local_44[0xd] == '\0') { b = local_44 + 0x10; if (0xf < *GHIDRA_CAST((local_44 + 0x24))) { b = *GHIDRA_CAST(b); } nameSize = GHIDRA_CAST((a + 0x10)); if (0xf < *GHIDRA_CAST((a + 0x14))) { a = *GHIDRA_CAST(a); } playersBegin = string_compare(a,*nameSize,b,*GHIDRA_CAST((local_44 + 0x20))); if ((-1 < playersBegin) && (nameSize != local_60)) { *GHIDRA_CAST((*GHIDRA_CAST((nameSize + 0x28)) * 0x148 + 0x124 + *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(self[2])) + 0x2)))))) = playerIndex; local_60 = nameMapHead; } } nameSize = local_60; } local_5c = local_5c + 0x148; playerIndex = playerIndex + 1; playersBegin = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(self[2])) + 0x2)))); } while (playerIndex < GHIDRA_UINT(((*GHIDRA_CAST((self + 4)) - playersBegin) / 0x148))); } msvc::map::_Erase_tree(&nameMapHead,*GHIDRA_CAST((nameSize + 4))); operator_delete(nameMapHead,0x2c); ExceptionList = local_1c; return; } // 008e4970 void Menu_Mods::reset() { uint8_t bVar1; uint8_t *currentName; uint32_t compareResult; uint8_t *defaultName; bool isLess; uint8_t *animData; MenuManager *menuManager; animData = *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x16])) + 0x2)))); if (animData != GHIDRA_CAST(0x0)) { currentName = animData; if (0xf < *GHIDRA_CAST((animData + 0x14))) { currentName = *GHIDRA_CAST(animData); } defaultName = &DAT_00b6767c; do { bVar1 = *currentName; isLess = bVar1 < *defaultName; if (bVar1 != *defaultName) { LAB_008e49b0: compareResult = -GHIDRA_UINT(isLess) | 1; goto LAB_008e49b5; } if (bVar1 == 0) break; bVar1 = currentName[1]; isLess = bVar1 < defaultName[1]; if (bVar1 != defaultName[1]) goto LAB_008e49b0; currentName = currentName + 2; defaultName = defaultName + 2; } while (bVar1 != 0); compareResult = 0; LAB_008e49b5: if ((compareResult == 0) && ((animData[0x34] == 0 || (*GHIDRA_CAST((this + 0x1c)) != '\0')))) goto LAB_008e49e2; } bVar1 = (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[5])) + 0x1)))))))->ANM2::SetAnimation(&DAT_00b6767c,1); if (bVar1 != 0) { (GHIDRA_CAST((GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x15])) + 0x1)))))))->AnimationState::Rewind(); *GHIDRA_CAST((this + 0x1c)) = 1; } LAB_008e49e2: menuManager = g_menuManager; *GHIDRA_CAST(this) = 0; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[1])) + 0x1)))) = 0; menuManager->_viewPositionSet[7].y = -216.0; menuManager->_state = 1; *GHIDRA_CAST(&(*GHIDRA_CAST((GHIDRA_CAST(&(this[0x62])) + 0x2)))) = g_manager->_modManager; (*GHIDRA_CAST((GHIDRA_CAST(&(this[0x61])) + 0x1))) = 0; return; }