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

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x98
mov rdi, qword [rsp + 0x118]
mov esi, dword [rsp + 0x110]
mov dword [rdx], 1
lea rax, [rsp + 0x60]
lea r15, [rsp + 0x64]
mov rbx, rdx
mov qword [rsp + 0x20], rdi
mov rdx, r15
mov qword [rsp + 0xe0], rcx
mov rcx, rax
mov dword [rsp + 0xf0], r8d
lea r8, [rsp + 0x68]
mov dword [rsp + 0xf8], r9d
lea r9, [rsp + 0x6c]
mov qword [rsp + 0x48], rax
mov dword [rsp + 0x68], 0
mov dword [rsp + 0x60], 1
mov qword [rsp + 0x58], r9
mov qword [rsp + 0x50], r8
call fcn.00504aa0
mov edx, dword [rsp + 0x64]
mov edi, dword [rsp + 0x6c]
mov dword [rsp + 0x44], 1
mov eax, edx
shr eax, 0x18
and edi, 0x10000000
mov dword [rbx + 4], eax
mov dword [rsp + 0x3c], edi
je 0x504fc7
shr edx, 0x10
movzx edx, dl
mov edi, edx
sub edi, 1
mov dword [rsp + 0x3c], edi
je 0x504fc7
test edi, 0xffff0000
jne 0x505550
test dil, 0xf0
jne 0x505b97
and edi, 0xc
mov ecx, 1
mov edx, edi
test edx, edx
jne 0x50555d
test byte [rsp + 0x3c], 2
je 0x504fad
add ecx, 1
mov edx, 1
shl edx, cl
mov edi, edx
mov dword [rsp + 0x44], edx
lea edx, [rdx - 1]
and edx, eax
mov dword [rsp + 0x3c], edx
xor edx, edx
div edi
mov dword [rbx + 8], eax
mov eax, dword [rsp + 0x60]
mov edx, eax
mov ecx, eax
mov ebp, esi
mov r10d, eax
shr edx, 8
shr ecx, 4
and edx, 0xf
and ecx, 0xf
cmp edx, 0xf
sete r11b
and ebp, 0xfffffffd
and r10d, 0xf
cmp esi, 1
setbe r9b
cmp esi, 3
sete r8b
or r9b, r8b
je 0x50500d
test r11b, r11b
jne 0x505520
mov dword [rbx + 0x88], edx
test esi, esi
je 0x505078
cmp ebp, 1
jne 0x505021
cmp edx, 0xf
je 0x505030
cmp esi, 2
jne 0x505082
sub edx, 6
cmp edx, 1
ja 0x505082
nop
shr eax, 0xc
mov dword [rbx + 0x80], r10d
and eax, 0xf0
add ecx, eax
mov dword [rbx + 0x84], ecx
test esi, esi
jne 0x50508f
cmp dword [rbx + 0x88], 6
jne 0x50508f
cmp ecx, 0x57
je 0x505061
cmp ecx, 0x85
jne 0x50508f
mov rax, qword [rsp + 0xe0]
mov dword [rax + 0x20], 1
jmp 0x50508f
cmp edx, 6
je 0x505030
test r11b, r11b
jne 0x505030
mov dword [rbx + 0x84], ecx
mov dword [rbx + 0x80], r10d
mov rax, qword [rsp + 0x118]
lea rdi, [rsp + 0x80]
lea r14, [rsp + 0x88]
mov qword [rsp + 0x80], 0
lea r13, [rsp + 0x8c]
lea r12, [rsp + 0x84]
mov r9, r14
mov rcx, rdi
mov qword [rsp + 0x20], rax
mov r8, r13
mov rdx, r12
mov qword [rsp + 0x88], 0
call fcn.00504aa0
mov r8, qword [rsp + 0x84]
cmp dword [rsp + 0x100], 0x80000003
mov qword [rbx + 0x40], r8
mov r8d, dword [rsp + 0x8c]
mov dword [rbx + 0x48], r8d
ja 0x505458
cmp ebp, 1
setne r14b
cmp dword [rsp + 0xf8], 3
seta al
and r14b, al
mov byte [rsp + 0x43], r14b
jne 0x505630
test ebp, ebp
je 0x5053c0
cmp dword [rsp + 0x100], 0x80000007
jbe 0x505155
mov rax, qword [rsp + 0x108]
test byte [rax + 0x12], 0x20
je 0x5055a1
mov rax, qword [rsp + 0x108]
test byte [rax + 0x1a], 0x40
jne 0x505690
cmp dword [rsp + 0xf8], 0xa
jbe 0x505188
cmp esi, 2
ja 0x505188
mov rax, qword [rsp + 0x108]
test byte [rax + 0x12], 0x20
jne 0x505570
mov dword [rbx + 0x34], 0
mov qword [rbx + 0x38], 0
mov rax, qword [rsp + 0x108]
test byte [rax + 0x1a], 0x40
jne 0x505708
cmp dword [rsp + 0x100], 0x80000005
ja 0x505a38
cmp byte [rsp + 0x43], 0
je 0x505405
lea r13, [rsp + 0x7c]
lea r12, [rsp + 0x78]
lea r15, [rsp + 0x74]
lea rdi, [rsp + 0x70]
mov rax, r13
mov dword [rsp + 0x110], esi
mov r13, r12
mov ebp, dword [rbx + 0x34]
mov r12, rdi
mov rsi, qword [rsp + 0x118]
xor r14d, r14d
mov rdi, rax
jmp 0x50522d
shr eax, 5
mov edx, dword [rbx + 0x34]
and eax, 7
cmp eax, 3
jne 0x505223
mov rax, qword [rsp + 0xe0]
mov r8d, dword [rax + 0x20]
test r8d, r8d
jne 0x505b38
add edx, 1
add r14d, 1
mov dword [rbx + 0x34], edx
mov qword [rsp + 0x20], rsi
mov r9, rdi
mov r8, r13
mov rdx, r15
mov rcx, r12
mov dword [rsp + 0x70], 4
mov dword [rsp + 0x78], r14d
call fcn.00504aa0
mov eax, dword [rsp + 0x70]
test al, 0x1f
jne 0x505200
mov rax, rdi
mov esi, dword [rsp + 0x110]
mov edx, dword [rbx + 0x34]
mov rdi, r12
mov r12, r13
mov r13, rax
lea rdx, [rdx + rdx*4]
mov rcx, qword [rbx + 0x38]
shl rdx, 3
call sub.msvcrt.dll_realloc
test rax, rax
je 0x505b8f
lea rdx, [rbp + rbp*4]
xor ebp, ebp
mov qword [rbx + 0x38], rax
mov qword [rsp + 0xe8], rbx
lea r14, [rax + rdx*8]
mov ebx, ebp
mov rbp, rdi
mov dword [rsp + 0x110], esi
mov rdi, qword [rsp + 0x118]
mov rsi, r13
mov r13, qword [rsp + 0xe0]
jmp 0x505358
cmp edx, 2
sete dl
movzx edx, dl
add edx, edx
mov dword [r14], edx
mov dword [r14 + 4], eax
mov eax, r8d
shr eax, 0xe
and eax, 0xfff
add eax, 1
mov dword [r14 + 8], eax
mov edx, dword [rsp + 0x74]
mov ecx, edx
mov eax, edx
shr edx, 0x16
shr ecx, 0xc
and eax, 0xfff
add edx, 1
and ecx, 0x3ff
add eax, 1
add ecx, 1
and r8d, 0x200
mov r8d, 0xffffffff
mov dword [r14 + 0x10], eax
cmove r8d, edx
mov dword [r14 + 0x14], ecx
imul eax, edx
add r14, 0x28
add ebx, 1
mov dword [r14 - 0xc], r8d
mov r11d, dword [rsp + 0x78]
lea r8d, [r11 + 1]
imul eax, r8d
mov dword [r14 - 8], r8d
imul eax, ecx
mov dword [r14 - 4], eax
mov eax, dword [rsp + 0x7c]
and eax, 2
mov dword [r14 - 0x10], eax
mov qword [rsp + 0x20], rdi
mov r8, r12
mov rdx, r15
mov r9, rsi
mov rcx, rbp
mov dword [rsp + 0x70], 4
mov dword [rsp + 0x78], ebx
call fcn.00504aa0
mov r8d, dword [rsp + 0x70]
mov edx, r8d
and edx, 0x1f
je 0x505a20
mov eax, r8d
mov ecx, dword [r13 + 0x20]
shr eax, 5
and eax, 7
test ecx, ecx
je 0x5053a5
cmp eax, 3
je 0x505a20
cmp edx, 1
jne 0x5052c8
mov dword [r14], 1
jmp 0x5052d6
test esi, esi
jne 0x505600
cmp dword [rsp + 0xf8], 0x1e
jbe 0x505600
mov r8, qword [rsp + 0x118]
mov edx, 0x1f
mov rcx, rbx
call fcn.00504bd0
cmp byte [rsp + 0x43], 0
mov dword [rbx + 0x34], 0
mov qword [rbx + 0x38], 0
jne 0x5051c5
mov r12d, dword [rbx + 4]
nop dword [rax]
mov rax, qword [rsp + 0xe0]
mov edx, r12d
mov r13, qword [rax + 8]
mov rcx, r13
call fcn.004f3200
test eax, eax
je 0x505a08
mov rax, qword [rsp + 0xe0]
mov dword [rax + 0x10], 0
add rsp, 0x98
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r9, r13
mov r8, r14
mov rdx, r12
mov rcx, rdi
mov rax, qword [rsp + 0x118]
mov qword [rsp + 0x80], 0
mov qword [rsp + 0x88], 0
mov qword [rsp + 0x20], rax
mov dword [rsp + 0x80], 0x80000002
call fcn.00504aa0
mov r9, r13
mov r8, r14
mov rdx, r12
movdqa xmm0, xmmword [rsp + 0x80]
mov rax, qword [rsp + 0x118]
mov rcx, rdi
mov dword [rsp + 0x80], 0x80000003
movups xmmword [rbx + 0x4d], xmm0
mov qword [rsp + 0x20], rax
call fcn.00504aa0
mov r9, r13
mov r8, r14
mov rdx, r12
movdqa xmm1, xmmword [rsp + 0x80]
mov rax, qword [rsp + 0x118]
mov rcx, rdi
mov dword [rsp + 0x80], 0x80000004
movups xmmword [rbx + 0x5d], xmm1
mov qword [rsp + 0x20], rax
call fcn.00504aa0
movdqa xmm2, xmmword [rsp + 0x80]
movups xmmword [rbx + 0x6d], xmm2
jmp 0x50510e
mov edx, eax
shr edx, 0x14
movzx edx, dl
add edx, 0xf
mov dword [rbx + 0x88], edx
test esi, esi
je 0x505030
cmp ebp, 1
je 0x505030
jmp 0x505082
mov dword [rsp + 0x3c], 0xf
mov ecx, 0x1d
shr dword [rsp + 0x3c], 2
add ecx, 2
jmp 0x504fa3
mov r8, qword [rsp + 0x118]
mov edx, 0xb
mov rcx, rbx
call fcn.00504bd0
mov dword [rbx + 0x34], 0
mov qword [rbx + 0x38], 0
test ebp, ebp
jne 0x505197
jmp 0x5051ba
mov rax, qword [rsp + 0x118]
lea r15, [rsp + 0x74]
lea rdi, [rsp + 0x70]
mov dword [rsp + 0x70], 0x80000008
mov rcx, rdi
lea r9, [rsp + 0x7c]
lea r8, [rsp + 0x78]
mov rdx, r15
mov qword [rsp + 0x20], rax
call fcn.00504aa0
mov eax, dword [rsp + 0x78]
mov ecx, eax
shr ecx, 0xc
and ecx, 0xf
jne 0x505b50
movzx eax, al
lea ecx, [rax + 1]
mov eax, dword [rbx + 4]
xor edx, edx
div ecx
mov dword [rbx + 8], eax
mov dword [rbx + 0xc], edx
jmp 0x505155
cmp dword [rsp + 0xf8], 0xa
jbe 0x50561c
mov rax, qword [rsp + 0x108]
test byte [rax + 0x12], 0x20
jne 0x505570
mov dword [rbx + 0x34], 0
mov qword [rbx + 0x38], 0
jmp 0x5051ba
mov rax, qword [rsp + 0x118]
mov r9, qword [rsp + 0x58]
mov rdx, r15
mov dword [rsp + 0x60], 4
mov r8, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x48]
mov dword [rsp + 0x68], 0
mov qword [rsp + 0x20], rax
call fcn.00504aa0
mov eax, dword [rsp + 0x60]
test al, 0x1f
je 0x50512e
shr eax, 0x1a
xor edx, edx
lea ecx, [rax + 1]
mov eax, dword [rsp + 0x44]
div ecx
xor edx, edx
mov ecx, eax
mov eax, dword [rsp + 0x3c]
div ecx
mov dword [rbx + 0xc], eax
jmp 0x50512e
mov rax, qword [rsp + 0x118]
lea r15, [rsp + 0x74]
lea rdi, [rsp + 0x70]
mov dword [rsp + 0x70], 0x8000001e
mov rdx, r15
lea r9, [rsp + 0x7c]
lea r8, [rsp + 0x78]
mov rcx, rdi
mov qword [rsp + 0x20], rax
call fcn.00504aa0
mov eax, dword [rsp + 0x70]
movzx edx, byte [rsp + 0x74]
mov dword [rbx + 4], eax
mov eax, dword [rbx + 0x88]
test byte [rsp + 0xf0], 2
je 0x5056f1
cmp eax, 0x16
je 0x505b29
movzx ecx, byte [rsp + 0x78]
mov dword [rbx + 0x10], ecx
cmp eax, 0x16
jbe 0x505b30
mov dword [rbx + 0xc], edx
jmp 0x505167
mov dword [rsp + 0x110], esi
xor r14d, r14d
lea r13, [rsp + 0x7c]
mov rsi, qword [rsp + 0x118]
lea r12, [rsp + 0x78]
lea r15, [rsp + 0x74]
lea rdi, [rsp + 0x70]
jmp 0x505738
add dword [rbx + 0x34], 1
add r14d, 1
mov qword [rsp + 0x20], rsi
mov r9, r13
mov r8, r12
mov rdx, r15
mov rcx, rdi
mov dword [rsp + 0x70], 0x8000001d
mov dword [rsp + 0x78], r14d
call fcn.00504aa0
mov ebp, dword [rsp + 0x70]
and ebp, 0x1f
jne 0x505730
mov eax, dword [rbx + 0x34]
mov esi, dword [rsp + 0x110]
lea rcx, [rax + rax*4]
shl rcx, 3
call sub.msvcrt.dll_malloc
mov qword [rbx + 0x38], rax
mov r14, rax
test rax, rax
je 0x505b83
mov qword [rsp + 0xe8], rbx
mov ebx, ebp
mov rbp, qword [rsp + 0x118]
jmp 0x505841
cmp eax, 2
sete al
movzx eax, al
add eax, eax
mov dword [r14], eax
mov eax, r8d
mov edx, dword [rsp + 0x74]
mov r11d, dword [rsp + 0x78]
shr eax, 5
and eax, 7
mov ecx, edx
mov dword [r14 + 4], eax
mov eax, r8d
shr ecx, 0xc
shr eax, 0xe
and ecx, 0x3ff
and eax, 0xfff
add ecx, 1
add eax, 1
mov dword [r14 + 0x14], ecx
mov dword [r14 + 8], eax
mov eax, edx
shr edx, 0x16
and eax, 0xfff
add edx, 1
add eax, 1
and r8d, 0x200
mov r8d, 0xffffffff
cmove r8d, edx
mov dword [r14 + 0x10], eax
imul eax, edx
add r14, 0x28
add ebx, 1
mov dword [r14 - 0xc], r8d
lea r8d, [r11 + 1]
imul eax, r8d
mov dword [r14 - 8], r8d
imul eax, ecx
mov dword [r14 - 4], eax
mov eax, dword [rsp + 0x7c]
and eax, 2
mov dword [r14 - 0x10], eax
mov qword [rsp + 0x20], rbp
mov r8, r12
mov r9, r13
mov rdx, r15
mov rcx, rdi
mov dword [rsp + 0x70], 0x8000001d
mov dword [rsp + 0x78], ebx
call fcn.00504aa0
mov r8d, dword [rsp + 0x70]
mov eax, r8d
and eax, 0x1f
je 0x505890
cmp eax, 1
jne 0x5057a8
mov dword [r14], 1
jmp 0x5057b6
mov rbx, qword [rsp + 0xe8]
cmp byte [rsp + 0x43], 0
jne 0x5051d9
mov edx, dword [rbx + 0x34]
mov r12d, dword [rbx + 4]
test edx, edx
je 0x505410
mov rax, qword [rbx + 0x38]
sub edx, 1
mov r10d, r12d
mov r11d, 0xaaaaaaab
lea rdx, [rdx + rdx*4]
shr r10d, 3
mov edi, 6
lea rcx, [rax + 4]
lea r9, [rax + rdx*8 + 0x2c]
jmp 0x5058f6
cmp esi, 3
je 0x505988
add rcx, 0x28
cmp r9, rcx
je 0x505410
mov r8d, dword [rcx + 4]
mov eax, r12d
xor edx, edx
div r8d
mov dword [rcx + 8], eax
cmp esi, 1
jne 0x5058e0
mov eax, dword [rbx + 0x88]
cmp eax, 0x17
je 0x505995
cmp eax, 0x10
jne 0x5059b8
cmp dword [rbx + 0x84], 9
jne 0x5058e9
cmp dword [rcx], 3
jne 0x5058e9
mov eax, dword [rcx + 0x18]
cmp eax, 0xffffffff
je 0x50593c
test al, 1
jne 0x5058e9
cmp r8d, 7
jbe 0x5058e9
mov edx, r8d
shr edx, 1
cmp r8d, 0x10
cmove edx, edi
shr dword [rcx + 0x20], 1
mov dword [rcx + 4], edx
mov r8d, edx
cmp eax, 0xffffffff
je 0x505968
mov edx, eax
shr edx, 0x1f
add eax, edx
sar eax, 1
mov dword [rcx + 0x18], eax
mov eax, r12d
xor edx, edx
div dword [rsp + 0x44]
mov ebp, eax
mov eax, edx
xor edx, edx
div r8d
lea eax, [rax + rbp*2]
mov dword [rcx + 8], eax
jmp 0x5058e9
cmp dword [rbx + 0x88], 0x18
jne 0x5058e9
cmp dword [rcx], 3
jne 0x5058e9
cmp r8d, 6
jne 0x5058e9
mov dword [rcx + 8], r10d
jmp 0x5058e9
cmp eax, 0x15
jne 0x5058e9
mov eax, dword [rbx + 0x84]
sub eax, 1
cmp eax, 1
ja 0x5058e9
cmp dword [rcx], 3
jne 0x5058e9
cmp r8d, 6
jne 0x5058e9
mov eax, r12d
xor edx, edx
div dword [rsp + 0x44]
imul rdx, r11
shr rdx, 0x22
lea eax, [rdx + rax*2]
mov dword [rcx + 8], eax
jmp 0x5058e9
mov edx, r12d
mov rcx, r13
call fcn.004f2d60
jmp 0x50543e
mov rbx, qword [rsp + 0xe8]
mov esi, dword [rsp + 0x110]
jmp 0x5058a3
mov rax, qword [rsp + 0x118]
lea r13, [rsp + 0x7c]
lea r12, [rsp + 0x78]
mov dword [rsp + 0x70], 0x80000005
lea r15, [rsp + 0x74]
lea rdi, [rsp + 0x70]
mov r9, r13
mov r8, r12
mov qword [rsp + 0x20], rax
mov rdx, r15
mov rcx, rdi
lea r14, [rbx + 0x34]
lea rbp, [rbx + 0x38]
call fcn.00504aa0
mov eax, dword [rsp + 0x78]
mov rdx, rbp
mov rcx, r14
mov dword [rsp + 0x20], 1
mov r9d, 1
mov r8d, 1
mov dword [rsp + 0x28], eax
call fcn.00504db0
mov eax, dword [rsp + 0x7c]
mov rdx, rbp
mov rcx, r14
mov dword [rsp + 0x20], 1
mov r9d, 2
mov r8d, 1
mov dword [rsp + 0x28], eax
call fcn.00504db0
mov r9, r13
mov r8, r12
mov rdx, r15
mov rax, qword [rsp + 0x118]
mov rcx, rdi
mov dword [rsp + 0x70], 0x80000006
mov qword [rsp + 0x20], rax
call fcn.00504aa0
mov eax, dword [rsp + 0x78]
test ah, 0xf0
jne 0x505b5e
mov eax, dword [rsp + 0x7c]
test ah, 0xf0
je 0x505898
mov dword [rsp + 0x28], eax
mov eax, dword [rsp + 0x44]
xor r9d, r9d
mov rdx, rbp
mov r8d, 3
mov rcx, r14
mov dword [rsp + 0x20], eax
call fcn.00504db0
jmp 0x505898
mov dword [rbx + 0x10], 0
mov dword [rbx + 0x14], edx
jmp 0x505167
mov rax, rdi
mov esi, dword [rsp + 0x110]
mov rdi, r12
mov r12, r13
mov r13, rax
jmp 0x50526e
mov eax, 1
shl eax, cl
mov ecx, eax
jmp 0x5055ed
mov dword [rsp + 0x28], eax
xor r9d, r9d
mov r8d, 2
mov rdx, rbp
mov dword [rsp + 0x20], 1
mov rcx, r14
call fcn.00504db0
jmp 0x505af7
mov dword [rbx + 0x34], 0
jmp 0x505898
mov dword [rbx + 0x34], ebp
jmp 0x5058a3
shr dword [rsp + 0x3c], 4
mov edi, dword [rsp + 0x3c]
mov ecx, 5
and edi, 0xc
mov edx, edi
jmp 0x504f9b