// // sub_A13D1C from 0xa13d1c to 0xa14040 (804 bytes) // // 2 xrefs: // > sub_A1404C @ 0xa14348 // > @ 0xd25f6c // // 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:07:48 +0000 // int __fastcall sub_A13D1C(int a1, int *a2, char *a3, size_t a4) { int v4; // r4 char *v7; // r6 size_t v9; // r5 int result; // r0 int v11; // r11 int v12; // r7 int v13; // r3 unsigned __int8 *v14; // r1 unsigned __int8 v15[20]; // [sp+8h] [bp-14h] BYREF v4 = *(_DWORD *)(a1 + 96); v7 = a3; v9 = *(_DWORD *)(v4 + 184); if ( *(_DWORD *)(v4 + 172) ) { if ( a3 ) goto LABEL_3; LABEL_35: v12 = v4 + 192; v11 = (int)v7; goto LABEL_22; } *(_DWORD *)(v4 + 32) = 0; memset((void *)(v4 + 48), 0, 0x40u); ChaCha20_ctr32(v4 + 48, v4 + 48, 64, v4, v4 + 32); Poly1305_Init(v4 + 192, v4 + 48); *(_DWORD *)(v4 + 112) = 0; *(_DWORD *)(v4 + 32) = 1; *(_DWORD *)(v4 + 172) = 1; *(_QWORD *)(v4 + 160) = 0; *(_QWORD *)(v4 + 152) = 0; if ( !v7 ) goto LABEL_35; LABEL_3: if ( !a2 ) { Poly1305_Update(v4 + 192, v7); *(_QWORD *)(v4 + 152) += a4; *(_DWORD *)(v4 + 168) = 1; return a4; } if ( *(_DWORD *)(v4 + 168) ) { if ( (*(_DWORD *)(v4 + 152) & 0xF) != 0 ) Poly1305_Update(v4 + 192, &unk_C57550); result = -1; *(_DWORD *)(v4 + 168) = 0; *(_DWORD *)(v4 + 184) = -1; if ( v9 != -1 ) { LABEL_6: if ( v9 + 16 != a4 ) return result; v11 = 1; if ( !*(_DWORD *)(a1 + 8) ) goto LABEL_8; LABEL_19: v12 = v4 + 192; sub_A138F8(a1, a2, v7, v9); Poly1305_Update(v4 + 192, a2); v7 += v9; a2 = (int *)((char *)a2 + v9); *(_QWORD *)(v4 + 160) += v9; goto LABEL_9; } } else { result = -1; *(_DWORD *)(v4 + 184) = -1; if ( v9 != -1 ) goto LABEL_6; } v9 = a4; v11 = 0; if ( *(_DWORD *)(a1 + 8) ) goto LABEL_19; LABEL_8: v12 = v4 + 192; Poly1305_Update(v4 + 192, v7); sub_A138F8(a1, a2, v7, v9); a2 = (int *)((char *)a2 + v9); v7 += v9; *(_QWORD *)(v4 + 160) += v9; LABEL_9: if ( v7 ) v13 = v11; else v13 = v11 | 1; if ( !v13 ) return a4; if ( !v7 ) v11 = 0; LABEL_22: if ( *(_DWORD *)(v4 + 168) ) { if ( (*(_DWORD *)(v4 + 152) & 0xF) != 0 ) Poly1305_Update(v12, &unk_C57550); *(_DWORD *)(v4 + 168) = 0; } if ( (*(_DWORD *)(v4 + 160) & 0xF) != 0 ) Poly1305_Update(v12, &unk_C57550); Poly1305_Update(v12, (void *)(v4 + 152)); if ( *(_DWORD *)(a1 + 8) ) v14 = (unsigned __int8 *)(v4 + 132); else v14 = v15; Poly1305_Final(v12, v14); *(_DWORD *)(v4 + 172) = 0; if ( !v11 ) { if ( *(_DWORD *)(a1 + 8) || !CRYPTO_memcmp(v15, (unsigned __int8 *)(v4 + 132), *(_DWORD *)(v4 + 176)) ) return a4; return -1; } if ( !*(_DWORD *)(a1 + 8) ) { if ( !CRYPTO_memcmp(v15, (unsigned __int8 *)v7, 16) ) return a4; memset((char *)a2 - v9, 0, v9); return -1; } memcpy(a2, (const void *)(v4 + 132), 0x10u); return a4; }
GD Web Decomp Icon

GD Web Decomp

Raw Source