{"type": "func", "start": 10487132, "end": 10487392, "name": "EC_GROUP_set_generator", "pseudocode": "// \n// EC_GROUP_set_generator from 0xa0055c to 0xa00660 (260 bytes)\n// \n// 3 xrefs:\n// > EC_GROUP_new_from_ecparameters @ 0x9fbc44\n// > EC_GROUP_new_by_curve_name @ 0x9fcff4\n// > <???> @ 0x7af5c\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:38 +0000\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 0xa0055c to 0xa00660 (260 bytes)\n; \n; 3 xrefs:\n; > EC_GROUP_new_from_ecparameters @ 0x9fbc44\n; > EC_GROUP_new_by_curve_name @ 0x9fcff4\n; > <???> @ 0x7af5c\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:38 +0000\n; \nPUSH            {R4-R7,LR}                                             ; +0x0, 0xa0055c\nSUBS            R5, R1, #0                                             ; +0x4, 0xa00560\nSUB             SP, SP, #0xC                                           ; +0x8, 0xa00564\nBEQ             loc_A00638                                             ; +0xc, 0xa00568\nLDR             R12, [R0,#4]                                           ; +0x10, 0xa0056c\nMOV             R6, R2                                                 ; +0x14, 0xa00570\nCMP             R12, #0                                                ; +0x18, 0xa00574\nMOV             R7, R3                                                 ; +0x1c, 0xa00578\nMOV             R4, R0                                                 ; +0x20, 0xa0057c\nBEQ             loc_A005F8                                             ; +0x24, 0xa00580\nMOV             R0, R12                                                ; +0x28, 0xa00584\nMOV             R1, R5                                                 ; +0x2c, 0xa00588\nBL              EC_POINT_copy                                          ; +0x30, 0xa0058c\nCMP             R0, #0                                                 ; +0x34, 0xa00590\nBEQ             loc_A0060C                                             ; +0x38, 0xa00594\nCMP             R6, #0                                                 ; +0x3c, 0xa00598\nMOV             R1, R6                                                 ; +0x40, 0xa0059c\nLDR             R0, [R4,#8]                                            ; +0x44, 0xa005a0\nBEQ             loc_A00618                                             ; +0x48, 0xa005a4\nBL              BN_copy                                                ; +0x4c, 0xa005a8\nCMP             R0, #0                                                 ; +0x50, 0xa005ac\nBEQ             loc_A0060C                                             ; +0x54, 0xa005b0\nCMP             R7, #0                                                 ; +0x58, 0xa005b4\nMOV             R1, R7                                                 ; +0x5c, 0xa005b8\nLDR             R0, [R4,#0xC]                                          ; +0x60, 0xa005bc\nBEQ             loc_A00630                                             ; +0x64, 0xa005c0\nBL              BN_copy                                                ; +0x68, 0xa005c4\nCMP             R0, #0                                                 ; +0x6c, 0xa005c8\nBEQ             loc_A0060C                                             ; +0x70, 0xa005cc\nLDR             R0, [R4,#8]                                            ; +0x74, 0xa005d0\nBL              BN_is_odd                                              ; +0x78, 0xa005d4\nSUBS            R5, R0, #0                                             ; +0x7c, 0xa005d8\nBNE             loc_A00620                                             ; +0x80, 0xa005dc\nLDR             R0, [R4,#0x58]                                         ; +0x84, 0xa005e0\nBL              BN_MONT_CTX_free                                       ; +0x88, 0xa005e4\nMOV             R0, #1                                                 ; +0x8c, 0xa005e8\nSTR             R5, [R4,#0x58]                                         ; +0x90, 0xa005ec\nADD             SP, SP, #0xC                                           ; +0x94, 0xa005f0\nPOP             {R4-R7,PC}                                             ; +0x98, 0xa005f4\nBL              EC_POINT_new                                           ; +0x9c, 0xa005f8\nCMP             R0, #0                                                 ; +0xa0, 0xa005fc\nMOV             R12, R0                                                ; +0xa4, 0xa00600\nSTR             R0, [R4,#4]                                            ; +0xa8, 0xa00604\nBNE             loc_A00584                                             ; +0xac, 0xa00608\nMOV             R0, #0                                                 ; +0xb0, 0xa0060c\nADD             SP, SP, #0xC                                           ; +0xb4, 0xa00610\nPOP             {R4-R7,PC}                                             ; +0xb8, 0xa00614\nBL              BN_set_word                                            ; +0xbc, 0xa00618\nB               loc_A005B4                                             ; +0xc0, 0xa0061c\nMOV             R0, R4                                                 ; +0xc4, 0xa00620\nADD             SP, SP, #0xC                                           ; +0xc8, 0xa00624\nPOP             {R4-R7,LR}                                             ; +0xcc, 0xa00628\nB               ec_precompute_mont_data                                ; +0xd0, 0xa0062c\nBL              BN_set_word                                            ; +0xd4, 0xa00630\nB               loc_A005D0                                             ; +0xd8, 0xa00634\nLDR             R3, =0x107                                             ; +0xdc, 0xa00638\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xe0, 0xa0063c\nLDR             R3, =(aCryptoEcEcLibC - 0xA00658); \"crypto/ec/ec_lib.c\" ; +0xe4, 0xa00640\nMOV             R0, #0x10                                              ; +0xe8, 0xa00644\nMOV             R1, #0x6F ; 'o'                                        ; +0xec, 0xa00648\nMOV             R2, #0x43 ; 'C'                                        ; +0xf0, 0xa0064c\nADD             R3, PC, R3; \"crypto/ec/ec_lib.c\"                       ; +0xf4, 0xa00650\nBL              ERR_put_error                                          ; +0xf8, 0xa00654\nMOV             R0, R5                                                 ; +0xfc, 0xa00658\nB               loc_A005F0                                             ; +0x100, 0xa0065c", "xrefs": ["EC_GROUP_new_from_ecparameters @ 0x9fbc44", "EC_GROUP_new_by_curve_name @ 0x9fcff4", "<???> @ 0x7af5c"], "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"}