{"type": "func", "start": 10394444, "end": 10394592, "name": "BN_set_bit", "pseudocode": "// \n// BN_set_bit from 0x9e9b4c to 0x9e9be0 (148 bytes)\n// \n// 14 xrefs:\n// > BN_MONT_CTX_set @ 0x9ea410\n// > BN_MONT_CTX_set @ 0x9ea528\n// > EC_GROUP_new_from_ecparameters @ 0x9fb7e8\n// > EC_GROUP_new_from_ecparameters @ 0x9fb83c\n// > EC_GROUP_new_from_ecparameters @ 0x9fb858\n// > EC_GROUP_new_from_ecparameters @ 0x9fb86c\n// > EC_GROUP_new_from_ecparameters @ 0x9fb880\n// > EC_GROUP_new_from_ecparameters @ 0x9fb894\n// > EC_GROUP_new_from_ecparameters @ 0x9fbaf4\n// > EC_GROUP_new_from_ecparameters @ 0x9fbb08\n// > BN_reciprocal @ 0xa85f0c\n// > BN_GF2m_mod_sqrt_arr @ 0xade94c\n// > BN_GF2m_arr2poly @ 0xadf770\n// > <???> @ 0x7971c\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:25 +0000\n// \n\nint __fastcall BN_set_bit(int *a1, int a2)\n{\n  int v2; // r6\n  char v3; // r5\n  int v4; // r7\n  int v7; // r0\n\n  if ( a2 < 0 )\n    return 0;\n  v2 = a2 >> 5;\n  v3 = a2 & 0x1F;\n  if ( a2 >> 5 < a1[1] )\n  {\n    v4 = *a1;\nLABEL_4:\n    *(_DWORD *)(v4 + 4 * v2) |= 1 << v3;\n    return 1;\n  }\n  if ( bn_wexpand((int)a1, v2 + 1) )\n  {\n    v7 = a1[1];\n    v4 = *a1;\n    if ( v2 >= v7 )\n      memset((void *)(*a1 + 4 * v7), 0, 4 * (1 - v7 + v2));\n    a1[1] = v2 + 1;\n    goto LABEL_4;\n  }\n  return 0;\n}", "assembly": "; \n; BN_set_bit from 0x9e9b4c to 0x9e9be0 (148 bytes)\n; \n; 14 xrefs:\n; > BN_MONT_CTX_set @ 0x9ea410\n; > BN_MONT_CTX_set @ 0x9ea528\n; > EC_GROUP_new_from_ecparameters @ 0x9fb7e8\n; > EC_GROUP_new_from_ecparameters @ 0x9fb83c\n; > EC_GROUP_new_from_ecparameters @ 0x9fb858\n; > EC_GROUP_new_from_ecparameters @ 0x9fb86c\n; > EC_GROUP_new_from_ecparameters @ 0x9fb880\n; > EC_GROUP_new_from_ecparameters @ 0x9fb894\n; > EC_GROUP_new_from_ecparameters @ 0x9fbaf4\n; > EC_GROUP_new_from_ecparameters @ 0x9fbb08\n; > BN_reciprocal @ 0xa85f0c\n; > BN_GF2m_mod_sqrt_arr @ 0xade94c\n; > BN_GF2m_arr2poly @ 0xadf770\n; > <???> @ 0x7971c\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:25 +0000\n; \nCMP             R1, #0                                                 ; +0x0, 0x9e9b4c\nBLT             loc_9E9BD0                                             ; +0x4, 0x9e9b50\nLDR             R2, [R0,#4]                                            ; +0x8, 0x9e9b54\nPUSH            {R4-R8,LR}                                             ; +0xc, 0x9e9b58\nMOV             R6, R1,ASR#5                                           ; +0x10, 0x9e9b5c\nCMP             R6, R2                                                 ; +0x14, 0x9e9b60\nAND             R5, R1, #0x1F                                          ; +0x18, 0x9e9b64\nBGE             loc_9E9B84                                             ; +0x1c, 0x9e9b68\nLDR             R7, [R0]                                               ; +0x20, 0x9e9b6c\nLDR             R3, [R7,R6,LSL#2]                                      ; +0x24, 0x9e9b70\nMOV             R0, #1                                                 ; +0x28, 0x9e9b74\nORR             R1, R3, R0,LSL R5                                      ; +0x2c, 0x9e9b78\nSTR             R1, [R7,R6,LSL#2]                                      ; +0x30, 0x9e9b7c\nPOP             {R4-R8,PC}                                             ; +0x34, 0x9e9b80\nADD             R8, R6, #1                                             ; +0x38, 0x9e9b84\nMOV             R1, R8                                                 ; +0x3c, 0x9e9b88\nMOV             R4, R0                                                 ; +0x40, 0x9e9b8c\nBL              bn_wexpand                                             ; +0x44, 0x9e9b90\nCMP             R0, #0                                                 ; +0x48, 0x9e9b94\nBEQ             loc_9E9BD8                                             ; +0x4c, 0x9e9b98\nLDR             R0, [R4,#4]                                            ; +0x50, 0x9e9b9c\nCMP             R6, R0                                                 ; +0x54, 0x9e9ba0\nLDRLT           R7, [R4]                                               ; +0x58, 0x9e9ba4\nBLT             loc_9E9BC8                                             ; +0x5c, 0x9e9ba8\nRSB             R2, R0, #1                                             ; +0x60, 0x9e9bac\nLDR             R7, [R4]                                               ; +0x64, 0x9e9bb0\nADD             R2, R2, R6                                             ; +0x68, 0x9e9bb4\nMOV             R2, R2,LSL#2; size_t                                   ; +0x6c, 0x9e9bb8\nADD             R0, R7, R0,LSL#2; void *                               ; +0x70, 0x9e9bbc\nMOV             R1, #0; int                                            ; +0x74, 0x9e9bc0\nBL              memset                                                 ; +0x78, 0x9e9bc4\nSTR             R8, [R4,#4]                                            ; +0x7c, 0x9e9bc8\nB               loc_9E9B70                                             ; +0x80, 0x9e9bcc\nMOV             R0, #0                                                 ; +0x84, 0x9e9bd0\nBX              LR                                                     ; +0x88, 0x9e9bd4\nMOV             R0, #0                                                 ; +0x8c, 0x9e9bd8\nPOP             {R4-R8,PC}                                             ; +0x90, 0x9e9bdc", "xrefs": ["BN_MONT_CTX_set @ 0x9ea410", "BN_MONT_CTX_set @ 0x9ea528", "EC_GROUP_new_from_ecparameters @ 0x9fb7e8", "EC_GROUP_new_from_ecparameters @ 0x9fb83c", "EC_GROUP_new_from_ecparameters @ 0x9fb858", "EC_GROUP_new_from_ecparameters @ 0x9fb86c", "EC_GROUP_new_from_ecparameters @ 0x9fb880", "EC_GROUP_new_from_ecparameters @ 0x9fb894", "EC_GROUP_new_from_ecparameters @ 0x9fbaf4", "EC_GROUP_new_from_ecparameters @ 0x9fbb08", "BN_reciprocal @ 0xa85f0c", "BN_GF2m_mod_sqrt_arr @ 0xade94c", "BN_GF2m_arr2poly @ 0xadf770", "<???> @ 0x7971c"], "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"}