{"type": "func", "start": 6443667016, "end": 6443667263, "name": "common_getenv_s<wchar_t>", "pseudocode": "// \n// common_getenv_s<wchar_t> from 0x180128e48 to 0x180128f3f (247 bytes)\n// \n// 3 xrefs:\n// > common_getenv_s<wchar_t> @ 0x180128f40\n// > <???> @ 0x180202a44\n// > <???> @ 0x180202a50\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 10:54:56 +0000\n// \n\n__int64 __fastcall common_getenv_s<wchar_t>(rsize_t *a1, wchar_t *a2, rsize_t a3, wchar_t *a4)\n{\n  unsigned int v8; // ebx\n  int v9; // eax\n  const wchar_t *v10; // r8\n  __int64 v11; // rax\n  rsize_t v12; // rax\n\n  sub_1801346AC(11);\n  v8 = 0;\n  if ( !a1 )\n    goto LABEL_2;\n  *a1 = 0;\n  if ( a2 )\n  {\n    if ( !a3 )\n      goto LABEL_8;\nLABEL_7:\n    v9 = 1;\n    goto LABEL_9;\n  }\n  if ( !a3 )\n    goto LABEL_7;\nLABEL_8:\n  v9 = 0;\nLABEL_9:\n  if ( !v9 )\n  {\nLABEL_2:\n    v8 = 22;\n    *errno() = 22;\n    invalid_parameter_noinfo();\n    goto LABEL_19;\n  }\n  if ( a2 )\n    *a2 = 0;\n  v10 = common_getenv_nolock<wchar_t>(a4);\n  if ( v10 )\n  {\n    v11 = -1;\n    do\n      ++v11;\n    while ( v10[v11] );\n    v12 = v11 + 1;\n    *a1 = v12;\n    if ( a3 )\n    {\n      if ( v12 <= a3 )\n      {\n        if ( wcscpy_s(a2, a3, v10) )\n          invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n      }\n      else\n      {\n        v8 = 34;\n      }\n    }\n  }\nLABEL_19:\n  sub_180134700(11);\n  return v8;\n}", "assembly": "; \n; common_getenv_s<wchar_t> from 0x180128e48 to 0x180128f3f (247 bytes)\n; \n; 3 xrefs:\n; > common_getenv_s<wchar_t> @ 0x180128f40\n; > <???> @ 0x180202a44\n; > <???> @ 0x180202a50\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 10:54:56 +0000\n; \nmov     rax, rsp                                                       ; +0x0, 0x180128e48\nmov     [rax+8], rbx                                                   ; +0x3, 0x180128e4b\nmov     [rax+10h], rsi                                                 ; +0x7, 0x180128e4f\nmov     [rax+18h], rdi                                                 ; +0xb, 0x180128e53\nmov     [rax+20h], r14                                                 ; +0xf, 0x180128e57\npush    r15                                                            ; +0x13, 0x180128e5b\nsub     rsp, 30h                                                       ; +0x15, 0x180128e5d\nmov     r15, r9                                                        ; +0x19, 0x180128e61\nmov     rsi, r8                                                        ; +0x1c, 0x180128e64\nmov     rdi, rdx                                                       ; +0x1f, 0x180128e67\nmov     r14, rcx                                                       ; +0x22, 0x180128e6a\nmov     ecx, 0Bh                                                       ; +0x25, 0x180128e6d\ncall    sub_1801346AC                                                  ; +0x2a, 0x180128e72\nnop                                                                    ; +0x2f, 0x180128e77\nxor     ebx, ebx                                                       ; +0x30, 0x180128e78\ntest    r14, r14                                                       ; +0x32, 0x180128e7a\njnz     short loc_180128E92                                            ; +0x35, 0x180128e7d\ncall    _errno                                                         ; +0x37, 0x180128e7f\nmov     ebx, 16h                                                       ; +0x3c, 0x180128e84\nmov     [rax], ebx                                                     ; +0x41, 0x180128e89\ncall    _invalid_parameter_noinfo                                      ; +0x43, 0x180128e8b\njmp     short loc_180128F02                                            ; +0x48, 0x180128e90\nmov     [r14], rbx                                                     ; +0x4a, 0x180128e92\ntest    rdi, rdi                                                       ; +0x4d, 0x180128e95\njz      short loc_180128EA4                                            ; +0x50, 0x180128e98\ntest    rsi, rsi                                                       ; +0x52, 0x180128e9a\njnz     short loc_180128EA9                                            ; +0x55, 0x180128e9d\ntest    rdi, rdi                                                       ; +0x57, 0x180128e9f\njnz     short loc_180128EB0                                            ; +0x5a, 0x180128ea2\ntest    rsi, rsi                                                       ; +0x5c, 0x180128ea4\njnz     short loc_180128EB0                                            ; +0x5f, 0x180128ea7\nmov     eax, 1                                                         ; +0x61, 0x180128ea9\njmp     short loc_180128EB2                                            ; +0x66, 0x180128eae\nmov     eax, ebx                                                       ; +0x68, 0x180128eb0\ntest    eax, eax                                                       ; +0x6a, 0x180128eb2\njz      short loc_180128E7F                                            ; +0x6c, 0x180128eb4\ntest    rdi, rdi                                                       ; +0x6e, 0x180128eb6\njz      short loc_180128EBE                                            ; +0x71, 0x180128eb9\nmov     [rdi], bx                                                      ; +0x73, 0x180128ebb\nmov     rcx, r15; String2                                              ; +0x76, 0x180128ebe\ncall    ??$common_getenv_nolock@_W@@YAPEA_WQEB_W@Z                     ; +0x79, 0x180128ec1\nmov     r8, rax; Source                                                ; +0x7e, 0x180128ec6\ntest    rax, rax                                                       ; +0x81, 0x180128ec9\njz      short loc_180128F02                                            ; +0x84, 0x180128ecc\nor      rax, 0FFFFFFFFFFFFFFFFh                                        ; +0x86, 0x180128ece\ninc     rax                                                            ; +0x8a, 0x180128ed2\ncmp     [r8+rax*2], bx                                                 ; +0x8d, 0x180128ed5\njnz     short loc_180128ED2                                            ; +0x92, 0x180128eda\ninc     rax                                                            ; +0x94, 0x180128edc\nmov     [r14], rax                                                     ; +0x97, 0x180128edf\ntest    rsi, rsi                                                       ; +0x9a, 0x180128ee2\njz      short loc_180128F02                                            ; +0x9d, 0x180128ee5\ncmp     rax, rsi                                                       ; +0x9f, 0x180128ee7\njbe     short loc_180128EF3                                            ; +0xa2, 0x180128eea\nmov     ebx, 22h ; '\"'                                                 ; +0xa4, 0x180128eec\njmp     short loc_180128F02                                            ; +0xa9, 0x180128ef1\nmov     rdx, rsi; SizeInWords                                          ; +0xab, 0x180128ef3\nmov     rcx, rdi; Destination                                          ; +0xae, 0x180128ef6\ncall    wcscpy_s                                                       ; +0xb1, 0x180128ef9\ntest    eax, eax                                                       ; +0xb6, 0x180128efe\njnz     short loc_180128F29                                            ; +0xb8, 0x180128f00\nmov     ecx, 0Bh                                                       ; +0xba, 0x180128f02\ncall    sub_180134700                                                  ; +0xbf, 0x180128f07\nmov     eax, ebx                                                       ; +0xc4, 0x180128f0c\nmov     rbx, [rsp+38h+arg_0]                                           ; +0xc6, 0x180128f0e\nmov     rsi, [rsp+38h+arg_8]                                           ; +0xcb, 0x180128f13\nmov     rdi, [rsp+38h+arg_10]                                          ; +0xd0, 0x180128f18\nmov     r14, [rsp+38h+arg_18]                                          ; +0xd5, 0x180128f1d\nadd     rsp, 30h                                                       ; +0xda, 0x180128f22\npop     r15                                                            ; +0xde, 0x180128f26\nretn                                                                   ; +0xe0, 0x180128f28\nmov     [rsp+38h+Reserved], rbx; Reserved                              ; +0xe1, 0x180128f29\nxor     r9d, r9d; LineNo                                               ; +0xe6, 0x180128f2e\nxor     r8d, r8d; FileName                                             ; +0xe9, 0x180128f31\nxor     edx, edx; FunctionName                                         ; +0xec, 0x180128f34\nxor     ecx, ecx; Expression                                           ; +0xee, 0x180128f36\ncall    _invoke_watson                                                 ; +0xf0, 0x180128f38\ndb 90h                                                                 ; +0xf5, 0x180128f3d\ndb 0CCh                                                                ; +0xf6, 0x180128f3e", "xrefs": ["common_getenv_s<wchar_t> @ 0x180128f40", "<???> @ 0x180202a44", "<???> @ 0x180202a50"], "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"}