{"type": "func", "start": 5370292208, "end": 5370292374, "name": "GameManager::loadFont", "pseudocode": "// \n// GameManager::loadFont from 0x1401827f0 to 0x140182896 (166 bytes)\n// \n// 25 xrefs:\n// > CustomizeObjectLayer::init @ 0x1400a6faa\n// > CustomizeObjectLayer::init @ 0x1400a6fcb\n// > CustomizeObjectLayer::init @ 0x1400a72fb\n// > CustomizeObjectLayer::init @ 0x1400a731c\n// > GameObject::createWithKey @ 0x14018b9f2\n// > GameObject::createWithKey @ 0x14018ba16\n// > TextGameObject::updateTextObject @ 0x1401a77fc\n// > TextGameObject::updateTextObject @ 0x1401a781d\n// > GJBaseGameLayer::createTextLayers @ 0x14020ed37\n// > GJBaseGameLayer::createTextLayers @ 0x14020ed5b\n// > SelectFontLayer::updateFontLabel @ 0x14028ebe5\n// > SelectFontLayer::updateFontLabel @ 0x14028ec72\n// > SelectFontLayer::updateFontLabel @ 0x14028ec93\n// > LevelEditorLayer::createObjectsFromSetup @ 0x1402d3a80\n// > LevelEditorLayer::updateLevelFont @ 0x1402df382\n// > LevelEditorLayer::updateLevelFont @ 0x1402df3a6\n// > PlayLayer::setupHasCompleted @ 0x1403a6eef\n// > PlayLayer::setupHasCompleted @ 0x1403a6f10\n// > PlayLayer::prepareCreateObjectsFromSetup @ 0x1403ad091\n// > SecretLayer5::init @ 0x1403f4e09\n// > LabelGameObject::createLabel @ 0x1404b35f0\n// > LabelGameObject::createLabel @ 0x1404b3611\n// > <???> @ 0x140677a78\n// > <???> @ 0x140677a88\n// > <???> @ 0x1406cb448\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid GameManager::loadFont(GameManager *a1, int a2)\n{\n  int v2; // eax\n  int m_loadedFont; // edx\n  int v5; // edi\n  cocos2d::CCString *v6; // rax\n  const char *CString; // rbx\n  cocos2d::CCTextureCache *v8; // rax\n  cocos2d::CCString *v9; // rax\n  const char *v10; // rbx\n  cocos2d::CCTextureCache *v11; // rax\n\n  v2 = 59;\n  if ( a2 < 59 )\n    v2 = a2;\n  m_loadedFont = a1->m_loadedFont;\n  v5 = 0;\n  if ( v2 > 0 )\n    v5 = v2;\n  if ( v5 != m_loadedFont )\n  {\n    if ( m_loadedFont )\n    {\n      v6 = cocos2d::CCString::createWithFormat(\"gjFont%02d.png\", m_loadedFont);\n      CString = cocos2d::CCString::getCString(v6);\n      v8 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n      cocos2d::CCTextureCache::removeTextureForKey(v8, CString);\n    }\n    if ( v5 )\n    {\n      v9 = cocos2d::CCString::createWithFormat(\"gjFont%02d.png\", v5);\n      v10 = cocos2d::CCString::getCString(v9);\n      v11 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n      cocos2d::CCTextureCache::addImage(v11, v10, 0);\n    }\n    a1->m_loadedFont = v5;\n  }\n}", "assembly": "; \n; GameManager::loadFont from 0x1401827f0 to 0x140182896 (166 bytes)\n; \n; 25 xrefs:\n; > CustomizeObjectLayer::init @ 0x1400a6faa\n; > CustomizeObjectLayer::init @ 0x1400a6fcb\n; > CustomizeObjectLayer::init @ 0x1400a72fb\n; > CustomizeObjectLayer::init @ 0x1400a731c\n; > GameObject::createWithKey @ 0x14018b9f2\n; > GameObject::createWithKey @ 0x14018ba16\n; > TextGameObject::updateTextObject @ 0x1401a77fc\n; > TextGameObject::updateTextObject @ 0x1401a781d\n; > GJBaseGameLayer::createTextLayers @ 0x14020ed37\n; > GJBaseGameLayer::createTextLayers @ 0x14020ed5b\n; > SelectFontLayer::updateFontLabel @ 0x14028ebe5\n; > SelectFontLayer::updateFontLabel @ 0x14028ec72\n; > SelectFontLayer::updateFontLabel @ 0x14028ec93\n; > LevelEditorLayer::createObjectsFromSetup @ 0x1402d3a80\n; > LevelEditorLayer::updateLevelFont @ 0x1402df382\n; > LevelEditorLayer::updateLevelFont @ 0x1402df3a6\n; > PlayLayer::setupHasCompleted @ 0x1403a6eef\n; > PlayLayer::setupHasCompleted @ 0x1403a6f10\n; > PlayLayer::prepareCreateObjectsFromSetup @ 0x1403ad091\n; > SecretLayer5::init @ 0x1403f4e09\n; > LabelGameObject::createLabel @ 0x1404b35f0\n; > LabelGameObject::createLabel @ 0x1404b3611\n; > <???> @ 0x140677a78\n; > <???> @ 0x140677a88\n; > <???> @ 0x1406cb448\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nmov     [rsp+arg_8], rsi                                               ; +0x0, 0x1401827f0\npush    rdi                                                            ; +0x5, 0x1401827f5\nsub     rsp, 20h                                                       ; +0x6, 0x1401827f6\nmov     eax, 3Bh ; ';'                                                 ; +0xa, 0x1401827fa\nmov     rsi, rcx                                                       ; +0xf, 0x1401827ff\ncmp     edx, eax                                                       ; +0x12, 0x140182802\ncmovl   eax, edx                                                       ; +0x14, 0x140182804\nmov     edx, [rcx+3CCh]                                                ; +0x17, 0x140182807\nxor     edi, edi                                                       ; +0x1d, 0x14018280d\ntest    eax, eax                                                       ; +0x1f, 0x14018280f\ncmovg   edi, eax                                                       ; +0x21, 0x140182811\ncmp     edi, edx                                                       ; +0x24, 0x140182814\njz      short loc_14018288B                                            ; +0x26, 0x140182816\nmov     [rsp+28h+arg_0], rbx                                           ; +0x28, 0x140182818\ntest    edx, edx                                                       ; +0x2d, 0x14018281d\njz      short loc_14018284C                                            ; +0x2f, 0x14018281f\nlea     rcx, aGjfont02dPng; \"gjFont%02d.png\"                           ; +0x31, 0x140182821\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x38, 0x140182828\nmov     rcx, rax                                                       ; +0x3e, 0x14018282e\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x41, 0x140182831\nmov     rbx, rax                                                       ; +0x47, 0x140182837\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x4a, 0x14018283a\nmov     rcx, rax                                                       ; +0x50, 0x140182840\nmov     rdx, rbx                                                       ; +0x53, 0x140182843\ncall    cs:?removeTextureForKey@CCTextureCache@cocos2d@@QEAAXPEBD@Z; cocos2d::CCTextureCache::removeTextureForKey(char const *) ; +0x56, 0x140182846\ntest    edi, edi                                                       ; +0x5c, 0x14018284c\njz      short loc_140182880                                            ; +0x5e, 0x14018284e\nmov     edx, edi                                                       ; +0x60, 0x140182850\nlea     rcx, aGjfont02dPng; \"gjFont%02d.png\"                           ; +0x62, 0x140182852\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x69, 0x140182859\nmov     rcx, rax                                                       ; +0x6f, 0x14018285f\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x72, 0x140182862\nmov     rbx, rax                                                       ; +0x78, 0x140182868\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x7b, 0x14018286b\nxor     r8d, r8d                                                       ; +0x81, 0x140182871\nmov     rdx, rbx                                                       ; +0x84, 0x140182874\nmov     rcx, rax                                                       ; +0x87, 0x140182877\ncall    cs:?addImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD_N@Z; cocos2d::CCTextureCache::addImage(char const *,bool) ; +0x8a, 0x14018287a\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x90, 0x140182880\nmov     [rsi+3CCh], edi                                                ; +0x95, 0x140182885\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x9b, 0x14018288b\nadd     rsp, 20h                                                       ; +0xa0, 0x140182890\npop     rdi                                                            ; +0xa4, 0x140182894\nretn                                                                   ; +0xa5, 0x140182895", "xrefs": ["CustomizeObjectLayer::init @ 0x1400a6faa", "CustomizeObjectLayer::init @ 0x1400a6fcb", "CustomizeObjectLayer::init @ 0x1400a72fb", "CustomizeObjectLayer::init @ 0x1400a731c", "GameObject::createWithKey @ 0x14018b9f2", "GameObject::createWithKey @ 0x14018ba16", "TextGameObject::updateTextObject @ 0x1401a77fc", "TextGameObject::updateTextObject @ 0x1401a781d", "GJBaseGameLayer::createTextLayers @ 0x14020ed37", "GJBaseGameLayer::createTextLayers @ 0x14020ed5b", "SelectFontLayer::updateFontLabel @ 0x14028ebe5", "SelectFontLayer::updateFontLabel @ 0x14028ec72", "SelectFontLayer::updateFontLabel @ 0x14028ec93", "LevelEditorLayer::createObjectsFromSetup @ 0x1402d3a80", "LevelEditorLayer::updateLevelFont @ 0x1402df382", "LevelEditorLayer::updateLevelFont @ 0x1402df3a6", "PlayLayer::setupHasCompleted @ 0x1403a6eef", "PlayLayer::setupHasCompleted @ 0x1403a6f10", "PlayLayer::prepareCreateObjectsFromSetup @ 0x1403ad091", "SecretLayer5::init @ 0x1403f4e09", "LabelGameObject::createLabel @ 0x1404b35f0", "LabelGameObject::createLabel @ 0x1404b3611", "<???> @ 0x140677a78", "<???> @ 0x140677a88", "<???> @ 0x1406cb448"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}