//
// common_expand_argv_wildcards from 0x180139a40 to 0x180139c49 (521 bytes)
//
// 2 xrefs:
// > common_expand_argv_wildcards @ 0x18013a0e4
// > ??> @ 0x18020380c
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:55:01 +0000
//
__int64 __fastcall common_expand_argv_wildcards(const char **a1, _QWORD *a2)
{
const char **v2; // rbx
const char *i; // rax
char *v5; // rax
char *v6; // rcx
unsigned int v7; // eax
unsigned int v8; // esi
char *buffer_for_argv; // rax
char *v10; // rdx
__int64 Control; // [rsp+B0h] [rbp+50h] BYREF
char *v13; // [rsp+B8h] [rbp+58h]
v2 = a1;
if ( a2 )
{
*a2 = 0;
for ( i = *a1; i; i = *v2 )
{
strcpy((char *)&Control, "*?");
v5 = strpbrk(i, (const char *)&Control);
v6 = (char *)*v2;
if ( v5 )
v7 = wsetlocale_set_cat(v6);
else
v7 = copy_and_add_argument_to_buffer(v6, nullptr, 0);
v8 = v7;
if ( v7 )
goto LABEL_14;
++v2;
}
Control = 0;
v8 = -1;
buffer_for_argv = (char *)_acrt_allocate_buffer_for_argv(1u, 0, 1u);
if ( buffer_for_argv )
{
v10 = buffer_for_argv + 8;
v13 = v10;
v8 = 0;
*a2 = buffer_for_argv;
}
free_base(nullptr);
LABEL_14:
free_base(nullptr);
return v8;
}
else
{
*errno() = 22;
invalid_parameter_noinfo();
return 22;
}
}