Function at 0x180016b30
Capabilities:
Resolve function by parsing pe exports

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xa0
mov rax, qword [rcx + 0xb8]
xor ebp, ebp
mov r14, r9
mov r15, r8
mov r12, rdx
mov rdi, rcx
cmp rax, qword [rcx + 0xc0]
jae 0x180016b7e
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180016ba2
cmp dword [rcx + 0x30], ebp
je 0x180016ba0
call fcn.180015150
mov rax, qword [rdi + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180016ba2
mov eax, ebp
movzx r13d, al
mov rax, qword [rdi + 0xb8]
cmp rax, qword [rdi + 0xc0]
jae 0x180016bc7
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180016bee
cmp dword [rdi + 0x30], ebp
je 0x180016bec
mov rcx, rdi
call fcn.180015150
mov rax, qword [rdi + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180016bee
mov eax, ebp
movzx eax, al
mov dword [rsp + 0x28], eax
mov rax, qword [rdi + 0xb8]
cmp rax, qword [rdi + 0xc0]
jae 0x180016c16
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180016c3d
cmp dword [rdi + 0x30], ebp
je 0x180016c3b
mov rcx, rdi
call fcn.180015150
mov rax, qword [rdi + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180016c3d
mov eax, ebp
mov rcx, rdi
movzx ebx, al
call fcn.180010e60
mov rcx, rdi
mov dword [rsp + 0x20], eax
call fcn.180010e60
mov rcx, qword [rdi + 0xb8]
mov dword [rsp + 0x3c], eax
cmp rcx, qword [rdi + 0xc0]
jae 0x180016c79
movzx edx, byte [rcx]
inc rcx
mov qword [rdi + 0xb8], rcx
mov ecx, edx
jmp 0x180016c9e
cmp dword [rdi + 0x30], ebp
je 0x180016c9c
mov rcx, rdi
call fcn.180015150
mov rax, qword [rdi + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
jmp 0x180016c9e
mov ecx, ebp
movzx esi, cl
mov rcx, rdi
call fcn.180010e60
mov rcx, rdi
call fcn.180010e60
mov rcx, rdi
call fcn.180010e60
mov rcx, rdi
mov dword [rsp + 0x48], eax
call fcn.180010e60
mov rcx, qword [rdi + 0xb8]
mov dword [rsp + 0x44], eax
cmp rcx, qword [rdi + 0xc0]
jae 0x180016cea
movzx edx, byte [rcx]
inc rcx
mov qword [rdi + 0xb8], rcx
mov ecx, edx
jmp 0x180016d0f
cmp dword [rdi + 0x30], ebp
je 0x180016d0d
mov rcx, rdi
call fcn.180015150
mov rax, qword [rdi + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
jmp 0x180016d0f
mov ecx, ebp
mov rax, qword [rdi + 0xb8]
movzx edx, cl
mov dword [rsp + 0xd0], edx
cmp rax, qword [rdi + 0xc0]
jae 0x180016d3a
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180016d68
cmp dword [rdi + 0x30], ebp
je 0x180016d66
mov rcx, rdi
call fcn.180015150
mov rax, qword [rdi + 0xb8]
mov edx, dword [rsp + 0xd0]
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180016d68
mov eax, ebp
movzx eax, al
mov ecx, 1
mov qword [rsp + 0x70], rbp
mov dword [rsp + 0x24], ebp
mov dword [rsp + 0x38], ebp
mov qword [rsp + 0x78], rbp
cmp ebx, 8
jb 0x180016d8f
sub ebx, 8
mov qword [rsp + 0x78], rcx
mov r9d, dword [rsp + 0x48]
shr eax, 5
and eax, ecx
sub ecx, eax
mov dword [rsp + 0x68], ecx
cmp r9d, 1
jl 0x180016e44
mov r8d, dword [rsp + 0x44]
cmp r8d, 1
jl 0x180016e44
lea eax, [rbx - 1]
cmp eax, 2
ja 0x180016e44
lea eax, [rdx - 8]
test eax, 0xffffffe7
jne 0x180016e44
cmp dword [rsp + 0x28], ebp
mov ecx, dword [rsp + 0xf0]
cmovne edx, esi
mov dword [r12], r9d
mov dword [r15], r8d
mov r15d, edx
lea eax, [rcx - 1]
cmp eax, 3
ja 0x180016dff
mov r12d, edx
shr r12d, 3
mov dword [rsp + 0x40], r12d
mov dword [r14], r12d
jmp 0x180016e15
mov eax, r15d
shr eax, 3
mov dword [rsp + 0x40], eax
mov ecx, eax
mov dword [rsp + 0xf0], eax
mov dword [r14], eax
mov ebx, r8d
imul ebx, r9d
mov eax, ebx
imul eax, ecx
movsxd rcx, eax
call fcn.18001e1f0
mov qword [rsp + 0x60], rax
mov r14, rax
test rax, rax
jne 0x180016e67
lea rax, str.outofmem
mov qword [0x180045200], rax
xor eax, eax
lea r11, [rsp + 0xa0]
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret
mov edx, r13d
mov rcx, rdi
call fcn.180015430
cmp dword [rsp + 0x28], ebp
je 0x180016eda
mov edx, dword [rsp + 0x20]
mov rcx, rdi
call fcn.180015430
imul esi, dword [rsp + 0x3c]
mov eax, esi
cdq
and edx, 7
add eax, edx
sar eax, 3
movsxd rsi, eax
mov rcx, rsi
call fcn.18001e1f0
mov qword [rsp + 0x70], rax
mov r12, rax
test rax, rax
je 0x180016e36
mov r8d, esi
mov rdx, rax
mov rcx, rdi
call fcn.180011030
test eax, eax
jne 0x180016eda
mov rcx, r14
call fcn.18001e1e8
mov rcx, r12
call fcn.18001e1e8
lea rax, str.bad_palette
jmp 0x180016e3d
xor r10b, r10b
xor r14b, r14b
xor r12b, r12b
mov byte [rsp + 0xd0], r10b
xor r13b, r13b
test ebx, ebx
jle 0x180017253
mov rax, qword [rsp + 0x60]
mov r8d, 1
movzx esi, byte [rsp + 0x21]
mov r9d, ebp
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x58], rax
lea rdx, [rax + 2]
mov eax, ebx
mov ebx, dword [rsp + 0x20]
mov r11, rdx
mov qword [rsp + 0x88], rax
mov qword [rsp + 0x50], rdx
mov qword [rsp + 0x80], rdx
cmp qword [rsp + 0x78], rbp
je 0x180016fb3
test r9d, r9d
jne 0x180016fa4
mov rax, qword [rdi + 0xb8]
cmp rax, qword [rdi + 0xc0]
jae 0x180016f62
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180016f89
cmp dword [rdi + 0x30], ebp
je 0x180016f87
mov rcx, rdi
call fcn.180015150
mov rax, qword [rdi + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180016f89
mov eax, ebp
movzx eax, al
mov r9d, eax
and r9d, 0x7f
inc r9d
shr eax, 7
mov dword [rsp + 0x38], eax
mov dword [rsp + 0x24], r9d
jmp 0x180016fb3
cmp dword [rsp + 0x38], ebp
je 0x180016fb3
test r8d, r8d
je 0x18001717c
cmp dword [rsp + 0x28], ebp
je 0x180017055
mov rax, qword [rdi + 0xb8]
cmp rax, qword [rdi + 0xc0]
jae 0x180016fde
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180017005
cmp dword [rdi + 0x30], ebp
je 0x180017003
mov rcx, rdi
call fcn.180015150
mov rax, qword [rdi + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x180017005
mov eax, ebp
mov r8d, dword [rsp + 0x40]
movzx eax, al
cmp eax, dword [rsp + 0x3c]
cmovge eax, ebp
imul r8d, eax
test r15d, r15d
je 0x1800170ce
mov eax, r8d
lea rcx, [rsp + 0x20]
lea r8, [rsp + 0x20]
mov edx, ebp
sub rax, r8
mov r8, qword [rsp + 0x70]
add r8, rax
nop dword [rax + rax]
movzx eax, byte [r8 + rcx]
add edx, 8
mov byte [rcx], al
lea rcx, [rcx + 1]
cmp edx, r15d
jl 0x180017040
jmp 0x1800170c5
test r15d, r15d
je 0x1800170ce
mov ebx, ebp
lea rsi, [rsp + 0x20]
nop dword [rax]
nop word [rax + rax]
mov rax, qword [rdi + 0xb8]
cmp rax, qword [rdi + 0xc0]
jae 0x180017091
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x1800170b8
cmp dword [rdi + 0x30], ebp
je 0x1800170b6
mov rcx, rdi
call fcn.180015150
mov rax, qword [rdi + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rdi + 0xb8], rax
mov eax, ecx
jmp 0x1800170b8
mov eax, ebp
mov byte [rsi], al
add ebx, 8
inc rsi
cmp ebx, r15d
jl 0x180017070
movzx esi, byte [rsp + 0x21]
mov ebx, dword [rsp + 0x20]
cmp r15d, 8
je 0x180017139
cmp r15d, 0x10
je 0x18001711f
cmp r15d, 0x18
je 0x180017104
cmp r15d, 0x20
jne 0x180017152
movzx r10d, byte [rsp + 0x23]
movzx r12d, sil
movzx r13d, byte [rsp + 0x22]
movzx r14d, bl
mov byte [rsp + 0xd0], r10b
jmp 0x18001715b
movzx r13d, byte [rsp + 0x22]
mov r10b, 0xff
mov byte [rsp + 0xd0], r10b
movzx r12d, sil
movzx r14d, bl
jmp 0x18001715b
movzx r13d, bl
mov byte [rsp + 0xd0], sil
movzx r12d, bl
movzx r14d, bl
movzx r10d, sil
jmp 0x18001715b
mov r10b, 0xff
movzx r13d, bl
mov byte [rsp + 0xd0], r10b
movzx r12d, bl
movzx r14d, bl
jmp 0x18001715b
movzx r10d, byte [rsp + 0xd0]
mov r9d, dword [rsp + 0x24]
mov r11, qword [rsp + 0x80]
mov rdx, qword [rsp + 0x50]
mov dword [rsp + 0x90], ebp
mov r8, qword [rsp + 0x90]
mov ecx, dword [rsp + 0xf0]
sub ecx, 1
je 0x1800171ee
sub ecx, 1
je 0x1800171ba
mov rax, qword [rsp + 0x30]
sub ecx, 1
je 0x1800171ad
cmp ecx, 1
jne 0x180017219
mov byte [r11 - 2], r13b
mov byte [r11 - 1], r12b
mov byte [r11], r14b
mov byte [r11 + 1], r10b
jmp 0x180017219
mov byte [rdx - 2], r13b
mov byte [rdx - 1], r12b
mov byte [rdx], r14b
jmp 0x180017219
movzx eax, r12b
imul edx, eax, 0x96
movzx eax, r13b
imul ecx, eax, 0x4d
movzx eax, r14b
add edx, ecx
imul ecx, eax, 0x1d
mov rax, qword [rsp + 0x58]
add edx, ecx
mov byte [rax + 1], r10b
shr edx, 8
mov byte [rax], dl
mov rdx, rax
mov rax, qword [rsp + 0x30]
jmp 0x180017214
movzx eax, r12b
imul edx, eax, 0x96
movzx eax, r13b
imul ecx, eax, 0x4d
movzx eax, r14b
add edx, ecx
imul ecx, eax, 0x1d
mov rax, qword [rsp + 0x30]
add edx, ecx
shr edx, 8
mov byte [rax], dl
mov rdx, qword [rsp + 0x50]
add qword [rsp + 0x58], 2
dec r9d
add r11, 4
mov dword [rsp + 0x24], r9d
add rdx, 3
mov qword [rsp + 0x80], r11
inc rax
mov qword [rsp + 0x50], rdx
sub qword [rsp + 0x88], 1
mov qword [rsp + 0x30], rax
jne 0x180016f35
mov rsi, qword [rsp + 0x60]
cmp dword [rsp + 0x68], ebp
je 0x1800172d8
mov r14d, dword [rsp + 0x44]
test r14d, r14d
jle 0x1800172d8
mov ebx, dword [rsp + 0x48]
lea r10d, [r14 - 1]
imul ebx, dword [rsp + 0xf0]
mov r11d, ebp
imul r10d, dword [rsp + 0x48]
mov edi, ebx
neg edi
imul r10d, dword [rsp + 0xf0]
nop
mov r8d, ebx
test ebx, ebx
jle 0x1800172ca
movsxd rax, r11d
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + rsi]
nop dword [rax]
nop dword [rax + rax]
movzx eax, byte [r9 + rdx]
dec r8d
movzx ecx, byte [rdx]
mov byte [rdx], al
mov byte [r9 + rdx], cl
lea rdx, [rdx + 1]
test r8d, r8d
jg 0x1800172b0
add r11d, ebx
add r10d, edi
add ebp, 2
cmp ebp, r14d
jl 0x180017290
mov rax, qword [rsp + 0x70]
test rax, rax
je 0x1800172ea
mov rcx, rax
call fcn.18001e1e8
mov rax, rsi
jmp 0x180016e46