//
// lws_set_proxy from 0x64691c to 0x6469e0 (196 bytes)
//
// 1 xrefs:
// > lws_create_context @ 0x649618
//
// 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
//
int __fastcall lws_set_proxy(int a1, char *a2)
{
const char *v2; // r4
char *v4; // r0
char *v5; // r5
int v6; // r7
char *v7; // r0
int v8; // r3
unsigned __int8 v10[100]; // [sp+0h] [bp-64h] BYREF
v2 = a2;
if ( !a2 )
return -1;
v4 = strchr(a2, 64);
v5 = v4;
if ( v4 )
{
v6 = v4 - v2;
if ( (unsigned int)(v4 - v2) > 0x5F
|| (strncpy((char *)v10, v2, v4 - v2), lws_b64_encode_string(v10, v6, (_BYTE *)(a1 + 4292), 128) < 0) )
{
lws_log(1, "proxy auth too long\n");
return -1;
}
v2 = v5 + 1;
lws_log(4, " Proxy auth in use\n");
}
else
{
*(_BYTE *)(a1 + 4292) = 0;
}
strncpy((char *)(a1 + 4164), v2, 0x7Fu);
*(_BYTE *)(a1 + 4291) = 0;
v7 = strchr((const char *)(a1 + 4164), 58);
if ( v7 )
{
*v7 = 0;
v8 = atoi(v7 + 1);
*(_DWORD *)(a1 + 4584) = v8;
}
else
{
v8 = *(_DWORD *)(a1 + 4584);
if ( !v8 )
{
lws_log(1, "http_proxy needs to be ads:port\n");
return -1;
}
}
lws_log(4, " Proxy %s:%u\n", (const char *)(a1 + 4164), v8);
return 0;
}