//
// sub_841F24 from 0x841f24 to 0x842056 (306 bytes)
//
// 2 xrefs:
// > sub_8247F0 @ 0x82493c
// > sub_8247F0 @ 0x824a58
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:02:22 +0000
//
int __fastcall sub_841F24(_DWORD *a1, int a2, int a3, const char *a4)
{
int v4; // r7
char **v7; // r10
char *v8; // r8
char *v9; // r9
int *v10; // r5
void *v11; // r0
int v12; // r6
int result; // r0
char *v14; // r0
char *v15; // r12
int v16; // r5
const char *v17; // r1
char *p; // [sp+1Ch] [bp-10h]
void *v21; // [sp+20h] [bp-Ch] BYREF
_BYTE v22[8]; // [sp+24h] [bp-8h] BYREF
v4 = *a1;
if ( a2 )
{
v7 = (char **)(a1 + 171);
v8 = (char *)a1[63];
v9 = (char *)a1[64];
v10 = (int *)(v4 + 34532);
v11 = (void *)a1[171];
v12 = v4 + 34584;
}
else
{
v8 = (char *)a1[94];
v10 = (int *)(v4 + 34496);
v9 = (char *)a1[95];
v12 = v4 + 34568;
v11 = (void *)a1[174];
v7 = (char **)(a1 + 174);
}
off_D200B0(v11);
*v7 = nullptr;
if ( v8 )
{
if ( v9 )
goto LABEL_5;
LABEL_20:
result = *v10;
v9 = &byte_BF4ECA;
if ( *v10 )
goto LABEL_6;
LABEL_21:
*(_BYTE *)(v12 + 12) = result;
return result;
}
v8 = &byte_BF4ECA;
if ( !v9 )
goto LABEL_20;
LABEL_5:
result = *v10;
if ( !*v10 )
goto LABEL_21;
LABEL_6:
if ( *(_BYTE *)(v12 + 14) && (v14 = strchr(a4, 63)) != nullptr )
{
v15 = sub_837044("%.*s", v14 - a4, a4);
if ( !v15 )
return 27;
}
else
{
v15 = off_D200B8(a4);
if ( !v15 )
return 27;
}
p = v15;
v16 = sub_850CB8(v4, v8, v9, a3, v15, v10, &v21, v22);
off_D200B0(p);
result = v16;
if ( v16 )
return result;
if ( a2 )
v17 = "Proxy-";
else
v17 = &byte_BF4ECA;
*v7 = sub_837044("%sAuthorization: Digest %s\r\n", v17, (const char *)v21);
off_D200B0(v21);
if ( *v7 )
{
*(_BYTE *)(v12 + 12) = 1;
return 0;
}
return 27;
}