{"type": "func", "start": 14341428, "end": 14341572, "name": "EVP_PKEY_derive_init", "pseudocode": "// \n// EVP_PKEY_derive_init from 0xdad534 to 0xdad5c4 (144 bytes)\n// \n// 7 xrefs:\n// > ssl_derive @ 0xd388ac\n// > sub_D60980 @ 0xd609e0\n// > tls1_final_finish_mac @ 0xd61434\n// > tls1_generate_master_secret @ 0xd61608\n// > CMS_RecipientInfo_kari_set0_pkey @ 0xe1f0d0\n// > cms_RecipientInfo_kari_init @ 0xe1f3f4\n// > <???> @ 0x85008\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 EVP_PKEY_derive_init(__int64 *a1)\n{\n  __int64 v2; // x1\n  __int64 (*v3)(void); // x1\n  __int64 result; // x0\n\n  if ( a1 && (v2 = *a1) != 0 && *(_QWORD *)(v2 + 184) )\n  {\n    v3 = *(__int64 (**)(void))(v2 + 176);\n    *((_DWORD *)a1 + 8) = 1024;\n    if ( v3 )\n    {\n      result = v3();\n      if ( (int)result <= 0 )\n        *((_DWORD *)a1 + 8) = 0;\n    }\n    else\n    {\n      return 1;\n    }\n  }\n  else\n  {\n    ERR_put_error(6, 154, 150, (__int64)\"crypto/evp/pmeth_fn.c\", 207);\n    return 4294967294LL;\n  }\n  return result;\n}", "assembly": "; \n; EVP_PKEY_derive_init from 0xdad534 to 0xdad5c4 (144 bytes)\n; \n; 7 xrefs:\n; > ssl_derive @ 0xd388ac\n; > sub_D60980 @ 0xd609e0\n; > tls1_final_finish_mac @ 0xd61434\n; > tls1_generate_master_secret @ 0xd61608\n; > CMS_RecipientInfo_kari_set0_pkey @ 0xe1f0d0\n; > cms_RecipientInfo_kari_init @ 0xe1f3f4\n; > <???> @ 0x85008\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_20]!                                ; +0x0, 0xdad534\nMOV             X29, SP                                                ; +0x4, 0xdad538\nSTR             X19, [SP,#0x20+var_10]                                 ; +0x8, 0xdad53c\nMOV             X19, X0                                                ; +0xc, 0xdad540\nCBZ             X0, loc_DAD5A0                                         ; +0x10, 0xdad544\nLDR             X1, [X0]                                               ; +0x14, 0xdad548\nCBZ             X1, loc_DAD5A0                                         ; +0x18, 0xdad54c\nLDR             X2, [X1,#0xB8]                                         ; +0x1c, 0xdad550\nCBZ             X2, loc_DAD5A0                                         ; +0x20, 0xdad554\nLDR             X1, [X1,#0xB0]                                         ; +0x24, 0xdad558\nMOV             W2, #0x400                                             ; +0x28, 0xdad55c\nSTR             W2, [X0,#0x20]                                         ; +0x2c, 0xdad560\nCBZ             X1, loc_DAD580                                         ; +0x30, 0xdad564\nBLR             X1                                                     ; +0x34, 0xdad568\nCMP             W0, WZR                                                ; +0x38, 0xdad56c\nB.LE            loc_DAD590                                             ; +0x3c, 0xdad570\nLDR             X19, [SP,#0x20+var_10]                                 ; +0x40, 0xdad574\nLDP             X29, X30, [SP+0x20+var_20],#0x20                       ; +0x44, 0xdad578\nRET                                                                    ; +0x48, 0xdad57c\nMOV             W0, #1                                                 ; +0x4c, 0xdad580\nLDR             X19, [SP,#0x20+var_10]                                 ; +0x50, 0xdad584\nLDP             X29, X30, [SP+0x20+var_20],#0x20                       ; +0x54, 0xdad588\nRET                                                                    ; +0x58, 0xdad58c\nSTR             WZR, [X19,#0x20]                                       ; +0x5c, 0xdad590\nLDR             X19, [SP,#0x20+var_10]                                 ; +0x60, 0xdad594\nLDP             X29, X30, [SP+0x20+var_20],#0x20                       ; +0x64, 0xdad598\nRET                                                                    ; +0x68, 0xdad59c\nADRP            X3, #aCryptoEvpPmeth@PAGE; \"crypto/evp/pmeth_fn.c\"     ; +0x6c, 0xdad5a0\nMOV             W0, #6                                                 ; +0x70, 0xdad5a4\nMOV             W1, #0x9A                                              ; +0x74, 0xdad5a8\nMOV             W2, #0x96                                              ; +0x78, 0xdad5ac\nADD             X3, X3, #aCryptoEvpPmeth@PAGEOFF; \"crypto/evp/pmeth_fn.c\" ; +0x7c, 0xdad5b0\nMOV             W4, #0xCF                                              ; +0x80, 0xdad5b4\nBL              ERR_put_error                                          ; +0x84, 0xdad5b8\nMOV             W0, #0xFFFFFFFE                                        ; +0x88, 0xdad5bc\nB               loc_DAD574                                             ; +0x8c, 0xdad5c0", "xrefs": ["ssl_derive @ 0xd388ac", "sub_D60980 @ 0xd609e0", "tls1_final_finish_mac @ 0xd61434", "tls1_generate_master_secret @ 0xd61608", "CMS_RecipientInfo_kari_set0_pkey @ 0xe1f0d0", "cms_RecipientInfo_kari_init @ 0xe1f3f4", "<???> @ 0x85008"], "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"}