// // PEM_write_bio from 0xa36904 to 0xa36bc8 (708 bytes) // // 4 xrefs: // > PEM_ASN1_write_bio @ 0xa36f00 // > PEM_write @ 0xa37178 // > PEM_X509_INFO_write_bio @ 0xacf66c // > @ 0x7edcc // // 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:08:08 +0000 // int __fastcall PEM_write_bio(int a1, const char *a2, const char *a3, int a4, int a5) { int v9; // r6 size_t v10; // r4 __int16 v11; // r7 _BYTE *v12; // r5 int v14; // r10 signed int v15; // r4 int v16; // r11 int v17; // r8 int v18; // r3 size_t v19; // r10 int v20; // r0 int v21; // r2 int v22; // r0 int v23; // r4 int v24; // r0 int v25; // [sp+10h] [bp-14h] const char *v26; // [sp+14h] [bp-10h] int v27[2]; // [sp+1Ch] [bp-8h] BYREF v9 = EVP_ENCODE_CTX_new(); if ( !v9 ) goto LABEL_5; EVP_EncodeInit(); v10 = strlen(a2); if ( BIO_write(a1, (int)"-----BEGIN ", 11) != 11 || (v14 = BIO_write(a1, (int)a2, v10), v14 != v10) || BIO_write(a1, (int)"-----\n", 6) != 6 || (v15 = strlen(a3), v15 > 0) && (BIO_write(a1, (int)a3, v15) != v15 || BIO_write(a1, (int)"\n", 1) != 1) ) { v11 = 7; v12 = nullptr; LABEL_4: CRYPTO_clear_free(v12, 0x2000u, (int)"crypto/pem/pem_lib.c", 640); EVP_ENCODE_CTX_free(v9); ERR_put_error(9, 114, v11, (int)"crypto/pem/pem_lib.c", 642); return 0; } v12 = CRYPTO_malloc(&stru_1FFC.st_value, (int)"crypto/pem/pem_lib.c", 612); if ( !v12 ) { LABEL_5: v11 = 65; v12 = nullptr; goto LABEL_4; } if ( a5 > 0 ) { v16 = 0; v26 = a2; v25 = v14; v17 = 0; v18 = a5; while ( 1 ) { v19 = v18 >= 5120 ? 5120 : v18; v20 = EVP_EncodeUpdate(v9, (int)v12, (int)v27, (void *)(a4 + v17), v19); v17 += v19; a5 -= v19; if ( !v20 ) break; v21 = v27[0]; if ( v27[0] ) { v22 = BIO_write(a1, (int)v12, v27[0]); v21 = v27[0]; if ( v22 != v27[0] ) break; } v18 = a5; v16 += v21; if ( a5 <= 0 ) { v14 = v25; a2 = v26; v23 = v16; EVP_EncodeFinal(v9, v12, v27); goto LABEL_23; } } LABEL_21: v11 = 7; goto LABEL_4; } v23 = 0; EVP_EncodeFinal(v9, v12, v27); LABEL_23: if ( v27[0] > 0 ) { v24 = BIO_write(a1, (int)v12, v27[0]); if ( v24 != v27[0] ) goto LABEL_21; } if ( BIO_write(a1, (int)"-----END ", 9) != 9 || v14 != BIO_write(a1, (int)a2, v14) || BIO_write(a1, (int)"-----\n", 6) != 6 ) { goto LABEL_21; } CRYPTO_clear_free(v12, 0x2000u, (int)"crypto/pem/pem_lib.c", 636); EVP_ENCODE_CTX_free(v9); return v23 + v27[0]; }
GD Web Decomp Icon

GD Web Decomp

Raw Source