// // sub_84C92C from 0x84c92c to 0x84ccb0 (900 bytes) // // 2 xrefs: // > sub_8247F0 @ 0x8248cc // > sub_8247F0 @ 0x824a3c // // 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:28 +0000 // int __fastcall sub_84C92C(int a1, int a2) { int v4; // r5 char *v5; // r6 int v6; // r5 void **v7; // r8 int *v8; // r10 int v9; // r3 int result; // r0 char *v11; // r0 char *v12; // r11 int v13; // r6 const char *v14; // r1 const char *v15; // r1 char *v16; // r0 char *v17; // r0 char *v18; // r5 char *v19; // r0 char *v20; // r11 int v21; // r5 int v22; // r6 int v23; // r0 int v24; // r4 char *v25; // r0 int v26; // r5 int v27; // r0 int v28; // r4 char *v29; // r0 __pid_t v30; // r0 int v31; // r5 int v32; // r6 char *v33; // r0 int v34; // r5 int v35; // r6 char *v36; // r0 int v37; // r5 int v38; // r0 int v39; // r4 char *v40; // r0 int v41; // r5 int v42; // r0 int v43; // r4 char *v44; // r0 __pid_t v45; // [sp+1Ch] [bp-10h] int fd; // [sp+20h] [bp-Ch] BYREF int v47; // [sp+24h] [bp-8h] v4 = *(_DWORD *)a1; if ( a2 ) { v5 = *(char **)(a1 + 252); v6 = v4 + 34584; v7 = (void **)(a1 + 684); v8 = (int *)(a1 + 780); *(_BYTE *)(v6 + 12) = 0; if ( v5 ) goto LABEL_3; LABEL_8: v9 = *v8; v5 = &byte_BF4ECA; if ( *v8 != 2 ) goto LABEL_4; LABEL_9: v11 = sub_837044("TT %s\n", *(const char **)(a1 + 812)); v12 = v11; if ( !v11 ) return 27; v13 = sub_84C750((int *)(a1 + 804), (char **)(a1 + 816), v11, *v8); off_D200B0(v12); result = v13; if ( !v13 ) { off_D200B0(*v7); if ( a2 ) v14 = "Proxy-"; else v14 = &byte_BF4ECA; *v7 = sub_837044("%sAuthorization: %s\r\n", v14, *(const char **)(a1 + 816)); *v8 = 3; *(_BYTE *)(v6 + 12) = 1; sub_84C88C(a1); return 0; } return result; } v5 = *(char **)(a1 + 376); v6 = v4 + 34568; v7 = (void **)(a1 + 696); v8 = (int *)(a1 + 756); *(_BYTE *)(v6 + 12) = 0; if ( !v5 ) goto LABEL_8; LABEL_3: v9 = *v8; if ( *v8 == 2 ) goto LABEL_9; LABEL_4: if ( v9 == 3 ) { off_D200B0(*v7); result = 0; *v7 = nullptr; *(_BYTE *)(v6 + 12) = 1; return result; } if ( *(_DWORD *)(a1 + 804) == -1 && !*(_DWORD *)(a1 + 808) ) { if ( !*v5 ) { v16 = getenv("NTLMUSER"); if ( v16 && *v16 || (v16 = getenv("LOGNAME")) != nullptr && *v16 ) { v5 = v16; } else { v17 = getenv("USER"); if ( v17 && *v17 ) v5 = v17; } } v18 = strpbrk(v5, "\\/"); if ( v18 ) { v19 = off_D200B8(v5); v20 = v19; if ( !v19 ) return 27; v21 = v18 - v5; v5 += v21 + 1; v19[v21] = 0; } else { v20 = nullptr; } if ( access("/usr/bin/ntlm_auth", 1) ) { v22 = *(_DWORD *)_errno(); v23 = a1; v24 = *(_DWORD *)a1; v25 = sub_842624(v23, v22); sub_828178(v24, "Could not access ntlm_auth: %s errno %d: %s", "/usr/bin/ntlm_auth", v22, v25); LABEL_34: off_D200B0(v20); off_D200B0(nullptr); return 9; } if ( socketpair(1, 1, 0, &fd) ) { v26 = *(_DWORD *)_errno(); v27 = a1; v28 = *(_DWORD *)a1; v29 = sub_842624(v27, v26); sub_828178(v28, "Could not open socket pair. errno %d: %s", v26, v29); goto LABEL_34; } v30 = fork(); if ( v30 == -1 ) { v34 = *(_DWORD *)_errno(); close(fd); close(v47); v35 = *(_DWORD *)a1; v36 = sub_842624(a1, v34); sub_828178(v35, "Could not fork. errno %d: %s", v34, v36); goto LABEL_34; } if ( !v30 ) { close(fd); if ( dup2(v47, 0) != -1 ) { if ( dup2(v47, 1) != -1 ) { if ( v20 ) execl( "/usr/bin/ntlm_auth", "/usr/bin/ntlm_auth", "--helper-protocol", "ntlmssp-client-1", "--use-cached-creds", "--username", v5, "--domain", v20, 0); else execl( "/usr/bin/ntlm_auth", "/usr/bin/ntlm_auth", "--helper-protocol", "ntlmssp-client-1", "--use-cached-creds", "--username", v5, 0); v31 = *(_DWORD *)_errno(); close(v47); v32 = *(_DWORD *)a1; v33 = sub_842624(a1, v31); sub_828178(v32, "Could not execl(). errno %d: %s", v31, v33); exit(1); } v37 = *(_DWORD *)_errno(); v38 = a1; v39 = *(_DWORD *)a1; v40 = sub_842624(v38, v37); sub_828178(v39, "Could not redirect child stdout. errno %d: %s", v37, v40); exit(1); } v41 = *(_DWORD *)_errno(); v42 = a1; v43 = *(_DWORD *)a1; v44 = sub_842624(v42, v41); sub_828178(v43, "Could not redirect child stdin. errno %d: %s", v41, v44); exit(1); } v45 = v30; close(v47); *(_DWORD *)(a1 + 804) = fd; *(_DWORD *)(a1 + 808) = v45; off_D200B0(v20); off_D200B0(nullptr); v9 = *v8; } result = sub_84C750((int *)(a1 + 804), (char **)(a1 + 816), "YR\n", v9); if ( !result ) { off_D200B0(*v7); if ( a2 ) v15 = "Proxy-"; else v15 = &byte_BF4ECA; *v7 = sub_837044("%sAuthorization: %s\r\n", v15, *(const char **)(a1 + 816)); off_D200B0(*(void **)(a1 + 816)); *(_DWORD *)(a1 + 816) = 0; return 0; } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source