{"type": "func", "start": 8304988, "end": 8305248, "name": "EC_GROUP_set_generator", "pseudocode": "// \n// EC_GROUP_set_generator from 0x7eb95c to 0x7eba60 (260 bytes)\n// \n// 3 xrefs:\n// > EC_GROUP_new_from_ecparameters @ 0x7e7044\n// > EC_GROUP_new_by_curve_name @ 0x7e83f4\n// > <???> @ 0x614dc\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_set_generator(int a1, _DWORD *a2, int a3, int a4)\n{\n  _DWORD *v5; // r12\n  int **v9; // r0\n  int **v10; // r0\n\n  if ( !a2 )\n  {\n    ERR_put_error(16, 111, 67, \"crypto/ec/ec_lib.c\", 263);\n    return 0;\n  }\n  v5 = *(_DWORD **)(a1 + 4);\n  if ( !v5 )\n  {\n    v5 = EC_POINT_new((int *)a1);\n    *(_DWORD *)(a1 + 4) = v5;\n    if ( !v5 )\n      return 0;\n  }\n  if ( !EC_POINT_copy(v5, a2) )\n    return 0;\n  v9 = *(int ***)(a1 + 8);\n  if ( a3 )\n  {\n    if ( !BN_copy((int)v9, a3) )\n      return 0;\n  }\n  else\n  {\n    BN_set_word(v9, 0);\n  }\n  v10 = *(int ***)(a1 + 12);\n  if ( a4 )\n  {\n    if ( BN_copy((int)v10, a4) )\n      goto LABEL_8;\n    return 0;\n  }\n  BN_set_word(v10, 0);\nLABEL_8:\n  if ( BN_is_odd(*(_DWORD *)(a1 + 8)) )\n    return ec_precompute_mont_data(a1);\n  BN_MONT_CTX_free(*(_BYTE **)(a1 + 88));\n  *(_DWORD *)(a1 + 88) = 0;\n  return 1;\n}", "assembly": "; \n; EC_GROUP_set_generator from 0x7eb95c to 0x7eba60 (260 bytes)\n; \n; 3 xrefs:\n; > EC_GROUP_new_from_ecparameters @ 0x7e7044\n; > EC_GROUP_new_by_curve_name @ 0x7e83f4\n; > <???> @ 0x614dc\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-R7,LR}                                             ; +0x0, 0x7eb95c\nSUBS            R5, R1, #0                                             ; +0x4, 0x7eb960\nSUB             SP, SP, #0xC                                           ; +0x8, 0x7eb964\nBEQ             loc_7EBA38                                             ; +0xc, 0x7eb968\nLDR             R12, [R0,#4]                                           ; +0x10, 0x7eb96c\nMOV             R6, R2                                                 ; +0x14, 0x7eb970\nCMP             R12, #0                                                ; +0x18, 0x7eb974\nMOV             R7, R3                                                 ; +0x1c, 0x7eb978\nMOV             R4, R0                                                 ; +0x20, 0x7eb97c\nBEQ             loc_7EB9F8                                             ; +0x24, 0x7eb980\nMOV             R0, R12                                                ; +0x28, 0x7eb984\nMOV             R1, R5                                                 ; +0x2c, 0x7eb988\nBL              EC_POINT_copy                                          ; +0x30, 0x7eb98c\nCMP             R0, #0                                                 ; +0x34, 0x7eb990\nBEQ             loc_7EBA0C                                             ; +0x38, 0x7eb994\nCMP             R6, #0                                                 ; +0x3c, 0x7eb998\nMOV             R1, R6                                                 ; +0x40, 0x7eb99c\nLDR             R0, [R4,#8]                                            ; +0x44, 0x7eb9a0\nBEQ             loc_7EBA18                                             ; +0x48, 0x7eb9a4\nBL              BN_copy                                                ; +0x4c, 0x7eb9a8\nCMP             R0, #0                                                 ; +0x50, 0x7eb9ac\nBEQ             loc_7EBA0C                                             ; +0x54, 0x7eb9b0\nCMP             R7, #0                                                 ; +0x58, 0x7eb9b4\nMOV             R1, R7                                                 ; +0x5c, 0x7eb9b8\nLDR             R0, [R4,#0xC]                                          ; +0x60, 0x7eb9bc\nBEQ             loc_7EBA30                                             ; +0x64, 0x7eb9c0\nBL              BN_copy                                                ; +0x68, 0x7eb9c4\nCMP             R0, #0                                                 ; +0x6c, 0x7eb9c8\nBEQ             loc_7EBA0C                                             ; +0x70, 0x7eb9cc\nLDR             R0, [R4,#8]                                            ; +0x74, 0x7eb9d0\nBL              BN_is_odd                                              ; +0x78, 0x7eb9d4\nSUBS            R5, R0, #0                                             ; +0x7c, 0x7eb9d8\nBNE             loc_7EBA20                                             ; +0x80, 0x7eb9dc\nLDR             R0, [R4,#0x58]                                         ; +0x84, 0x7eb9e0\nBL              BN_MONT_CTX_free                                       ; +0x88, 0x7eb9e4\nMOV             R0, #1                                                 ; +0x8c, 0x7eb9e8\nSTR             R5, [R4,#0x58]                                         ; +0x90, 0x7eb9ec\nADD             SP, SP, #0xC                                           ; +0x94, 0x7eb9f0\nPOP             {R4-R7,PC}                                             ; +0x98, 0x7eb9f4\nBL              EC_POINT_new                                           ; +0x9c, 0x7eb9f8\nCMP             R0, #0                                                 ; +0xa0, 0x7eb9fc\nMOV             R12, R0                                                ; +0xa4, 0x7eba00\nSTR             R0, [R4,#4]                                            ; +0xa8, 0x7eba04\nBNE             loc_7EB984                                             ; +0xac, 0x7eba08\nMOV             R0, #0                                                 ; +0xb0, 0x7eba0c\nADD             SP, SP, #0xC                                           ; +0xb4, 0x7eba10\nPOP             {R4-R7,PC}                                             ; +0xb8, 0x7eba14\nBL              BN_set_word                                            ; +0xbc, 0x7eba18\nB               loc_7EB9B4                                             ; +0xc0, 0x7eba1c\nMOV             R0, R4                                                 ; +0xc4, 0x7eba20\nADD             SP, SP, #0xC                                           ; +0xc8, 0x7eba24\nPOP             {R4-R7,LR}                                             ; +0xcc, 0x7eba28\nB               ec_precompute_mont_data                                ; +0xd0, 0x7eba2c\nBL              BN_set_word                                            ; +0xd4, 0x7eba30\nB               loc_7EB9D0                                             ; +0xd8, 0x7eba34\nLDR             R3, =0x107                                             ; +0xdc, 0x7eba38\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xe0, 0x7eba3c\nLDR             R3, =(aCryptoEcEcLibC - 0x7EBA58); \"crypto/ec/ec_lib.c\" ; +0xe4, 0x7eba40\nMOV             R0, #0x10                                              ; +0xe8, 0x7eba44\nMOV             R1, #0x6F ; 'o'                                        ; +0xec, 0x7eba48\nMOV             R2, #0x43 ; 'C'                                        ; +0xf0, 0x7eba4c\nADD             R3, PC, R3; \"crypto/ec/ec_lib.c\"                       ; +0xf4, 0x7eba50\nBL              ERR_put_error                                          ; +0xf8, 0x7eba54\nMOV             R0, R5                                                 ; +0xfc, 0x7eba58\nB               loc_7EB9F0                                             ; +0x100, 0x7eba5c", "xrefs": ["EC_GROUP_new_from_ecparameters @ 0x7e7044", "EC_GROUP_new_by_curve_name @ 0x7e83f4", "<???> @ 0x614dc"], "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"}