{"type": "func", "start": 8353836, "end": 8354004, "name": "ENGINE_get_first", "pseudocode": "// \n// ENGINE_get_first from 0x7f782c to 0x7f78d4 (168 bytes)\n// \n// 12 xrefs:\n// > sub_644A78 @ 0x644a7a\n// > ENGINE_register_all_complete @ 0x7f7064\n// > ENGINE_register_all_pkey_asn1_meths @ 0x7f8700\n// > ENGINE_register_all_ciphers @ 0x7f8b38\n// > ENGINE_register_all_DH @ 0x7f8cfc\n// > ENGINE_register_all_digests @ 0x7f8e4c\n// > ENGINE_register_all_DSA @ 0x7f9010\n// > ENGINE_register_all_EC @ 0x7f9140\n// > ENGINE_register_all_pkey_meths @ 0x7f9290\n// > ENGINE_register_all_RAND @ 0x7f94d8\n// > ENGINE_register_all_RSA @ 0x7f9608\n// > <???> @ 0x5552c\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 ENGINE_get_first()\n{\n  int v0; // r0\n  int v1; // r4\n\n  if ( CRYPTO_THREAD_run_once(&engine_lock_init, do_engine_lock_init_ossl_) && do_engine_lock_init_ossl_ret_ )\n  {\n    CRYPTO_THREAD_write_lock(global_engine_lock);\n    v0 = global_engine_lock;\n    v1 = dword_AD2E84;\n    if ( dword_AD2E84 )\n      ++*(_DWORD *)(dword_AD2E84 + 80);\n    CRYPTO_THREAD_unlock(v0);\n    return v1;\n  }\n  else\n  {\n    ERR_put_error(38, 195, 65, \"crypto/engine/eng_list.c\", 140);\n    return 0;\n  }\n}", "assembly": "; \n; ENGINE_get_first from 0x7f782c to 0x7f78d4 (168 bytes)\n; \n; 12 xrefs:\n; > sub_644A78 @ 0x644a7a\n; > ENGINE_register_all_complete @ 0x7f7064\n; > ENGINE_register_all_pkey_asn1_meths @ 0x7f8700\n; > ENGINE_register_all_ciphers @ 0x7f8b38\n; > ENGINE_register_all_DH @ 0x7f8cfc\n; > ENGINE_register_all_digests @ 0x7f8e4c\n; > ENGINE_register_all_DSA @ 0x7f9010\n; > ENGINE_register_all_EC @ 0x7f9140\n; > ENGINE_register_all_pkey_meths @ 0x7f9290\n; > ENGINE_register_all_RAND @ 0x7f94d8\n; > ENGINE_register_all_RSA @ 0x7f9608\n; > <???> @ 0x5552c\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, 0x7f782c\nLDR             R4, =(_GLOBAL_OFFSET_TABLE_ - 0x7F7844)                ; +0x4, 0x7f7830\nLDR             R2, =(engine_lock_init_ptr - 0xAB8990)                 ; +0x8, 0x7f7834\nLDR             R3, =(do_engine_lock_init_ossl__ptr - 0xAB8990)        ; +0xc, 0x7f7838\nADD             R4, PC, R4; _GLOBAL_OFFSET_TABLE_                      ; +0x10, 0x7f783c\nSUB             SP, SP, #0xC                                           ; +0x14, 0x7f7840\nLDR             R0, [R4,R2]; engine_lock_init                          ; +0x18, 0x7f7844\nLDR             R1, [R4,R3]; do_engine_lock_init_ossl_                 ; +0x1c, 0x7f7848\nBL              CRYPTO_THREAD_run_once                                 ; +0x20, 0x7f784c\nCMP             R0, #0                                                 ; +0x24, 0x7f7850\nBEQ             loc_7F78A8                                             ; +0x28, 0x7f7854\nLDR             R3, =(do_engine_lock_init_ossl_ret__ptr - 0xAB8990)    ; +0x2c, 0x7f7858\nLDR             R3, [R4,R3]; do_engine_lock_init_ossl_ret_             ; +0x30, 0x7f785c\nLDR             R3, [R3]                                               ; +0x34, 0x7f7860\nCMP             R3, #0                                                 ; +0x38, 0x7f7864\nBEQ             loc_7F78A8                                             ; +0x3c, 0x7f7868\nLDR             R3, =(global_engine_lock_ptr - 0xAB8990)               ; +0x40, 0x7f786c\nLDR             R5, [R4,R3]; global_engine_lock                        ; +0x44, 0x7f7870\nLDR             R0, [R5]                                               ; +0x48, 0x7f7874\nBL              CRYPTO_THREAD_write_lock                               ; +0x4c, 0x7f7878\nLDR             R3, =(dword_AD2E84 - 0x7F788C)                         ; +0x50, 0x7f787c\nLDR             R0, [R5]                                               ; +0x54, 0x7f7880\nLDR             R4, [PC,R3]; dword_AD2E84                              ; +0x58, 0x7f7884\nCMP             R4, #0                                                 ; +0x5c, 0x7f7888\nLDRNE           R3, [R4,#0x50]                                         ; +0x60, 0x7f788c\nADDNE           R3, R3, #1                                             ; +0x64, 0x7f7890\nSTRNE           R3, [R4,#0x50]                                         ; +0x68, 0x7f7894\nBL              CRYPTO_THREAD_unlock                                   ; +0x6c, 0x7f7898\nMOV             R0, R4                                                 ; +0x70, 0x7f789c\nADD             SP, SP, #0xC                                           ; +0x74, 0x7f78a0\nPOP             {R4,R5,PC}                                             ; +0x78, 0x7f78a4\nMOV             R3, #0x8C                                              ; +0x7c, 0x7f78a8\nSTR             R3, [SP,#0xC+var_C]                                    ; +0x80, 0x7f78ac\nLDR             R3, =(aCryptoEngineEn_4 - 0x7F78C8); \"crypto/engine/eng_list.c\" ; +0x84, 0x7f78b0\nMOV             R0, #0x26 ; '&'                                        ; +0x88, 0x7f78b4\nMOV             R1, #0xC3                                              ; +0x8c, 0x7f78b8\nMOV             R2, #0x41 ; 'A'                                        ; +0x90, 0x7f78bc\nADD             R3, PC, R3; \"crypto/engine/eng_list.c\"                 ; +0x94, 0x7f78c0\nBL              ERR_put_error                                          ; +0x98, 0x7f78c4\nMOV             R0, #0                                                 ; +0x9c, 0x7f78c8\nADD             SP, SP, #0xC                                           ; +0xa0, 0x7f78cc\nPOP             {R4,R5,PC}                                             ; +0xa4, 0x7f78d0", "xrefs": ["sub_644A78 @ 0x644a7a", "ENGINE_register_all_complete @ 0x7f7064", "ENGINE_register_all_pkey_asn1_meths @ 0x7f8700", "ENGINE_register_all_ciphers @ 0x7f8b38", "ENGINE_register_all_DH @ 0x7f8cfc", "ENGINE_register_all_digests @ 0x7f8e4c", "ENGINE_register_all_DSA @ 0x7f9010", "ENGINE_register_all_EC @ 0x7f9140", "ENGINE_register_all_pkey_meths @ 0x7f9290", "ENGINE_register_all_RAND @ 0x7f94d8", "ENGINE_register_all_RSA @ 0x7f9608", "<???> @ 0x5552c"], "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"}