{"type": "func", "start": 6443101696, "end": 6443102081, "name": "sub_18009EE00", "pseudocode": "// \n// sub_18009EE00 from 0x18009ee00 to 0x18009ef81 (385 bytes)\n// \n// 9 xrefs:\n// > cocos2d::CCUserDefault::getBoolForKey @ 0x18009e904\n// > cocos2d::CCUserDefault::getDoubleForKey @ 0x18009e9ad\n// > cocos2d::CCUserDefault::getIntegerForKey @ 0x18009ea7c\n// > cocos2d::CCUserDefault::getStringForKey @ 0x18009ebc2\n// > cocos2d::CCUserDefault::setBoolForKey @ 0x18009f2ef\n// > cocos2d::CCUserDefault::setDoubleForKey @ 0x18009f466\n// > cocos2d::CCUserDefault::setIntegerForKey @ 0x18009f5a1\n// > cocos2d::CCUserDefault::setStringForKey @ 0x18009f6af\n// > <???> @ 0x1801b762c\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\n// Hidden C++ exception states: #wind=1\nconst struct tinyxml2::XMLElement *__fastcall sub_18009EE00(__int64 a1, tinyxml2::XMLNode **a2, tinyxml2::XMLNode **a3)\n{\n  const struct tinyxml2::XMLElement *i; // rbx\n  cocos2d::CCUserDefault *v8; // rax\n  tinyxml2::XMLNode *v9; // rdi\n  char **v10; // rbp\n  const char *v11; // rcx\n  FILE *v12; // rax\n  struct cocos2d::CCFileUtils *v13; // rax\n  _BYTE *v14; // rax\n  void *v15; // rbp\n  tinyxml2::XMLNode *ChildElement; // rax\n  const char *Str; // rax\n  __int64 v18; // r8\n  int v19; // ecx\n  int v20; // edx\n  unsigned int v21; // [rsp+50h] [rbp+8h] BYREF\n  cocos2d::CCUserDefault *v22; // [rsp+68h] [rbp+20h]\n\n  i = nullptr;\n  if ( !a1 )\n    return nullptr;\n  v8 = (cocos2d::CCUserDefault *)operator new(0x280u);\n  v22 = v8;\n  if ( v8 )\n    v9 = (tinyxml2::XMLNode *)tinyxml2::XMLDocument::XMLDocument((__int64)v8, 1, 0);\n  else\n    v9 = nullptr;\n  *a3 = v9;\n  cocos2d::CCUserDefault::initXMLFilePath();\n  v10 = &cocos2d::CCUserDefault::m_sFilePath;\n  v11 = (const char *)&cocos2d::CCUserDefault::m_sFilePath;\n  if ( *((_QWORD *)&xmmword_1801A8A40 + 1) > 0xFu )\n    v11 = cocos2d::CCUserDefault::m_sFilePath;\n  v12 = fopen(v11, \"r\");\n  if ( v12 )\n  {\n    fclose(v12);\n    goto LABEL_11;\n  }\n  if ( cocos2d::CCUserDefault::createXMLFile() )\n  {\nLABEL_11:\n    if ( !cocos2d::CCUserDefault::m_spUserDefault )\n    {\n      v22 = (cocos2d::CCUserDefault *)operator new(1u);\n      cocos2d::CCUserDefault::m_spUserDefault = v22;\n    }\n  }\n  v13 = cocos2d::CCFileUtils::sharedFileUtils();\n  if ( *((_QWORD *)&xmmword_1801A8A40 + 1) > 0xFu )\n    v10 = (char **)cocos2d::CCUserDefault::m_sFilePath;\n  v14 = (_BYTE *)((__int64 (__fastcall *)(struct cocos2d::CCFileUtils *, char **, const char *, unsigned int *))v13->addSearchResolutionsOrder)(\n                   v13,\n                   v10,\n                   \"rb\",\n                   &v21);\n  v15 = v14;\n  if ( v14 )\n  {\n    tinyxml2::XMLDocument::Parse((__int64)v9, v14, v21);\n    j_j_free_0(v15);\n    ChildElement = tinyxml2::XMLNode::FirstChildElement(v9, nullptr);\n    *a2 = ChildElement;\n    if ( ChildElement )\n    {\n      for ( i = tinyxml2::XMLNode::FirstChildElement(ChildElement, nullptr);\n            i;\n            i = tinyxml2::XMLNode::NextSiblingElement(i, nullptr) )\n      {\n        Str = tinyxml2::StrPair::GetStr((const struct tinyxml2::XMLElement *)((char *)i + 24));\n        v18 = a1 - (_QWORD)Str;\n        do\n        {\n          v19 = (unsigned __int8)Str[v18];\n          v20 = *(unsigned __int8 *)Str - v19;\n          if ( v20 )\n            break;\n          ++Str;\n        }\n        while ( v19 );\n        if ( !v20 )\n          break;\n      }\n    }\n  }\n  return i;\n}", "assembly": "; \n; sub_18009EE00 from 0x18009ee00 to 0x18009ef81 (385 bytes)\n; \n; 9 xrefs:\n; > cocos2d::CCUserDefault::getBoolForKey @ 0x18009e904\n; > cocos2d::CCUserDefault::getDoubleForKey @ 0x18009e9ad\n; > cocos2d::CCUserDefault::getIntegerForKey @ 0x18009ea7c\n; > cocos2d::CCUserDefault::getStringForKey @ 0x18009ebc2\n; > cocos2d::CCUserDefault::setBoolForKey @ 0x18009f2ef\n; > cocos2d::CCUserDefault::setDoubleForKey @ 0x18009f466\n; > cocos2d::CCUserDefault::setIntegerForKey @ 0x18009f5a1\n; > cocos2d::CCUserDefault::setStringForKey @ 0x18009f6af\n; > <???> @ 0x1801b762c\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], rbx                                               ; +0x0, 0x18009ee00\npush    rbp                                                            ; +0x5, 0x18009ee05\npush    rsi                                                            ; +0x6, 0x18009ee06\npush    rdi                                                            ; +0x7, 0x18009ee07\npush    r14                                                            ; +0x8, 0x18009ee08\npush    r15                                                            ; +0xa, 0x18009ee0a\nsub     rsp, 20h                                                       ; +0xc, 0x18009ee0c\nmov     r14, r8                                                        ; +0x10, 0x18009ee10\nmov     r15, rdx                                                       ; +0x13, 0x18009ee13\nmov     rsi, rcx                                                       ; +0x16, 0x18009ee16\nxor     ebx, ebx                                                       ; +0x19, 0x18009ee19\ntest    rcx, rcx                                                       ; +0x1b, 0x18009ee1b\njnz     short loc_18009EE33                                            ; +0x1e, 0x18009ee1e\nxor     eax, eax                                                       ; +0x20, 0x18009ee20\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x22, 0x18009ee22\nadd     rsp, 20h                                                       ; +0x27, 0x18009ee27\npop     r15                                                            ; +0x2b, 0x18009ee2b\npop     r14                                                            ; +0x2d, 0x18009ee2d\npop     rdi                                                            ; +0x2f, 0x18009ee2f\npop     rsi                                                            ; +0x30, 0x18009ee30\npop     rbp                                                            ; +0x31, 0x18009ee31\nretn                                                                   ; +0x32, 0x18009ee32\nmov     ecx, 280h; Size                                                ; +0x33, 0x18009ee33\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x38, 0x18009ee38\nmov     [rsp+48h+arg_18], rax                                          ; +0x3d, 0x18009ee3d\ntest    rax, rax                                                       ; +0x42, 0x18009ee42\njz      short loc_18009EE59                                            ; +0x45, 0x18009ee45\nxor     r8d, r8d                                                       ; +0x47, 0x18009ee47\nmov     dl, 1                                                          ; +0x4a, 0x18009ee4a\nmov     rcx, rax                                                       ; +0x4c, 0x18009ee4c\ncall    ??0XMLDocument@tinyxml2@@QEAA@_NW4Whitespace@1@@Z; tinyxml2::XMLDocument::XMLDocument(bool,tinyxml2::Whitespace) ; +0x4f, 0x18009ee4f\nmov     rdi, rax                                                       ; +0x54, 0x18009ee54\njmp     short loc_18009EE5C                                            ; +0x57, 0x18009ee57\nmov     rdi, rbx                                                       ; +0x59, 0x18009ee59\nmov     [r14], rdi                                                     ; +0x5c, 0x18009ee5c\ncall    ?initXMLFilePath@CCUserDefault@cocos2d@@CAXXZ; cocos2d::CCUserDefault::initXMLFilePath(void) ; +0x5f, 0x18009ee5f\nlea     rbp, ?m_sFilePath@CCUserDefault@cocos2d@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A; std::string cocos2d::CCUserDefault::m_sFilePath ; +0x64, 0x18009ee64\nmov     rcx, rbp                                                       ; +0x6b, 0x18009ee6b\ncmp     qword ptr cs:xmmword_1801A8A40+8, 0Fh                          ; +0x6e, 0x18009ee6e\ncmova   rcx, cs:?m_sFilePath@CCUserDefault@cocos2d@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A; FileName ; +0x76, 0x18009ee76\nlea     rdx, aR; \"r\"                                                   ; +0x7e, 0x18009ee7e\ncall    cs:fopen                                                       ; +0x85, 0x18009ee85\ntest    rax, rax                                                       ; +0x8b, 0x18009ee8b\njz      short loc_18009EE9B                                            ; +0x8e, 0x18009ee8e\nmov     rcx, rax; Stream                                               ; +0x90, 0x18009ee90\ncall    cs:fclose                                                      ; +0x93, 0x18009ee93\njmp     short loc_18009EEA4                                            ; +0x99, 0x18009ee99\ncall    ?createXMLFile@CCUserDefault@cocos2d@@CA_NXZ; cocos2d::CCUserDefault::createXMLFile(void) ; +0x9b, 0x18009ee9b\ntest    al, al                                                         ; +0xa0, 0x18009eea0\njz      short loc_18009EEC4                                            ; +0xa2, 0x18009eea2\ncmp     cs:?m_spUserDefault@CCUserDefault@cocos2d@@0PEAV12@EA, 0; cocos2d::CCUserDefault * cocos2d::CCUserDefault::m_spUserDefault ; +0xa4, 0x18009eea4\njnz     short loc_18009EEC4                                            ; +0xac, 0x18009eeac\nmov     ecx, 1; Size                                                   ; +0xae, 0x18009eeae\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xb3, 0x18009eeb3\nmov     [rsp+48h+arg_18], rax                                          ; +0xb8, 0x18009eeb8\nmov     cs:?m_spUserDefault@CCUserDefault@cocos2d@@0PEAV12@EA, rax; cocos2d::CCUserDefault * cocos2d::CCUserDefault::m_spUserDefault ; +0xbd, 0x18009eebd\ncall    ?sharedFileUtils@CCFileUtils@cocos2d@@SAPEAV12@XZ; cocos2d::CCFileUtils::sharedFileUtils(void) ; +0xc4, 0x18009eec4\nmov     rcx, rax                                                       ; +0xc9, 0x18009eec9\ncmp     qword ptr cs:xmmword_1801A8A40+8, 0Fh                          ; +0xcc, 0x18009eecc\ncmova   rbp, cs:?m_sFilePath@CCUserDefault@cocos2d@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A; std::string cocos2d::CCUserDefault::m_sFilePath ; +0xd4, 0x18009eed4\nmov     rax, [rax]                                                     ; +0xdc, 0x18009eedc\nlea     r9, [rsp+48h+arg_0]                                            ; +0xdf, 0x18009eedf\nlea     r8, aRb_0; \"rb\"                                                ; +0xe4, 0x18009eee4\nmov     rdx, rbp                                                       ; +0xeb, 0x18009eeeb\ncall    qword ptr [rax+18h]                                            ; +0xee, 0x18009eeee\nmov     rbp, rax                                                       ; +0xf1, 0x18009eef1\ntest    rax, rax                                                       ; +0xf4, 0x18009eef4\njz      short loc_18009EF6D                                            ; +0xf7, 0x18009eef7\nmov     r8d, [rsp+48h+arg_0]                                           ; +0xf9, 0x18009eef9\nmov     rdx, rax                                                       ; +0xfe, 0x18009eefe\nmov     rcx, rdi                                                       ; +0x101, 0x18009ef01\ncall    ?Parse@XMLDocument@tinyxml2@@QEAA?AW4XMLError@2@PEBD_K@Z; tinyxml2::XMLDocument::Parse(char const *,unsigned __int64) ; +0x104, 0x18009ef04\nmov     rcx, rbp; Block                                                ; +0x109, 0x18009ef09\ncall    j_j_free_0                                                     ; +0x10c, 0x18009ef0c\nxor     edx, edx; char *                                               ; +0x111, 0x18009ef11\nmov     rcx, rdi; this                                                 ; +0x113, 0x18009ef13\ncall    ?FirstChildElement@XMLNode@tinyxml2@@QEBAPEBVXMLElement@2@PEBD@Z; tinyxml2::XMLNode::FirstChildElement(char const *) ; +0x116, 0x18009ef16\nmov     [r15], rax                                                     ; +0x11b, 0x18009ef1b\ntest    rax, rax                                                       ; +0x11e, 0x18009ef1e\njz      short loc_18009EF6D                                            ; +0x121, 0x18009ef21\nxor     edx, edx; char *                                               ; +0x123, 0x18009ef23\nmov     rcx, rax; this                                                 ; +0x125, 0x18009ef25\ncall    ?FirstChildElement@XMLNode@tinyxml2@@QEBAPEBVXMLElement@2@PEBD@Z; tinyxml2::XMLNode::FirstChildElement(char const *) ; +0x128, 0x18009ef28\nmov     rbx, rax                                                       ; +0x12d, 0x18009ef2d\ntest    rax, rax                                                       ; +0x130, 0x18009ef30\njz      short loc_18009EF6D                                            ; +0x133, 0x18009ef33\nlea     rcx, [rbx+18h]; this                                           ; +0x135, 0x18009ef35\ncall    ?GetStr@StrPair@tinyxml2@@QEAAPEBDXZ; tinyxml2::StrPair::GetStr(void) ; +0x139, 0x18009ef39\nmov     r8, rsi                                                        ; +0x13e, 0x18009ef3e\nsub     r8, rax                                                        ; +0x141, 0x18009ef41\nmovzx   edx, byte ptr [rax]                                            ; +0x144, 0x18009ef44\nmovzx   ecx, byte ptr [rax+r8]                                         ; +0x147, 0x18009ef47\nsub     edx, ecx                                                       ; +0x14c, 0x18009ef4c\njnz     short loc_18009EF57                                            ; +0x14e, 0x18009ef4e\ninc     rax                                                            ; +0x150, 0x18009ef50\ntest    ecx, ecx                                                       ; +0x153, 0x18009ef53\njnz     short loc_18009EF44                                            ; +0x155, 0x18009ef55\ntest    edx, edx                                                       ; +0x157, 0x18009ef57\njz      short loc_18009EF6D                                            ; +0x159, 0x18009ef59\nxor     edx, edx; char *                                               ; +0x15b, 0x18009ef5b\nmov     rcx, rbx; this                                                 ; +0x15d, 0x18009ef5d\ncall    ?NextSiblingElement@XMLNode@tinyxml2@@QEBAPEBVXMLElement@2@PEBD@Z; tinyxml2::XMLNode::NextSiblingElement(char const *) ; +0x160, 0x18009ef60\nmov     rbx, rax                                                       ; +0x165, 0x18009ef65\ntest    rax, rax                                                       ; +0x168, 0x18009ef68\njnz     short loc_18009EF35                                            ; +0x16b, 0x18009ef6b\nmov     rax, rbx                                                       ; +0x16d, 0x18009ef6d\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x170, 0x18009ef70\nadd     rsp, 20h                                                       ; +0x175, 0x18009ef75\npop     r15                                                            ; +0x179, 0x18009ef79\npop     r14                                                            ; +0x17b, 0x18009ef7b\npop     rdi                                                            ; +0x17d, 0x18009ef7d\npop     rsi                                                            ; +0x17e, 0x18009ef7e\npop     rbp                                                            ; +0x17f, 0x18009ef7f\nretn                                                                   ; +0x180, 0x18009ef80", "xrefs": ["cocos2d::CCUserDefault::getBoolForKey @ 0x18009e904", "cocos2d::CCUserDefault::getDoubleForKey @ 0x18009e9ad", "cocos2d::CCUserDefault::getIntegerForKey @ 0x18009ea7c", "cocos2d::CCUserDefault::getStringForKey @ 0x18009ebc2", "cocos2d::CCUserDefault::setBoolForKey @ 0x18009f2ef", "cocos2d::CCUserDefault::setDoubleForKey @ 0x18009f466", "cocos2d::CCUserDefault::setIntegerForKey @ 0x18009f5a1", "cocos2d::CCUserDefault::setStringForKey @ 0x18009f6af", "<???> @ 0x1801b762c"], "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"}