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

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0xf4
mov eax, dword [edx + 8]
mov esi, dword [edx + 4]
mov dword [esp + 0xc], edx
mov dword [esp + 0x10], ecx
lea edx, [esi + eax]
test eax, eax
mov dword [esp + 8], eax
mov dword [esp + 0x1c], esi
mov dword [esp], edx
je 0x487d56
movzx ebx, byte [esi]
test bl, bl
js 0x487d73
lea ebp, [esi + 1]
jmp 0x487dcd
xor edi, edi
mov esi, 4
mov edx, 8
xor ebp, ebp
mov dword [esp + 4], 0
xor ebx, ebx
jmp 0x487e0f
movzx edx, byte [esi + 1]
mov eax, ebx
and eax, 0x1f
and edx, 0x3f
cmp bl, 0xdf
jbe 0x487dc0
movzx ecx, byte [esi + 2]
shl edx, 6
and ecx, 0x3f
or ecx, edx
cmp bl, 0xf0
jb 0x488583
movzx ebx, byte [esi + 3]
and eax, 7
shl ecx, 6
lea ebp, [esi + 4]
shl eax, 0x12
and ebx, 0x3f
or ebx, ecx
or ebx, eax
mov edx, dword [esp]
cmp ebx, 0xffff
jbe 0x487dcd
jmp 0x48859c
shl eax, 6
lea ebp, [esi + 2]
or eax, edx
mov edx, dword [esp]
mov ebx, eax
mov eax, 1
xor edi, edi
mov ecx, edx
mov edx, 0xffffffff
mov esi, 4
sub ecx, ebp
add ecx, 3
cmovae edx, ecx
shr edx, 2
lea ecx, [edx + eax]
lea eax, [edx + eax + 1]
cmp ecx, 3
cmovae esi, eax
cmp esi, 0x40000000
jae 0x488407
lea edx, [esi + esi]
mov ax, 1
mov dword [esp + 4], eax
movzx eax, byte [0x6019e5]
xor ecx, ecx
call fcn.00499510
test eax, eax
je 0x488407
mov word [eax], bx
mov dword [esp + 0x58], esi
mov esi, 1
mov edx, ebp
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], 1
jmp 0x487e80
inc edx
xor ecx, ecx
cmp esi, dword [esp + 0x58]
jne 0x487e93
mov ebp, dword [esp]
mov eax, 0xffffffff
movzx edi, word [esp + 4]
sub ebp, edx
add ebp, 3
cmovb ebp, eax
shr ebp, 2
cmp cx, 1
sbb ebp, 0xffffffff
add ebp, edi
mov edi, ecx
jmp 0x487f2c
test edx, edx
je 0x487f00
test di, di
je 0x487ea0
xor ecx, ecx
mov ebx, edi
cmp esi, dword [esp + 0x58]
je 0x487e4a
mov edi, ecx
mov word [eax + esi*2], bx
inc esi
mov dword [esp + 0x60], esi
jmp 0x487e80
cmp edx, dword [esp]
je 0x487f00
movzx ebx, byte [edx]
test bl, bl
jns 0x487e41
movzx edi, byte [edx + 1]
mov ecx, ebx
and ecx, 0x1f
and edi, 0x3f
cmp bl, 0xdf
jbe 0x487f51
movzx ebp, byte [edx + 2]
shl edi, 6
and ebp, 0x3f
or ebp, edi
cmp bl, 0xf0
jb 0x487f6c
movzx ebx, byte [edx + 3]
and ecx, 7
shl ebp, 6
add edx, 4
shl ecx, 0x12
and ebx, 0x3f
or ebx, ebp
or ebx, ecx
cmp ebx, 0xffff
jbe 0x487e42
jmp 0x487f82
cmp word [esp + 4], 1
mov ebp, dword [esp + 0x58]
jne 0x487fb0
xor ebx, ebx
cmp esi, ebp
mov edx, 0
mov ebp, 0
mov dword [esp + 4], 0
jne 0x487e95
mov dword [esp + 0x14], edx
mov edx, esi
inc ebp
lea ecx, [esp + 0x58]
push 2
push 2
push ebp
call fcn.00500270
mov edx, dword [esp + 0x20]
add esp, 0xc
mov eax, dword [esp + 0x5c]
jmp 0x487e95
shl ecx, 6
add edx, 2
or ecx, edi
mov ebx, ecx
xor ecx, ecx
cmp esi, dword [esp + 0x58]
jne 0x487e93
jmp 0x487e4a
shl ecx, 0xc
add edx, 3
or ebp, ecx
mov ebx, ebp
cmp ebx, 0xffff
jbe 0x487e42
lea edi, [ebx + 0xff0000]
and ebx, 0x3ff
shr edi, 0xa
or ebx, 0xdc00
or edi, 0xd800
mov ecx, ebx
mov ebx, edi
cmp esi, dword [esp + 0x58]
jne 0x487e93
jmp 0x487e4a
mov ebx, dword [esp + 0x5c]
lea eax, [esp + 0xc4]
mov dword [esp + 0xc4], 0xc
mov dword [esp + 0xc8], 0
mov dword [esp + 0xcc], 1
push 0
push 0x4000000
push 3
push eax
push 5
push 0x80000000
push ebx
call dword [sym.imp.kernel32.dll_CreateFileW]
cmp eax, 0xffffffff
je 0x488067
mov dword [esp + 4], eax
mov dword [esp + 0x20], 0
call sub.kernel32.dll_GetCurrentProcess
mov esi, eax
call sub.kernel32.dll_GetCurrentProcess
mov edi, eax
call sub.kernel32.dll_GetCurrentProcess
lea ecx, [esp + 0x20]
push 2
push 1
push 0
push ecx
push eax
push edi
push esi
call dword [sym.imp.kernel32.dll_DuplicateHandle]
mov edi, eax
test eax, eax
je 0x488093
mov esi, dword [esp + 8]
test esi, esi
js 0x488407
mov dword [esp + 0x18], edi
je 0x4880fe
movzx eax, byte [0x6019e5]
xor ecx, ecx
mov edx, esi
call fcn.00499510
mov edi, eax
test eax, eax
jne 0x488103
jmp 0x488407
call dword [sym.imp.kernel32.dll_GetLastError]
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x108]
test ebp, ebp
mov byte [ecx], 0
mov dword [ecx + 4], eax
je 0x4880cf
push ebx
push 0
push dword [0x6019d8]
call dword [sym.imp.kernel32.dll_HeapFree]
jmp 0x4880cf
push dword [esp + 4]
call dword [sym.imp.kernel32.dll_CloseHandle]
call dword [sym.imp.kernel32.dll_GetLastError]
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x108]
mov byte [ecx], 0
mov dword [ecx + 4], eax
test ebp, ebp
je 0x4880c7
push ebx
push 0
push dword [0x6019d8]
call dword [sym.imp.kernel32.dll_HeapFree]
test edi, edi
jne 0x488578
cmp dword [esi], 0
je 0x4880e5
push dword [esi + 4]
push 0
push dword [0x6019d8]
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, dword [esp + 0xc]
cmp dword [eax], 0
je 0x488578
mov eax, dword [esp + 0xc]
push dword [eax + 4]
jmp 0x48856a
mov edi, 1
mov dword [esp + 0x14], ebx
push esi
mov ebx, dword [esp + 0x20]
push ebx
push edi
call fcn.004ef180
add esp, 0xc
mov eax, dword [esp + 0xc]
mov dword [esp + 0x70], esi
mov dword [esp + 0x74], edi
mov dword [esp + 0x78], esi
mov byte [esp + 0x7c], 0
mov dword [esp + 0x80], 0
mov dword [esp + 0x84], 4
mov dword [esp + 0x88], 0
mov dword [esp + 0xa0], 0
mov dword [esp + 0xa8], 0
mov word [esp + 0xac], 0
mov dword [esp + 0x8c], 0x80000000
mov dword [esp + 0xb0], 0
mov word [esp + 0x9c], 0
mov word [esp + 0xc0], 0
mov dword [esp + 0x58], 6
mov dword [esp + 0x60], 6
mov dword [esp + 0x68], 6
mov dword [esp + 0xb4], 0
mov dword [esp + 0xbc], 0
cmp dword [eax], 0
je 0x4881d8
push ebx
push 0
push dword [0x6019d8]
call dword [sym.imp.kernel32.dll_HeapFree]
lea eax, [esp + 0x24]
mov dword [esp + 0xec], 0
mov dword [esp + 0xe0], 0x20
mov byte [esp + 0xf0], 3
mov dword [esp + 0xd0], 0
mov dword [esp + 0xd8], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 1
mov dword [esp + 0x2c], 0
mov dword [esp + 0xe4], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0xe8], 0x5bb7cc
mov ebx, eax
mov dword [esp], eax
neg ebx
cmovs ebx, eax
mov eax, 0x27
cmp ebx, 0x2710
jb 0x4882f0
mov edi, 0x27
nop
mov eax, ebx
mov ecx, 0xd1b71759
mul ecx
mov ecx, ebx
shr edx, 0xd
imul eax, edx, 0x2710
sub ecx, eax
imul esi, ecx, 0x147b
shr esi, 0x13
imul eax, esi, 0x64
movzx esi, word [esi + esi + 0x5a25a7]
sub ecx, eax
lea eax, [edi - 4]
cmp ebx, 0x5f5e0ff
mov ebx, edx
movzx ecx, cx
movzx ecx, word [ecx + ecx + 0x5a25a7]
mov word [esp + edi + 0x2c], si
mov word [esp + edi + 0x2e], cx
mov edi, eax
ja 0x488260
cmp edx, 0x63
jbe 0x4882de
movzx ecx, dx
shr ecx, 2
imul ecx, ecx, 0x147b
shr ecx, 0x11
imul esi, ecx, 0x64
sub edx, esi
movzx edx, dx
movzx edx, word [edx + edx + 0x5a25a7]
mov word [esp + eax + 0x2e], dx
add eax, 0xfffffffe
mov edx, ecx
mov ebx, dword [esp]
cmp edx, 0xa
jae 0x4882f9
or dl, 0x30
mov byte [esp + eax + 0x2f], dl
dec eax
jmp 0x488309
mov edx, ebx
cmp edx, 0x63
ja 0x4882b5
jmp 0x4882de
movzx ecx, word [edx + edx + 0x5a25a7]
mov word [esp + eax + 0x2e], cx
add eax, 0xfffffffe
mov edi, 0x27
not ebx
lea esi, [esp + eax + 0x30]
lea ecx, [esp + 0xd0]
sub edi, eax
shr ebx, 0x1f
mov edx, ebx
push edi
push esi
push 0
push 1
call fcn.00411a70
add esp, 0x10
test al, al
jne 0x488407
mov ebx, dword [esp + 0x2c]
test ebx, ebx
js 0x488407
mov eax, dword [esp + 0x24]
mov edi, dword [esp + 0x28]
mov dword [esp], eax
je 0x48836c
movzx eax, byte [0x6019e5]
xor ecx, ecx
mov edx, ebx
call fcn.00499510
mov esi, eax
test eax, eax
jne 0x488371
jmp 0x488407
mov esi, 1
push ebx
mov dword [esp + 0xc], edi
push edi
push esi
call fcn.004ef180
add esp, 0xc
mov edi, dword [esp + 0x88]
cmp edi, dword [esp + 0x80]
jne 0x48839c
lea ecx, [esp + 0x80]
call fcn.004996f0
lea ecx, [edi + edi*4]
mov eax, dword [esp + 0x84]
inc edi
cmp dword [esp], 0
mov dword [eax + ecx*4], 0
mov dword [eax + ecx*4 + 4], ebx
mov dword [eax + ecx*4 + 8], esi
mov dword [eax + ecx*4 + 0xc], ebx
mov byte [eax + ecx*4 + 0x10], 0
mov dword [esp + 0x88], edi
je 0x4883de
push dword [esp + 8]
push 0
push dword [0x6019d8]
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, dword [esp + 0x108]
mov ebx, dword [eax + 8]
test ebx, ebx
js 0x488407
mov edi, dword [eax + 4]
je 0x488409
movzx eax, byte [0x6019e5]
xor ecx, ecx
mov edx, ebx
call fcn.00499510
mov esi, eax
test eax, eax
jne 0x48840e
ud2
mov esi, 1
push ebx
mov dword [esp + 4], edi
push edi
push esi
call fcn.004ef180
add esp, 0xc
mov edi, dword [esp + 0x88]
cmp edi, dword [esp + 0x80]
jne 0x488439
lea ecx, [esp + 0x80]
call fcn.004996f0
mov eax, dword [esp + 0x84]
lea ecx, [edi + edi*4]
inc edi
mov dword [eax + ecx*4], 0
mov dword [eax + ecx*4 + 4], ebx
mov dword [eax + ecx*4 + 8], esi
mov esi, dword [esp + 0x108]
mov dword [eax + ecx*4 + 0xc], ebx
mov byte [eax + ecx*4 + 0x10], 0
mov dword [esp + 0x88], edi
cmp dword [esi], 0
je 0x488480
push dword [esp]
push 0
push dword [0x6019d8]
call dword [sym.imp.kernel32.dll_HeapFree]
lea ecx, [esp + 0x30]
lea edx, [esp + 0x58]
push 1
push 0
call fcn.00490b40
add esp, 8
mov edi, dword [esp + 0x38]
cmp edi, 2
jne 0x4884c9
movsd xmm0, qword [esp + 0x30]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x58]
movsd qword [eax], xmm0
call fcn.004037c0
mov ebx, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
test ebp, ebp
jne 0x4880b8
jmp 0x4880c7
mov eax, dword [esp + 0x3c]
mov ebx, dword [esp + 0x34]
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x44]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x48]
mov dword [esp], eax
mov eax, dword [esp + 0x4c]
mov dword [esp + 8], eax
push dword [esp + 0x30]
call esi
push ebx
mov ebx, esi
call esi
test edi, edi
je 0x488513
push dword [esp + 0x18]
call dword [sym.imp.kernel32.dll_CloseHandle]
cmp dword [esp + 0xc], 0
mov esi, dword [esp + 0x14]
je 0x488528
push dword [esp + 0x1c]
call dword [sym.imp.kernel32.dll_CloseHandle]
cmp dword [esp], 0
je 0x488538
push dword [esp + 8]
call dword [sym.imp.kernel32.dll_CloseHandle]
lea ecx, [esp + 0x58]
call fcn.004037c0
xor ecx, ecx
xor edx, edx
push 0x5f5e100
call fcn.00489f00
add esp, 4
push dword [esp + 0x20]
call ebx
push dword [esp + 4]
call ebx
mov eax, dword [esp + 0x10]
test ebp, ebp
mov byte [eax], 4
je 0x488578
push esi
push 0
push dword [0x6019d8]
call dword [sym.imp.kernel32.dll_HeapFree]
add esp, 0xf4
pop esi
pop edi
pop ebx
pop ebp
ret
shl eax, 0xc
lea ebp, [esi + 3]
or ecx, eax
mov ebx, ecx
mov edx, dword [esp]
cmp ebx, 0xffff
jbe 0x487dcd
lea ecx, [ebx + 0xff0000]
and ebx, 0x3ff
mov eax, 2
shr ecx, 0xa
or ebx, 0xdc00
or ecx, 0xd800
mov edi, ebx
mov ebx, ecx
jmp 0x487dd4