{"type": "func", "start": 16995332, "end": 16995736, "name": "CRYPTO_secure_actual_size", "pseudocode": "// \n// CRYPTO_secure_actual_size from 0x1035404 to 0x1035598 (404 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x4e838\n// \n// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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 13:16:23 +0000\n// \n\nunsigned __int64 __fastcall CRYPTO_secure_actual_size(unsigned __int64 a1)\n{\n  unsigned __int64 v2; // x1\n  int v3; // w4\n  __int64 v4; // x5\n  unsigned __int64 v5; // x19\n  unsigned __int64 v6; // x20\n  unsigned __int64 v7; // x20\n\n  CRYPTO_THREAD_write_lock(qword_1567F60);\n  if ( a1 < qword_1567F18 || a1 >= qword_1567F18 + qword_1567F20 )\n    OPENSSL_die(\"assertion failed: WITHIN_ARENA(ptr)\", \"crypto/mem_sec.c\", 574);\n  v2 = (a1 + qword_1567F20 - qword_1567F18) / qword_1567F38;\n  v3 = qword_1567F30 - 1;\n  if ( v2 )\n  {\n    v4 = qword_1567F40;\n    if ( ((*(unsigned __int8 *)(qword_1567F40 + (v2 >> 3)) >> (v2 & 7)) & 1) == 0 )\n    {\n      do\n      {\n        if ( (v2 & 1) != 0 )\n          OPENSSL_die(\"assertion failed: (bit & 1) == 0\", \"crypto/mem_sec.c\", 259);\n        v2 >>= 1;\n        --v3;\n      }\n      while ( v2 && ((*(unsigned __int8 *)(qword_1567F40 + (v2 >> 3)) >> (v2 & 7)) & 1) == 0 );\n    }\n  }\n  else\n  {\n    v4 = qword_1567F40;\n  }\n  if ( v3 < 0 || qword_1567F30 <= v3 )\n    OPENSSL_die(\"assertion failed: list >= 0 && list < sh.freelist_size\", \"crypto/mem_sec.c\", 270);\n  v5 = (unsigned __int64)qword_1567F20 >> v3;\n  v6 = a1 - qword_1567F18;\n  if ( ((((unsigned __int64)qword_1567F20 >> v3) - 1) & v6) != 0 )\n    sub_632B7C();\n  v7 = v6 / v5 + (1LL << v3);\n  if ( !v7 || v7 >= qword_1567F50 )\n    OPENSSL_die(\"assertion failed: bit > 0 && bit < sh.bittable_size\", \"crypto/mem_sec.c\", 273);\n  if ( (*(unsigned __int8 *)(v4 + (v7 >> 3)) & (unsigned int)(1LL << (v7 & 7))) == 0 )\n    OPENSSL_die(\"assertion failed: sh_testbit(ptr, list, sh.bittable)\", \"crypto/mem_sec.c\", 578);\n  CRYPTO_THREAD_unlock(qword_1567F60);\n  return v5;\n}", "assembly": "; \n; CRYPTO_secure_actual_size from 0x1035404 to 0x1035598 (404 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x4e838\n; \n; This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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 13:16:23 +0000\n; \nSTP             X29, X30, [SP,#var_30]!                                ; +0x0, 0x1035404\nMOV             X29, SP                                                ; +0x4, 0x1035408\nSTR             X21, [SP,#0x30+var_10]                                 ; +0x8, 0x103540c\nADRP            X21, #qword_1567F08@PAGE                               ; +0xc, 0x1035410\nSTP             X19, X20, [SP,#0x30+var_20]                            ; +0x10, 0x1035414\nADD             X19, X21, #qword_1567F08@PAGEOFF                       ; +0x14, 0x1035418\nMOV             X20, X0                                                ; +0x18, 0x103541c\nLDR             X0, [X19,#(qword_1567F60 - 0x1567F08)]                 ; +0x1c, 0x1035420\nBL              CRYPTO_THREAD_write_lock                               ; +0x20, 0x1035424\nLDR             X6, [X19,#(qword_1567F18 - 0x1567F08)]                 ; +0x24, 0x1035428\nCMP             X20, X6                                                ; +0x28, 0x103542c\nB.CC            loc_1035534                                            ; +0x2c, 0x1035430\nLDR             X0, [X19,#(qword_1567F20 - 0x1567F08)]                 ; +0x30, 0x1035434\nADD             X1, X6, X0                                             ; +0x34, 0x1035438\nCMP             X20, X1                                                ; +0x38, 0x103543c\nB.CS            loc_1035534                                            ; +0x3c, 0x1035440\nADD             X2, X20, X0                                            ; +0x40, 0x1035444\nLDR             X1, [X19,#(qword_1567F38 - 0x1567F08)]                 ; +0x44, 0x1035448\nSUB             X2, X2, X6                                             ; +0x48, 0x103544c\nLDR             X7, [X19,#(qword_1567F30 - 0x1567F08)]                 ; +0x4c, 0x1035450\nUDIV            X1, X2, X1                                             ; +0x50, 0x1035454\nSUB             X4, X7, #1                                             ; +0x54, 0x1035458\nCBZ             X1, loc_1035514                                        ; +0x58, 0x103545c\nLSR             X3, X1, #3                                             ; +0x5c, 0x1035460\nLDR             X5, [X19,#(qword_1567F40 - 0x1567F08)]                 ; +0x60, 0x1035464\nAND             W2, W1, #7                                             ; +0x64, 0x1035468\nLDRB            W3, [X5,X3]                                            ; +0x68, 0x103546c\nLSR             X2, X3, X2                                             ; +0x6c, 0x1035470\nTBNZ            W2, #0, loc_103549C                                    ; +0x70, 0x1035474\nTBNZ            W1, #0, loc_103551C                                    ; +0x74, 0x1035478\nLSR             X1, X1, #1                                             ; +0x78, 0x103547c\nSUB             X4, X4, #1                                             ; +0x7c, 0x1035480\nCBZ             X1, loc_103549C                                        ; +0x80, 0x1035484\nLSR             X3, X1, #3                                             ; +0x84, 0x1035488\nAND             W2, W1, #7                                             ; +0x88, 0x103548c\nLDRB            W3, [X5,X3]                                            ; +0x8c, 0x1035490\nLSR             X2, X3, X2                                             ; +0x90, 0x1035494\nTBZ             W2, #0, loc_1035478                                    ; +0x94, 0x1035498\nTBNZ            W4, #0x1F, loc_103554C                                 ; +0x98, 0x103549c\nCMP             X7, W4,SXTW                                            ; +0x9c, 0x10354a0\nB.LE            loc_103554C                                            ; +0xa0, 0x10354a4\nLSR             X19, X0, X4                                            ; +0xa4, 0x10354a8\nSUB             X20, X20, X6                                           ; +0xa8, 0x10354ac\nSUB             X0, X19, #1                                            ; +0xac, 0x10354b0\nTST             X0, X20                                                ; +0xb0, 0x10354b4\nB.NE            loc_1035564                                            ; +0xb4, 0x10354b8\nMOV             X2, #1                                                 ; +0xb8, 0x10354bc\nUDIV            X20, X20, X19                                          ; +0xbc, 0x10354c0\nLSL             X0, X2, X4                                             ; +0xc0, 0x10354c4\nADDS            X20, X20, X0                                           ; +0xc4, 0x10354c8\nB.EQ            loc_1035568                                            ; +0xc8, 0x10354cc\nADD             X21, X21, #qword_1567F08@PAGEOFF                       ; +0xcc, 0x10354d0\nLDR             X0, [X21,#(qword_1567F50 - 0x1567F08)]                 ; +0xd0, 0x10354d4\nCMP             X20, X0                                                ; +0xd4, 0x10354d8\nB.CS            loc_1035568                                            ; +0xd8, 0x10354dc\nAND             W0, W20, #7                                            ; +0xdc, 0x10354e0\nLSR             X20, X20, #3                                           ; +0xe0, 0x10354e4\nLSL             X2, X2, X0                                             ; +0xe4, 0x10354e8\nLDRB            W0, [X5,X20]                                           ; +0xe8, 0x10354ec\nTST             W0, W2                                                 ; +0xec, 0x10354f0\nB.EQ            loc_1035580                                            ; +0xf0, 0x10354f4\nLDR             X0, [X21,#(qword_1567F60 - 0x1567F08)]                 ; +0xf4, 0x10354f8\nBL              CRYPTO_THREAD_unlock                                   ; +0xf8, 0x10354fc\nLDR             X21, [SP,#0x30+var_10]                                 ; +0xfc, 0x1035500\nMOV             X0, X19                                                ; +0x100, 0x1035504\nLDP             X19, X20, [SP,#0x30+var_20]                            ; +0x104, 0x1035508\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0x108, 0x103550c\nRET                                                                    ; +0x10c, 0x1035510\nLDR             X5, [X19,#(qword_1567F40 - 0x1567F08)]                 ; +0x110, 0x1035514\nB               loc_103549C                                            ; +0x114, 0x1035518\nADRP            X0, #aAssertionFaile_52@PAGE; \"assertion failed: (bit & 1) == 0\" ; +0x118, 0x103551c\nADRP            X1, #aCryptoMemSecC@PAGE; \"crypto/mem_sec.c\"           ; +0x11c, 0x1035520\nADD             X0, X0, #aAssertionFaile_52@PAGEOFF; \"assertion failed: (bit & 1) == 0\" ; +0x120, 0x1035524\nADD             X1, X1, #aCryptoMemSecC@PAGEOFF; \"crypto/mem_sec.c\"    ; +0x124, 0x1035528\nMOV             W2, #0x103                                             ; +0x128, 0x103552c\nBL              OPENSSL_die                                            ; +0x12c, 0x1035530\nADRP            X0, #aAssertionFaile_48@PAGE; \"assertion failed: WITHIN_ARENA(ptr)\" ; +0x130, 0x1035534\nADRP            X1, #aCryptoMemSecC@PAGE; \"crypto/mem_sec.c\"           ; +0x134, 0x1035538\nADD             X0, X0, #aAssertionFaile_48@PAGEOFF; \"assertion failed: WITHIN_ARENA(ptr)\" ; +0x138, 0x103553c\nADD             X1, X1, #aCryptoMemSecC@PAGEOFF; \"crypto/mem_sec.c\"    ; +0x13c, 0x1035540\nMOV             W2, #0x23E                                             ; +0x140, 0x1035544\nBL              OPENSSL_die                                            ; +0x144, 0x1035548\nADRP            X0, #aAssertionFaile_44@PAGE; \"assertion failed: list >= 0 && list < s\"... ; +0x148, 0x103554c\nADRP            X1, #aCryptoMemSecC@PAGE; \"crypto/mem_sec.c\"           ; +0x14c, 0x1035550\nADD             X0, X0, #aAssertionFaile_44@PAGEOFF; \"assertion failed: list >= 0 && list < s\"... ; +0x150, 0x1035554\nADD             X1, X1, #aCryptoMemSecC@PAGEOFF; \"crypto/mem_sec.c\"    ; +0x154, 0x1035558\nMOV             W2, #0x10E                                             ; +0x158, 0x103555c\nBL              OPENSSL_die                                            ; +0x15c, 0x1035560\nBL              sub_632B7C                                             ; +0x160, 0x1035564\nADRP            X0, #aAssertionFaile_45@PAGE; \"assertion failed: bit > 0 && bit < sh.b\"... ; +0x164, 0x1035568\nADRP            X1, #aCryptoMemSecC@PAGE; \"crypto/mem_sec.c\"           ; +0x168, 0x103556c\nADD             X0, X0, #aAssertionFaile_45@PAGEOFF; \"assertion failed: bit > 0 && bit < sh.b\"... ; +0x16c, 0x1035570\nADD             X1, X1, #aCryptoMemSecC@PAGEOFF; \"crypto/mem_sec.c\"    ; +0x170, 0x1035574\nMOV             W2, #0x111                                             ; +0x174, 0x1035578\nBL              OPENSSL_die                                            ; +0x178, 0x103557c\nADRP            X0, #aAssertionFaile_53@PAGE; \"assertion failed: sh_testbit(ptr, list,\"... ; +0x17c, 0x1035580\nADRP            X1, #aCryptoMemSecC@PAGE; \"crypto/mem_sec.c\"           ; +0x180, 0x1035584\nADD             X0, X0, #aAssertionFaile_53@PAGEOFF; \"assertion failed: sh_testbit(ptr, list,\"... ; +0x184, 0x1035588\nADD             X1, X1, #aCryptoMemSecC@PAGEOFF; \"crypto/mem_sec.c\"    ; +0x188, 0x103558c\nMOV             W2, #0x242                                             ; +0x18c, 0x1035590\nBL              OPENSSL_die                                            ; +0x190, 0x1035594", "xrefs": ["<???> @ 0x4e838"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "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"}