; ; BrowseSmartKeyLayer::onButton from 0x14045be50 to 0x14045c26e (1054 bytes) ; ; 5 xrefs: ; > BrowseSmartKeyLayer::init @ 0x14045ba8a ; > BrowseSmartKeyLayer::init @ 0x14045bb37 ; > BrowseSmartKeyLayer::init @ 0x14045bbe4 ; > BrowseSmartKeyLayer::init @ 0x14045bc91 ; > @ 0x1406dabe0 ; ; This function is hookable on this platform! ; ; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA ; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings ; mov [rsp-40h+arg_0], rcx ; +0x0, 0x14045be50 push rbp ; +0x5, 0x14045be55 push rbx ; +0x6, 0x14045be56 push rsi ; +0x7, 0x14045be57 push rdi ; +0x8, 0x14045be58 push r12 ; +0x9, 0x14045be59 push r13 ; +0xb, 0x14045be5b push r14 ; +0xd, 0x14045be5d push r15 ; +0xf, 0x14045be5f mov rbp, rsp ; +0x11, 0x14045be61 sub rsp, 78h ; +0x14, 0x14045be64 mov rdi, rcx ; +0x18, 0x14045be68 mov rax, [rdx] ; +0x1b, 0x14045be6b mov rcx, rdx ; +0x1e, 0x14045be6e call qword ptr [rax+38h] ; +0x21, 0x14045be71 sub eax, 1 ; +0x24, 0x14045be74 jz loc_14045C134 ; +0x27, 0x14045be77 sub eax, 1 ; +0x2d, 0x14045be7d jz loc_14045BFBB ; +0x30, 0x14045be80 sub eax, 1 ; +0x36, 0x14045be86 jz loc_14045BF29 ; +0x39, 0x14045be89 cmp eax, 1 ; +0x3f, 0x14045be8f jnz loc_14045C25D ; +0x42, 0x14045be92 mov rcx, rdi ; +0x48, 0x14045be98 call BrowseSmartKeyLayer__getAllSelectedBlocks ; +0x4b, 0x14045be9b mov r14, rax ; +0x50, 0x14045bea0 xor esi, esi ; +0x53, 0x14045bea3 mov rcx, rax ; +0x55, 0x14045bea5 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x58, 0x14045bea8 test eax, eax ; +0x5e, 0x14045beae jz short loc_14045BF1C ; +0x60, 0x14045beb0 lea r15, [rdi+2A8h] ; +0x62, 0x14045beb2 nop dword ptr [rax+00000000h] ; +0x69, 0x14045beb9 mov edx, esi ; +0x70, 0x14045bec0 mov rcx, r14 ; +0x72, 0x14045bec2 call cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x75, 0x14045bec5 mov rdi, rax ; +0x7b, 0x14045becb lea rax, [rbp+var_28] ; +0x7e, 0x14045bece mov [rbp+arg_8], rax ; +0x82, 0x14045bed2 mov rdx, r15 ; +0x86, 0x14045bed6 lea rcx, [rbp+var_28] ; +0x89, 0x14045bed9 call sub_14003BDB0 ; +0x8d, 0x14045bedd mov rbx, rax ; +0x92, 0x14045bee2 mov rdx, [rdi] ; +0x95, 0x14045bee5 mov rcx, rdi ; +0x98, 0x14045bee8 call qword ptr [rdx+38h] ; +0x9b, 0x14045beeb mov r8d, eax ; +0x9e, 0x14045beee mov rdx, rbx ; +0xa1, 0x14045bef1 mov rdi, [rbp+arg_0] ; +0xa4, 0x14045bef4 mov rcx, [rdi+278h] ; +0xa8, 0x14045bef8 call GJSmartTemplate__getPrefabWithID ; +0xaf, 0x14045beff test rax, rax ; +0xb4, 0x14045bf04 jz short loc_14045BF0D ; +0xb7, 0x14045bf07 add dword ptr [rax+7Ch], 0Ah ; +0xb9, 0x14045bf09 inc esi ; +0xbd, 0x14045bf0d mov rcx, r14 ; +0xbf, 0x14045bf0f call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xc2, 0x14045bf12 cmp esi, eax ; +0xc8, 0x14045bf18 jb short loc_14045BEC0 ; +0xca, 0x14045bf1a mov rcx, rdi ; +0xcc, 0x14045bf1c call BrowseSmartKeyLayer__updateChanceValues ; +0xcf, 0x14045bf1f jmp loc_14045C25D ; +0xd4, 0x14045bf24 mov rcx, rdi ; +0xd9, 0x14045bf29 call BrowseSmartKeyLayer__getAllSelectedBlocks ; +0xdc, 0x14045bf2c mov r15, rax ; +0xe1, 0x14045bf31 xor esi, esi ; +0xe4, 0x14045bf34 mov r14d, esi ; +0xe6, 0x14045bf36 mov rcx, rax ; +0xe9, 0x14045bf39 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xec, 0x14045bf3c test eax, eax ; +0xf2, 0x14045bf42 jz short loc_14045BFAE ; +0xf4, 0x14045bf44 lea r12, [rdi+2A8h] ; +0xf6, 0x14045bf46 nop dword ptr [rax] ; +0xfd, 0x14045bf4d mov edx, r14d ; +0x100, 0x14045bf50 mov rcx, r15 ; +0x103, 0x14045bf53 call cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x106, 0x14045bf56 mov rdi, rax ; +0x10c, 0x14045bf5c lea rax, [rbp+var_28] ; +0x10f, 0x14045bf5f mov [rbp+arg_8], rax ; +0x113, 0x14045bf63 mov rdx, r12 ; +0x117, 0x14045bf67 lea rcx, [rbp+var_28] ; +0x11a, 0x14045bf6a call sub_14003BDB0 ; +0x11e, 0x14045bf6e mov rbx, rax ; +0x123, 0x14045bf73 mov rdx, [rdi] ; +0x126, 0x14045bf76 mov rcx, rdi ; +0x129, 0x14045bf79 call qword ptr [rdx+38h] ; +0x12c, 0x14045bf7c mov r8d, eax ; +0x12f, 0x14045bf7f mov rdx, rbx ; +0x132, 0x14045bf82 mov rdi, [rbp+arg_0] ; +0x135, 0x14045bf85 mov rcx, [rdi+278h] ; +0x139, 0x14045bf89 call GJSmartTemplate__getPrefabWithID ; +0x140, 0x14045bf90 test rax, rax ; +0x145, 0x14045bf95 jz short loc_14045BF9D ; +0x148, 0x14045bf98 mov [rax+7Ch], esi ; +0x14a, 0x14045bf9a inc r14d ; +0x14d, 0x14045bf9d mov rcx, r15 ; +0x150, 0x14045bfa0 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x153, 0x14045bfa3 cmp r14d, eax ; +0x159, 0x14045bfa9 jb short loc_14045BF50 ; +0x15c, 0x14045bfac mov rcx, rdi ; +0x15e, 0x14045bfae call BrowseSmartKeyLayer__updateChanceValues ; +0x161, 0x14045bfb1 jmp loc_14045C25D ; +0x166, 0x14045bfb6 xor ebx, ebx ; +0x16b, 0x14045bfbb mov esi, ebx ; +0x16d, 0x14045bfbd mov dword ptr [rbp+arg_8], ebx ; +0x16f, 0x14045bfbf mov rcx, [rdi+280h] ; +0x172, 0x14045bfc2 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x179, 0x14045bfc9 test eax, eax ; +0x17f, 0x14045bfcf jz loc_14045C127 ; +0x181, 0x14045bfd1 nop word ptr [rax+rax+00000000h] ; +0x187, 0x14045bfd7 mov edx, esi ; +0x190, 0x14045bfe0 mov rcx, [rdi+280h] ; +0x192, 0x14045bfe2 call cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x199, 0x14045bfe9 mov r12, rax ; +0x19f, 0x14045bfef mov esi, ebx ; +0x1a2, 0x14045bff2 mov rcx, rax ; +0x1a4, 0x14045bff4 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x1a7, 0x14045bff7 test eax, eax ; +0x1ad, 0x14045bffd jz loc_14045C10A ; +0x1af, 0x14045bfff mov edx, esi ; +0x1b5, 0x14045c005 mov rcx, r12 ; +0x1b7, 0x14045c007 call cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x1ba, 0x14045c00a mov r15, rax ; +0x1c0, 0x14045c010 mov rdx, [rax] ; +0x1c3, 0x14045c013 mov rcx, rax ; +0x1c6, 0x14045c016 call qword ptr [rdx+3A8h] ; +0x1c9, 0x14045c019 mov rbx, rax ; +0x1cf, 0x14045c01f cmp byte ptr [rax+170h], 0 ; +0x1d2, 0x14045c022 jz loc_14045C0F5 ; +0x1d9, 0x14045c029 lea rax, [rbp+var_28] ; +0x1df, 0x14045c02f mov [rbp+arg_10], rax ; +0x1e3, 0x14045c033 lea rdx, [rdi+2A8h] ; +0x1e7, 0x14045c037 lea rcx, [rbp+var_28] ; +0x1ee, 0x14045c03e call sub_14003BDB0 ; +0x1f2, 0x14045c042 mov r13, rax ; +0x1f7, 0x14045c047 mov [rbp+arg_18], rax ; +0x1fa, 0x14045c04a mov rdx, [rbx] ; +0x1fe, 0x14045c04e mov rcx, rbx ; +0x201, 0x14045c051 call qword ptr [rdx+38h] ; +0x204, 0x14045c054 mov r14d, eax ; +0x207, 0x14045c057 mov rcx, [rdi+278h] ; +0x20a, 0x14045c05a test eax, eax ; +0x211, 0x14045c061 jle short loc_14045C0D1 ; +0x213, 0x14045c063 mov rdx, r13 ; +0x215, 0x14045c065 mov rcx, [rcx+38h] ; +0x218, 0x14045c068 call cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0x21c, 0x14045c06c mov rdi, rax ; +0x222, 0x14045c072 test rax, rax ; +0x225, 0x14045c075 jz short loc_14045C0CD ; +0x228, 0x14045c078 mov rcx, rax ; +0x22a, 0x14045c07a call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x22d, 0x14045c07d test eax, eax ; +0x233, 0x14045c083 jz short loc_14045C0CD ; +0x235, 0x14045c085 xor ebx, ebx ; +0x237, 0x14045c087 mov rcx, rdi ; +0x239, 0x14045c089 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x23c, 0x14045c08c test eax, eax ; +0x242, 0x14045c092 jz short loc_14045C0CD ; +0x244, 0x14045c094 nop word ptr [rax+rax+00000000h] ; +0x246, 0x14045c096 mov edx, ebx ; +0x250, 0x14045c0a0 mov rcx, rdi ; +0x252, 0x14045c0a2 call cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x255, 0x14045c0a5 mov rcx, rdi ; +0x25b, 0x14045c0ab cmp [rax+78h], r14d ; +0x25e, 0x14045c0ae jz short loc_14045C0C2 ; +0x262, 0x14045c0b2 inc ebx ; +0x264, 0x14045c0b4 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x266, 0x14045c0b6 cmp ebx, eax ; +0x26c, 0x14045c0bc jb short loc_14045C0A0 ; +0x26e, 0x14045c0be jmp short loc_14045C0CD ; +0x270, 0x14045c0c0 mov r8b, 1 ; +0x272, 0x14045c0c2 mov edx, ebx ; +0x275, 0x14045c0c5 call cs:?removeObjectAtIndex@CCArray@cocos2d@@QEAAXI_N@Z; cocos2d::CCArray::removeObjectAtIndex(uint,bool) ; +0x277, 0x14045c0c7 mov rdi, [rbp+arg_0] ; +0x27d, 0x14045c0cd mov rcx, r13 ; +0x281, 0x14045c0d1 call sub_14003A830 ; +0x284, 0x14045c0d4 mov rax, [r15] ; +0x289, 0x14045c0d9 mov rcx, r15 ; +0x28c, 0x14045c0dc call qword ptr [rax+200h] ; +0x28f, 0x14045c0df mov r8b, 1 ; +0x295, 0x14045c0e5 mov edx, esi ; +0x298, 0x14045c0e8 mov rcx, r12 ; +0x29a, 0x14045c0ea call cs:?removeObjectAtIndex@CCArray@cocos2d@@QEAAXI_N@Z; cocos2d::CCArray::removeObjectAtIndex(uint,bool) ; +0x29d, 0x14045c0ed jmp short loc_14045C0F7 ; +0x2a3, 0x14045c0f3 inc esi ; +0x2a5, 0x14045c0f5 mov rcx, r12 ; +0x2a7, 0x14045c0f7 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x2aa, 0x14045c0fa cmp esi, eax ; +0x2b0, 0x14045c100 jb loc_14045C005 ; +0x2b2, 0x14045c102 xor ebx, ebx ; +0x2b8, 0x14045c108 mov esi, dword ptr [rbp+arg_8] ; +0x2ba, 0x14045c10a inc esi ; +0x2bd, 0x14045c10d mov dword ptr [rbp+arg_8], esi ; +0x2bf, 0x14045c10f mov rcx, [rdi+280h] ; +0x2c2, 0x14045c112 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x2c9, 0x14045c119 cmp esi, eax ; +0x2cf, 0x14045c11f jb loc_14045BFE0 ; +0x2d1, 0x14045c121 mov rcx, rdi ; +0x2d7, 0x14045c127 call BrowseSmartKeyLayer__updateChanceValues ; +0x2da, 0x14045c12a jmp loc_14045C25D ; +0x2df, 0x14045c12f mov rcx, rdi ; +0x2e4, 0x14045c134 call BrowseSmartKeyLayer__getAllSelectedBlocks ; +0x2e7, 0x14045c137 mov r15, rax ; +0x2ec, 0x14045c13c mov rcx, rax ; +0x2ef, 0x14045c13f call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x2f2, 0x14045c142 test eax, eax ; +0x2f8, 0x14045c148 jz loc_14045C25D ; +0x2fa, 0x14045c14a xor esi, esi ; +0x300, 0x14045c150 mov r14d, esi ; +0x302, 0x14045c152 mov rcx, r15 ; +0x305, 0x14045c155 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x308, 0x14045c158 test eax, eax ; +0x30e, 0x14045c15e jz short loc_14045C1C2 ; +0x310, 0x14045c160 lea r12, [rdi+2A8h] ; +0x312, 0x14045c162 nop dword ptr [rax+00000000h] ; +0x319, 0x14045c169 mov edx, r14d ; +0x320, 0x14045c170 mov rcx, r15 ; +0x323, 0x14045c173 call cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x326, 0x14045c176 mov rdi, rax ; +0x32c, 0x14045c17c lea rax, [rbp+var_28] ; +0x32f, 0x14045c17f mov [rbp+arg_8], rax ; +0x333, 0x14045c183 mov rdx, r12 ; +0x337, 0x14045c187 lea rcx, [rbp+var_28] ; +0x33a, 0x14045c18a call sub_14003BDB0 ; +0x33e, 0x14045c18e mov rbx, rax ; +0x343, 0x14045c193 mov rdx, [rdi] ; +0x346, 0x14045c196 mov rcx, rdi ; +0x349, 0x14045c199 call qword ptr [rdx+38h] ; +0x34c, 0x14045c19c mov r8d, eax ; +0x34f, 0x14045c19f mov rdx, rbx ; +0x352, 0x14045c1a2 mov rdi, [rbp+arg_0] ; +0x355, 0x14045c1a5 mov rcx, rdi ; +0x359, 0x14045c1a9 call BrowseSmartTemplateLayer__createPrefab ; +0x35c, 0x14045c1ac inc r14d ; +0x361, 0x14045c1b1 mov rcx, r15 ; +0x364, 0x14045c1b4 call cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x367, 0x14045c1b7 cmp r14d, eax ; +0x36d, 0x14045c1bd jb short loc_14045C170 ; +0x370, 0x14045c1c0 lea rax, [rbp+var_28] ; +0x372, 0x14045c1c2 mov [rbp+arg_8], rax ; +0x376, 0x14045c1c6 xorps xmm0, xmm0 ; +0x37a, 0x14045c1ca movups [rbp+var_28], xmm0 ; +0x37d, 0x14045c1cd mov [rbp+var_18], rsi ; +0x381, 0x14045c1d1 mov [rbp+var_10], 0Fh ; +0x385, 0x14045c1d5 mov byte ptr [rbp+var_28], 0 ; +0x38d, 0x14045c1dd mov [rbp+var_38], 0Fh ; +0x391, 0x14045c1e1 mov [rbp+var_30], 0Fh ; +0x399, 0x14045c1e9 movsd xmm0, cs:qword_1405F4EC0 ; +0x3a1, 0x14045c1f1 movsd qword ptr [rbp+var_48], xmm0 ; +0x3a9, 0x14045c1f9 mov eax, cs:dword_1405F4EC8 ; +0x3ae, 0x14045c1fe mov dword ptr [rbp+var_48+8], eax ; +0x3b4, 0x14045c204 movzx eax, cs:word_1405F4ECC ; +0x3b7, 0x14045c207 mov word ptr [rbp+var_48+0Ch], ax ; +0x3be, 0x14045c20e movzx eax, cs:byte_1405F4ECE ; +0x3c2, 0x14045c212 mov [rbp+var_48+0Eh], al ; +0x3c9, 0x14045c219 mov [rbp+var_48+0Fh], 0 ; +0x3cc, 0x14045c21c mov rbx, [rdi] ; +0x3d0, 0x14045c220 lea rax, [rbp+var_28] ; +0x3d3, 0x14045c223 mov [rsp+78h+var_58], rax ; +0x3d7, 0x14045c227 mov r9d, 96h ; +0x3dc, 0x14045c22c movss xmm2, cs:dword_140622B38 ; +0x3e2, 0x14045c232 movss xmm1, cs:dword_140622B08 ; +0x3ea, 0x14045c23a lea rcx, [rbp+var_48] ; +0x3f2, 0x14045c242 call TextAlertPopup__create ; +0x3f6, 0x14045c246 mov rdx, rax ; +0x3fb, 0x14045c24b mov r8d, 64h ; 'd' ; +0x3fe, 0x14045c24e mov rcx, rdi ; +0x404, 0x14045c254 call qword ptr [rbx+1B8h] ; +0x407, 0x14045c257 add rsp, 78h ; +0x40d, 0x14045c25d pop r15 ; +0x411, 0x14045c261 pop r14 ; +0x413, 0x14045c263 pop r13 ; +0x415, 0x14045c265 pop r12 ; +0x417, 0x14045c267 pop rdi ; +0x419, 0x14045c269 pop rsi ; +0x41a, 0x14045c26a pop rbx ; +0x41b, 0x14045c26b pop rbp ; +0x41c, 0x14045c26c retn ; +0x41d, 0x14045c26d