{"type": "func", "start": 6443733528, "end": 6443733814, "name": "__acrt_GetModuleFileNameA", "pseudocode": "// \n// __acrt_GetModuleFileNameA from 0x180139218 to 0x180139336 (286 bytes)\n// \n// 2 xrefs:\n// > _configure_narrow_argv @ 0x180131d01\n// > <???> @ 0x1802037a0\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__int64 __fastcall _acrt_GetModuleFileNameA(HMODULE a1, __int64 a2, unsigned int a3)\n{\n  __int64 v3; // rdi\n  DWORD LastError; // eax\n  int v7; // r8d\n  _QWORD v8[3]; // [rsp+20h] [rbp-E0h] BYREF\n  char v9; // [rsp+38h] [rbp-C8h]\n  _QWORD v10[4]; // [rsp+40h] [rbp-C0h] BYREF\n  __int64 v11; // [rsp+60h] [rbp-A0h]\n  char v12; // [rsp+68h] [rbp-98h]\n  WCHAR Filename[264]; // [rsp+70h] [rbp-90h] BYREF\n\n  v3 = a3;\n  if ( GetModuleFileNameW(a1, Filename, 0x105u) )\n  {\n    v11 = 0;\n    v10[0] = a2;\n    v10[1] = v3;\n    v10[3] = v3;\n    v10[2] = a2;\n    v12 = 0;\n    _LocaleUpdate::_LocaleUpdate((_LocaleUpdate *)v8, nullptr);\n    v7 = 65001;\n    if ( *(_DWORD *)(v8[1] + 12LL) == 65001 )\n    {\n      if ( v9 )\n        *(_DWORD *)(v8[0] + 936LL) &= ~2u;\n    }\n    else if ( (unsigned int)_acrt_AreFileApisANSI() )\n    {\n      if ( v9 )\n        *(_DWORD *)(v8[0] + 936LL) &= ~2u;\n      v7 = 0;\n    }\n    else\n    {\n      if ( v9 )\n        *(_DWORD *)(v8[0] + 936LL) &= ~2u;\n      v7 = 1;\n    }\n    __acrt_wcs_to_mbs_cp<__crt_win32_buffer_no_resizing>(Filename, (__int64)v10, v7);\n    return (unsigned int)v11;\n  }\n  else\n  {\n    LastError = GetLastError();\n    _acrt_errno_map_os_error(LastError);\n    return 0;\n  }\n}", "assembly": "; \n; __acrt_GetModuleFileNameA from 0x180139218 to 0x180139336 (286 bytes)\n; \n; 2 xrefs:\n; > _configure_narrow_argv @ 0x180131d01\n; > <???> @ 0x1802037a0\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-8+arg_8], rbx                                             ; +0x0, 0x180139218\nmov     [rsp-8+arg_10], rdi                                            ; +0x5, 0x18013921d\npush    rbp                                                            ; +0xa, 0x180139222\nlea     rbp, [rsp-190h]                                                ; +0xb, 0x180139223\nsub     rsp, 290h                                                      ; +0x13, 0x18013922b\nmov     rax, cs:__security_cookie                                      ; +0x1a, 0x180139232\nxor     rax, rsp                                                       ; +0x21, 0x180139239\nmov     [rbp+190h+var_10], rax                                         ; +0x24, 0x18013923c\nmov     edi, r8d                                                       ; +0x2b, 0x180139243\nmov     rbx, rdx                                                       ; +0x2e, 0x180139246\nmov     r8d, 105h; nSize                                               ; +0x31, 0x180139249\nlea     rdx, [rsp+290h+Filename]; lpFilename                           ; +0x37, 0x18013924f\ncall    cs:GetModuleFileNameW                                          ; +0x3c, 0x180139254\ntest    eax, eax                                                       ; +0x42, 0x18013925a\njnz     short loc_180139272                                            ; +0x44, 0x18013925c\ncall    cs:GetLastError                                                ; +0x46, 0x18013925e\nmov     ecx, eax                                                       ; +0x4c, 0x180139264\ncall    __acrt_errno_map_os_error                                      ; +0x4e, 0x180139266\nxor     eax, eax                                                       ; +0x53, 0x18013926b\njmp     loc_180139312                                                  ; +0x55, 0x18013926d\nand     [rsp+290h+var_230], 0                                          ; +0x5a, 0x180139272\nlea     rcx, [rsp+290h+var_270]; this                                  ; +0x60, 0x180139278\nmov     rax, rdi                                                       ; +0x65, 0x18013927d\nmov     [rsp+290h+var_250], rbx                                        ; +0x68, 0x180139280\nxor     edx, edx; struct __crt_locale_pointers *                       ; +0x6d, 0x180139285\nmov     [rsp+290h+var_248], rax                                        ; +0x6f, 0x180139287\nmov     [rsp+290h+var_238], rax                                        ; +0x74, 0x18013928c\nmov     [rsp+290h+var_240], rbx                                        ; +0x79, 0x180139291\nmov     [rsp+290h+var_228], 0                                          ; +0x7e, 0x180139296\ncall    ??0_LocaleUpdate@@QEAA@QEAU__crt_locale_pointers@@@Z           ; +0x83, 0x18013929b\nmov     rax, [rsp+290h+var_268]                                        ; +0x88, 0x1801392a0\nmov     r8d, 0FDE9h                                                    ; +0x8d, 0x1801392a5\ncmp     [rax+0Ch], r8d                                                 ; +0x93, 0x1801392ab\njnz     short loc_1801392C6                                            ; +0x97, 0x1801392af\ncmp     [rsp+290h+var_258], 0                                          ; +0x99, 0x1801392b1\njz      short loc_1801392FF                                            ; +0x9e, 0x1801392b6\nmov     rax, [rsp+290h+var_270]                                        ; +0xa0, 0x1801392b8\nand     dword ptr [rax+3A8h], 0FFFFFFFDh                               ; +0xa5, 0x1801392bd\njmp     short loc_1801392FF                                            ; +0xac, 0x1801392c4\ncall    __acrt_AreFileApisANSI                                         ; +0xae, 0x1801392c6\ntest    eax, eax                                                       ; +0xb3, 0x1801392cb\njnz     short loc_1801392E9                                            ; +0xb5, 0x1801392cd\ncmp     [rsp+290h+var_258], al                                         ; +0xb7, 0x1801392cf\njz      short loc_1801392E1                                            ; +0xbb, 0x1801392d3\nmov     rax, [rsp+290h+var_270]                                        ; +0xbd, 0x1801392d5\nand     dword ptr [rax+3A8h], 0FFFFFFFDh                               ; +0xc2, 0x1801392da\nmov     r8d, 1                                                         ; +0xc9, 0x1801392e1\njmp     short loc_1801392FF                                            ; +0xcf, 0x1801392e7\ncmp     [rsp+290h+var_258], 0                                          ; +0xd1, 0x1801392e9\njz      short loc_1801392FC                                            ; +0xd6, 0x1801392ee\nmov     rax, [rsp+290h+var_270]                                        ; +0xd8, 0x1801392f0\nand     dword ptr [rax+3A8h], 0FFFFFFFDh                               ; +0xdd, 0x1801392f5\nxor     r8d, r8d                                                       ; +0xe4, 0x1801392fc\nlea     rdx, [rsp+290h+var_250]                                        ; +0xe7, 0x1801392ff\nlea     rcx, [rsp+290h+Filename]                                       ; +0xec, 0x180139304\ncall    ??$__acrt_wcs_to_mbs_cp@U__crt_win32_buffer_no_resizing@@@@YAHQEB_WAEAV?$__crt_win32_buffer@DU__crt_win32_buffer_no_resizing@@@@I@Z ; +0xf1, 0x180139309\nmov     eax, dword ptr [rsp+290h+var_230]                              ; +0xf6, 0x18013930e\nmov     rcx, [rbp+190h+var_10]                                         ; +0xfa, 0x180139312\nxor     rcx, rsp; StackCookie                                          ; +0x101, 0x180139319\ncall    __security_check_cookie                                        ; +0x104, 0x18013931c\nlea     r11, [rsp+290h+var_s0]                                         ; +0x109, 0x180139321\nmov     rbx, [r11+18h]                                                 ; +0x111, 0x180139329\nmov     rdi, [r11+20h]                                                 ; +0x115, 0x18013932d\nmov     rsp, r11                                                       ; +0x119, 0x180139331\npop     rbp                                                            ; +0x11c, 0x180139334\nretn                                                                   ; +0x11d, 0x180139335", "xrefs": ["_configure_narrow_argv @ 0x180131d01", "<???> @ 0x1802037a0"], "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"}