{"type": "func", "start": 6442703168, "end": 6442703483, "name": "sub_18003D940", "pseudocode": "// \n// sub_18003D940 from 0x18003d940 to 0x18003da7b (315 bytes)\n// \n// 6 xrefs:\n// > DS_Dictionary::copyFile @ 0x18001908d\n// > DS_Dictionary::loadRootSubDictFromCompressedFile @ 0x18001b9bb\n// > DS_Dictionary::loadRootSubDictFromFile @ 0x18001bd59\n// > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x18001d555\n// > DS_Dictionary::saveRootSubDictToFile @ 0x18001dd3e\n// > <???> @ 0x1801bb254\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:21:37 +0000\n// \n\n// Hidden C++ exception states: #wind=1\n__int64 __fastcall sub_18003D940(__int64 a1)\n{\n  struct cocos2d::CCFileUtils *v2; // rax\n  __int64 v3; // rdi\n  unsigned __int64 v4; // rdx\n  _QWORD *v5; // rcx\n  _BYTE *v6; // rcx\n  void *Block; // [rsp+40h] [rbp-38h] BYREF\n  unsigned __int64 v9; // [rsp+58h] [rbp-20h]\n\n  *(_OWORD *)a1 = 0;\n  *(_QWORD *)(a1 + 16) = 0;\n  *(_QWORD *)(a1 + 24) = 15;\n  *(_BYTE *)a1 = 0;\n  v2 = cocos2d::CCFileUtils::sharedFileUtils();\n  v3 = (*(__int64 (__fastcall **)(struct cocos2d::CCFileUtils *, void **))(*(_QWORD *)v2 + 136LL))(v2, &Block);\n  if ( a1 != v3 )\n  {\n    v4 = *(_QWORD *)(a1 + 24);\n    if ( v4 > 0xF )\n    {\n      v5 = *(_QWORD **)a1;\n      if ( v4 + 1 >= 0x1000 )\n      {\n        if ( (unsigned __int64)v5 - *(v5 - 1) - 8 > 0x1F )\n          goto LABEL_11;\n        v5 = (_QWORD *)*(v5 - 1);\n      }\n      j_j_free_0(v5);\n    }\n    *(_QWORD *)(a1 + 16) = 0;\n    *(_QWORD *)(a1 + 24) = 15;\n    *(_BYTE *)a1 = 0;\n    *(_OWORD *)a1 = *(_OWORD *)v3;\n    *(_OWORD *)(a1 + 16) = *(_OWORD *)(v3 + 16);\n    *(_QWORD *)(v3 + 16) = 0;\n    *(_QWORD *)(v3 + 24) = 15;\n    *(_BYTE *)v3 = 0;\n  }\n  if ( v9 > 0xF )\n  {\n    v6 = Block;\n    if ( v9 + 1 >= 0x1000 )\n    {\n      v6 = *((_BYTE **)Block - 1);\n      if ( (unsigned __int64)((_BYTE *)Block - v6 - 8) > 0x1F )\nLABEL_11:\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free_0(v6);\n  }\n  return a1;\n}", "assembly": "; \n; sub_18003D940 from 0x18003d940 to 0x18003da7b (315 bytes)\n; \n; 6 xrefs:\n; > DS_Dictionary::copyFile @ 0x18001908d\n; > DS_Dictionary::loadRootSubDictFromCompressedFile @ 0x18001b9bb\n; > DS_Dictionary::loadRootSubDictFromFile @ 0x18001bd59\n; > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x18001d555\n; > DS_Dictionary::saveRootSubDictToFile @ 0x18001dd3e\n; > <???> @ 0x1801bb254\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:21:37 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x18003d940\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x18003d945\npush    rdi                                                            ; +0xa, 0x18003d94a\nsub     rsp, 70h                                                       ; +0xb, 0x18003d94b\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x18003d94f\nxor     rax, rsp                                                       ; +0x16, 0x18003d956\nmov     [rsp+78h+var_18], rax                                          ; +0x19, 0x18003d959\nmov     rbx, rcx                                                       ; +0x1e, 0x18003d95e\nmov     [rsp+78h+var_40], rcx                                          ; +0x21, 0x18003d961\nxor     esi, esi                                                       ; +0x26, 0x18003d966\nmov     [rsp+78h+var_48], esi                                          ; +0x28, 0x18003d968\nxorps   xmm0, xmm0                                                     ; +0x2c, 0x18003d96c\nmovups  xmmword ptr [rcx], xmm0                                        ; +0x2f, 0x18003d96f\nmov     [rcx+10h], rsi                                                 ; +0x32, 0x18003d972\nmov     qword ptr [rcx+18h], 0Fh                                       ; +0x36, 0x18003d976\nmov     [rcx], sil                                                     ; +0x3e, 0x18003d97e\nmov     [rsp+78h+var_48], 1                                            ; +0x41, 0x18003d981\ncall    ?sharedFileUtils@CCFileUtils@cocos2d@@SAPEAV12@XZ; cocos2d::CCFileUtils::sharedFileUtils(void) ; +0x49, 0x18003d989\nmov     rcx, rax                                                       ; +0x4e, 0x18003d98e\nmov     rax, [rax]                                                     ; +0x51, 0x18003d991\nlea     rdx, [rsp+78h+Block]                                           ; +0x54, 0x18003d994\ncall    qword ptr [rax+88h]                                            ; +0x59, 0x18003d999\nmov     rdi, rax                                                       ; +0x5f, 0x18003d99f\ncmp     rbx, rax                                                       ; +0x62, 0x18003d9a2\njz      short loc_18003DA09                                            ; +0x65, 0x18003d9a5\nmov     rdx, [rbx+18h]                                                 ; +0x67, 0x18003d9a7\ncmp     rdx, 0Fh                                                       ; +0x6b, 0x18003d9ab\njbe     short loc_18003D9DD                                            ; +0x6f, 0x18003d9af\ninc     rdx                                                            ; +0x71, 0x18003d9b1\nmov     rcx, [rbx]                                                     ; +0x74, 0x18003d9b4\ncmp     rdx, 1000h                                                     ; +0x77, 0x18003d9b7\njb      short loc_18003D9D8                                            ; +0x7e, 0x18003d9be\nadd     rdx, 27h ; '''                                                 ; +0x80, 0x18003d9c0\nmov     rax, [rcx-8]                                                   ; +0x84, 0x18003d9c4\nsub     rcx, rax                                                       ; +0x88, 0x18003d9c8\nsub     rcx, 8                                                         ; +0x8b, 0x18003d9cb\ncmp     rcx, 1Fh                                                       ; +0x8f, 0x18003d9cf\nja      short loc_18003DA3D                                            ; +0x93, 0x18003d9d3\nmov     rcx, rax; Block                                                ; +0x95, 0x18003d9d5\ncall    j_j_free_0                                                     ; +0x98, 0x18003d9d8\nmov     [rbx+10h], rsi                                                 ; +0x9d, 0x18003d9dd\nmov     qword ptr [rbx+18h], 0Fh                                       ; +0xa1, 0x18003d9e1\nmov     byte ptr [rbx], 0                                              ; +0xa9, 0x18003d9e9\nmovups  xmm0, xmmword ptr [rdi]                                        ; +0xac, 0x18003d9ec\nmovups  xmmword ptr [rbx], xmm0                                        ; +0xaf, 0x18003d9ef\nmovups  xmm1, xmmword ptr [rdi+10h]                                    ; +0xb2, 0x18003d9f2\nmovups  xmmword ptr [rbx+10h], xmm1                                    ; +0xb6, 0x18003d9f6\nmov     [rdi+10h], rsi                                                 ; +0xba, 0x18003d9fa\nmov     qword ptr [rdi+18h], 0Fh                                       ; +0xbe, 0x18003d9fe\nmov     byte ptr [rdi], 0                                              ; +0xc6, 0x18003da06\nmov     rdx, [rsp+78h+var_20]                                          ; +0xc9, 0x18003da09\ncmp     rdx, 0Fh                                                       ; +0xce, 0x18003da0e\njbe     short loc_18003DA58                                            ; +0xd2, 0x18003da12\ninc     rdx                                                            ; +0xd4, 0x18003da14\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0xd7, 0x18003da17\nmov     rax, rcx                                                       ; +0xdc, 0x18003da1c\ncmp     rdx, 1000h                                                     ; +0xdf, 0x18003da1f\njb      short loc_18003DA53                                            ; +0xe6, 0x18003da26\nadd     rdx, 27h ; '''                                                 ; +0xe8, 0x18003da28\nmov     rcx, [rcx-8]                                                   ; +0xec, 0x18003da2c\nsub     rax, rcx                                                       ; +0xf0, 0x18003da30\nsub     rax, 8                                                         ; +0xf3, 0x18003da33\ncmp     rax, 1Fh                                                       ; +0xf7, 0x18003da37\njbe     short loc_18003DA53                                            ; +0xfb, 0x18003da3b\nmov     [rsp+78h+Reserved], rsi; Reserved                              ; +0xfd, 0x18003da3d\nxor     r9d, r9d; LineNo                                               ; +0x102, 0x18003da42\nxor     r8d, r8d; FileName                                             ; +0x105, 0x18003da45\nxor     edx, edx; FunctionName                                         ; +0x108, 0x18003da48\nxor     ecx, ecx; Expression                                           ; +0x10a, 0x18003da4a\ncall    cs:_invoke_watson                                              ; +0x10c, 0x18003da4c\ndb 0CCh                                                                ; +0x112, 0x18003da52\ncall    j_j_free_0                                                     ; +0x113, 0x18003da53\nmov     rax, rbx                                                       ; +0x118, 0x18003da58\nmov     rcx, [rsp+78h+var_18]                                          ; +0x11b, 0x18003da5b\nxor     rcx, rsp; StackCookie                                          ; +0x120, 0x18003da60\ncall    __security_check_cookie                                        ; +0x123, 0x18003da63\nlea     r11, [rsp+78h+var_8]                                           ; +0x128, 0x18003da68\nmov     rbx, [r11+18h]                                                 ; +0x12d, 0x18003da6d\nmov     rsi, [r11+20h]                                                 ; +0x131, 0x18003da71\nmov     rsp, r11                                                       ; +0x135, 0x18003da75\npop     rdi                                                            ; +0x138, 0x18003da78\nretn                                                                   ; +0x139, 0x18003da79\ndb 0CCh                                                                ; +0x13a, 0x18003da7a", "xrefs": ["DS_Dictionary::copyFile @ 0x18001908d", "DS_Dictionary::loadRootSubDictFromCompressedFile @ 0x18001b9bb", "DS_Dictionary::loadRootSubDictFromFile @ 0x18001bd59", "DS_Dictionary::saveRootSubDictToCompressedFile @ 0x18001d555", "DS_Dictionary::saveRootSubDictToFile @ 0x18001dd3e", "<???> @ 0x1801bb254"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}