{"type": "func", "start": 6443104096, "end": 6443104208, "name": "cocos2d::CCUserDefault::sharedUserDefault", "pseudocode": "// \n// cocos2d::CCUserDefault::sharedUserDefault from 0x18009f760 to 0x18009f7d0 (112 bytes)\n// \n// 6 xrefs:\n// > cocos2d::CCUserDefault::setBoolForKey @ 0x18009f359\n// > cocos2d::CCUserDefault::setDoubleForKey @ 0x18009f4d8\n// > cocos2d::CCUserDefault::setIntegerForKey @ 0x18009f613\n// > cocos2d::CCUserDefault::setStringForKey @ 0x18009f71a\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b76ec\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\nstruct cocos2d::CCUserDefault *__fastcall cocos2d::CCUserDefault::sharedUserDefault()\n{\n  const char *v0; // rcx\n  FILE *v1; // rax\n  struct cocos2d::CCUserDefault *result; // rax\n\n  cocos2d::CCUserDefault::initXMLFilePath();\n  v0 = (const char *)&cocos2d::CCUserDefault::m_sFilePath;\n  if ( *((_QWORD *)&xmmword_1801A8A40 + 1) > 0xFu )\n    v0 = cocos2d::CCUserDefault::m_sFilePath;\n  v1 = fopen(v0, \"r\");\n  if ( v1 )\n  {\n    fclose(v1);\n  }\n  else if ( !cocos2d::CCUserDefault::createXMLFile() )\n  {\n    return nullptr;\n  }\n  result = cocos2d::CCUserDefault::m_spUserDefault;\n  if ( !cocos2d::CCUserDefault::m_spUserDefault )\n  {\n    result = (struct cocos2d::CCUserDefault *)operator new(1u);\n    cocos2d::CCUserDefault::m_spUserDefault = result;\n  }\n  return result;\n}", "assembly": "; \n; cocos2d::CCUserDefault::sharedUserDefault from 0x18009f760 to 0x18009f7d0 (112 bytes)\n; \n; 6 xrefs:\n; > cocos2d::CCUserDefault::setBoolForKey @ 0x18009f359\n; > cocos2d::CCUserDefault::setDoubleForKey @ 0x18009f4d8\n; > cocos2d::CCUserDefault::setIntegerForKey @ 0x18009f613\n; > cocos2d::CCUserDefault::setStringForKey @ 0x18009f71a\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b76ec\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\nsub     rsp, 28h                                                       ; +0x0, 0x18009f760\ncall    ?initXMLFilePath@CCUserDefault@cocos2d@@CAXXZ; cocos2d::CCUserDefault::initXMLFilePath(void) ; +0x4, 0x18009f764\ncmp     qword ptr cs:xmmword_1801A8A40+8, 0Fh                          ; +0x9, 0x18009f769\nlea     rcx, ?m_sFilePath@CCUserDefault@cocos2d@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A; std::string cocos2d::CCUserDefault::m_sFilePath ; +0x11, 0x18009f771\nlea     rdx, aR; \"r\"                                                   ; +0x18, 0x18009f778\ncmova   rcx, cs:?m_sFilePath@CCUserDefault@cocos2d@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A; FileName ; +0x1f, 0x18009f77f\ncall    cs:fopen                                                       ; +0x27, 0x18009f787\ntest    rax, rax                                                       ; +0x2d, 0x18009f78d\njz      short loc_18009F7C0                                            ; +0x30, 0x18009f790\nmov     rcx, rax; Stream                                               ; +0x32, 0x18009f792\ncall    cs:fclose                                                      ; +0x35, 0x18009f795\nmov     rax, cs:?m_spUserDefault@CCUserDefault@cocos2d@@0PEAV12@EA; cocos2d::CCUserDefault * cocos2d::CCUserDefault::m_spUserDefault ; +0x3b, 0x18009f79b\ntest    rax, rax                                                       ; +0x42, 0x18009f7a2\njnz     short loc_18009F7BB                                            ; +0x45, 0x18009f7a5\nlea     ecx, [rax+1]; Size                                             ; +0x47, 0x18009f7a7\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x4a, 0x18009f7aa\nmov     [rsp+28h+arg_0], rax                                           ; +0x4f, 0x18009f7af\nmov     cs:?m_spUserDefault@CCUserDefault@cocos2d@@0PEAV12@EA, rax; cocos2d::CCUserDefault * cocos2d::CCUserDefault::m_spUserDefault ; +0x54, 0x18009f7b4\nadd     rsp, 28h                                                       ; +0x5b, 0x18009f7bb\nretn                                                                   ; +0x5f, 0x18009f7bf\ncall    ?createXMLFile@CCUserDefault@cocos2d@@CA_NXZ; cocos2d::CCUserDefault::createXMLFile(void) ; +0x60, 0x18009f7c0\ntest    al, al                                                         ; +0x65, 0x18009f7c5\njnz     short loc_18009F79B                                            ; +0x67, 0x18009f7c7\nxor     eax, eax                                                       ; +0x69, 0x18009f7c9\nadd     rsp, 28h                                                       ; +0x6b, 0x18009f7cb\nretn                                                                   ; +0x6f, 0x18009f7cf", "xrefs": ["cocos2d::CCUserDefault::setBoolForKey @ 0x18009f359", "cocos2d::CCUserDefault::setDoubleForKey @ 0x18009f4d8", "cocos2d::CCUserDefault::setIntegerForKey @ 0x18009f613", "cocos2d::CCUserDefault::setStringForKey @ 0x18009f71a", "<???> @ 0x1801438a8", "<???> @ 0x1801b76ec"], "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"}