; ; sub_18001BEA0 from 0x18001bea0 to 0x18001c389 (1257 bytes) ; ; 3 xrefs: ; > sub_18001CFD0 @ 0x18001f286 ; > @ 0x1801f7320 ; > @ 0x1801f732c ; ; 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+arg_18], r9d ; +0x0, 0x18001bea0 mov [rsp+arg_0], rcx ; +0x5, 0x18001bea5 push rbx ; +0xa, 0x18001beaa push rbp ; +0xb, 0x18001beab push rsi ; +0xc, 0x18001beac push rdi ; +0xd, 0x18001bead push r12 ; +0xe, 0x18001beae push r13 ; +0x10, 0x18001beb0 push r14 ; +0x12, 0x18001beb2 push r15 ; +0x14, 0x18001beb4 sub rsp, 18h ; +0x16, 0x18001beb6 movsxd r10, dword ptr [rdx+98h] ; +0x1a, 0x18001beba mov rdi, r8 ; +0x21, 0x18001bec1 mov ebx, r9d ; +0x24, 0x18001bec4 mov r11, rdx ; +0x27, 0x18001bec7 mov r8, rcx ; +0x2a, 0x18001beca movzx eax, byte ptr [rdi+4B0h] ; +0x2d, 0x18001becd cmp r10d, eax ; +0x34, 0x18001bed4 jge short loc_18001BF01 ; +0x37, 0x18001bed7 lea r14, [rdi+4B2h] ; +0x39, 0x18001bed9 lea rax, [r14+r10*2] ; +0x40, 0x18001bee0 movzx edx, word ptr [r10+rax+1] ; +0x44, 0x18001bee4 cmp [r11+94h], edx ; +0x4a, 0x18001beea jz short loc_18001BF60 ; +0x51, 0x18001bef1 mov eax, [r11+0A4h] ; +0x53, 0x18001bef3 add [r11+9Ch], eax ; +0x5a, 0x18001befa test byte ptr [rdi+4AFh], 10h ; +0x61, 0x18001bf01 jnz short loc_18001BF0F ; +0x68, 0x18001bf08 or byte ptr [r11+3Ch], 1 ; +0x6a, 0x18001bf0a movsx eax, word ptr [r11+9Eh] ; +0x6f, 0x18001bf0f inc dword ptr [r11+94h] ; +0x77, 0x18001bf17 mov [r11+0A0h], eax ; +0x7e, 0x18001bf1e xor eax, eax ; +0x85, 0x18001bf25 add rsp, 18h ; +0x87, 0x18001bf27 pop r15 ; +0x8b, 0x18001bf2b pop r14 ; +0x8d, 0x18001bf2d pop r13 ; +0x8f, 0x18001bf2f pop r12 ; +0x91, 0x18001bf31 pop rdi ; +0x93, 0x18001bf33 pop rsi ; +0x94, 0x18001bf34 pop rbp ; +0x95, 0x18001bf35 pop rbx ; +0x96, 0x18001bf36 retn ; +0x97, 0x18001bf37 mov r10, rax ; +0x98, 0x18001bf38 lea rax, [r14+rax*2] ; +0x9b, 0x18001bf3b mov [r11+98h], r10d ; +0x9f, 0x18001bf3f movzx edx, word ptr [r10+rax+1] ; +0xa6, 0x18001bf46 dec edx ; +0xac, 0x18001bf4c mov [r11+94h], edx ; +0xae, 0x18001bf4e mov r8, [rsp+58h+arg_0] ; +0xb5, 0x18001bf55 mov ebx, [rsp+58h+arg_18] ; +0xba, 0x18001bf5a xchg ax, ax ; +0xbe, 0x18001bf5e movzx edx, word ptr [r8+0BE6h] ; +0xc0, 0x18001bf60 movsxd r12, r10d ; +0xc8, 0x18001bf68 and dx, 8 ; +0xcb, 0x18001bf6b mov [rsp+58h+arg_8], dx ; +0xcf, 0x18001bf6f lea rcx, [r14+r12*2] ; +0xd4, 0x18001bf74 movzx r13d, word ptr [rcx+r12+1] ; +0xd8, 0x18001bf78 lea r15, [r14+r12*2] ; +0xde, 0x18001bf7e movzx r9d, word ptr [r15+r12+4] ; +0xe2, 0x18001bf82 mov [rsp+58h+var_58], r13d ; +0xe8, 0x18001bf88 mov [rsp+58h+arg_10], r9d ; +0xec, 0x18001bf8c jnz loc_18001C0D5 ; +0xf1, 0x18001bf91 movzx esi, byte ptr [rdi+4AFh] ; +0xf7, 0x18001bf97 test sil, 10h ; +0xfe, 0x18001bf9e jnz loc_18001C0D5 ; +0x102, 0x18001bfa2 movsx ebp, byte ptr [rcx+r12] ; +0x108, 0x18001bfa8 mov ecx, ebp ; +0x10d, 0x18001bfad sar ecx, 1 ; +0x10f, 0x18001bfaf test bpl, 1 ; +0x111, 0x18001bfb1 jz short loc_18001C00A ; +0x115, 0x18001bfb5 mov rax, [r11+28h] ; +0x117, 0x18001bfb7 xor edx, edx ; +0x11b, 0x18001bfbb add ecx, ebx ; +0x11d, 0x18001bfbd movsxd r8, ecx ; +0x11f, 0x18001bfbf mov r9d, [rax+8] ; +0x122, 0x18001bfc2 movsxd rax, ebx ; +0x126, 0x18001bfc6 lea rbx, dword_1801AF220 ; +0x129, 0x18001bfc9 imul r13d, [rbx+rax*4], 20ABh ; +0x130, 0x18001bfd0 imul eax, [rbx+r8*4+4], 20ABh ; +0x138, 0x18001bfd8 div r9d ; +0x141, 0x18001bfe1 xor edx, edx ; +0x144, 0x18001bfe4 mov ecx, eax ; +0x146, 0x18001bfe6 imul eax, [rbx+r8*4], 20ABh ; +0x148, 0x18001bfe8 div r9d ; +0x150, 0x18001bff0 add eax, ecx ; +0x153, 0x18001bff3 cdq ; +0x155, 0x18001bff5 sub eax, edx ; +0x156, 0x18001bff6 xor edx, edx ; +0x158, 0x18001bff8 sar eax, 1 ; +0x15a, 0x18001bffa mov ecx, eax ; +0x15c, 0x18001bffc mov eax, r13d ; +0x15e, 0x18001bffe div r9d ; +0x161, 0x18001c001 mov r9, [r11+28h] ; +0x164, 0x18001c004 jmp short loc_18001C03D ; +0x168, 0x18001c008 mov r9, [r11+28h] ; +0x16a, 0x18001c00a lea rdx, dword_1801AF220 ; +0x16e, 0x18001c00e movsxd rax, ebx ; +0x175, 0x18001c015 imul r13d, [rdx+rax*4], 20ABh ; +0x178, 0x18001c018 lea eax, [rbx+rcx] ; +0x180, 0x18001c020 cdqe ; +0x183, 0x18001c023 imul eax, [rdx+rax*4], 20ABh ; +0x185, 0x18001c025 xor edx, edx ; +0x18c, 0x18001c02c div dword ptr [r9+8] ; +0x18e, 0x18001c02e xor edx, edx ; +0x192, 0x18001c032 mov ecx, eax ; +0x194, 0x18001c034 mov eax, r13d ; +0x196, 0x18001c036 div dword ptr [r9+8] ; +0x199, 0x18001c039 mov ebx, eax ; +0x19d, 0x18001c03d xor edx, edx ; +0x19f, 0x18001c03f movsx eax, byte ptr [r15+r12+3] ; +0x1a1, 0x18001c041 sub ebx, ecx ; +0x1a7, 0x18001c047 mov r15d, [rsp+58h+arg_18] ; +0x1a9, 0x18001c049 mov ecx, eax ; +0x1ae, 0x18001c04e sar ecx, 1 ; +0x1b0, 0x18001c050 test al, 1 ; +0x1b2, 0x18001c052 jz short loc_18001C0B0 ; +0x1b4, 0x18001c054 mov r9d, [r9+8] ; +0x1b6, 0x18001c056 add ecx, r15d ; +0x1ba, 0x18001c05a movsxd r8, ecx ; +0x1bd, 0x18001c05d lea rcx, dword_1801AF220 ; +0x1c0, 0x18001c060 imul eax, [rcx+r8*4+4], 20ABh ; +0x1c7, 0x18001c067 div r9d ; +0x1d0, 0x18001c070 xor edx, edx ; +0x1d3, 0x18001c073 mov ecx, eax ; +0x1d5, 0x18001c075 lea rax, dword_1801AF220 ; +0x1d7, 0x18001c077 imul eax, [rax+r8*4], 20ABh ; +0x1de, 0x18001c07e div r9d ; +0x1e6, 0x18001c086 add eax, ecx ; +0x1e9, 0x18001c089 cdq ; +0x1eb, 0x18001c08b sub eax, edx ; +0x1ec, 0x18001c08c xor edx, edx ; +0x1ee, 0x18001c08e sar eax, 1 ; +0x1f0, 0x18001c090 mov ecx, eax ; +0x1f2, 0x18001c092 mov eax, r13d ; +0x1f4, 0x18001c094 div r9d ; +0x1f7, 0x18001c097 movzx edx, [rsp+58h+arg_8] ; +0x1fa, 0x18001c09a mov r8d, eax ; +0x1ff, 0x18001c09f mov r9d, [rsp+58h+arg_10] ; +0x202, 0x18001c0a2 sub r8d, ecx ; +0x207, 0x18001c0a7 mov r13d, [rsp+58h+var_58] ; +0x20a, 0x18001c0aa jmp short loc_18001C0F5 ; +0x20e, 0x18001c0ae lea eax, [r15+rcx] ; +0x210, 0x18001c0b0 cdqe ; +0x214, 0x18001c0b4 lea rcx, dword_1801AF220 ; +0x216, 0x18001c0b6 imul eax, [rcx+rax*4], 20ABh ; +0x21d, 0x18001c0bd div dword ptr [r9+8] ; +0x224, 0x18001c0c4 xor edx, edx ; +0x228, 0x18001c0c8 mov ecx, eax ; +0x22a, 0x18001c0ca mov eax, r13d ; +0x22c, 0x18001c0cc div dword ptr [r9+8] ; +0x22f, 0x18001c0cf jmp short loc_18001C09A ; +0x233, 0x18001c0d3 movsx r8d, byte ptr [r15+r12+3] ; +0x235, 0x18001c0d5 movsx ebp, byte ptr [rcx+r12] ; +0x23b, 0x18001c0db movzx esi, byte ptr [rdi+4AFh] ; +0x240, 0x18001c0e0 mov ebx, ebp ; +0x247, 0x18001c0e7 mov r15d, [rsp+58h+arg_18] ; +0x249, 0x18001c0e9 shl ebx, 5 ; +0x24e, 0x18001c0ee shl r8d, 5 ; +0x251, 0x18001c0f1 shl ebx, 10h ; +0x255, 0x18001c0f5 shl r8d, 10h ; +0x258, 0x18001c0f8 test sil, 2 ; +0x25c, 0x18001c0fc jz loc_18001C1B1 ; +0x260, 0x18001c100 movzx ecx, byte ptr [rdi+506h] ; +0x266, 0x18001c106 cmp r10d, ecx ; +0x26d, 0x18001c10d jl loc_18001C1B1 ; +0x270, 0x18001c110 cmp byte ptr [r11+0BCh], 0 ; +0x276, 0x18001c116 jnz loc_18001C1B1 ; +0x27e, 0x18001c11e movzx eax, byte ptr [rdi+505h] ; +0x284, 0x18001c124 cmp cl, al ; +0x28b, 0x18001c12b jnz loc_18001BF38 ; +0x28d, 0x18001c12d test dx, dx ; +0x293, 0x18001c133 jnz loc_18001C293 ; +0x296, 0x18001c136 test sil, 10h ; +0x29c, 0x18001c13c jnz loc_18001C293 ; +0x2a0, 0x18001c140 test bpl, 1 ; +0x2a6, 0x18001c146 jz loc_18001C251 ; +0x2aa, 0x18001c14a movsxd rcx, r10d ; +0x2b0, 0x18001c150 lea r10, dword_1801AF220 ; +0x2b3, 0x18001c153 lea rax, [r14+rcx*2] ; +0x2ba, 0x18001c15a movsx edx, byte ptr [rcx+rax] ; +0x2be, 0x18001c15e mov rax, [r11+28h] ; +0x2c2, 0x18001c162 sar edx, 1 ; +0x2c6, 0x18001c166 add edx, r15d ; +0x2c8, 0x18001c168 movsxd r8, edx ; +0x2cb, 0x18001c16b xor edx, edx ; +0x2ce, 0x18001c16e mov r9d, [rax+8] ; +0x2d0, 0x18001c170 imul eax, [r10+r8*4+4], 20ABh ; +0x2d4, 0x18001c174 div r9d ; +0x2dd, 0x18001c17d xor edx, edx ; +0x2e0, 0x18001c180 mov ecx, eax ; +0x2e2, 0x18001c182 imul eax, [r10+r8*4], 20ABh ; +0x2e4, 0x18001c184 div r9d ; +0x2ec, 0x18001c18c add eax, ecx ; +0x2ef, 0x18001c18f movsxd rcx, r15d ; +0x2f1, 0x18001c191 cdq ; +0x2f4, 0x18001c194 sub eax, edx ; +0x2f5, 0x18001c195 xor edx, edx ; +0x2f7, 0x18001c197 sar eax, 1 ; +0x2f9, 0x18001c199 mov r8d, eax ; +0x2fb, 0x18001c19b imul eax, [r10+rcx*4], 20ABh ; +0x2fe, 0x18001c19e div r9d ; +0x306, 0x18001c1a6 sub eax, r8d ; +0x309, 0x18001c1a9 jmp loc_18001BF1E ; +0x30c, 0x18001c1ac test sil, 4 ; +0x311, 0x18001c1b1 jz short loc_18001C1F4 ; +0x315, 0x18001c1b5 movzx ecx, byte ptr [rdi+504h] ; +0x317, 0x18001c1b7 cmp r10d, ecx ; +0x31e, 0x18001c1be jl short loc_18001C1F4 ; +0x321, 0x18001c1c1 movzx eax, byte ptr [rdi+503h] ; +0x323, 0x18001c1c3 cmp cl, al ; +0x32a, 0x18001c1ca ja loc_18001BF38 ; +0x32c, 0x18001c1cc test dx, dx ; +0x332, 0x18001c1d2 jnz short loc_18001C1E1 ; +0x335, 0x18001c1d5 test sil, 10h ; +0x337, 0x18001c1d7 jz loc_18001C146 ; +0x33b, 0x18001c1db mov rcx, rax ; +0x341, 0x18001c1e1 lea rax, [r14+rax*2] ; +0x344, 0x18001c1e4 movsx eax, byte ptr [rcx+rax] ; +0x348, 0x18001c1e8 shl eax, 5 ; +0x34c, 0x18001c1ec jmp loc_18001BF1E ; +0x34f, 0x18001c1ef movzx eax, byte ptr [rdi+4B0h] ; +0x354, 0x18001c1f4 dec eax ; +0x35b, 0x18001c1fb cmp r10d, eax ; +0x35d, 0x18001c1fd jz loc_18001C29F ; +0x360, 0x18001c200 sub r9d, r13d ; +0x366, 0x18001c206 jz short loc_18001C217 ; +0x369, 0x18001c209 sub r8d, ebx ; +0x36b, 0x18001c20b mov eax, r8d ; +0x36e, 0x18001c20e cdq ; +0x371, 0x18001c211 idiv r9d ; +0x372, 0x18001c212 jmp short loc_18001C219 ; +0x375, 0x18001c215 xor eax, eax ; +0x377, 0x18001c217 mov [r11+0A4h], eax ; +0x379, 0x18001c219 inc dword ptr [r11+98h] ; +0x380, 0x18001c220 movsxd r10, dword ptr [r11+98h] ; +0x387, 0x18001c227 mov [r11+9Ch], ebx ; +0x38e, 0x18001c22e lea rax, [r14+r10*2] ; +0x395, 0x18001c235 movzx ecx, word ptr [r10+rax+1] ; +0x399, 0x18001c239 cmp [r11+94h], ecx ; +0x39f, 0x18001c23f jnz loc_18001BF01 ; +0x3a6, 0x18001c246 jmp loc_18001BF55 ; +0x3ac, 0x18001c24c mov rax, [r11+28h] ; +0x3b1, 0x18001c251 lea r10, dword_1801AF220 ; +0x3b5, 0x18001c255 xor edx, edx ; +0x3bc, 0x18001c25c movsxd rcx, r15d ; +0x3be, 0x18001c25e mov r9d, [rax+8] ; +0x3c1, 0x18001c261 movsx eax, bpl ; +0x3c5, 0x18001c265 sar eax, 1 ; +0x3c9, 0x18001c269 add eax, r15d ; +0x3cb, 0x18001c26b cdqe ; +0x3ce, 0x18001c26e imul eax, [r10+rax*4], 20ABh ; +0x3d0, 0x18001c270 div r9d ; +0x3d8, 0x18001c278 xor edx, edx ; +0x3db, 0x18001c27b mov r8d, eax ; +0x3dd, 0x18001c27d imul eax, [r10+rcx*4], 20ABh ; +0x3e0, 0x18001c280 div r9d ; +0x3e8, 0x18001c288 sub eax, r8d ; +0x3eb, 0x18001c28b jmp loc_18001BF1E ; +0x3ee, 0x18001c28e movsx eax, bpl ; +0x3f3, 0x18001c293 shl eax, 5 ; +0x3f7, 0x18001c297 jmp loc_18001BF1E ; +0x3fa, 0x18001c29a test dx, dx ; +0x3ff, 0x18001c29f jnz loc_18001C36E ; +0x402, 0x18001c2a2 test sil, 10h ; +0x408, 0x18001c2a8 jnz loc_18001C36E ; +0x40c, 0x18001c2ac xor edx, edx ; +0x412, 0x18001c2b2 lea r10, dword_1801AF220 ; +0x414, 0x18001c2b4 test bpl, 1 ; +0x41b, 0x18001c2bb jz short loc_18001C326 ; +0x41f, 0x18001c2bf lea rax, [r14+r12*2] ; +0x421, 0x18001c2c1 movsx ecx, byte ptr [r12+rax] ; +0x425, 0x18001c2c5 mov rax, [r11+28h] ; +0x42a, 0x18001c2ca sar ecx, 1 ; +0x42e, 0x18001c2ce add ecx, r15d ; +0x430, 0x18001c2d0 movsxd r8, ecx ; +0x433, 0x18001c2d3 mov r9d, [rax+8] ; +0x436, 0x18001c2d6 imul eax, [r10+r8*4+4], 20ABh ; +0x43a, 0x18001c2da div r9d ; +0x443, 0x18001c2e3 xor edx, edx ; +0x446, 0x18001c2e6 mov ecx, eax ; +0x448, 0x18001c2e8 imul eax, [r10+r8*4], 20ABh ; +0x44a, 0x18001c2ea div r9d ; +0x452, 0x18001c2f2 add eax, ecx ; +0x455, 0x18001c2f5 movsxd rcx, r15d ; +0x457, 0x18001c2f7 cdq ; +0x45a, 0x18001c2fa sub eax, edx ; +0x45b, 0x18001c2fb xor edx, edx ; +0x45d, 0x18001c2fd sar eax, 1 ; +0x45f, 0x18001c2ff mov r8d, eax ; +0x461, 0x18001c301 imul eax, [r10+rcx*4], 20ABh ; +0x464, 0x18001c304 div r9d ; +0x46c, 0x18001c30c sub eax, r8d ; +0x46f, 0x18001c30f mov [r11+0A0h], eax ; +0x472, 0x18001c312 mov byte ptr [r11+0A8h], 1 ; +0x479, 0x18001c319 jmp loc_18001BF25 ; +0x481, 0x18001c321 mov rax, [r11+28h] ; +0x486, 0x18001c326 movsxd rcx, r15d ; +0x48a, 0x18001c32a mov r9d, [rax+8] ; +0x48d, 0x18001c32d movsx eax, bpl ; +0x491, 0x18001c331 sar eax, 1 ; +0x495, 0x18001c335 add eax, r15d ; +0x497, 0x18001c337 cdqe ; +0x49a, 0x18001c33a imul eax, [r10+rax*4], 20ABh ; +0x49c, 0x18001c33c div r9d ; +0x4a4, 0x18001c344 xor edx, edx ; +0x4a7, 0x18001c347 mov r8d, eax ; +0x4a9, 0x18001c349 imul eax, [r10+rcx*4], 20ABh ; +0x4ac, 0x18001c34c div r9d ; +0x4b4, 0x18001c354 sub eax, r8d ; +0x4b7, 0x18001c357 mov [r11+0A0h], eax ; +0x4ba, 0x18001c35a mov byte ptr [r11+0A8h], 1 ; +0x4c1, 0x18001c361 jmp loc_18001BF25 ; +0x4c9, 0x18001c369 movsx eax, bpl ; +0x4ce, 0x18001c36e shl eax, 5 ; +0x4d2, 0x18001c372 mov [r11+0A0h], eax ; +0x4d5, 0x18001c375 mov byte ptr [r11+0A8h], 1 ; +0x4dc, 0x18001c37c jmp loc_18001BF25 ; +0x4e4, 0x18001c384