{"type": "func", "start": 10440932, "end": 10441152, "name": "DH_free", "pseudocode": "// \n// DH_free from 0x9f50e4 to 0x9f51c0 (220 bytes)\n// \n// 20 xrefs:\n// > tls_process_key_exchange @ 0x9b83c4\n// > tls_construct_server_key_exchange @ 0x9befe0\n// > ssl_get_auto_dh @ 0x9c9858\n// > sub_9CFEE0 @ 0x9cff98\n// > sub_9F283C @ 0x9f2840\n// > sub_9F2DCC @ 0x9f2e50\n// > sub_9F3178 @ 0x9f3204\n// > DHparams_dup @ 0x9f3cc8\n// > sub_9F3D50 @ 0x9f422c\n// > sub_9F3D50 @ 0x9f4484\n// > sub_9F49B8 @ 0x9f49f4\n// > d2i_DHxparams @ 0x9f4a88\n// > d2i_DHxparams @ 0x9f4b20\n// > DH_new_method @ 0x9f5270\n// > DH_get_1024_160 @ 0x9f564c\n// > DH_get_2048_224 @ 0x9f56c8\n// > DH_get_2048_256 @ 0x9f5744\n// > DSA_dup_DH @ 0x9f6f20\n// > sub_A94888 @ 0xa949dc\n// > <???> @ 0x76cfc\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\nint __fastcall DH_free(int result)\n{\n  int v1; // r4\n  void (__fastcall *v2)(int); // r3\n  int v3; // [sp+4h] [bp-14h] BYREF\n\n  if ( result )\n  {\n    v1 = result;\n    result = CRYPTO_atomic_add(result + 56, -1, &v3, *(_DWORD *)(result + 72));\n    if ( v3 <= 0 )\n    {\n      v2 = *(void (__fastcall **)(int))(*(_DWORD *)(v1 + 64) + 20);\n      if ( v2 )\n        v2(v1);\n      ENGINE_finish(*(_DWORD *)(v1 + 68));\n      CRYPTO_free_ex_data(6, v1, v1 + 60);\n      CRYPTO_THREAD_lock_free(*(_DWORD *)(v1 + 72));\n      BN_clear_free(*(_BYTE **)(v1 + 8));\n      BN_clear_free(*(_BYTE **)(v1 + 12));\n      BN_clear_free(*(_BYTE **)(v1 + 36));\n      BN_clear_free(*(_BYTE **)(v1 + 40));\n      CRYPTO_free(*(_DWORD *)(v1 + 44), \"crypto/dh/dh_lib.c\", 134);\n      BN_clear_free(*(_BYTE **)(v1 + 52));\n      BN_clear_free(*(_BYTE **)(v1 + 20));\n      BN_clear_free(*(_BYTE **)(v1 + 24));\n      return CRYPTO_free(v1, \"crypto/dh/dh_lib.c\", 138);\n    }\n  }\n  return result;\n}", "assembly": "; \n; DH_free from 0x9f50e4 to 0x9f51c0 (220 bytes)\n; \n; 20 xrefs:\n; > tls_process_key_exchange @ 0x9b83c4\n; > tls_construct_server_key_exchange @ 0x9befe0\n; > ssl_get_auto_dh @ 0x9c9858\n; > sub_9CFEE0 @ 0x9cff98\n; > sub_9F283C @ 0x9f2840\n; > sub_9F2DCC @ 0x9f2e50\n; > sub_9F3178 @ 0x9f3204\n; > DHparams_dup @ 0x9f3cc8\n; > sub_9F3D50 @ 0x9f422c\n; > sub_9F3D50 @ 0x9f4484\n; > sub_9F49B8 @ 0x9f49f4\n; > d2i_DHxparams @ 0x9f4a88\n; > d2i_DHxparams @ 0x9f4b20\n; > DH_new_method @ 0x9f5270\n; > DH_get_1024_160 @ 0x9f564c\n; > DH_get_2048_224 @ 0x9f56c8\n; > DH_get_2048_256 @ 0x9f5744\n; > DSA_dup_DH @ 0x9f6f20\n; > sub_A94888 @ 0xa949dc\n; > <???> @ 0x76cfc\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; \nCMP             R0, #0                                                 ; +0x0, 0x9f50e4\nBXEQ            LR                                                     ; +0x4, 0x9f50e8\nPUSH            {R4,R5,LR}                                             ; +0x8, 0x9f50ec\nMOV             R4, R0                                                 ; +0xc, 0x9f50f0\nSUB             SP, SP, #0xC                                           ; +0x10, 0x9f50f4\nLDR             R3, [R4,#0x48]                                         ; +0x14, 0x9f50f8\nADD             R0, R0, #0x38 ; '8'                                    ; +0x18, 0x9f50fc\nMOV             R1, #0xFFFFFFFF                                        ; +0x1c, 0x9f5100\nADD             R2, SP, #0x18+var_14                                   ; +0x20, 0x9f5104\nBL              CRYPTO_atomic_add                                      ; +0x24, 0x9f5108\nLDR             R3, [SP,#0x18+var_14]                                  ; +0x28, 0x9f510c\nCMP             R3, #0                                                 ; +0x2c, 0x9f5110\nBLE             loc_9F5120                                             ; +0x30, 0x9f5114\nADD             SP, SP, #0xC                                           ; +0x34, 0x9f5118\nPOP             {R4,R5,PC}                                             ; +0x38, 0x9f511c\nLDR             R3, [R4,#0x40]                                         ; +0x3c, 0x9f5120\nLDR             R3, [R3,#0x14]                                         ; +0x40, 0x9f5124\nCMP             R3, #0                                                 ; +0x44, 0x9f5128\nBEQ             loc_9F5138                                             ; +0x48, 0x9f512c\nMOV             R0, R4                                                 ; +0x4c, 0x9f5130\nBLX             R3                                                     ; +0x50, 0x9f5134\nLDR             R0, [R4,#0x44]                                         ; +0x54, 0x9f5138\nBL              ENGINE_finish                                          ; +0x58, 0x9f513c\nMOV             R1, R4                                                 ; +0x5c, 0x9f5140\nADD             R2, R4, #0x3C ; '<'                                    ; +0x60, 0x9f5144\nMOV             R0, #6                                                 ; +0x64, 0x9f5148\nBL              CRYPTO_free_ex_data                                    ; +0x68, 0x9f514c\nLDR             R0, [R4,#0x48]                                         ; +0x6c, 0x9f5150\nBL              CRYPTO_THREAD_lock_free                                ; +0x70, 0x9f5154\nLDR             R0, [R4,#8]                                            ; +0x74, 0x9f5158\nBL              BN_clear_free                                          ; +0x78, 0x9f515c\nLDR             R5, =(aCryptoDhDhLibC - 0x9F517C); \"crypto/dh/dh_lib.c\" ; +0x7c, 0x9f5160\nLDR             R0, [R4,#0xC]                                          ; +0x80, 0x9f5164\nBL              BN_clear_free                                          ; +0x84, 0x9f5168\nLDR             R0, [R4,#0x24]                                         ; +0x88, 0x9f516c\nBL              BN_clear_free                                          ; +0x8c, 0x9f5170\nADD             R5, PC, R5; \"crypto/dh/dh_lib.c\"                       ; +0x90, 0x9f5174\nLDR             R0, [R4,#0x28]                                         ; +0x94, 0x9f5178\nBL              BN_clear_free                                          ; +0x98, 0x9f517c\nMOV             R1, R5                                                 ; +0x9c, 0x9f5180\nMOV             R2, #0x86                                              ; +0xa0, 0x9f5184\nLDR             R0, [R4,#0x2C]                                         ; +0xa4, 0x9f5188\nBL              CRYPTO_free                                            ; +0xa8, 0x9f518c\nLDR             R0, [R4,#0x34]                                         ; +0xac, 0x9f5190\nBL              BN_clear_free                                          ; +0xb0, 0x9f5194\nLDR             R0, [R4,#0x14]                                         ; +0xb4, 0x9f5198\nBL              BN_clear_free                                          ; +0xb8, 0x9f519c\nLDR             R0, [R4,#0x18]                                         ; +0xbc, 0x9f51a0\nBL              BN_clear_free                                          ; +0xc0, 0x9f51a4\nMOV             R0, R4                                                 ; +0xc4, 0x9f51a8\nMOV             R1, R5                                                 ; +0xc8, 0x9f51ac\nMOV             R2, #0x8A                                              ; +0xcc, 0x9f51b0\nBL              CRYPTO_free                                            ; +0xd0, 0x9f51b4\nADD             SP, SP, #0xC                                           ; +0xd4, 0x9f51b8\nPOP             {R4,R5,PC}                                             ; +0xd8, 0x9f51bc", "xrefs": ["tls_process_key_exchange @ 0x9b83c4", "tls_construct_server_key_exchange @ 0x9befe0", "ssl_get_auto_dh @ 0x9c9858", "sub_9CFEE0 @ 0x9cff98", "sub_9F283C @ 0x9f2840", "sub_9F2DCC @ 0x9f2e50", "sub_9F3178 @ 0x9f3204", "DHparams_dup @ 0x9f3cc8", "sub_9F3D50 @ 0x9f422c", "sub_9F3D50 @ 0x9f4484", "sub_9F49B8 @ 0x9f49f4", "d2i_DHxparams @ 0x9f4a88", "d2i_DHxparams @ 0x9f4b20", "DH_new_method @ 0x9f5270", "DH_get_1024_160 @ 0x9f564c", "DH_get_2048_224 @ 0x9f56c8", "DH_get_2048_256 @ 0x9f5744", "DSA_dup_DH @ 0x9f6f20", "sub_A94888 @ 0xa949dc", "<???> @ 0x76cfc"], "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"}