//
// strcpy_s from 0x180132afc to 0x180132b5b (95 bytes)
//
// 9 xrefs:
// > __std_exception_copy @ 0x180127039
// > create_environment @ 0x180131fa8
// > fp_format_e_internal @ 0x180137b4b
// > sub_180137FE0 @ 0x180138132
// > common_set_variable_in_environment_nolock @ 0x18013b033
// > copy_environment @ 0x18013b491
// > __acrt_fltout @ 0x18013e2b6
// > __acrt_fltout @ 0x18013f3b3
// > ??> @ 0x1802030e0
//
// 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 strcpy_s(char *Destination, rsize_t SizeInBytes, const char *Source)
{
errno_t v3; // ebx
int *v4; // rax
char *v6; // r9
signed __int64 v7; // r8
char v8; // al
v3 = 0;
if ( !Destination || !SizeInBytes )
goto LABEL_5;
if ( !Source )
{
*Destination = 0;
LABEL_5:
v4 = errno();
v3 = 22;
LABEL_6:
*v4 = v3;
invalid_parameter_noinfo();
return v3;
}
v6 = Destination;
v7 = Source - Destination;
do
{
v8 = v6[v7];
*v6++ = v8;
if ( !v8 )
break;
--SizeInBytes;
}
while ( SizeInBytes );
if ( !SizeInBytes )
{
*Destination = 0;
v4 = errno();
v3 = 34;
goto LABEL_6;
}
return v3;
}