{"type": "func", "start": 10479956, "end": 10480228, "name": "ECDH_compute_key", "pseudocode": "// \n// ECDH_compute_key from 0x9fe954 to 0x9fea64 (272 bytes)\n// \n// 3 xrefs:\n// > sub_A9FDF4 @ 0xa9fed8\n// > sub_A9FDF4 @ 0xa9ff88\n// > <???> @ 0x7b34c\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:07:37 +0000\n// \n\nint __fastcall ECDH_compute_key(\n        void *a1,\n        int a2,\n        int a3,\n        int a4,\n        void (__fastcall *a5)(void *, size_t, void *, size_t *))\n{\n  int (__fastcall *v5)(void **, size_t *); // r5\n  int result; // r0\n  void *v8; // r5\n  size_t v9; // r4\n  size_t v10; // r2\n  size_t v11; // [sp+Ch] [bp-Ch] BYREF\n  void *v12; // [sp+10h] [bp-8h] BYREF\n  size_t v13; // [sp+14h] [bp-4h] BYREF\n\n  v5 = *(int (__fastcall **)(void **, size_t *))(*(_DWORD *)a4 + 36);\n  v11 = a2;\n  v12 = nullptr;\n  if ( v5 )\n  {\n    if ( a2 < 0 )\n    {\n      ERR_put_error(16, 246, 161, \"crypto/ec/ec_kmeth.c\", 139);\n      return 0;\n    }\n    else\n    {\n      result = v5(&v12, &v13);\n      if ( result )\n      {\n        if ( a5 )\n        {\n          a5(v12, v13, a1, &v11);\n          v8 = v12;\n          v9 = v13;\n        }\n        else\n        {\n          v10 = v11;\n          v9 = v13;\n          v8 = v12;\n          if ( v11 > v13 )\n          {\n            v10 = v13;\n            v11 = v13;\n          }\n          memcpy(a1, v12, v10);\n        }\n        CRYPTO_clear_free(v8, v9, \"crypto/ec/ec_kmeth.c\", 151);\n        return v11;\n      }\n    }\n  }\n  else\n  {\n    ERR_put_error(16, 246, 152, \"crypto/ec/ec_kmeth.c\", 135);\n    return 0;\n  }\n  return result;\n}", "assembly": "; \n; ECDH_compute_key from 0x9fe954 to 0x9fea64 (272 bytes)\n; \n; 3 xrefs:\n; > sub_A9FDF4 @ 0xa9fed8\n; > sub_A9FDF4 @ 0xa9ff88\n; > <???> @ 0x7b34c\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:07:37 +0000\n; \nLDR             R12, [R3]                                              ; +0x0, 0x9fe954\nPUSH            {R4-R6,LR}                                             ; +0x4, 0x9fe958\nLDR             R5, [R12,#0x24]                                        ; +0x8, 0x9fe95c\nMOV             R4, #0                                                 ; +0xc, 0x9fe960\nSUB             SP, SP, #0x18                                          ; +0x10, 0x9fe964\nCMP             R5, R4                                                 ; +0x14, 0x9fe968\nSTR             R1, [SP,#0x18+var_C]                                   ; +0x18, 0x9fe96c\nSTR             R4, [SP,#0x18+var_8]                                   ; +0x1c, 0x9fe970\nBEQ             loc_9FEA3C                                             ; +0x20, 0x9fe974\nCMP             R1, #0                                                 ; +0x24, 0x9fe978\nBLT             loc_9FE9E8                                             ; +0x28, 0x9fe97c\nMOV             R6, R0                                                 ; +0x2c, 0x9fe980\nADD             R1, SP, #0x18+var_4                                    ; +0x30, 0x9fe984\nADD             R0, SP, #0x18+var_8                                    ; +0x34, 0x9fe988\nBLX             R5                                                     ; +0x38, 0x9fe98c\nCMP             R0, #0                                                 ; +0x3c, 0x9fe990\nBEQ             loc_9FE9E0                                             ; +0x40, 0x9fe994\nLDR             R3, [SP,#0x18+arg_0]                                   ; +0x44, 0x9fe998\nCMP             R3, #0                                                 ; +0x48, 0x9fe99c\nBEQ             loc_9FEA14                                             ; +0x4c, 0x9fe9a0\nMOV             R12, R3                                                ; +0x50, 0x9fe9a4\nMOV             R2, R6                                                 ; +0x54, 0x9fe9a8\nLDR             R0, [SP,#0x18+var_8]                                   ; +0x58, 0x9fe9ac\nLDR             R1, [SP,#0x18+var_4]                                   ; +0x5c, 0x9fe9b0\nADD             R3, SP, #0x18+var_C                                    ; +0x60, 0x9fe9b4\nBLX             R12                                                    ; +0x64, 0x9fe9b8\nLDR             R5, [SP,#0x18+var_8]                                   ; +0x68, 0x9fe9bc\nLDR             R4, [SP,#0x18+var_4]                                   ; +0x6c, 0x9fe9c0\nLDR             R2, =(aCryptoEcEcKmet - 0x9FE9D8); \"crypto/ec/ec_kmeth.c\" ; +0x70, 0x9fe9c4\nMOV             R0, R5                                                 ; +0x74, 0x9fe9c8\nMOV             R1, R4                                                 ; +0x78, 0x9fe9cc\nADD             R2, PC, R2; \"crypto/ec/ec_kmeth.c\"                     ; +0x7c, 0x9fe9d0\nMOV             R3, #0x97                                              ; +0x80, 0x9fe9d4\nBL              CRYPTO_clear_free                                      ; +0x84, 0x9fe9d8\nLDR             R0, [SP,#0x18+var_C]                                   ; +0x88, 0x9fe9dc\nADD             SP, SP, #0x18                                          ; +0x8c, 0x9fe9e0\nPOP             {R4-R6,PC}                                             ; +0x90, 0x9fe9e4\nMOV             R3, #0x8B                                              ; +0x94, 0x9fe9e8\nSTR             R3, [SP,#0x18+var_18]                                  ; +0x98, 0x9fe9ec\nLDR             R3, =(aCryptoEcEcKmet - 0x9FEA08); \"crypto/ec/ec_kmeth.c\" ; +0x9c, 0x9fe9f0\nMOV             R0, #0x10                                              ; +0xa0, 0x9fe9f4\nMOV             R1, #0xF6                                              ; +0xa4, 0x9fe9f8\nMOV             R2, #0xA1                                              ; +0xa8, 0x9fe9fc\nADD             R3, PC, R3; \"crypto/ec/ec_kmeth.c\"                     ; +0xac, 0x9fea00\nBL              ERR_put_error                                          ; +0xb0, 0x9fea04\nMOV             R0, R4                                                 ; +0xb4, 0x9fea08\nADD             SP, SP, #0x18                                          ; +0xb8, 0x9fea0c\nPOP             {R4-R6,PC}                                             ; +0xbc, 0x9fea10\nLDR             R2, [SP,#0x18+var_C]                                   ; +0xc0, 0x9fea14\nLDR             R4, [SP,#0x18+var_4]                                   ; +0xc4, 0x9fea18\nLDR             R5, [SP,#0x18+var_8]                                   ; +0xc8, 0x9fea1c\nCMP             R2, R4                                                 ; +0xcc, 0x9fea20\nMOVHI           R2, R4; size_t                                         ; +0xd0, 0x9fea24\nMOV             R0, R6; void *                                         ; +0xd4, 0x9fea28\nMOV             R1, R5; void *                                         ; +0xd8, 0x9fea2c\nSTRHI           R4, [SP,#0x18+var_C]                                   ; +0xdc, 0x9fea30\nBL              memcpy                                                 ; +0xe0, 0x9fea34\nB               loc_9FE9C4                                             ; +0xe4, 0x9fea38\nMOV             R3, #0x87                                              ; +0xe8, 0x9fea3c\nSTR             R3, [SP,#0x18+var_18]                                  ; +0xec, 0x9fea40\nLDR             R3, =(aCryptoEcEcKmet - 0x9FEA5C); \"crypto/ec/ec_kmeth.c\" ; +0xf0, 0x9fea44\nMOV             R0, #0x10                                              ; +0xf4, 0x9fea48\nMOV             R1, #0xF6                                              ; +0xf8, 0x9fea4c\nMOV             R2, #0x98                                              ; +0xfc, 0x9fea50\nADD             R3, PC, R3; \"crypto/ec/ec_kmeth.c\"                     ; +0x100, 0x9fea54\nBL              ERR_put_error                                          ; +0x104, 0x9fea58\nMOV             R0, R5                                                 ; +0x108, 0x9fea5c\nB               loc_9FE9E0                                             ; +0x10c, 0x9fea60", "xrefs": ["sub_A9FDF4 @ 0xa9fed8", "sub_A9FDF4 @ 0xa9ff88", "<???> @ 0x7b34c"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}