//
// wcscat_s from 0x180139098 to 0x180139117 (127 bytes)
//
// 22 xrefs:
// > common_assert_to_message_box_build_string @ 0x180130f32
// > common_assert_to_message_box_build_string @ 0x180130f4c
// > common_assert_to_message_box_build_string @ 0x180131035
// > common_assert_to_message_box_build_string @ 0x18013104f
// > common_assert_to_message_box_build_string @ 0x180131069
// > common_assert_to_message_box_build_string @ 0x180131114
// > common_assert_to_message_box_build_string @ 0x180131163
// > common_assert_to_message_box_build_string @ 0x18013117d
// > common_assert_to_message_box_build_string @ 0x18013119a
// > common_assert_to_message_box_build_string @ 0x1801311b4
// > common_assert_to_message_box_build_string @ 0x18013120c
// > common_assert_to_message_box_build_string @ 0x180131226
// > common_assert_to_message_box_build_string @ 0x180131286
// > common_assert_to_message_box_build_string @ 0x1801312a0
// > common_assert_to_message_box_build_string @ 0x1801312ba
// > common_assert_to_message_box_build_string @ 0x1801312d4
// > common_assert_to_message_box_build_string @ 0x1801312ee
// > common_assert_to_message_box_build_string @ 0x18013133e
// > common_assert_to_message_box_build_string @ 0x18013136b
// > common_assert_to_message_box_build_string @ 0x180131387
// > ??> @ 0x18020377c
// > ??> @ 0x180203788
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
errno_t __cdecl wcscat_s(wchar_t *Destination, rsize_t SizeInWords, const wchar_t *Source)
{
errno_t v3; // ebx
wchar_t *v4; // r9
int *v5; // rax
signed __int64 v7; // r8
wchar_t v8; // ax
v3 = 0;
v4 = Destination;
if ( !Destination || !SizeInWords )
goto LABEL_5;
if ( !Source )
{
*Destination = 0;
LABEL_5:
v5 = errno();
v3 = 22;
LABEL_6:
*v5 = v3;
invalid_parameter_noinfo();
return v3;
}
do
{
if ( !*Destination )
break;
++Destination;
--SizeInWords;
}
while ( SizeInWords );
if ( !SizeInWords )
{
*v4 = 0;
goto LABEL_5;
}
v7 = (char *)Source - (char *)Destination;
do
{
v8 = *(wchar_t *)((char *)Destination + v7);
*Destination++ = v8;
if ( !v8 )
break;
--SizeInWords;
}
while ( SizeInWords );
if ( !SizeInWords )
{
*v4 = 0;
v5 = errno();
v3 = 34;
goto LABEL_6;
}
return v3;
}