{"type": "func", "start": 6442951536, "end": 6442951968, "name": "cocos2d::CCFileUtilsWin32::getPathForFilename", "pseudocode": "// \n// cocos2d::CCFileUtilsWin32::getPathForFilename from 0x18007a370 to 0x18007a520 (432 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x180101138\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b4ca4\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=3\n_QWORD *__fastcall cocos2d::CCFileUtilsWin32::getPathForFilename(\n        __int64 a1,\n        _QWORD *a2,\n        _QWORD *a3,\n        _QWORD *a4,\n        _QWORD *a5)\n{\n  _QWORD *v8; // rdi\n  void *v9; // rcx\n  void *v10; // rcx\n  void *v11; // rcx\n  void *Block[2]; // [rsp+40h] [rbp-98h] BYREF\n  __m128i si128; // [rsp+50h] [rbp-88h]\n  void *v15[2]; // [rsp+60h] [rbp-78h] BYREF\n  __m128i v16; // [rsp+70h] [rbp-68h]\n  void *v17[3]; // [rsp+80h] [rbp-58h] BYREF\n  unsigned __int64 v18; // [rsp+98h] [rbp-40h]\n\n  v8 = a5;\n  if ( a3[3] > 0xFu )\n    a3 = (_QWORD *)*a3;\n  cocos2d::CCFileUtilsWin32::utf8Togbk(a1, v17, a3);\n  if ( a4[3] > 0xFu )\n    a4 = (_QWORD *)*a4;\n  cocos2d::CCFileUtilsWin32::utf8Togbk(a1, v15, a4);\n  if ( a5[3] > 0xFu )\n    v8 = (_QWORD *)*a5;\n  cocos2d::CCFileUtilsWin32::utf8Togbk(a1, Block, v8);\n  cocos2d::CCFileUtils::getPathForFilename(a1, a2, (__int64)v17, (unsigned __int64 *)v15, (__int64)Block);\n  if ( si128.m128i_i64[1] > 0xFuLL )\n  {\n    v9 = Block[0];\n    if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )\n    {\n      v9 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free_0(v9);\n  }\n  si128 = _mm_load_si128((const __m128i *)&xmmword_1800E7160);\n  LOBYTE(Block[0]) = 0;\n  if ( v16.m128i_i64[1] > 0xFuLL )\n  {\n    v10 = v15[0];\n    if ( (unsigned __int64)(v16.m128i_i64[1] + 1) >= 0x1000 )\n    {\n      v10 = *((void **)v15[0] - 1);\n      if ( (unsigned __int64)((char *)v15[0] - (char *)v10 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free_0(v10);\n  }\n  v16 = _mm_load_si128((const __m128i *)&xmmword_1800E7160);\n  LOBYTE(v15[0]) = 0;\n  if ( v18 > 0xF )\n  {\n    v11 = v17[0];\n    if ( v18 + 1 >= 0x1000 )\n    {\n      v11 = *((void **)v17[0] - 1);\n      if ( (unsigned __int64)((char *)v17[0] - (char *)v11 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free_0(v11);\n  }\n  return a2;\n}", "assembly": "; \n; cocos2d::CCFileUtilsWin32::getPathForFilename from 0x18007a370 to 0x18007a520 (432 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x180101138\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b4ca4\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\npush    rbx                                                            ; +0x0, 0x18007a370\npush    rbp                                                            ; +0x2, 0x18007a372\npush    rsi                                                            ; +0x3, 0x18007a373\npush    rdi                                                            ; +0x4, 0x18007a374\nsub     rsp, 0B8h                                                      ; +0x5, 0x18007a375\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x18007a37c\nxor     rax, rsp                                                       ; +0x13, 0x18007a383\nmov     [rsp+0D8h+var_38], rax                                         ; +0x16, 0x18007a386\nmov     rbx, r9                                                        ; +0x1e, 0x18007a38e\nmov     rbp, rdx                                                       ; +0x21, 0x18007a391\nmov     rsi, rcx                                                       ; +0x24, 0x18007a394\nmov     [rsp+0D8h+var_A0], rdx                                         ; +0x27, 0x18007a397\nmov     rdi, [rsp+0D8h+arg_20]                                         ; +0x2c, 0x18007a39c\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x34, 0x18007a3a4\njbe     short loc_18007A3AE                                            ; +0x39, 0x18007a3a9\nmov     r8, [r8]                                                       ; +0x3b, 0x18007a3ab\nlea     rdx, [rsp+0D8h+var_58]                                         ; +0x3e, 0x18007a3ae\ncall    ?utf8Togbk@CCFileUtilsWin32@cocos2d@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBD@Z; cocos2d::CCFileUtilsWin32::utf8Togbk(char const *) ; +0x46, 0x18007a3b6\nnop                                                                    ; +0x4b, 0x18007a3bb\ncmp     qword ptr [rbx+18h], 0Fh                                       ; +0x4c, 0x18007a3bc\njbe     short loc_18007A3C6                                            ; +0x51, 0x18007a3c1\nmov     rbx, [rbx]                                                     ; +0x53, 0x18007a3c3\nmov     r8, rbx                                                        ; +0x56, 0x18007a3c6\nlea     rdx, [rsp+0D8h+var_78]                                         ; +0x59, 0x18007a3c9\nmov     rcx, rsi                                                       ; +0x5e, 0x18007a3ce\ncall    ?utf8Togbk@CCFileUtilsWin32@cocos2d@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBD@Z; cocos2d::CCFileUtilsWin32::utf8Togbk(char const *) ; +0x61, 0x18007a3d1\nnop                                                                    ; +0x66, 0x18007a3d6\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0x67, 0x18007a3d7\njbe     short loc_18007A3E1                                            ; +0x6c, 0x18007a3dc\nmov     rdi, [rdi]                                                     ; +0x6e, 0x18007a3de\nmov     r8, rdi                                                        ; +0x71, 0x18007a3e1\nlea     rdx, [rsp+0D8h+Block]                                          ; +0x74, 0x18007a3e4\nmov     rcx, rsi                                                       ; +0x79, 0x18007a3e9\ncall    ?utf8Togbk@CCFileUtilsWin32@cocos2d@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBD@Z; cocos2d::CCFileUtilsWin32::utf8Togbk(char const *) ; +0x7c, 0x18007a3ec\nnop                                                                    ; +0x81, 0x18007a3f1\nlea     rax, [rsp+0D8h+Block]                                          ; +0x82, 0x18007a3f2\nmov     [rsp+0D8h+var_B8], rax                                         ; +0x87, 0x18007a3f7\nlea     r9, [rsp+0D8h+var_78]                                          ; +0x8c, 0x18007a3fc\nlea     r8, [rsp+0D8h+var_58]                                          ; +0x91, 0x18007a401\nmov     rdx, rbp                                                       ; +0x99, 0x18007a409\nmov     rcx, rsi                                                       ; +0x9c, 0x18007a40c\ncall    ?getPathForFilename@CCFileUtils@cocos2d@@MEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV34@00@Z; cocos2d::CCFileUtils::getPathForFilename(std::string const &,std::string const &,std::string const &) ; +0x9f, 0x18007a40f\nnop                                                                    ; +0xa4, 0x18007a414\nmov     rdx, [rsp+0D8h+var_80]                                         ; +0xa5, 0x18007a415\ncmp     rdx, 0Fh                                                       ; +0xaa, 0x18007a41a\njbe     short loc_18007A455                                            ; +0xae, 0x18007a41e\ninc     rdx                                                            ; +0xb0, 0x18007a420\nmov     rcx, [rsp+0D8h+Block]; Block                                   ; +0xb3, 0x18007a423\nmov     rax, rcx                                                       ; +0xb8, 0x18007a428\ncmp     rdx, 1000h                                                     ; +0xbb, 0x18007a42b\njb      short loc_18007A450                                            ; +0xc2, 0x18007a432\nadd     rdx, 27h ; '''                                                 ; +0xc4, 0x18007a434\nmov     rcx, [rcx-8]                                                   ; +0xc8, 0x18007a438\nsub     rax, rcx                                                       ; +0xcc, 0x18007a43c\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xcf, 0x18007a43f\ncmp     rax, 1Fh                                                       ; +0xd3, 0x18007a443\njbe     short loc_18007A450                                            ; +0xd7, 0x18007a447\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xd9, 0x18007a449\nalign 10h                                                              ; +0xdf, 0x18007a44f\ncall    j_j_free_0                                                     ; +0xe0, 0x18007a450\nmovdqa  xmm0, cs:xmmword_1800E7160                                     ; +0xe5, 0x18007a455\nmovdqu  xmmword ptr [rsp+50h], xmm0                                    ; +0xed, 0x18007a45d\nmov     byte ptr [rsp+0D8h+Block], 0                                   ; +0xf3, 0x18007a463\nmov     rdx, [rsp+0D8h+var_60]                                         ; +0xf8, 0x18007a468\ncmp     rdx, 0Fh                                                       ; +0xfd, 0x18007a46d\njbe     short loc_18007A4A8                                            ; +0x101, 0x18007a471\ninc     rdx                                                            ; +0x103, 0x18007a473\nmov     rcx, [rsp+0D8h+var_78]; Block                                  ; +0x106, 0x18007a476\nmov     rax, rcx                                                       ; +0x10b, 0x18007a47b\ncmp     rdx, 1000h                                                     ; +0x10e, 0x18007a47e\njb      short loc_18007A4A3                                            ; +0x115, 0x18007a485\nadd     rdx, 27h ; '''                                                 ; +0x117, 0x18007a487\nmov     rcx, [rcx-8]                                                   ; +0x11b, 0x18007a48b\nsub     rax, rcx                                                       ; +0x11f, 0x18007a48f\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x122, 0x18007a492\ncmp     rax, 1Fh                                                       ; +0x126, 0x18007a496\njbe     short loc_18007A4A3                                            ; +0x12a, 0x18007a49a\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x12c, 0x18007a49c\ndb 0CCh                                                                ; +0x132, 0x18007a4a2\ncall    j_j_free_0                                                     ; +0x133, 0x18007a4a3\nmovdqa  xmm0, cs:xmmword_1800E7160                                     ; +0x138, 0x18007a4a8\nmovdqu  xmmword ptr [rsp+70h], xmm0                                    ; +0x140, 0x18007a4b0\nmov     byte ptr [rsp+0D8h+var_78], 0                                  ; +0x146, 0x18007a4b6\nmov     rdx, [rsp+0D8h+var_40]                                         ; +0x14b, 0x18007a4bb\ncmp     rdx, 0Fh                                                       ; +0x153, 0x18007a4c3\njbe     short loc_18007A501                                            ; +0x157, 0x18007a4c7\ninc     rdx                                                            ; +0x159, 0x18007a4c9\nmov     rcx, [rsp+0D8h+var_58]; Block                                  ; +0x15c, 0x18007a4cc\nmov     rax, rcx                                                       ; +0x164, 0x18007a4d4\ncmp     rdx, 1000h                                                     ; +0x167, 0x18007a4d7\njb      short loc_18007A4FC                                            ; +0x16e, 0x18007a4de\nadd     rdx, 27h ; '''                                                 ; +0x170, 0x18007a4e0\nmov     rcx, [rcx-8]                                                   ; +0x174, 0x18007a4e4\nsub     rax, rcx                                                       ; +0x178, 0x18007a4e8\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x17b, 0x18007a4eb\ncmp     rax, 1Fh                                                       ; +0x17f, 0x18007a4ef\njbe     short loc_18007A4FC                                            ; +0x183, 0x18007a4f3\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x185, 0x18007a4f5\nalign 4                                                                ; +0x18b, 0x18007a4fb\ncall    j_j_free_0                                                     ; +0x18c, 0x18007a4fc\nmov     rax, rbp                                                       ; +0x191, 0x18007a501\nmov     rcx, [rsp+0D8h+var_38]                                         ; +0x194, 0x18007a504\nxor     rcx, rsp; StackCookie                                          ; +0x19c, 0x18007a50c\ncall    __security_check_cookie                                        ; +0x19f, 0x18007a50f\nadd     rsp, 0B8h                                                      ; +0x1a4, 0x18007a514\npop     rdi                                                            ; +0x1ab, 0x18007a51b\npop     rsi                                                            ; +0x1ac, 0x18007a51c\npop     rbp                                                            ; +0x1ad, 0x18007a51d\npop     rbx                                                            ; +0x1ae, 0x18007a51e\nretn                                                                   ; +0x1af, 0x18007a51f", "xrefs": ["<???> @ 0x180101138", "<???> @ 0x1801438a8", "<???> @ 0x1801b4ca4"], "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"}