{"type": "func", "start": 6443712636, "end": 6443712737, "name": "wcscpy_s", "pseudocode": "// \n// wcscpy_s from 0x18013407c to 0x1801340e1 (101 bytes)\n// \n// 8 xrefs:\n// > common_getenv_s<wchar_t> @ 0x180128ef9\n// > common_assert_to_message_box_build_string<wchar_t> @ 0x180130f15\n// > common_assert_to_message_box_build_string<wchar_t> @ 0x180130fb8\n// > create_environment<wchar_t> @ 0x1801320bc\n// > common_set_variable_in_environment_nolock<wchar_t> @ 0x18013b354\n// > copy_environment<wchar_t> @ 0x18013b584\n// > tzset_from_environment_nolock @ 0x18013ce07\n// > <???> @ 0x180203230\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\nerrno_t __cdecl wcscpy_s(wchar_t *Destination, rsize_t SizeInWords, const wchar_t *Source)\n{\n  errno_t v3; // ebx\n  int *v4; // rax\n  wchar_t *v6; // r9\n  signed __int64 v7; // r8\n  wchar_t v8; // ax\n\n  v3 = 0;\n  if ( !Destination || !SizeInWords )\n    goto LABEL_5;\n  if ( !Source )\n  {\n    *Destination = 0;\nLABEL_5:\n    v4 = errno();\n    v3 = 22;\nLABEL_6:\n    *v4 = v3;\n    invalid_parameter_noinfo();\n    return v3;\n  }\n  v6 = Destination;\n  v7 = (char *)Source - (char *)Destination;\n  do\n  {\n    v8 = *(wchar_t *)((char *)v6 + v7);\n    *v6++ = v8;\n    if ( !v8 )\n      break;\n    --SizeInWords;\n  }\n  while ( SizeInWords );\n  if ( !SizeInWords )\n  {\n    *Destination = 0;\n    v4 = errno();\n    v3 = 34;\n    goto LABEL_6;\n  }\n  return v3;\n}", "assembly": "; \n; wcscpy_s from 0x18013407c to 0x1801340e1 (101 bytes)\n; \n; 8 xrefs:\n; > common_getenv_s<wchar_t> @ 0x180128ef9\n; > common_assert_to_message_box_build_string<wchar_t> @ 0x180130f15\n; > common_assert_to_message_box_build_string<wchar_t> @ 0x180130fb8\n; > create_environment<wchar_t> @ 0x1801320bc\n; > common_set_variable_in_environment_nolock<wchar_t> @ 0x18013b354\n; > copy_environment<wchar_t> @ 0x18013b584\n; > tzset_from_environment_nolock @ 0x18013ce07\n; > <???> @ 0x180203230\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, 0x18013407c\nsub     rsp, 20h                                                       ; +0x2, 0x18013407e\nxor     ebx, ebx                                                       ; +0x6, 0x180134082\ntest    rcx, rcx                                                       ; +0x8, 0x180134084\njz      short loc_180134096                                            ; +0xb, 0x180134087\ntest    rdx, rdx                                                       ; +0xd, 0x180134089\njz      short loc_180134096                                            ; +0x10, 0x18013408c\ntest    r8, r8                                                         ; +0x12, 0x18013408e\njnz     short loc_1801340AF                                            ; +0x15, 0x180134091\nmov     [rcx], bx                                                      ; +0x17, 0x180134093\ncall    _errno                                                         ; +0x1a, 0x180134096\nmov     ebx, 16h                                                       ; +0x1f, 0x18013409b\nmov     [rax], ebx                                                     ; +0x24, 0x1801340a0\ncall    _invalid_parameter_noinfo                                      ; +0x26, 0x1801340a2\nmov     eax, ebx                                                       ; +0x2b, 0x1801340a7\nadd     rsp, 20h                                                       ; +0x2d, 0x1801340a9\npop     rbx                                                            ; +0x31, 0x1801340ad\nretn                                                                   ; +0x32, 0x1801340ae\nmov     r9, rcx                                                        ; +0x33, 0x1801340af\nsub     r8, rcx                                                        ; +0x36, 0x1801340b2\nmovzx   eax, word ptr [r8+r9]                                          ; +0x39, 0x1801340b5\nmov     [r9], ax                                                       ; +0x3e, 0x1801340ba\nlea     r9, [r9+2]                                                     ; +0x42, 0x1801340be\ntest    ax, ax                                                         ; +0x46, 0x1801340c2\njz      short loc_1801340CD                                            ; +0x49, 0x1801340c5\nsub     rdx, 1                                                         ; +0x4b, 0x1801340c7\njnz     short loc_1801340B5                                            ; +0x4f, 0x1801340cb\ntest    rdx, rdx                                                       ; +0x51, 0x1801340cd\njnz     short loc_1801340A7                                            ; +0x54, 0x1801340d0\nmov     [rcx], bx                                                      ; +0x56, 0x1801340d2\ncall    _errno                                                         ; +0x59, 0x1801340d5\nmov     ebx, 22h ; '\"'                                                 ; +0x5e, 0x1801340da\njmp     short loc_1801340A0                                            ; +0x63, 0x1801340df", "xrefs": ["common_getenv_s<wchar_t> @ 0x180128ef9", "common_assert_to_message_box_build_string<wchar_t> @ 0x180130f15", "common_assert_to_message_box_build_string<wchar_t> @ 0x180130fb8", "create_environment<wchar_t> @ 0x1801320bc", "common_set_variable_in_environment_nolock<wchar_t> @ 0x18013b354", "copy_environment<wchar_t> @ 0x18013b584", "tzset_from_environment_nolock @ 0x18013ce07", "<???> @ 0x180203230"], "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"}