// // sub_9F7978 from 0x9f7978 to 0x9f7bb8 (576 bytes) // // 1 xrefs: // > @ 0xd25cb0 // // 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:33 +0000 // int __fastcall sub_9F7978(int a1, int a2, int *a3, int *a4) { int v5; // r9 _DWORD *v8; // r4 int v9; // r7 int v10; // r5 int v12; // r10 int (__fastcall *v13)(int, int, _DWORD, _DWORD *, _DWORD, int, _DWORD); // r12 int v14; // r9 int v15; // r0 v5 = *a4; if ( *(_DWORD *)(a1 + 8) && *(_DWORD *)(a1 + 12) && *(_DWORD *)(a1 + 16) ) { v8 = (_DWORD *)BN_new(); if ( !v8 ) goto LABEL_25; if ( a2 ) { v9 = a2; goto LABEL_9; } v15 = BN_CTX_new(); v9 = v15; if ( v15 ) { LABEL_9: while ( BN_rand_range(v8, *(_DWORD *)(a1 + 12)) ) { if ( !BN_is_zero((int)v8) ) { BN_set_flags((int)v8, 4); if ( (*(_DWORD *)(a1 + 28) & 1) == 0 || BN_MONT_CTX_set_locked((_BYTE **)(a1 + 32), *(_DWORD *)(a1 + 52), *(int ***)(a1 + 8), v9) ) { if ( BN_add(v8, v8, *(_DWORD *)(a1 + 12)) ) { v12 = BN_num_bits(v8); if ( v12 > BN_num_bits(*(_DWORD **)(a1 + 12)) || BN_add(v8, v8, *(_DWORD *)(a1 + 12)) ) { v13 = *(int (__fastcall **)(int, int, _DWORD, _DWORD *, _DWORD, int, _DWORD))(*(_DWORD *)(a1 + 44) + 20); if ( v13 ) { if ( !v13(a1, v5, *(_DWORD *)(a1 + 16), v8, *(_DWORD *)(a1 + 8), v9, *(_DWORD *)(a1 + 32)) ) break; } else if ( !BN_mod_exp_mont(v5, *(_DWORD *)(a1 + 16), v8, *(_DWORD *)(a1 + 8), v9, *(_DWORD *)(a1 + 32)) ) { break; } if ( BN_div(0, v5, v5, *(_DWORD *)(a1 + 12), v9) ) { v14 = BN_mod_inverse(0, v8, *(_DWORD *)(a1 + 12), v9); if ( v14 ) { BN_clear_free((_BYTE *)*a3); v10 = 1; *a3 = v14; goto LABEL_11; } } } } } break; } } } else { LABEL_25: v9 = 0; } ERR_put_error(10, 107, 3, "crypto/dsa/dsa_ossl.c", 216); v10 = 0; LABEL_11: if ( a2 != v9 ) BN_CTX_free(v9); BN_clear_free(v8); return v10; } else { ERR_put_error(10, 107, 101, "crypto/dsa/dsa_ossl.c", 142); return 0; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source