{"type": "func", "start": 6443731832, "end": 6443731993, "name": "sub_180138B78", "pseudocode": "// \n// sub_180138B78 from 0x180138b78 to 0x180138c19 (161 bytes)\n// \n// 2 xrefs:\n// > _fclose_nolock @ 0x18012fa49\n// > <???> @ 0x180203704\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 sub_180138B78(int a1)\n{\n  int *v2; // [rsp+20h] [rbp-18h] BYREF\n  int v3; // [rsp+40h] [rbp+8h] BYREF\n  char v4; // [rsp+48h] [rbp+10h] BYREF\n  int v5; // [rsp+50h] [rbp+18h] BYREF\n  int v6; // [rsp+58h] [rbp+20h] BYREF\n\n  v3 = a1;\n  if ( a1 == -2 )\n  {\n    *_doserrno() = 0;\n    *errno() = 9;\n  }\n  else\n  {\n    if ( a1 >= 0\n      && a1 < (unsigned int)dword_1801F5560\n      && (*(_BYTE *)(qword_1801F5160[(__int64)a1 >> 6] + 72LL * (a1 & 0x3F) + 56) & 1) != 0 )\n    {\n      v5 = a1;\n      v6 = a1;\n      v2 = &v3;\n      return __crt_seh_guarded_call<int>::operator()<_lambda_751a882b2c74d4b022dec766aa51a29a_,_lambda_628dfdc04ba53c8bfc02c9951375f3f5_ &,_lambda_f6c7be5f7998530c34de24c7437d6b54_>(\n               (__int64)&v4,\n               &v6,\n               &v2,\n               &v5);\n    }\n    *_doserrno() = 0;\n    *errno() = 9;\n    invalid_parameter_noinfo();\n  }\n  return 0xFFFFFFFFLL;\n}", "assembly": "; \n; sub_180138B78 from 0x180138b78 to 0x180138c19 (161 bytes)\n; \n; 2 xrefs:\n; > _fclose_nolock @ 0x18012fa49\n; > <???> @ 0x180203704\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_0], ecx                                               ; +0x0, 0x180138b78\nsub     rsp, 38h                                                       ; +0x4, 0x180138b7c\nmovsxd  rdx, ecx                                                       ; +0x8, 0x180138b80\ncmp     edx, 0FFFFFFFEh                                                ; +0xb, 0x180138b83\njnz     short loc_180138B9D                                            ; +0xe, 0x180138b86\ncall    __doserrno                                                     ; +0x10, 0x180138b88\nand     dword ptr [rax], 0                                             ; +0x15, 0x180138b8d\ncall    _errno                                                         ; +0x18, 0x180138b90\nmov     dword ptr [rax], 9                                             ; +0x1d, 0x180138b95\njmp     short loc_180138C11                                            ; +0x23, 0x180138b9b\ntest    ecx, ecx                                                       ; +0x25, 0x180138b9d\njs      short loc_180138BF9                                            ; +0x27, 0x180138b9f\ncmp     edx, cs:dword_1801F5560                                        ; +0x29, 0x180138ba1\njnb     short loc_180138BF9                                            ; +0x2f, 0x180138ba7\nmov     rcx, rdx                                                       ; +0x31, 0x180138ba9\nlea     r8, qword_1801F5160                                            ; +0x34, 0x180138bac\nand     ecx, 3Fh                                                       ; +0x3b, 0x180138bb3\nmov     rax, rdx                                                       ; +0x3e, 0x180138bb6\nsar     rax, 6                                                         ; +0x41, 0x180138bb9\nlea     rcx, [rcx+rcx*8]                                               ; +0x45, 0x180138bbd\nmov     rax, [r8+rax*8]                                                ; +0x49, 0x180138bc1\ntest    byte ptr [rax+rcx*8+38h], 1                                    ; +0x4d, 0x180138bc5\njz      short loc_180138BF9                                            ; +0x52, 0x180138bca\nlea     rax, [rsp+38h+arg_0]                                           ; +0x54, 0x180138bcc\nmov     [rsp+38h+arg_10], edx                                          ; +0x59, 0x180138bd1\nmov     [rsp+38h+arg_18], edx                                          ; +0x5d, 0x180138bd5\nlea     r9, [rsp+38h+arg_10]                                           ; +0x61, 0x180138bd9\nlea     rdx, [rsp+38h+arg_18]                                          ; +0x66, 0x180138bde\nmov     [rsp+38h+var_18], rax                                          ; +0x6b, 0x180138be3\nlea     r8, [rsp+38h+var_18]                                           ; +0x70, 0x180138be8\nlea     rcx, [rsp+38h+arg_8]                                           ; +0x75, 0x180138bed\ncall    ??$?RV_lambda_751a882b2c74d4b022dec766aa51a29a_@@AEAV_lambda_628dfdc04ba53c8bfc02c9951375f3f5_@@V_lambda_f6c7be5f7998530c34de24c7437d6b54_@@@?$__crt_seh_guarded_call@H@@QEAAH$$QEAV_lambda_751a882b2c74d4b022dec766aa51a29a_@@AEAV_lambda_628dfdc04ba53c8bfc02c9951375f3f5_@@$$QEAV_lambda_f6c7be5f7998530c34de24c7437d6b54_@@@Z; __crt_seh_guarded_call<int>::operator()<_lambda_751a882b2c74d4b022dec766aa51a29a_,_lambda_628dfdc04ba53c8bfc02c9951375f3f5_ &,_lambda_f6c7be5f7998530c34de24c7437d6b54_>(_lambda_751a882b2c74d4b022dec766aa51a29a_ &&,_lambda_628dfdc04ba53c8bfc02c9951375f3f5_ &,_lambda_f6c7be5f7998530c34de24c7437d6b54_ &&) ; +0x7a, 0x180138bf2\njmp     short loc_180138C14                                            ; +0x7f, 0x180138bf7\ncall    __doserrno                                                     ; +0x81, 0x180138bf9\nand     dword ptr [rax], 0                                             ; +0x86, 0x180138bfe\ncall    _errno                                                         ; +0x89, 0x180138c01\nmov     dword ptr [rax], 9                                             ; +0x8e, 0x180138c06\ncall    _invalid_parameter_noinfo                                      ; +0x94, 0x180138c0c\nor      eax, 0FFFFFFFFh                                                ; +0x99, 0x180138c11\nadd     rsp, 38h                                                       ; +0x9c, 0x180138c14\nretn                                                                   ; +0xa0, 0x180138c18", "xrefs": ["_fclose_nolock @ 0x18012fa49", "<???> @ 0x180203704"], "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"}