{"type": "func", "start": 8454140, "end": 8454528, "name": "CRYPTO_secure_actual_size", "pseudocode": "// \n// CRYPTO_secure_actual_size from 0x80fffc to 0x810180 (388 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x641cc\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\nunsigned int __fastcall CRYPTO_secure_actual_size(unsigned int a1)\n{\n  unsigned int v2; // r0\n  int i; // r4\n  unsigned int v4; // r7\n  unsigned int v5; // r0\n\n  CRYPTO_THREAD_write_lock(dword_AD44F4);\n  if ( a1 < dword_AD44D0 || a1 >= dword_AD44D0 + dword_AD44D4 )\n    OPENSSL_die(\"assertion failed: WITHIN_ARENA(ptr)\", \"crypto/mem_sec.c\", 574);\n  v2 = (a1 + dword_AD44D4 - dword_AD44D0) / dword_AD44E0;\n  for ( i = dword_AD44DC - 1; v2 && ((*(unsigned __int8 *)(dword_AD44E4 + (v2 >> 3)) >> (v2 & 7)) & 1) == 0; --i )\n  {\n    if ( (v2 & 1) != 0 )\n      OPENSSL_die(\"assertion failed: (bit & 1) == 0\", \"crypto/mem_sec.c\", 259);\n    v2 >>= 1;\n  }\n  if ( (dword_AD44DC <= i) | ((unsigned int)i >> 31) )\n    OPENSSL_die(\"assertion failed: list >= 0 && list < sh.freelist_size\", \"crypto/mem_sec.c\", 270);\n  v4 = (unsigned int)dword_AD44D4 >> i;\n  if ( ((((unsigned int)dword_AD44D4 >> i) - 1) & (a1 - dword_AD44D0)) != 0 )\n    sub_2B44A0();\n  v5 = (a1 - dword_AD44D0) / v4 + (1 << i);\n  if ( !v5 || v5 >= dword_AD44EC )\n    OPENSSL_die(\"assertion failed: bit > 0 && bit < sh.bittable_size\", \"crypto/mem_sec.c\", 273);\n  if ( (*(unsigned __int8 *)(dword_AD44E4 + (v5 >> 3)) & (1 << (v5 & 7))) == 0 )\n    OPENSSL_die(\"assertion failed: sh_testbit(ptr, list, sh.bittable)\", \"crypto/mem_sec.c\", 578);\n  CRYPTO_THREAD_unlock(dword_AD44F4);\n  return v4;\n}", "assembly": "; \n; CRYPTO_secure_actual_size from 0x80fffc to 0x810180 (388 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x641cc\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-R8,LR}                                             ; +0x0, 0x80fffc\nLDR             R5, =(dword_AD44C8 - 0x810010)                         ; +0x4, 0x810000\nMOV             R6, R0                                                 ; +0x8, 0x810004\nADD             R5, PC, R5; dword_AD44C8                               ; +0xc, 0x810008\nLDR             R0, [R5,#(dword_AD44F4 - 0xAD44C8)]                    ; +0x10, 0x81000c\nBL              CRYPTO_THREAD_write_lock                               ; +0x14, 0x810010\nLDR             R8, [R5,#(dword_AD44D0 - 0xAD44C8)]                    ; +0x18, 0x810014\nCMP             R6, R8                                                 ; +0x1c, 0x810018\nBCC             loc_81011C                                             ; +0x20, 0x81001c\nLDR             R7, [R5,#(dword_AD44D4 - 0xAD44C8)]                    ; +0x24, 0x810020\nADD             R3, R8, R7                                             ; +0x28, 0x810024\nCMP             R6, R3                                                 ; +0x2c, 0x810028\nBCS             loc_81011C                                             ; +0x30, 0x81002c\nADD             R0, R6, R7                                             ; +0x34, 0x810030\nLDR             R1, [R5,#(dword_AD44E0 - 0xAD44C8)]                    ; +0x38, 0x810034\nRSB             R0, R8, R0                                             ; +0x3c, 0x810038\nBL              __aeabi_uidiv                                          ; +0x40, 0x81003c\nLDR             R12, [R5,#(dword_AD44DC - 0xAD44C8)]                   ; +0x44, 0x810040\nLDR             R5, [R5,#(dword_AD44E4 - 0xAD44C8)]                    ; +0x48, 0x810044\nSUB             R4, R12, #1                                            ; +0x4c, 0x810048\nCMP             R0, #0                                                 ; +0x50, 0x81004c\nBEQ             loc_810068                                             ; +0x54, 0x810050\nLDRB            R1, [R5,R0,LSR#3]                                      ; +0x58, 0x810054\nAND             R2, R0, #7                                             ; +0x5c, 0x810058\nMOV             R2, R1,LSR R2                                          ; +0x60, 0x81005c\nTST             R2, #1                                                 ; +0x64, 0x810060\nBEQ             loc_8100EC                                             ; +0x68, 0x810064\nCMP             R12, R4                                                ; +0x6c, 0x810068\nMOVGT           R12, #0                                                ; +0x70, 0x81006c\nMOVLE           R12, #1                                                ; +0x74, 0x810070\nORRS            R3, R12, R4,LSR#31                                     ; +0x78, 0x810074\nBNE             loc_810168                                             ; +0x7c, 0x810078\nMOV             R7, R7,LSR R4                                          ; +0x80, 0x81007c\nRSB             R0, R8, R6                                             ; +0x84, 0x810080\nSUB             R3, R7, #1                                             ; +0x88, 0x810084\nTST             R3, R0                                                 ; +0x8c, 0x810088\nBNE             loc_810134                                             ; +0x90, 0x81008c\nMOV             R1, R7                                                 ; +0x94, 0x810090\nBL              __aeabi_uidiv                                          ; +0x98, 0x810094\nMOV             R2, #1                                                 ; +0x9c, 0x810098\nADDS            R0, R0, R2,LSL R4                                      ; +0xa0, 0x81009c\nBEQ             loc_810150                                             ; +0xa4, 0x8100a0\nLDR             R3, =(dword_AD44C8 - 0x8100B0)                         ; +0xa8, 0x8100a4\nADD             R3, PC, R3; dword_AD44C8                               ; +0xac, 0x8100a8\nLDR             R1, [R3,#(dword_AD44EC - 0xAD44C8)]                    ; +0xb0, 0x8100ac\nCMP             R0, R1                                                 ; +0xb4, 0x8100b0\nBCS             loc_810150                                             ; +0xb8, 0x8100b4\nLDRB            R1, [R5,R0,LSR#3]                                      ; +0xbc, 0x8100b8\nAND             R4, R0, #7                                             ; +0xc0, 0x8100bc\nANDS            R2, R1, R2,LSL R4                                      ; +0xc4, 0x8100c0\nBEQ             loc_810138                                             ; +0xc8, 0x8100c4\nLDR             R0, [R3,#(dword_AD44F4 - 0xAD44C8)]                    ; +0xcc, 0x8100c8\nBL              CRYPTO_THREAD_unlock                                   ; +0xd0, 0x8100cc\nMOV             R0, R7                                                 ; +0xd4, 0x8100d0\nPOP             {R4-R8,PC}                                             ; +0xd8, 0x8100d4\nLDRB            R2, [R5,R0,LSR#3]                                      ; +0xdc, 0x8100d8\nAND             R1, R0, #7                                             ; +0xe0, 0x8100dc\nMOV             R2, R2,LSR R1                                          ; +0xe4, 0x8100e0\nTST             R2, #1                                                 ; +0xe8, 0x8100e4\nBNE             loc_810068                                             ; +0xec, 0x8100e8\nTST             R0, #1                                                 ; +0xf0, 0x8100ec\nBNE             loc_810104                                             ; +0xf4, 0x8100f0\nMOVS            R0, R0,LSR#1                                           ; +0xf8, 0x8100f4\nSUB             R4, R4, #1                                             ; +0xfc, 0x8100f8\nBNE             loc_8100D8                                             ; +0x100, 0x8100fc\nB               loc_810068                                             ; +0x104, 0x810100\nLDR             R0, =(aAssertionFaile_53 - 0x810114); \"assertion failed: (bit & 1) == 0\" ; +0x108, 0x810104\nLDR             R1, =(aCryptoMemSecC - 0x810118); \"crypto/mem_sec.c\"   ; +0x10c, 0x810108\nADD             R0, PC, R0; \"assertion failed: (bit & 1) == 0\"         ; +0x110, 0x81010c\nADD             R1, PC, R1; \"crypto/mem_sec.c\"                         ; +0x114, 0x810110\nLDR             R2, =0x103                                             ; +0x118, 0x810114\nBL              OPENSSL_die                                            ; +0x11c, 0x810118\nLDR             R0, =(aAssertionFaile_49 - 0x81012C); \"assertion failed: WITHIN_ARENA(ptr)\" ; +0x120, 0x81011c\nLDR             R1, =(aCryptoMemSecC - 0x810130); \"crypto/mem_sec.c\"   ; +0x124, 0x810120\nADD             R0, PC, R0; \"assertion failed: WITHIN_ARENA(ptr)\"      ; +0x128, 0x810124\nADD             R1, PC, R1; \"crypto/mem_sec.c\"                         ; +0x12c, 0x810128\nLDR             R2, =0x23E                                             ; +0x130, 0x81012c\nBL              OPENSSL_die                                            ; +0x134, 0x810130\nBL              sub_2B44A0                                             ; +0x138, 0x810134\nLDR             R0, =(aAssertionFaile_54 - 0x810148); \"assertion failed: sh_testbit(ptr, list,\"... ; +0x13c, 0x810138\nLDR             R1, =(aCryptoMemSecC - 0x81014C); \"crypto/mem_sec.c\"   ; +0x140, 0x81013c\nADD             R0, PC, R0; \"assertion failed: sh_testbit(ptr, list,\"... ; +0x144, 0x810140\nADD             R1, PC, R1; \"crypto/mem_sec.c\"                         ; +0x148, 0x810144\nLDR             R2, =0x242                                             ; +0x14c, 0x810148\nBL              OPENSSL_die                                            ; +0x150, 0x81014c\nLDR             R0, =(aAssertionFaile_46 - 0x810160); \"assertion failed: bit > 0 && bit < sh.b\"... ; +0x154, 0x810150\nLDR             R1, =(aCryptoMemSecC - 0x810164); \"crypto/mem_sec.c\"   ; +0x158, 0x810154\nADD             R0, PC, R0; \"assertion failed: bit > 0 && bit < sh.b\"... ; +0x15c, 0x810158\nADD             R1, PC, R1; \"crypto/mem_sec.c\"                         ; +0x160, 0x81015c\nLDR             R2, =0x111                                             ; +0x164, 0x810160\nBL              OPENSSL_die                                            ; +0x168, 0x810164\nLDR             R0, =(aAssertionFaile_47 - 0x810178); \"assertion failed: list >= 0 && list < s\"... ; +0x16c, 0x810168\nLDR             R1, =(aCryptoMemSecC - 0x81017C); \"crypto/mem_sec.c\"   ; +0x170, 0x81016c\nADD             R0, PC, R0; \"assertion failed: list >= 0 && list < s\"... ; +0x174, 0x810170\nADD             R1, PC, R1; \"crypto/mem_sec.c\"                         ; +0x178, 0x810174\nLDR             R2, =0x10E                                             ; +0x17c, 0x810178\nBL              OPENSSL_die                                            ; +0x180, 0x81017c", "xrefs": ["<???> @ 0x641cc"], "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"}