{"type": "func", "start": 8303676, "end": 8304296, "name": "EC_GROUP_cmp", "pseudocode": "// \n// EC_GROUP_cmp from 0x7eb43c to 0x7eb6a8 (620 bytes)\n// \n// 2 xrefs:\n// > sub_7E4790 @ 0x7e47c8\n// > <???> @ 0x6115c\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\nint __fastcall EC_GROUP_cmp(int *a1, int a2, int a3)\n{\n  int v6; // r0\n  int field_type; // r7\n  int v8; // r0\n  int v10; // r7\n  int *v11; // r8\n  int *v12; // r9\n  int *v13; // r10\n  int *v14; // r11\n  _BOOL4 v15; // r5\n  int curve_name; // r7\n  _DWORD *v17; // r8\n  _DWORD *v18; // r0\n  int *v19; // r8\n  int *v20; // r9\n  int *v21; // r6\n  int v22; // r0\n  bool v23; // zf\n  int *v24; // r5\n  int v25; // r0\n  int *v26; // [sp+8h] [bp-Ch]\n  int *v27; // [sp+Ch] [bp-8h]\n\n  v6 = EC_GROUP_method_of((int)a1);\n  field_type = EC_METHOD_get_field_type(v6);\n  v8 = EC_GROUP_method_of(a2);\n  if ( field_type != EC_METHOD_get_field_type(v8) )\n    return 1;\n  if ( EC_GROUP_get_curve_name((int)a1) )\n  {\n    if ( EC_GROUP_get_curve_name(a2) )\n    {\n      curve_name = EC_GROUP_get_curve_name((int)a1);\n      if ( curve_name != EC_GROUP_get_curve_name(a2) )\n        return 1;\n    }\n  }\n  v10 = *(_DWORD *)*a1 & 2;\n  if ( v10 )\n    return 0;\n  if ( !a3 )\n  {\n    v25 = BN_CTX_new();\n    a3 = v25;\n    if ( !v25 )\n      return -1;\n    v10 = v25;\n  }\n  BN_CTX_start(a3);\n  v11 = (int *)BN_CTX_get(a3);\n  v12 = (int *)BN_CTX_get(a3);\n  v13 = (int *)BN_CTX_get(a3);\n  v14 = (int *)BN_CTX_get(a3);\n  v26 = (int *)BN_CTX_get(a3);\n  v27 = (int *)BN_CTX_get(a3);\n  if ( v27 )\n  {\n    if ( !(*(int (__fastcall **)(int *, int *, int *, int *, int))(*a1 + 28))(a1, v11, v12, v13, a3) )\n      goto LABEL_8;\n    if ( !(*(int (__fastcall **)(int, int *, int *, int *, int))(*(_DWORD *)a2 + 28))(a2, v14, v26, v27, a3) )\n      goto LABEL_8;\n    if ( BN_cmp(v11, v14) )\n      goto LABEL_8;\n    if ( BN_cmp(v12, v26) )\n      goto LABEL_8;\n    if ( BN_cmp(v13, v27) )\n      goto LABEL_8;\n    v17 = (_DWORD *)EC_GROUP_get0_generator((int)a1);\n    v18 = (_DWORD *)EC_GROUP_get0_generator(a2);\n    if ( EC_POINT_cmp(a1, v17, v18) )\n      goto LABEL_8;\n    v19 = (int *)EC_GROUP_get0_order((int)a1);\n    v20 = (int *)EC_GROUP_get0_order(a2);\n    v21 = (int *)EC_GROUP_get0_cofactor((int)a1);\n    v22 = EC_GROUP_get0_cofactor(a2);\n    v23 = v19 == nullptr;\n    if ( v19 )\n      v23 = v20 == nullptr;\n    v24 = (int *)v22;\n    if ( !v23 )\n    {\n      if ( !BN_cmp(v19, v20) )\n      {\n        v15 = BN_cmp(v21, v24) != 0;\n        goto LABEL_9;\n      }\nLABEL_8:\n      v15 = 1;\nLABEL_9:\n      BN_CTX_end(a3);\n      BN_CTX_free(v10);\n      return v15;\n    }\n  }\n  BN_CTX_end(a3);\n  BN_CTX_free(v10);\n  return -1;\n}", "assembly": "; \n; EC_GROUP_cmp from 0x7eb43c to 0x7eb6a8 (620 bytes)\n; \n; 2 xrefs:\n; > sub_7E4790 @ 0x7e47c8\n; > <???> @ 0x6115c\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\nPUSH            {R4-R11,LR}                                            ; +0x0, 0x7eb43c\nSUB             SP, SP, #0x14                                          ; +0x4, 0x7eb440\nMOV             R5, R1                                                 ; +0x8, 0x7eb444\nMOV             R4, R2                                                 ; +0xc, 0x7eb448\nMOV             R6, R0                                                 ; +0x10, 0x7eb44c\nBL              EC_GROUP_method_of                                     ; +0x14, 0x7eb450\nBL              EC_METHOD_get_field_type                               ; +0x18, 0x7eb454\nMOV             R7, R0                                                 ; +0x1c, 0x7eb458\nMOV             R0, R5                                                 ; +0x20, 0x7eb45c\nBL              EC_GROUP_method_of                                     ; +0x24, 0x7eb460\nBL              EC_METHOD_get_field_type                               ; +0x28, 0x7eb464\nCMP             R7, R0                                                 ; +0x2c, 0x7eb468\nBEQ             loc_7EB47C                                             ; +0x30, 0x7eb46c\nMOV             R0, #1                                                 ; +0x34, 0x7eb470\nADD             SP, SP, #0x14                                          ; +0x38, 0x7eb474\nPOP             {R4-R11,PC}                                            ; +0x3c, 0x7eb478\nMOV             R0, R6                                                 ; +0x40, 0x7eb47c\nBL              EC_GROUP_get_curve_name                                ; +0x44, 0x7eb480\nCMP             R0, #0                                                 ; +0x48, 0x7eb484\nBNE             loc_7EB54C                                             ; +0x4c, 0x7eb488\nLDR             R3, [R6]                                               ; +0x50, 0x7eb48c\nLDR             R7, [R3]                                               ; +0x54, 0x7eb490\nANDS            R7, R7, #2                                             ; +0x58, 0x7eb494\nBNE             loc_7EB544                                             ; +0x5c, 0x7eb498\nCMP             R4, #0                                                 ; +0x60, 0x7eb49c\nBEQ             loc_7EB678                                             ; +0x64, 0x7eb4a0\nMOV             R0, R4                                                 ; +0x68, 0x7eb4a4\nBL              BN_CTX_start                                           ; +0x6c, 0x7eb4a8\nMOV             R0, R4                                                 ; +0x70, 0x7eb4ac\nBL              BN_CTX_get                                             ; +0x74, 0x7eb4b0\nMOV             R8, R0                                                 ; +0x78, 0x7eb4b4\nMOV             R0, R4                                                 ; +0x7c, 0x7eb4b8\nBL              BN_CTX_get                                             ; +0x80, 0x7eb4bc\nMOV             R9, R0                                                 ; +0x84, 0x7eb4c0\nMOV             R0, R4                                                 ; +0x88, 0x7eb4c4\nBL              BN_CTX_get                                             ; +0x8c, 0x7eb4c8\nMOV             R10, R0                                                ; +0x90, 0x7eb4cc\nMOV             R0, R4                                                 ; +0x94, 0x7eb4d0\nBL              BN_CTX_get                                             ; +0x98, 0x7eb4d4\nMOV             R11, R0                                                ; +0x9c, 0x7eb4d8\nMOV             R0, R4                                                 ; +0xa0, 0x7eb4dc\nBL              BN_CTX_get                                             ; +0xa4, 0x7eb4e0\nSTR             R0, [SP,#0x14+var_C]                                   ; +0xa8, 0x7eb4e4\nMOV             R0, R4                                                 ; +0xac, 0x7eb4e8\nBL              BN_CTX_get                                             ; +0xb0, 0x7eb4ec\nSUBS            R3, R0, #0                                             ; +0xb4, 0x7eb4f0\nSTR             R3, [SP,#0x14+var_8]                                   ; +0xb8, 0x7eb4f4\nBEQ             loc_7EB690                                             ; +0xbc, 0x7eb4f8\nLDR             R3, [R6]                                               ; +0xc0, 0x7eb4fc\nMOV             R0, R6                                                 ; +0xc4, 0x7eb500\nSTR             R4, [SP,#0x14+var_14]                                  ; +0xc8, 0x7eb504\nMOV             R1, R8                                                 ; +0xcc, 0x7eb508\nLDR             R12, [R3,#0x1C]                                        ; +0xd0, 0x7eb50c\nMOV             R2, R9                                                 ; +0xd4, 0x7eb510\nMOV             R3, R10                                                ; +0xd8, 0x7eb514\nBLX             R12                                                    ; +0xdc, 0x7eb518\nCMP             R0, #0                                                 ; +0xe0, 0x7eb51c\nBNE             loc_7EB57C                                             ; +0xe4, 0x7eb520\nMOV             R5, #1                                                 ; +0xe8, 0x7eb524\nMOV             R0, R4                                                 ; +0xec, 0x7eb528\nBL              BN_CTX_end                                             ; +0xf0, 0x7eb52c\nMOV             R0, R7                                                 ; +0xf4, 0x7eb530\nBL              BN_CTX_free                                            ; +0xf8, 0x7eb534\nMOV             R0, R5                                                 ; +0xfc, 0x7eb538\nADD             SP, SP, #0x14                                          ; +0x100, 0x7eb53c\nPOP             {R4-R11,PC}                                            ; +0x104, 0x7eb540\nMOV             R0, #0                                                 ; +0x108, 0x7eb544\nB               loc_7EB474                                             ; +0x10c, 0x7eb548\nMOV             R0, R5                                                 ; +0x110, 0x7eb54c\nBL              EC_GROUP_get_curve_name                                ; +0x114, 0x7eb550\nCMP             R0, #0                                                 ; +0x118, 0x7eb554\nBEQ             loc_7EB48C                                             ; +0x11c, 0x7eb558\nMOV             R0, R6                                                 ; +0x120, 0x7eb55c\nBL              EC_GROUP_get_curve_name                                ; +0x124, 0x7eb560\nMOV             R7, R0                                                 ; +0x128, 0x7eb564\nMOV             R0, R5                                                 ; +0x12c, 0x7eb568\nBL              EC_GROUP_get_curve_name                                ; +0x130, 0x7eb56c\nCMP             R7, R0                                                 ; +0x134, 0x7eb570\nBNE             loc_7EB470                                             ; +0x138, 0x7eb574\nB               loc_7EB48C                                             ; +0x13c, 0x7eb578\nLDR             R3, [R5]                                               ; +0x140, 0x7eb57c\nMOV             R0, R5                                                 ; +0x144, 0x7eb580\nSTR             R4, [SP,#0x14+var_14]                                  ; +0x148, 0x7eb584\nMOV             R1, R11                                                ; +0x14c, 0x7eb588\nLDR             R12, [R3,#0x1C]                                        ; +0x150, 0x7eb58c\nLDR             R2, [SP,#0x14+var_C]                                   ; +0x154, 0x7eb590\nLDR             R3, [SP,#0x14+var_8]                                   ; +0x158, 0x7eb594\nBLX             R12                                                    ; +0x15c, 0x7eb598\nCMP             R0, #0                                                 ; +0x160, 0x7eb59c\nBEQ             loc_7EB524                                             ; +0x164, 0x7eb5a0\nMOV             R0, R8                                                 ; +0x168, 0x7eb5a4\nMOV             R1, R11                                                ; +0x16c, 0x7eb5a8\nBL              BN_cmp                                                 ; +0x170, 0x7eb5ac\nCMP             R0, #0                                                 ; +0x174, 0x7eb5b0\nBNE             loc_7EB524                                             ; +0x178, 0x7eb5b4\nMOV             R0, R9                                                 ; +0x17c, 0x7eb5b8\nLDR             R1, [SP,#0x14+var_C]                                   ; +0x180, 0x7eb5bc\nBL              BN_cmp                                                 ; +0x184, 0x7eb5c0\nCMP             R0, #0                                                 ; +0x188, 0x7eb5c4\nBNE             loc_7EB524                                             ; +0x18c, 0x7eb5c8\nMOV             R0, R10                                                ; +0x190, 0x7eb5cc\nLDR             R1, [SP,#0x14+var_8]                                   ; +0x194, 0x7eb5d0\nBL              BN_cmp                                                 ; +0x198, 0x7eb5d4\nCMP             R0, #0                                                 ; +0x19c, 0x7eb5d8\nBNE             loc_7EB524                                             ; +0x1a0, 0x7eb5dc\nMOV             R0, R6                                                 ; +0x1a4, 0x7eb5e0\nBL              EC_GROUP_get0_generator                                ; +0x1a8, 0x7eb5e4\nMOV             R8, R0                                                 ; +0x1ac, 0x7eb5e8\nMOV             R0, R5                                                 ; +0x1b0, 0x7eb5ec\nBL              EC_GROUP_get0_generator                                ; +0x1b4, 0x7eb5f0\nMOV             R1, R8                                                 ; +0x1b8, 0x7eb5f4\nMOV             R3, R4                                                 ; +0x1bc, 0x7eb5f8\nMOV             R2, R0                                                 ; +0x1c0, 0x7eb5fc\nMOV             R0, R6                                                 ; +0x1c4, 0x7eb600\nBL              EC_POINT_cmp                                           ; +0x1c8, 0x7eb604\nCMP             R0, #0                                                 ; +0x1cc, 0x7eb608\nBNE             loc_7EB524                                             ; +0x1d0, 0x7eb60c\nMOV             R0, R6                                                 ; +0x1d4, 0x7eb610\nBL              EC_GROUP_get0_order                                    ; +0x1d8, 0x7eb614\nMOV             R8, R0                                                 ; +0x1dc, 0x7eb618\nMOV             R0, R5                                                 ; +0x1e0, 0x7eb61c\nBL              EC_GROUP_get0_order                                    ; +0x1e4, 0x7eb620\nMOV             R9, R0                                                 ; +0x1e8, 0x7eb624\nMOV             R0, R6                                                 ; +0x1ec, 0x7eb628\nBL              EC_GROUP_get0_cofactor                                 ; +0x1f0, 0x7eb62c\nMOV             R6, R0                                                 ; +0x1f4, 0x7eb630\nMOV             R0, R5                                                 ; +0x1f8, 0x7eb634\nBL              EC_GROUP_get0_cofactor                                 ; +0x1fc, 0x7eb638\nCMP             R8, #0                                                 ; +0x200, 0x7eb63c\nCMPNE           R9, #0                                                 ; +0x204, 0x7eb640\nMOV             R5, R0                                                 ; +0x208, 0x7eb644\nBEQ             loc_7EB690                                             ; +0x20c, 0x7eb648\nMOV             R0, R8                                                 ; +0x210, 0x7eb64c\nMOV             R1, R9                                                 ; +0x214, 0x7eb650\nBL              BN_cmp                                                 ; +0x218, 0x7eb654\nCMP             R0, #0                                                 ; +0x21c, 0x7eb658\nBNE             loc_7EB524                                             ; +0x220, 0x7eb65c\nMOV             R1, R5                                                 ; +0x224, 0x7eb660\nMOV             R0, R6                                                 ; +0x228, 0x7eb664\nBL              BN_cmp                                                 ; +0x22c, 0x7eb668\nMOVS            R5, R0                                                 ; +0x230, 0x7eb66c\nMOVNE           R5, #1                                                 ; +0x234, 0x7eb670\nB               loc_7EB528                                             ; +0x238, 0x7eb674\nBL              BN_CTX_new                                             ; +0x23c, 0x7eb678\nSUBS            R4, R0, #0                                             ; +0x240, 0x7eb67c\nMOVEQ           R0, #0xFFFFFFFF                                        ; +0x244, 0x7eb680\nBEQ             loc_7EB474                                             ; +0x248, 0x7eb684\nMOV             R7, R4                                                 ; +0x24c, 0x7eb688\nB               loc_7EB4A4                                             ; +0x250, 0x7eb68c\nMOV             R0, R4                                                 ; +0x254, 0x7eb690\nBL              BN_CTX_end                                             ; +0x258, 0x7eb694\nMOV             R0, R7                                                 ; +0x25c, 0x7eb698\nBL              BN_CTX_free                                            ; +0x260, 0x7eb69c\nMOV             R0, #0xFFFFFFFF                                        ; +0x264, 0x7eb6a0\nB               loc_7EB474                                             ; +0x268, 0x7eb6a4", "xrefs": ["sub_7E4790 @ 0x7e47c8", "<???> @ 0x6115c"], "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"}