{"type": "func", "start": 10441156, "end": 10441596, "name": "DH_new_method", "pseudocode": "// \n// DH_new_method from 0x9f51c4 to 0x9f537c (440 bytes)\n// \n// 2 xrefs:\n// > DH_new @ 0x9f538c\n// > <???> @ 0x7a58c\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:31 +0000\n// \n\n_DWORD *__fastcall DH_new_method(int a1)\n{\n  int v2; // r0\n  _DWORD *v3; // r4\n  int v4; // r6\n  char **default_method; // r0\n  int default_DH; // r0\n  int DH; // r0\n  _DWORD *result; // r0\n  int (__fastcall *v9)(_DWORD *); // r3\n\n  v2 = CRYPTO_zalloc(76, \"crypto/dh/dh_lib.c\", 57);\n  v3 = (_DWORD *)v2;\n  if ( !v2 )\n  {\n    ERR_put_error(5, 105, 65, \"crypto/dh/dh_lib.c\", 60);\n    return nullptr;\n  }\n  *(_DWORD *)(v2 + 56) = 1;\n  v4 = CRYPTO_THREAD_lock_new(v2);\n  v3[18] = v4;\n  if ( !v4 )\n  {\n    ERR_put_error(5, 105, 65, \"crypto/dh/dh_lib.c\", 67);\n    CRYPTO_free(v3, \"crypto/dh/dh_lib.c\", 68);\n    return nullptr;\n  }\n  default_method = DH_get_default_method();\n  v3[7] = default_method[6];\n  v3[16] = default_method;\n  if ( a1 )\n  {\n    if ( !ENGINE_init(a1) )\n    {\n      ERR_put_error(5, 105, 38, \"crypto/dh/dh_lib.c\", 77);\nLABEL_9:\n      DH_free((int)v3);\n      return nullptr;\n    }\n    v3[17] = a1;\n    default_DH = a1;\n  }\n  else\n  {\n    default_DH = ENGINE_get_default_DH();\n    v3[17] = default_DH;\n    if ( !default_DH )\n    {\n      DH = v3[16];\n      goto LABEL_8;\n    }\n  }\n  DH = ENGINE_get_DH(default_DH);\n  v3[16] = DH;\n  if ( !DH )\n  {\n    ERR_put_error(5, 105, 38, \"crypto/dh/dh_lib.c\", 86);\n    goto LABEL_9;\n  }\nLABEL_8:\n  v3[7] = *(_DWORD *)(DH + 24);\n  if ( !CRYPTO_new_ex_data(6, v3, v3 + 15) )\n    goto LABEL_9;\n  result = v3;\n  v9 = *(int (__fastcall **)(_DWORD *))(v3[16] + 16);\n  if ( v9 )\n  {\n    if ( v9(v3) )\n      return v3;\n    ERR_put_error(5, 105, 70, \"crypto/dh/dh_lib.c\", 98);\n    goto LABEL_9;\n  }\n  return result;\n}", "assembly": "; \n; DH_new_method from 0x9f51c4 to 0x9f537c (440 bytes)\n; \n; 2 xrefs:\n; > DH_new @ 0x9f538c\n; > <???> @ 0x7a58c\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:31 +0000\n; \nPUSH            {R4-R7,LR}                                             ; +0x0, 0x9f51c4\nLDR             R7, =(aCryptoDhDhLibC - 0x9F51D8); \"crypto/dh/dh_lib.c\" ; +0x4, 0x9f51c8\nSUB             SP, SP, #0xC                                           ; +0x8, 0x9f51cc\nADD             R7, PC, R7; \"crypto/dh/dh_lib.c\"                       ; +0xc, 0x9f51d0\nMOV             R5, R0                                                 ; +0x10, 0x9f51d4\nMOV             R1, R7                                                 ; +0x14, 0x9f51d8\nMOV             R0, #0x4C ; 'L'                                        ; +0x18, 0x9f51dc\nMOV             R2, #0x39 ; '9'                                        ; +0x1c, 0x9f51e0\nBL              CRYPTO_zalloc                                          ; +0x20, 0x9f51e4\nSUBS            R4, R0, #0                                             ; +0x24, 0x9f51e8\nBEQ             loc_9F5324                                             ; +0x28, 0x9f51ec\nMOV             R3, #1                                                 ; +0x2c, 0x9f51f0\nSTR             R3, [R4,#0x38]                                         ; +0x30, 0x9f51f4\nBL              CRYPTO_THREAD_lock_new                                 ; +0x34, 0x9f51f8\nCMP             R0, #0                                                 ; +0x38, 0x9f51fc\nMOV             R6, R0                                                 ; +0x3c, 0x9f5200\nSTR             R0, [R4,#0x48]                                         ; +0x40, 0x9f5204\nBEQ             loc_9F5348                                             ; +0x44, 0x9f5208\nBL              DH_get_default_method                                  ; +0x48, 0x9f520c\nCMP             R5, #0                                                 ; +0x4c, 0x9f5210\nLDR             R3, [R0,#0x18]                                         ; +0x50, 0x9f5214\nSTR             R3, [R4,#0x1C]                                         ; +0x54, 0x9f5218\nSTR             R0, [R4,#0x40]                                         ; +0x58, 0x9f521c\nBEQ             loc_9F52E8                                             ; +0x5c, 0x9f5220\nMOV             R0, R5                                                 ; +0x60, 0x9f5224\nBL              ENGINE_init                                            ; +0x64, 0x9f5228\nCMP             R0, #0                                                 ; +0x68, 0x9f522c\nSTRNE           R5, [R4,#0x44]                                         ; +0x6c, 0x9f5230\nMOVNE           R0, R5                                                 ; +0x70, 0x9f5234\nBEQ             loc_9F52C8                                             ; +0x74, 0x9f5238\nBL              ENGINE_get_DH                                          ; +0x78, 0x9f523c\nCMP             R0, #0                                                 ; +0x7c, 0x9f5240\nSTR             R0, [R4,#0x40]                                         ; +0x80, 0x9f5244\nBEQ             loc_9F5300                                             ; +0x84, 0x9f5248\nLDR             R3, [R0,#0x18]                                         ; +0x88, 0x9f524c\nSTR             R3, [R4,#0x1C]                                         ; +0x8c, 0x9f5250\nMOV             R0, #6                                                 ; +0x90, 0x9f5254\nMOV             R1, R4                                                 ; +0x94, 0x9f5258\nADD             R2, R4, #0x3C ; '<'                                    ; +0x98, 0x9f525c\nBL              CRYPTO_new_ex_data                                     ; +0x9c, 0x9f5260\nCMP             R0, #0                                                 ; +0xa0, 0x9f5264\nBNE             loc_9F5280                                             ; +0xa4, 0x9f5268\nMOV             R0, R4                                                 ; +0xa8, 0x9f526c\nBL              DH_free                                                ; +0xac, 0x9f5270\nMOV             R0, #0                                                 ; +0xb0, 0x9f5274\nADD             SP, SP, #0xC                                           ; +0xb4, 0x9f5278\nPOP             {R4-R7,PC}                                             ; +0xb8, 0x9f527c\nLDR             R3, [R4,#0x40]                                         ; +0xbc, 0x9f5280\nMOV             R0, R4                                                 ; +0xc0, 0x9f5284\nLDR             R3, [R3,#0x10]                                         ; +0xc4, 0x9f5288\nCMP             R3, #0                                                 ; +0xc8, 0x9f528c\nBEQ             loc_9F5278                                             ; +0xcc, 0x9f5290\nBLX             R3                                                     ; +0xd0, 0x9f5294\nCMP             R0, #0                                                 ; +0xd4, 0x9f5298\nMOVNE           R0, R4                                                 ; +0xd8, 0x9f529c\nBNE             loc_9F5278                                             ; +0xdc, 0x9f52a0\nMOV             R3, #0x62 ; 'b'                                        ; +0xe0, 0x9f52a4\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xe4, 0x9f52a8\nLDR             R3, =(aCryptoDhDhLibC - 0x9F52C4); \"crypto/dh/dh_lib.c\" ; +0xe8, 0x9f52ac\nMOV             R0, #5                                                 ; +0xec, 0x9f52b0\nMOV             R1, #0x69 ; 'i'                                        ; +0xf0, 0x9f52b4\nMOV             R2, #0x46 ; 'F'                                        ; +0xf4, 0x9f52b8\nADD             R3, PC, R3; \"crypto/dh/dh_lib.c\"                       ; +0xf8, 0x9f52bc\nBL              ERR_put_error                                          ; +0xfc, 0x9f52c0\nB               loc_9F526C                                             ; +0x100, 0x9f52c4\nMOV             R2, #0x4D ; 'M'                                        ; +0x104, 0x9f52c8\nSTR             R2, [SP,#0xC+var_C]                                    ; +0x108, 0x9f52cc\nMOV             R3, R7                                                 ; +0x10c, 0x9f52d0\nMOV             R0, #5                                                 ; +0x110, 0x9f52d4\nMOV             R1, #0x69 ; 'i'                                        ; +0x114, 0x9f52d8\nMOV             R2, #0x26 ; '&'                                        ; +0x118, 0x9f52dc\nBL              ERR_put_error                                          ; +0x11c, 0x9f52e0\nB               loc_9F526C                                             ; +0x120, 0x9f52e4\nBL              ENGINE_get_default_DH                                  ; +0x124, 0x9f52e8\nCMP             R0, #0                                                 ; +0x128, 0x9f52ec\nSTR             R0, [R4,#0x44]                                         ; +0x12c, 0x9f52f0\nLDREQ           R0, [R4,#0x40]                                         ; +0x130, 0x9f52f4\nBEQ             loc_9F524C                                             ; +0x134, 0x9f52f8\nB               loc_9F523C                                             ; +0x138, 0x9f52fc\nMOV             R3, #0x56 ; 'V'                                        ; +0x13c, 0x9f5300\nSTR             R3, [SP,#0xC+var_C]                                    ; +0x140, 0x9f5304\nLDR             R3, =(aCryptoDhDhLibC - 0x9F5320); \"crypto/dh/dh_lib.c\" ; +0x144, 0x9f5308\nMOV             R0, #5                                                 ; +0x148, 0x9f530c\nMOV             R1, #0x69 ; 'i'                                        ; +0x14c, 0x9f5310\nMOV             R2, #0x26 ; '&'                                        ; +0x150, 0x9f5314\nADD             R3, PC, R3; \"crypto/dh/dh_lib.c\"                       ; +0x154, 0x9f5318\nBL              ERR_put_error                                          ; +0x158, 0x9f531c\nB               loc_9F526C                                             ; +0x15c, 0x9f5320\nMOV             R2, #0x3C ; '<'                                        ; +0x160, 0x9f5324\nSTR             R2, [SP,#0xC+var_C]                                    ; +0x164, 0x9f5328\nMOV             R0, #5                                                 ; +0x168, 0x9f532c\nMOV             R3, R7                                                 ; +0x16c, 0x9f5330\nMOV             R1, #0x69 ; 'i'                                        ; +0x170, 0x9f5334\nMOV             R2, #0x41 ; 'A'                                        ; +0x174, 0x9f5338\nBL              ERR_put_error                                          ; +0x178, 0x9f533c\nMOV             R0, R4                                                 ; +0x17c, 0x9f5340\nB               loc_9F5278                                             ; +0x180, 0x9f5344\nMOV             R3, #0x43 ; 'C'                                        ; +0x184, 0x9f5348\nSTR             R3, [SP,#0xC+var_C]                                    ; +0x188, 0x9f534c\nMOV             R0, #5                                                 ; +0x18c, 0x9f5350\nMOV             R1, #0x69 ; 'i'                                        ; +0x190, 0x9f5354\nMOV             R2, #0x41 ; 'A'                                        ; +0x194, 0x9f5358\nMOV             R3, R7                                                 ; +0x198, 0x9f535c\nBL              ERR_put_error                                          ; +0x19c, 0x9f5360\nMOV             R0, R4                                                 ; +0x1a0, 0x9f5364\nMOV             R1, R7                                                 ; +0x1a4, 0x9f5368\nMOV             R2, #0x44 ; 'D'                                        ; +0x1a8, 0x9f536c\nBL              CRYPTO_free                                            ; +0x1ac, 0x9f5370\nMOV             R0, R6                                                 ; +0x1b0, 0x9f5374\nB               loc_9F5278                                             ; +0x1b4, 0x9f5378", "xrefs": ["DH_new @ 0x9f538c", "<???> @ 0x7a58c"], "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"}