{"type": "func", "start": 14829844, "end": 14830240, "name": "CTLOG_new_from_base64", "pseudocode": "// \n// CTLOG_new_from_base64 from 0xe24914 to 0xe24aa0 (396 bytes)\n// \n// 2 xrefs:\n// > sub_D82AB0 @ 0xd82b34\n// > <???> @ 0x7c068\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n__int64 __fastcall CTLOG_new_from_base64(\n        __int64 **a1,\n        char *a2,\n        __int64 a3,\n        int a4,\n        int a5,\n        int a6,\n        int a7,\n        int a8,\n        char a9)\n{\n  size_t v12; // x0\n  unsigned int v13; // w20\n  __int64 result; // x0\n  void *v15; // x0\n  void *v16; // x22\n  int v17; // w0\n  __int64 v18; // x20\n  __int64 *v19; // x21\n  char *v20; // [xsp+58h] [xbp+58h] BYREF\n\n  v12 = strlen(a2);\n  v13 = v12;\n  if ( !v12 )\n  {\nLABEL_2:\n    if ( a1 )\n    {\nLABEL_3:\n      ERR_put_error(50, 118, 110, (__int64)\"crypto/ct/ct_b64.c\", 137);\n      return 0;\n    }\nLABEL_13:\n    ERR_put_error(50, 118, 7, (__int64)\"crypto/ct/ct_b64.c\", 132);\n    return 0;\n  }\n  v15 = CRYPTO_malloc((void *)(int)(3 * (v12 >> 2)), (__int64)\"crypto/ct/ct_b64.c\", 36);\n  v16 = v15;\n  if ( !v15 )\n  {\n    ERR_put_error(50, 124, 65, (__int64)\"crypto/ct/ct_b64.c\", 38);\nLABEL_15:\n    CRYPTO_free(v16, (__int64)\"crypto/ct/ct_b64.c\", 51);\n    goto LABEL_2;\n  }\n  v17 = EVP_DecodeBlock(v15, a2, v13);\n  if ( v17 < 0 )\n  {\n    ERR_put_error(50, 124, 108, (__int64)\"crypto/ct/ct_b64.c\", 44);\n    goto LABEL_15;\n  }\n  if ( !a1 )\n    goto LABEL_13;\n  if ( !v17 )\n    goto LABEL_3;\n  v20 = (char *)v16;\n  v18 = d2i_PUBKEY(nullptr, &v20, v17);\n  CRYPTO_free(v16, (__int64)\"crypto/ct/ct_b64.c\", 143);\n  if ( v18 )\n  {\n    v19 = CTLOG_new(v18, a3);\n    *a1 = v19;\n    result = 1;\n    if ( !v19 )\n    {\n      EVP_PKEY_free(v18);\n      return 0;\n    }\n  }\n  else\n  {\n    ERR_put_error(50, 118, 110, (__int64)\"crypto/ct/ct_b64.c\", 145);\n    return 0;\n  }\n  return result;\n}", "assembly": "; \n; CTLOG_new_from_base64 from 0xe24914 to 0xe24aa0 (396 bytes)\n; \n; 2 xrefs:\n; > sub_D82AB0 @ 0xd82b34\n; > <???> @ 0x7c068\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             X29, X30, [SP,#var_60]!                                ; +0x0, 0xe24914\nMOV             X29, SP                                                ; +0x4, 0xe24918\nSTP             X19, X20, [SP,#0x60+var_50]                            ; +0x8, 0xe2491c\nMOV             X19, X0                                                ; +0xc, 0xe24920\nMOV             X0, X1; char *                                         ; +0x10, 0xe24924\nSTP             X23, X24, [SP,#0x60+var_30]                            ; +0x14, 0xe24928\nSTP             X21, X22, [SP,#0x60+var_40]                            ; +0x18, 0xe2492c\nSTR             X25, [SP,#0x60+var_20]                                 ; +0x1c, 0xe24930\nMOV             X21, X1                                                ; +0x20, 0xe24934\nMOV             X24, X2                                                ; +0x24, 0xe24938\nADRP            X23, #aCryptoCtCtB64C@PAGE; \"crypto/ct/ct_b64.c\"       ; +0x28, 0xe2493c\nBL              .strlen                                                ; +0x2c, 0xe24940\nMOV             X20, X0                                                ; +0x30, 0xe24944\nCBNZ            X0, loc_E24984                                         ; +0x34, 0xe24948\nCBZ             X19, loc_E24A38                                        ; +0x38, 0xe2494c\nMOV             W0, #0x32 ; '2'                                        ; +0x3c, 0xe24950\nMOV             W1, #0x76 ; 'v'                                        ; +0x40, 0xe24954\nMOV             W2, #0x6E ; 'n'                                        ; +0x44, 0xe24958\nADD             X3, X23, #aCryptoCtCtB64C@PAGEOFF; \"crypto/ct/ct_b64.c\" ; +0x48, 0xe2495c\nMOV             W4, #0x89                                              ; +0x4c, 0xe24960\nBL              ERR_put_error                                          ; +0x50, 0xe24964\nMOV             W0, #0                                                 ; +0x54, 0xe24968\nLDP             X19, X20, [SP,#0x60+var_50]                            ; +0x58, 0xe2496c\nLDP             X21, X22, [SP,#0x60+var_40]                            ; +0x5c, 0xe24970\nLDP             X23, X24, [SP,#0x60+var_30]                            ; +0x60, 0xe24974\nLDR             X25, [SP,#0x60+var_20]                                 ; +0x64, 0xe24978\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0x68, 0xe2497c\nRET                                                                    ; +0x6c, 0xe24980\nLSR             X4, X0, #2                                             ; +0x70, 0xe24984\nADD             X25, X23, #aCryptoCtCtB64C@PAGEOFF; \"crypto/ct/ct_b64.c\" ; +0x74, 0xe24988\nMOV             X1, X25                                                ; +0x78, 0xe2498c\nMOV             W2, #0x24 ; '$'                                        ; +0x7c, 0xe24990\nADD             W0, W4, W4,LSL#1                                       ; +0x80, 0xe24994\nSXTW            X0, W0                                                 ; +0x84, 0xe24998\nBL              CRYPTO_malloc                                          ; +0x88, 0xe2499c\nMOV             X22, X0                                                ; +0x8c, 0xe249a0\nCBZ             X0, loc_E24A58                                         ; +0x90, 0xe249a4\nMOV             X1, X21                                                ; +0x94, 0xe249a8\nMOV             W2, W20                                                ; +0x98, 0xe249ac\nBL              EVP_DecodeBlock                                        ; +0x9c, 0xe249b0\nTBNZ            W0, #0x1F, loc_E24A84                                  ; +0xa0, 0xe249b4\nCBZ             X19, loc_E24A38                                        ; +0xa4, 0xe249b8\nCBZ             W0, loc_E24950                                         ; +0xa8, 0xe249bc\nADD             X1, X29, #0x60+arg_0                                   ; +0xac, 0xe249c0\nSXTW            X2, W0                                                 ; +0xb0, 0xe249c4\nMOV             X0, #0                                                 ; +0xb4, 0xe249c8\nSTR             X22, [X1,#-8]!                                         ; +0xb8, 0xe249cc\nBL              d2i_PUBKEY                                             ; +0xbc, 0xe249d0\nMOV             X20, X0                                                ; +0xc0, 0xe249d4\nMOV             X1, X25                                                ; +0xc4, 0xe249d8\nMOV             X0, X22                                                ; +0xc8, 0xe249dc\nMOV             W2, #0x8F                                              ; +0xcc, 0xe249e0\nBL              CRYPTO_free                                            ; +0xd0, 0xe249e4\nCBZ             X20, loc_E24A18                                        ; +0xd4, 0xe249e8\nMOV             X0, X20                                                ; +0xd8, 0xe249ec\nMOV             X1, X24                                                ; +0xdc, 0xe249f0\nBL              CTLOG_new                                              ; +0xe0, 0xe249f4\nMOV             X21, X0                                                ; +0xe4, 0xe249f8\nSTR             X0, [X19]                                              ; +0xe8, 0xe249fc\nMOV             W0, #1                                                 ; +0xec, 0xe24a00\nCBNZ            X21, loc_E2496C                                        ; +0xf0, 0xe24a04\nMOV             X0, X20                                                ; +0xf4, 0xe24a08\nBL              EVP_PKEY_free                                          ; +0xf8, 0xe24a0c\nMOV             W0, W21                                                ; +0xfc, 0xe24a10\nB               loc_E2496C                                             ; +0x100, 0xe24a14\nMOV             W0, #0x32 ; '2'                                        ; +0x104, 0xe24a18\nMOV             W1, #0x76 ; 'v'                                        ; +0x108, 0xe24a1c\nMOV             W2, #0x6E ; 'n'                                        ; +0x10c, 0xe24a20\nMOV             X3, X25                                                ; +0x110, 0xe24a24\nMOV             W4, #0x91                                              ; +0x114, 0xe24a28\nBL              ERR_put_error                                          ; +0x118, 0xe24a2c\nMOV             W0, W20                                                ; +0x11c, 0xe24a30\nB               loc_E2496C                                             ; +0x120, 0xe24a34\nMOV             W0, #0x32 ; '2'                                        ; +0x124, 0xe24a38\nMOV             W1, #0x76 ; 'v'                                        ; +0x128, 0xe24a3c\nMOV             W2, #7                                                 ; +0x12c, 0xe24a40\nADD             X3, X23, #aCryptoCtCtB64C@PAGEOFF; \"crypto/ct/ct_b64.c\" ; +0x130, 0xe24a44\nMOV             W4, #0x84                                              ; +0x134, 0xe24a48\nBL              ERR_put_error                                          ; +0x138, 0xe24a4c\nMOV             W0, #0                                                 ; +0x13c, 0xe24a50\nB               loc_E2496C                                             ; +0x140, 0xe24a54\nMOV             W0, #0x32 ; '2'                                        ; +0x144, 0xe24a58\nMOV             W1, #0x7C ; '|'                                        ; +0x148, 0xe24a5c\nMOV             W2, #0x41 ; 'A'                                        ; +0x14c, 0xe24a60\nMOV             X3, X25                                                ; +0x150, 0xe24a64\nMOV             W4, #0x26 ; '&'                                        ; +0x154, 0xe24a68\nBL              ERR_put_error                                          ; +0x158, 0xe24a6c\nMOV             X0, X22                                                ; +0x15c, 0xe24a70\nADD             X1, X23, #aCryptoCtCtB64C@PAGEOFF; \"crypto/ct/ct_b64.c\" ; +0x160, 0xe24a74\nMOV             W2, #0x33 ; '3'                                        ; +0x164, 0xe24a78\nBL              CRYPTO_free                                            ; +0x168, 0xe24a7c\nB               loc_E2494C                                             ; +0x16c, 0xe24a80\nMOV             W0, #0x32 ; '2'                                        ; +0x170, 0xe24a84\nMOV             W1, #0x7C ; '|'                                        ; +0x174, 0xe24a88\nMOV             W2, #0x6C ; 'l'                                        ; +0x178, 0xe24a8c\nMOV             X3, X25                                                ; +0x17c, 0xe24a90\nMOV             W4, #0x2C ; ','                                        ; +0x180, 0xe24a94\nBL              ERR_put_error                                          ; +0x184, 0xe24a98\nB               loc_E24A70                                             ; +0x188, 0xe24a9c", "xrefs": ["sub_D82AB0 @ 0xd82b34", "<???> @ 0x7c068"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}