// // PEM_write_bio from 0xdc76e0 to 0xdc79ac (716 bytes) // // 4 xrefs: // > PEM_ASN1_write_bio @ 0xdc7cf0 // > PEM_write @ 0xdc7f58 // > PEM_X509_INFO_write_bio @ 0xe64aa0 // > @ 0xa4ce8 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // __int64 __fastcall PEM_write_bio(__int64 a1, const char *a2, const char *a3, __int64 a4, __int64 a5) { __int64 v10; // x20 unsigned int v11; // w19 __int16 v12; // w22 _BYTE *v13; // x21 unsigned int v15; // w26 signed int v16; // w19 int v17; // w28 int v18; // s8 void *v19; // x3 int v20; // w27 signed int v21; // w2 int v22; // w0 int v23; // w0 __int64 v24; // [xsp+0h] [xbp+0h] BYREF signed int v25; // [xsp+7Ch] [xbp+7Ch] BYREF v10 = EVP_ENCODE_CTX_new(); if ( !v10 ) goto LABEL_5; EVP_EncodeInit(); v11 = strlen(a2); if ( (unsigned int)BIO_write(a1, (__int64)"-----BEGIN ", 0xBu) != 11 || (v15 = BIO_write(a1, (__int64)a2, v11), v15 != v11) || (unsigned int)BIO_write(a1, (__int64)"-----\n", 6u) != 6 || (v16 = strlen(a3), v16 > 0) && ((unsigned int)BIO_write(a1, (__int64)a3, v16) != v16 || (unsigned int)BIO_write(a1, (__int64)&byte_F1AB78, 1u) != 1) ) { v12 = 7; v13 = nullptr; LABEL_4: CRYPTO_clear_free(v13, 0x2000u, (__int64)"crypto/pem/pem_lib.c", 0x280u); EVP_ENCODE_CTX_free(v10); ERR_put_error(9, 114, v12, (__int64)"crypto/pem/pem_lib.c", 642); return 0; } v13 = CRYPTO_malloc(&elf_hash_bucket[1922], (__int64)"crypto/pem/pem_lib.c", 612); if ( !v13 ) { LABEL_5: v12 = 65; v13 = nullptr; goto LABEL_4; } if ( a5 > 0 ) { v17 = 0; v18 = 0; while ( 1 ) { v19 = (void *)(a4 + v17); v20 = a5 > 5120 ? 5120 : a5; a5 -= v20; v17 += v20; if ( !(unsigned int)EVP_EncodeUpdate(v10, (int)v13, (unsigned int)&v24 + 124, v19) ) break; v21 = v25; if ( v25 ) { v22 = BIO_write(a1, (__int64)v13, v25); v21 = v25; if ( v22 != v25 ) break; } v18 += v21; if ( a5 <= 0 ) goto LABEL_23; } v12 = 7; goto LABEL_4; } v18 = 0; LABEL_23: EVP_EncodeFinal(v10, v13, &v25); if ( v25 > 0 ) { v12 = 7; v23 = BIO_write(a1, (__int64)v13, v25); if ( v23 != v25 ) goto LABEL_4; } v12 = 7; if ( (unsigned int)BIO_write(a1, (__int64)"-----END ", 9u) != 9 || v15 != (unsigned int)BIO_write(a1, (__int64)a2, v15) || (unsigned int)BIO_write(a1, (__int64)"-----\n", 6u) != 6 ) { goto LABEL_4; } CRYPTO_clear_free(v13, 0x2000u, (__int64)"crypto/pem/pem_lib.c", 0x27Cu); EVP_ENCODE_CTX_free(v10); return (unsigned int)(v18 + v25); }
GD Web Decomp Icon

GD Web Decomp

Raw Source