{"type": "func", "start": 8847832, "end": 8847960, "name": "BN_nnmod", "pseudocode": "// \n// BN_nnmod from 0x8701d8 to 0x870258 (128 bytes)\n// \n// 28 xrefs:\n// > ossl_ecdsa_sign_setup @ 0x7edcc8\n// > ossl_ecdsa_sign_sig @ 0x7ee510\n// > ossl_ecdsa_verify_sig @ 0x7eef18\n// > sub_7F0594 @ 0x7f14d8\n// > sub_7F0594 @ 0x7f15a4\n// > ec_GFp_simple_set_compressed_coordinates @ 0x7f22a8\n// > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x7f3418\n// > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x7f3480\n// > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x7f34d4\n// > ec_GFp_simple_group_set_curve @ 0x7f3e74\n// > ec_GFp_simple_group_set_curve @ 0x7f3ebc\n// > SRP_Verify_B_mod_N @ 0x837028\n// > BN_mod_exp_recp @ 0x86cee8\n// > BN_mod_exp_mont @ 0x86d9d8\n// > BN_mod_exp_simple @ 0x86e3d0\n// > int_bn_mod_inverse @ 0x86f230\n// > int_bn_mod_inverse @ 0x86f328\n// > int_bn_mod_inverse @ 0x86f59c\n// > BN_kronecker @ 0x870150\n// > BN_mod_add @ 0x870290\n// > BN_mod_sub @ 0x87030c\n// > BN_mod_mul @ 0x8703ac\n// > BN_mod_lshift1 @ 0x870454\n// > BN_mod_lshift @ 0x8705bc\n// > BN_mod_sqrt @ 0x8717e8\n// > BN_mod_sqrt @ 0x871a48\n// > BN_mod_sqrt @ 0x871c28\n// > <???> @ 0x61c5c\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 BN_nnmod(int *a1, int *a2, int *a3, int ***a4, int a5)\n{\n  int result; // r0\n  int (__fastcall *v8)(int *, int *, int *); // r3\n\n  result = BN_div(nullptr, (int)a1, a2, a3, a4);\n  if ( result )\n  {\n    if ( a1[3] )\n    {\n      if ( a3[3] )\n        v8 = BN_sub;\n      else\n        v8 = BN_add;\n      return v8(a1, a1, a3);\n    }\n    else\n    {\n      return 1;\n    }\n  }\n  return result;\n}", "assembly": "; \n; BN_nnmod from 0x8701d8 to 0x870258 (128 bytes)\n; \n; 28 xrefs:\n; > ossl_ecdsa_sign_setup @ 0x7edcc8\n; > ossl_ecdsa_sign_sig @ 0x7ee510\n; > ossl_ecdsa_verify_sig @ 0x7eef18\n; > sub_7F0594 @ 0x7f14d8\n; > sub_7F0594 @ 0x7f15a4\n; > ec_GFp_simple_set_compressed_coordinates @ 0x7f22a8\n; > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x7f3418\n; > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x7f3480\n; > ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x7f34d4\n; > ec_GFp_simple_group_set_curve @ 0x7f3e74\n; > ec_GFp_simple_group_set_curve @ 0x7f3ebc\n; > SRP_Verify_B_mod_N @ 0x837028\n; > BN_mod_exp_recp @ 0x86cee8\n; > BN_mod_exp_mont @ 0x86d9d8\n; > BN_mod_exp_simple @ 0x86e3d0\n; > int_bn_mod_inverse @ 0x86f230\n; > int_bn_mod_inverse @ 0x86f328\n; > int_bn_mod_inverse @ 0x86f59c\n; > BN_kronecker @ 0x870150\n; > BN_mod_add @ 0x870290\n; > BN_mod_sub @ 0x87030c\n; > BN_mod_mul @ 0x8703ac\n; > BN_mod_lshift1 @ 0x870454\n; > BN_mod_lshift @ 0x8705bc\n; > BN_mod_sqrt @ 0x8717e8\n; > BN_mod_sqrt @ 0x871a48\n; > BN_mod_sqrt @ 0x871c28\n; > <???> @ 0x61c5c\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,R5,LR}                                             ; +0x0, 0x8701d8\nMOV             R5, R2                                                 ; +0x4, 0x8701dc\nSUB             SP, SP, #0xC                                           ; +0x8, 0x8701e0\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xc, 0x8701e4\nMOV             R2, R1                                                 ; +0x10, 0x8701e8\nMOV             R4, R0                                                 ; +0x14, 0x8701ec\nMOV             R1, R0                                                 ; +0x18, 0x8701f0\nMOV             R3, R5                                                 ; +0x1c, 0x8701f4\nMOV             R0, #0                                                 ; +0x20, 0x8701f8\nBL              BN_div                                                 ; +0x24, 0x8701fc\nCMP             R0, #0                                                 ; +0x28, 0x870200\nBEQ             loc_870244                                             ; +0x2c, 0x870204\nLDR             R3, [R4,#0xC]                                          ; +0x30, 0x870208\nCMP             R3, #0                                                 ; +0x34, 0x87020c\nBEQ             loc_870240                                             ; +0x38, 0x870210\nLDR             R3, [R5,#0xC]                                          ; +0x3c, 0x870214\nCMP             R3, #0                                                 ; +0x40, 0x870218\nBNE             loc_87024C                                             ; +0x44, 0x87021c\nLDR             R3, =(BN_add_ptr - 0x87022C)                           ; +0x48, 0x870220\nLDR             R3, [PC,R3]; BN_add                                    ; +0x4c, 0x870224\nMOV             R2, R5                                                 ; +0x50, 0x870228\nMOV             R0, R4                                                 ; +0x54, 0x87022c\nMOV             R1, R4                                                 ; +0x58, 0x870230\nADD             SP, SP, #0xC                                           ; +0x5c, 0x870234\nPOP             {R4,R5,LR}                                             ; +0x60, 0x870238\nBX              R3 ; BN_add BN_sub                                     ; +0x64, 0x87023c\nMOV             R0, #1                                                 ; +0x68, 0x870240\nADD             SP, SP, #0xC                                           ; +0x6c, 0x870244\nPOP             {R4,R5,PC}                                             ; +0x70, 0x870248\nLDR             R3, =(BN_sub_ptr - 0x870258)                           ; +0x74, 0x87024c\nLDR             R3, [PC,R3]; BN_sub                                    ; +0x78, 0x870250\nB               loc_870228                                             ; +0x7c, 0x870254", "xrefs": ["ossl_ecdsa_sign_setup @ 0x7edcc8", "ossl_ecdsa_sign_sig @ 0x7ee510", "ossl_ecdsa_verify_sig @ 0x7eef18", "sub_7F0594 @ 0x7f14d8", "sub_7F0594 @ 0x7f15a4", "ec_GFp_simple_set_compressed_coordinates @ 0x7f22a8", "ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x7f3418", "ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x7f3480", "ec_GFp_simple_set_Jprojective_coordinates_GFp @ 0x7f34d4", "ec_GFp_simple_group_set_curve @ 0x7f3e74", "ec_GFp_simple_group_set_curve @ 0x7f3ebc", "SRP_Verify_B_mod_N @ 0x837028", "BN_mod_exp_recp @ 0x86cee8", "BN_mod_exp_mont @ 0x86d9d8", "BN_mod_exp_simple @ 0x86e3d0", "int_bn_mod_inverse @ 0x86f230", "int_bn_mod_inverse @ 0x86f328", "int_bn_mod_inverse @ 0x86f59c", "BN_kronecker @ 0x870150", "BN_mod_add @ 0x870290", "BN_mod_sub @ 0x87030c", "BN_mod_mul @ 0x8703ac", "BN_mod_lshift1 @ 0x870454", "BN_mod_lshift @ 0x8705bc", "BN_mod_sqrt @ 0x8717e8", "BN_mod_sqrt @ 0x871a48", "BN_mod_sqrt @ 0x871c28", "<???> @ 0x61c5c"], "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"}