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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x529186
push eax
mov dword fs:[0], esp
sub esp, 0x98
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov ecx, dword [edi]
add ecx, 0x128
call fcn.004fabc0
mov eax, dword [edi + 8]
test eax, eax
je 0x508075
mov esi, dword [edi]
push eax
mov ecx, edi
add esi, 0x128
call fcn.00500030
mov ecx, dword [esi + 8]
mov ebx, dword [esi + 4]
mov edx, dword [edi + 8]
sub ecx, ebx
sub ecx, eax
mov dword [edx + 4], ecx
mov ecx, dword [edi]
mov edx, 0x20
add ecx, 0x128
call fcn.004fab90
mov ebx, dword [esp + 0xb8]
mov dword [edi + 8], eax
mov dword [eax + 4], 0
mov eax, dword [edi + 8]
mov dword [eax], 0xe
mov ecx, dword [ebx + 8]
mov edx, dword [ebx + 4]
mov eax, dword [edi + 8]
sub ecx, edx
sar ecx, 1
mov dword [eax + 8], ecx
mov ecx, dword [ebx + 0x18]
sub ecx, dword [ebx + 0x14]
sar ecx, 1
shr ecx, 1
mov dword [eax + 0xc], ecx
mov ecx, dword [ebx + 0x38]
sub ecx, dword [ebx + 0x34]
sar ecx, 1
mov dword [eax + 0x10], ecx
mov ecx, dword [ebx + 0x24]
mov dword [eax + 0x14], ecx
mov edx, dword [ebx + 0x28]
mov dword [eax + 0x18], edx
mov esi, dword [edi]
test dword [esi + 8], 0x100000
je 0x50811c
mov esi, dword [edi + 0x30]
mov ebp, ecx
and ebp, esi
cmp ebp, esi
je 0x5080f6
mov esi, dword [edi + 0x34]
mov ebp, ecx
and ebp, esi
cmp ebp, esi
jne 0x5080fe
mov esi, dword [edi + 0x38]
or esi, ecx
mov dword [eax + 0x14], esi
mov ecx, dword [edi + 0x30]
mov esi, edx
and esi, ecx
cmp esi, ecx
je 0x508114
mov ecx, dword [edi + 0x34]
mov esi, edx
and esi, ecx
cmp esi, ecx
jne 0x50811c
mov ecx, dword [edi + 0x38]
or ecx, edx
mov dword [eax + 0x18], ecx
mov cl, byte [ebx + 0x20]
mov byte [eax + 0x1c], cl
mov cl, byte [ebx + 0x21]
test cl, cl
sete dl
mov byte [eax + 0x1d], dl
mov ecx, dword [edi]
mov esi, dword [ecx + 0x12c]
mov ecx, dword [ebx + 8]
sub eax, esi
mov dword [esp + 0x50], ecx
mov dword [esp + 0x54], eax
mov eax, dword [ebx + 4]
cmp eax, ecx
je 0x508207
inc eax
mov dword [esp + 0x14], eax
mov edx, dword [esp + 0x14]
mov esi, dword [edi]
xor eax, eax
cmp byte [edx], 0
mov ecx, dword [esi + 0x128]
setne al
add eax, 2
add esi, 0x128
mov ebp, eax
mov eax, dword [esi + 8]
sub ecx, eax
cmp ecx, ebp
jae 0x50818e
mov ecx, dword [esi + 4]
mov edx, ebp
sub edx, ecx
mov ecx, esi
add edx, eax
call fcn.0050ba00
mov edx, dword [esp + 0x14]
mov eax, dword [esi + 8]
add ebp, eax
mov dword [esi + 8], ebp
mov cl, byte [edx - 1]
cmp byte [edi + 0xc], 0
mov byte [esp + 0x18], cl
je 0x5081b9
mov ecx, dword [edi + 4]
mov esi, dword [ecx]
mov ecx, dword [esp + 0x18]
and ecx, 0xff
mov cl, byte [ecx + esi + 0x104]
mov byte [eax], cl
mov cl, byte [edx]
test cl, cl
je 0x5081ef
mov dl, byte [edi + 0xc]
mov byte [esp + 0x34], cl
test dl, dl
je 0x5081e2
mov edx, dword [edi + 4]
mov ecx, dword [edx]
mov edx, dword [esp + 0x34]
and edx, 0xff
mov cl, byte [edx + ecx + 0x104]
mov edx, dword [esp + 0x14]
mov byte [eax + 1], cl
mov byte [eax + 2], 0
jmp 0x5081f3
mov byte [eax + 1], 0
mov eax, dword [esp + 0x50]
add edx, 2
mov dword [esp + 0x14], edx
dec edx
cmp edx, eax
jne 0x508152
mov eax, dword [ebx + 0x14]
mov ecx, dword [ebx + 0x18]
cmp eax, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x50], ecx
je 0x50876f
mov edx, dword [esp + 0x14]
mov ax, word [edx]
mov word [esp + 0x48], ax
mov al, byte [edi + 0xc]
test al, al
je 0x508248
mov ecx, dword [edi + 4]
mov esi, dword [esp + 0x48]
and esi, 0xff
mov ecx, dword [ecx]
mov cl, byte [esi + ecx + 0x104]
jmp 0x50824c
mov cl, byte [esp + 0x48]
test al, al
mov byte [esp + 0x48], cl
je 0x50826c
mov ecx, dword [edi + 4]
mov esi, dword [esp + 0x49]
and esi, 0xff
mov ecx, dword [ecx]
mov cl, byte [esi + ecx + 0x104]
jmp 0x508270
mov cl, byte [esp + 0x49]
add edx, 2
mov bl, cl
test al, al
mov cx, word [edx]
mov byte [esp + 0x49], bl
mov word [esp + 0x2c], cx
je 0x50829d
mov ecx, dword [edi + 4]
mov esi, dword [esp + 0x2c]
and esi, 0xff
mov ecx, dword [ecx]
mov cl, byte [esi + ecx + 0x104]
jmp 0x5082a1
mov cl, byte [esp + 0x2c]
test al, al
mov byte [esp + 0x2c], cl
je 0x5082c1
mov eax, dword [edi + 4]
mov ecx, dword [esp + 0x2d]
and ecx, 0xff
mov eax, dword [eax]
mov al, byte [ecx + eax + 0x104]
jmp 0x5082c5
mov al, byte [esp + 0x2d]
add edx, 2
push 0
mov dword [esp + 0x18], edx
mov dl, byte [esp + 0x17]
lea ecx, [esp + 0x20]
mov byte [esp + 0x31], al
mov byte [esp + 0x20], dl
call fcn.004f977a
mov al, byte [esp + 0x13]
push 0
lea ecx, [esp + 0x3c]
mov dword [esp + 0xb4], 0
mov byte [esp + 0x3c], al
call fcn.004f977a
mov ecx, dword [edi]
mov byte [esp + 0xb0], 1
test dword [ecx + 8], 0x200000
je 0x5084a6
mov al, byte [esp + 0x2c]
mov dl, byte [esp + 0x48]
mov cl, byte [esp + 0x2d]
mov byte [esp + 0x34], al
test bl, bl
mov byte [esp + 0x18], dl
mov byte [esp + 0x19], bl
mov byte [esp + 0x1a], 0
mov byte [esp + 0x35], cl
mov byte [esp + 0x36], 0
lea eax, [esp + 0x1a]
jne 0x50834a
lea eax, [esp + 0x19]
mov ecx, dword [edi + 4]
push eax
lea edx, [esp + 0x1c]
lea eax, [esp + 0x8c]
push edx
push eax
call fcn.0049e050
mov ecx, dword [0x58a2a8]
mov byte [esp + 0xb0], 2
push ecx
push 0
push eax
lea ecx, [esp + 0x28]
call fcn.004f96ac
push 1
lea ecx, [esp + 0x8c]
mov byte [esp + 0xb4], 1
call fcn.004f977a
mov al, byte [esp + 0x35]
test al, al
lea eax, [esp + 0x36]
jne 0x5083a1
lea eax, [esp + 0x35]
mov ecx, dword [edi + 4]
push eax
lea edx, [esp + 0x38]
lea eax, [esp + 0x9c]
push edx
push eax
call fcn.0049e050
mov ecx, dword [0x58a2a8]
mov byte [esp + 0xb0], 3
push ecx
push 0
push eax
lea ecx, [esp + 0x44]
call fcn.004f96ac
push 1
lea ecx, [esp + 0x9c]
mov byte [esp + 0xb4], 1
call fcn.004f977a
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x508444
mov dl, byte [esp + 0x13]
push 0
lea ecx, [esp + 0x7c]
mov byte [esp + 0x7c], dl
call fcn.004f977a
push 0
push 1
lea ecx, [esp + 0x80]
call fcn.005089c0
mov eax, dword [0x58a2a8]
lea ecx, [esp + 0x78]
push eax
push 0
push ecx
lea ecx, [esp + 0x28]
mov byte [esp + 0xbc], 4
call fcn.004f96ac
push 1
lea ecx, [esp + 0x7c]
mov byte [esp + 0xb4], 1
call fcn.004f977a
mov eax, dword [esp + 0x40]
test eax, eax
jne 0x508660
mov dl, byte [esp + 0x13]
push 0
lea ecx, [esp + 0x5c]
mov byte [esp + 0x5c], dl
call fcn.004f977a
push 0
push 1
lea ecx, [esp + 0x60]
call fcn.005089c0
mov eax, dword [0x58a2a8]
lea ecx, [esp + 0x58]
push eax
push 0
push ecx
lea ecx, [esp + 0x44]
mov byte [esp + 0xbc], 5
call fcn.004f96ac
push 1
lea ecx, [esp + 0x5c]
mov byte [esp + 0xb4], 1
call fcn.004f977a
jmp 0x508660
test bl, bl
je 0x50853e
lea ecx, [esp + 0x1c]
call fcn.004fa2c0
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x5084c3
xor esi, esi
jmp 0x5084ca
mov edx, dword [esp + 0x24]
lea esi, [eax + edx]
lea ecx, [esp + 0x1c]
call fcn.004fa2c0
test esi, esi
je 0x5084db
sub esi, dword [esp + 0x20]
mov eax, dword [esp + 0x48]
lea ecx, [esp + 0x1c]
push eax
push 1
push esi
call fcn.00509e80
lea ecx, [esp + 0x1c]
call fcn.004fa2c0
lea ecx, [esp + 0x1c]
call fcn.004fa2c0
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x50850a
xor esi, esi
jmp 0x508511
mov ecx, dword [esp + 0x24]
lea esi, [eax + ecx]
lea ecx, [esp + 0x1c]
call fcn.004fa2c0
test esi, esi
je 0x508522
sub esi, dword [esp + 0x20]
mov edx, dword [esp + 0x49]
lea ecx, [esp + 0x1c]
push edx
push 1
push esi
call fcn.00509e80
lea ecx, [esp + 0x1c]
call fcn.004fa2c0
jmp 0x508593
mov al, byte [esp + 0x13]
push 0
lea ecx, [esp + 0x6c]
mov byte [esp + 0x6c], al
call fcn.004f977a
mov ecx, dword [esp + 0x48]
push ecx
push 1
lea ecx, [esp + 0x70]
call fcn.005089c0
mov edx, dword [0x58a2a8]
lea eax, [esp + 0x68]
push edx
push 0
push eax
lea ecx, [esp + 0x28]
mov byte [esp + 0xbc], 6
call fcn.004f96ac
push 1
lea ecx, [esp + 0x6c]
mov byte [esp + 0xb4], 1
call fcn.004f977a
mov al, byte [esp + 0x2d]
lea ecx, [esp + 0x38]
test al, al
je 0x50861d
call fcn.004fa2c0
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x5085b0
xor esi, esi
jmp 0x5085b7
mov ecx, dword [esp + 0x40]
lea esi, [eax + ecx]
lea ecx, [esp + 0x38]
call fcn.004fa2c0
test esi, esi
je 0x5085c8
sub esi, dword [esp + 0x3c]
mov edx, dword [esp + 0x2c]
lea ecx, [esp + 0x38]
push edx
push 1
push esi
call fcn.00509e80
lea ecx, [esp + 0x38]
call fcn.004fa2c0
lea ecx, [esp + 0x38]
call fcn.004fa2c0
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x5085f7
xor esi, esi
jmp 0x5085fe
mov ecx, dword [esp + 0x40]
lea esi, [eax + ecx]
lea ecx, [esp + 0x38]
call fcn.004fa2c0
test esi, esi
jne 0x508611
mov edx, dword [esp + 0x2d]
jmp 0x50864a
mov eax, dword [esp + 0x3c]
mov edx, dword [esp + 0x2d]
sub esi, eax
jmp 0x50864a
call fcn.004fa2c0
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x50862e
xor esi, esi
jmp 0x508635
mov ecx, dword [esp + 0x40]
lea esi, [eax + ecx]
lea ecx, [esp + 0x38]
call fcn.004fa2c0
test esi, esi
je 0x508646
sub esi, dword [esp + 0x3c]
mov edx, dword [esp + 0x2c]
push edx
push 1
push esi
lea ecx, [esp + 0x44]
call fcn.00509e80
lea ecx, [esp + 0x38]
call fcn.004fa2c0
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x38]
push eax
call fcn.004ffc90
test eax, eax
jl 0x508808
mov esi, dword [edi]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x40]
add esi, 0x128
mov eax, dword [esi + 8]
lea ebp, [edx + ecx + 2]
mov ecx, dword [esi]
sub ecx, eax
cmp ecx, ebp
jae 0x5086a5
mov ebx, dword [esi + 4]
mov edx, ebp
sub edx, ebx
mov ecx, esi
add edx, eax
call fcn.0050ba00
mov ebx, dword [esi + 8]
lea ecx, [esp + 0x1c]
add ebp, ebx
mov dword [esi + 8], ebp
call fcn.004fa2c0
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x5086c2
xor ebp, ebp
jmp 0x5086c9
mov edx, dword [esp + 0x24]
lea ebp, [eax + edx]
lea ecx, [esp + 0x1c]
call fcn.004fa2c0
mov eax, dword [esp + 0x20]
mov esi, ebx
cmp eax, ebp
je 0x5086e6
mov cl, byte [eax]
mov byte [esi], cl
inc esi
inc eax
cmp eax, ebp
jne 0x5086dc
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x38]
mov byte [edx + ebx], 0
mov eax, dword [esp + 0x24]
lea ebp, [eax + ebx + 1]
call fcn.004fa2c0
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x50870b
xor esi, esi
jmp 0x508712
mov ecx, dword [esp + 0x40]
lea esi, [eax + ecx]
lea ecx, [esp + 0x38]
call fcn.004fa2c0
mov eax, dword [esp + 0x3c]
mov ecx, ebp
cmp eax, esi
je 0x50872f
mov dl, byte [eax]
mov byte [ecx], dl
inc ecx
inc eax
cmp eax, esi
jne 0x508725
mov eax, dword [esp + 0x40]
push 1
lea ecx, [esp + 0x3c]
mov byte [eax + ebp], 0
call fcn.004f977a
push 1
lea ecx, [esp + 0x20]
mov dword [esp + 0xb4], 0xffffffff
call fcn.004f977a
mov ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x14]
cmp eax, ecx
jne 0x50821d
mov ebx, dword [esp + 0xb8]
mov eax, dword [ebx + 0x34]
mov ebx, dword [ebx + 0x38]
cmp eax, ebx
mov dword [esp + 0x14], eax
mov dword [esp + 0x50], ebx
je 0x508979
mov dl, byte [esp + 0x13]
push 0
lea ecx, [esp + 0x20]
mov byte [esp + 0x20], dl
call fcn.004f977a
mov edx, dword [esp + 0x14]
mov dword [esp + 0xb0], 7
mov cl, byte [edx + 1]
lea eax, [edx + 1]
test cl, cl
je 0x508825
mov al, byte [edx]
mov byte [esp + 0x19], cl
lea ecx, [esp + 0x1a]
mov byte [esp + 0x18], al
lea edx, [esp + 0x18]
push ecx
mov ecx, dword [edi + 4]
lea eax, [esp + 0x9c]
push edx
push eax
mov byte [esp + 0x26], 0
call fcn.00504b20
mov ecx, dword [0x58a2a8]
mov byte [esp + 0xb0], 8
push ecx
push 0
push eax
lea ecx, [esp + 0x28]
call fcn.004f96ac
mov byte [esp + 0xb0], 7
push 1
lea ecx, [esp + 0x9c]
jmp 0x508863
push 1
lea ecx, [esp + 0x3c]
call fcn.004f977a
push 1
lea ecx, [esp + 0x20]
call fcn.004f977a
xor eax, eax
jmp 0x50898a
mov ecx, dword [edi + 4]
push eax
push edx
lea edx, [esp + 0x90]
push edx
call fcn.00504b20
mov ecx, dword [0x58a2a8]
mov byte [esp + 0xb0], 9
push ecx
push 0
push eax
lea ecx, [esp + 0x28]
call fcn.004f96ac
mov byte [esp + 0xb0], 7
push 1
lea ecx, [esp + 0x8c]
call fcn.004f977a
mov ebp, dword [esp + 0x24]
test ebp, ebp
je 0x5089a5
mov esi, dword [edi]
inc ebp
add esi, 0x128
mov eax, dword [esi + 8]
mov edx, dword [esi]
sub edx, eax
cmp edx, ebp
jae 0x508898
mov ebx, dword [esi + 4]
mov edx, ebp
sub edx, ebx
mov ecx, esi
add edx, eax
call fcn.0050ba00
mov ebx, dword [esi + 8]
add ebp, ebx
mov dword [esi + 8], ebp
mov eax, dword [esp + 0x20]
xor ebp, ebp
cmp eax, ebp
je 0x5088d9
mov cl, byte [eax - 1]
test cl, cl
je 0x5088c9
cmp cl, 0xff
je 0x5088c9
mov eax, dword [esp + 0x24]
push ebp
push eax
lea ecx, [esp + 0x24]
call fcn.004f9852
mov eax, dword [esp + 0x20]
cmp eax, ebp
je 0x5088d9
mov byte [eax - 1], 0xff
mov eax, dword [esp + 0x20]
cmp eax, ebp
jne 0x5088dd
xor esi, esi
jmp 0x50890b
mov edx, dword [esp + 0x24]
mov cl, byte [eax - 1]
test cl, cl
lea esi, [edx + eax]
je 0x5088ff
cmp cl, 0xff
je 0x5088ff
push ebp
push edx
lea ecx, [esp + 0x24]
call fcn.004f9852
mov eax, dword [esp + 0x20]
cmp eax, ebp
je 0x50890b
mov byte [eax - 1], 0xff
mov eax, dword [esp + 0x20]
cmp eax, esi
mov ecx, ebx
je 0x50891b
mov dl, byte [eax]
mov byte [ecx], dl
inc ecx
inc eax
cmp eax, esi
jne 0x508911
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x24]
add ecx, 2
mov dword [esp + 0xb0], 0xffffffff
mov byte [eax + ebx], 0
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x20]
cmp ecx, ebp
je 0x50895d
mov al, byte [ecx - 1]
test al, al
je 0x508953
cmp al, 0xff
je 0x508953
dec al
mov byte [ecx - 1], al
jmp 0x50895d
dec ecx
push ecx
call fcn.0050f4a2
add esp, 4
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x50]
cmp ecx, eax
mov dword [esp + 0x20], ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], ebp
jne 0x508785
mov edx, dword [edi]
mov ecx, dword [esp + 0x54]
mov eax, dword [edx + 0x12c]
add eax, ecx
mov dword [edi + 8], eax
mov ecx, dword [esp + 0xa8]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xa4
ret 8
push 1
lea ecx, [esp + 0x20]
call fcn.004f977a
xor eax, eax
jmp 0x50898a