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

Disassembly:
sub esp, 0xd4
push ebx
push ebp
push esi
xor esi, esi
push edi
push esi
push esi
push 0x3e9
mov dword [esp + 0x38], 0x64
mov dword [esp + 0x24], esi
call fcn.0050c030
mov ebp, eax
push esi
mov ebx, dword [esp + 0xec]
push esi
mov dword [esp + 0x58], ebp
lea edi, [ebx + 0x14]
mov ecx, edi
mov dword [esp + 0x1c], edi
call fcn.00506a60
cmp eax, esi
je 0x509fea
cmp dword [esp + 0xec], esi
jne 0x509ae3
lea esi, [eax + 0x18]
push esi
call fcn.004f9150
add esi, eax
push esi
call fcn.004f9150
add esi, eax
add esp, 8
mov esi, dword [esi]
test esi, esi
je 0x509ae1
mov eax, dword [esi + 0x1c]
push eax
call dword [fcn.0049c678]
test eax, eax
je 0x509ae1
mov eax, dword [esi + 0x1b4]
test eax, eax
je 0x509af6
push 0
push 0
mov ecx, esi
call fcn.0050ff10
xor esi, esi
cmp dword [esp + 0xf4], 1
jne 0x509b41
mov dword [esp + 0xf8], esi
jmp 0x509b5b
mov ecx, dword [esi + 0x1c]
push ecx
call dword [fcn.0049c5a8]
test eax, eax
je 0x509b1f
push 9
mov ecx, esi
call fcn.0056f8fe
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xd4
ret 0x14
mov edx, dword [esi + 0x1c]
push edx
call dword [0x49c624]
push eax
call fcn.0056cec8
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xd4
ret 0x14
mov eax, dword [esp + 0xf8]
cmp eax, esi
je 0x509b5b
push eax
call dword [fcn.0049c678]
test eax, eax
je 0x509fea
push esi
push esi
push 0x7d9
call fcn.0050c030
lea ecx, [ebx + 0x34]
push edi
mov dword [esp + 0x24], ecx
call fcn.005069f0
push ebx
mov ecx, ebp
call fcn.00507020
cmp eax, esi
mov dword [esp + 0x4c], eax
je 0x509fea
lea eax, [esp + 0xb4]
mov ecx, edi
push eax
mov dword [esp + 0xa0], esi
mov dword [esp + 0x14], esi
call fcn.00507680
cmp eax, esi
mov dword [esp + 0x28], esi
jle 0x509bd1
mov edx, dword [esp + 0xb4]
lea ecx, [esp + 0x28]
push esi
push ecx
push esi
push 0xffffffffffffffff
push eax
push esi
push edx
mov ecx, edi
call fcn.00506a60
push eax
call fcn.00517710
add esp, 0x18
mov dword [esp + 0x10], eax
lea ecx, [esp + 0x54]
call fcn.004f8710
mov esi, 0x5978cc
lea ecx, [esp + 0x7c]
mov dword [esp + 0x54], esi
call fcn.004f8710
lea ecx, [esp + 0x68]
mov dword [esp + 0x7c], esi
call fcn.004f8710
lea ecx, [esp + 0x34]
mov dword [esp + 0x68], esi
call fcn.004f8710
mov esi, dword [ebx + 0x18]
mov ebx, esi
mov dword [esp + 0x30], esi
test esi, esi
mov dword [esp + 0x1c], ebx
jle 0x509ed9
mov edi, ebx
mov ecx, dword [esp + 0x14]
sub edi, esi
push 0
neg edi
sbb edi, edi
and edi, ebx
push edi
call fcn.00506a60
mov ebp, eax
test ebp, ebp
je 0x509ed9
mov ecx, dword [esp + 0x14]
push edi
call fcn.00507290
cmp eax, 1
jne 0x509c54
dec ebx
mov dword [esp + 0x1c], ebx
jmp 0x509ed1
mov eax, dword [ebp]
push 0
push eax
push 0x3ea
call fcn.0050c030
mov ebx, eax
test ebx, ebx
je 0x509ff9
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x509ff9
push 1
call eax
test eax, eax
mov dword [esp + 0x24], eax
je 0x509ff9
lea esi, [ebp + 0x18]
push esi
call fcn.004f9150
add esi, eax
push esi
call fcn.004f9150
add esp, 8
lea ecx, [esp + 0x90]
add esi, eax
push ecx
push ebp
mov ebp, dword [esp + 0x1c]
mov dword [esp + 0x50], esi
mov ecx, ebp
add esi, 4
call fcn.005072b0
push edi
mov ecx, ebp
mov dword [esp + 0xac], eax
call fcn.00506ab0
mov edx, dword [ebx + 0x14]
lea ecx, [esp + 0x68]
shr edx, 8
and edx, 1
mov dword [esp + 0xb0], eax
push edx
call fcn.004f89a0
mov eax, dword [esi]
mov ecx, dword [esi + 4]
mov edx, dword [esi + 8]
mov dword [esp + 0x94], eax
mov eax, dword [esi + 0xc]
add esi, 0x18
mov dword [esp + 0xa4], ecx
mov dword [esp + 0xac], eax
mov ecx, dword [esi]
mov dword [esp + 0xa0], edx
xor ebp, ebp
mov edx, dword [esi + ecx*4 + 4]
lea eax, [esi + ecx*4 + 4]
lea esi, [eax + edx + 4]
push esi
call fcn.004f9150
mov ecx, dword [ebx + 0x14]
lea esi, [esi + eax + 4]
add esp, 4
mov eax, dword [esi]
test ch, 0x80
mov dword [esp + 0x98], eax
je 0x509d47
push ebp
lea ecx, [esp + 0x38]
call fcn.004f8a20
jmp 0x509d7e
mov ecx, dword [esp + 0xec]
test ecx, ecx
je 0x509d63
test edi, edi
jne 0x509d63
push 1
lea ecx, [esp + 0x38]
call fcn.004f8a20
jmp 0x509d7e
and al, 1
lea ecx, [esp + 0x34]
push eax
call fcn.004f8a20
test byte [esp + 0x98], 2
je 0x509d7e
mov ebp, 0x8000000
test byte [esp + 0x98], 4
je 0x509d8e
or ebp, 0x10000
test edi, edi
jne 0x509e3f
mov eax, dword [esp + 0xf4]
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0xac]
push edi
mov ebx, dword [esp + 0x14]
push edi
mov edi, dword [esp + 0xb8]
mov dword [0x5ca9c4], eax
mov eax, dword [esp + 0xa8]
push edi
push ecx
mov ecx, dword [esp + 0xb4]
push edx
mov edx, dword [esp + 0xa8]
push eax
mov eax, dword [esp + 0x110]
push ecx
mov ecx, dword [esp + 0xac]
push edx
mov edx, dword [esp + 0xc8]
push ebx
push 0
push eax
push ebp
push ecx
push edx
call dword [esp + 0x5c]
mov esi, eax
xor ebp, ebp
cmp esi, ebp
mov dword [0x5ca9c4], ebp
mov dword [esp + 0x18], esi
je 0x509f65
mov eax, dword [esi + 0x1c]
cmp eax, ebp
mov dword [esp + 0x9c], eax
je 0x509f65
push eax
call dword [fcn.0049c678]
test eax, eax
je 0x509f65
mov eax, dword [esp + 0xec]
mov dword [esp + 0x10], ebp
mov dword [esi + 0xd8], eax
jmp 0x509e9d
mov edi, dword [esp + 0xb0]
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0xac]
mov eax, dword [esp + 0xa0]
push 0
mov ebx, dword [esp + 0x30]
push 0
push edi
push ecx
mov ecx, dword [esp + 0xb4]
push edx
mov edx, dword [esp + 0xa8]
push eax
mov eax, dword [esp + 0x30]
push ecx
push edx
mov ecx, dword [eax + 0x1c]
mov edx, dword [esp + 0xb0]
mov eax, dword [esp + 0xc8]
push 0
push ebx
push ecx
push ebp
push edx
push eax
call dword [esp + 0x5c]
add ebx, 0xa
mov esi, eax
mov dword [esp + 0x2c], ebx
test esi, esi
je 0x509f8a
mov ecx, dword [esp + 0x48]
push edi
mov dword [ecx], esi
lea ecx, [esp + 0x58]
call fcn.004f89a0
push esi
lea ecx, [esp + 0x80]
call fcn.004f89a0
mov eax, dword [esp + 0x1c]
mov esi, dword [esp + 0x30]
dec eax
mov dword [esp + 0x1c], eax
mov ebx, eax
test ebx, ebx
jg 0x509c1b
mov eax, dword [esp + 0x78]
mov esi, dword [esp + 0x70]
neg eax
sbb eax, eax
mov ecx, dword [esp + 0x5c]
and eax, esi
mov ebx, dword [esp + 0x84]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x64]
mov edi, eax
mov edx, dword [esp + 0x3c]
neg edi
sbb edi, edi
mov esi, dword [esp + 0x14]
and edi, ecx
mov ecx, dword [esp + 0x8c]
neg ecx
sbb ecx, ecx
and ecx, ebx
mov ebx, 1
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x44]
neg ecx
sbb ecx, ecx
mov dword [esp + 0x10], ebx
and ecx, edx
shr eax, 2
mov dword [esp + 0x24], ecx
mov dword [esp + 0x1c], eax
push 0
push ebx
mov ecx, esi
call fcn.00506a60
mov ebp, eax
test ebp, ebp
je 0x50a102
push ebx
mov ecx, esi
call fcn.00507290
cmp eax, 1
jne 0x50a022
inc ebx
mov dword [esp + 0x10], ebx
jmp 0x509f39
mov eax, dword [esp + 0x28]
cmp eax, ebp
je 0x509f74
push eax
call dword [0x49c5b8]
cmp ebx, ebp
je 0x509f7f
push ebx
call dword [fcn.0049c648]
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx]
call dword [edx + 8]
jmp 0x509fb1
mov eax, dword [esp + 0x28]
test eax, eax
je 0x509f99
push eax
call dword [0x49c5b8]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x509fa8
push eax
call dword [fcn.0049c648]
mov ecx, dword [esp + 0x20]
mov eax, dword [ecx]
call dword [eax + 8]
mov esi, 0x5978c8
lea ecx, [esp + 0x34]
mov dword [esp + 0x34], esi
call fcn.004f8910
lea ecx, [esp + 0x68]
mov dword [esp + 0x68], esi
call fcn.004f8910
lea ecx, [esp + 0x7c]
mov dword [esp + 0x7c], esi
call fcn.004f8910
lea ecx, [esp + 0x54]
mov dword [esp + 0x54], esi
call fcn.004f8910
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xd4
ret 0x14
mov eax, dword [esp + 0x28]
test eax, eax
je 0x50a008
push eax
call dword [0x49c5b8]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x50a017
push eax
call dword [fcn.0049c648]
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx]
call dword [edx + 8]
jmp 0x509fb1
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
push eax
call fcn.00506ab0
push eax
mov ecx, dword [esp + 0x20]
push ecx
push edi
call fcn.004f91e0
mov edx, dword [esp + 0x2c]
mov ebx, eax
lea esi, [ebp + 0x18]
mov eax, dword [edx + ebx*4]
push esi
mov dword [esp + 0x40], eax
call fcn.004f9150
add esi, eax
push esi
call fcn.004f9150
lea esi, [eax + esi + 0x18]
add esp, 0x14
mov eax, dword [esi]
test eax, eax
je 0x50a07f
mov ecx, dword [esp + 0x1c]
push eax
push ecx
push edi
call fcn.004f91e0
mov edx, dword [esp + 0x2c]
add esp, 0xc
mov eax, dword [edx + eax*4]
jmp 0x50a083
mov eax, dword [esp + 0x18]
test eax, eax
je 0x50a08a
mov eax, dword [eax + 0x1c]
push eax
mov eax, dword [esp + 0x34]
mov ecx, dword [eax + 0x1c]
push ecx
call dword [0x49c67c]
push eax
call fcn.0056cec8
mov edx, dword [esp + 0x48]
cmp dword [edx + ebx*4], 0
je 0x50a0ee
mov eax, dword [esi + 4]
add esi, 4
add esi, 4
test eax, eax
jle 0x50a0ee
cmp dword [esi], 0
je 0x50a0c5
dec eax
add esi, 4
test eax, eax
jg 0x50a0b6
jmp 0x50a0ee
test eax, eax
jle 0x50a0ee
mov ebx, dword [esp + 0x24]
mov ebp, eax
mov eax, dword [esi]
test eax, eax
je 0x50a0e8
push eax
mov eax, dword [esp + 0x20]
push eax
push edi
call fcn.004f91e0
add esp, 0xc
mov byte [eax + ebx], 0
add esi, 4
dec ebp
jne 0x50a0cf
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
inc eax
mov dword [esp + 0x10], eax
mov ebx, eax
jmp 0x509f39
mov ebx, 1
mov dword [esp + 0x10], ebx
push 0
push ebx
mov ecx, esi
call fcn.00506a60
mov edi, eax
test edi, edi
je 0x50a208
push ebx
mov ecx, esi
call fcn.00507290
cmp eax, 1
jne 0x50a12f
inc ebx
jmp 0x50a107
add edi, 0x18
push edi
call fcn.004f9150
add edi, eax
push edi
call fcn.004f9150
mov edx, dword [esp + 0x18]
mov ecx, dword [eax + edi]
mov ebp, dword [eax + edi + 0x18]
add eax, edi
mov eax, edx
add esp, 8
cmp eax, 2
mov dword [esp + 0x2c], ecx
lea ebx, [edx - 1]
jl 0x50a197
push 0
push ebx
mov ecx, esi
call fcn.00506a60
push ebx
mov ecx, esi
mov edi, eax
call fcn.00507290
test eax, eax
jne 0x50a191
add edi, 0x18
push edi
call fcn.004f9150
add edi, eax
push edi
call fcn.004f9150
add edi, eax
add esp, 8
cmp dword [edi + 0x18], ebp
je 0x50a1c1
dec ebx
cmp ebx, 1
jge 0x50a15e
mov eax, dword [esp + 0x2c]
push 0x13
push 0
push 0
mov ecx, dword [eax + 0x1c]
push 0
push 0
push 0
push ecx
call dword [fcn.0049c688]
mov eax, dword [esp + 0x10]
inc eax
mov dword [esp + 0x10], eax
mov ebx, eax
jmp 0x50a10b
cmp ebx, 1
jl 0x50a197
push 0
push ebx
mov ecx, esi
call fcn.00506a60
test eax, eax
je 0x50a1b1
lea edi, [eax + 0x18]
push edi
call fcn.004f9150
add edi, eax
push edi
call fcn.004f9150
add edi, eax
add esp, 8
mov edi, dword [edi]
test edi, edi
je 0x50a1b1
mov ecx, dword [esp + 0x2c]
mov eax, dword [edi + 0x1c]
push 0x13
push 0
mov edx, dword [ecx + 0x1c]
push 0
push 0
push 0
push eax
push edx
jmp 0x50a1ab
xor esi, esi
mov ebx, dword [esp + 0x14]
mov eax, esi
push 0
push eax
mov ecx, ebx
inc esi
call fcn.00506a60
mov edi, eax
test edi, edi
je 0x50a287
lea edx, [esi - 1]
mov ecx, ebx
push edx
call fcn.00507290
cmp eax, 1
je 0x50a20a
lea ebx, [edi + 0x18]
mov edi, ebx
push edi
call fcn.004f9150
add edi, eax
push edi
call fcn.004f9150
mov ecx, dword [edi + eax + 0x1c]
lea eax, [edi + eax + 0x1c]
mov edi, ebx
push edi
lea ebp, [eax + ecx*4 + 4]
call fcn.004f9150
add edi, eax
push edi
call fcn.004f9150
lea edi, [eax + edi + 0x14]
mov eax, dword [ebp]
add esp, 0x10
test eax, eax
jle 0x50a27f
add ebp, 4
push eax
push ebp
call fcn.00514920
add esp, 8
mov dword [edi], eax
jmp 0x50a20a
mov dword [edi], 0
jmp 0x50a20a
mov edx, dword [esp + 0xe8]
mov ebx, dword [edx + 0x18]
dec ebx
js 0x50a2fd
lea esi, [ebx + 1]
xor ebp, ebp
mov ecx, dword [esp + 0x14]
mov eax, ebx
push ebp
dec ebx
push eax
dec esi
call fcn.00506a60
mov edi, eax
cmp edi, ebp
je 0x50a2ff
mov ecx, dword [esp + 0x14]
push esi
call fcn.00507290
test eax, eax
jne 0x50a2f7
add edi, 0x18
push edi
call fcn.004f9150
add edi, eax
push edi
call fcn.004f9150
add edi, eax
add esp, 8
mov edi, dword [edi]
cmp edi, ebp
je 0x50a2f7
mov eax, dword [edi + 0x1c]
push eax
call dword [fcn.0049c678]
test eax, eax
je 0x50a2f7
mov ecx, dword [edi + 0x1c]
push ebp
push ebp
push 0x806f
push ecx
call dword [fcn.0049c684]
cmp ebx, ebp
jge 0x50a299
jmp 0x50a2ff
xor ebp, ebp
mov edx, dword [esp + 0x18]
push ebp
push ebp
push 0x8004
mov eax, dword [edx + 0x1c]
push eax
call dword [fcn.0049c684]
mov edi, 1
mov esi, dword [esp + 0x1c]
cmp esi, edi
jle 0x50a34d
mov ecx, dword [esp + 0x20]
mov ebp, dword [esp + 0x24]
lea ebx, [ecx + 4]
mov dl, byte [edi + ebp]
mov ecx, dword [ebx]
dec dl
neg dl
sbb edx, edx
and edx, 0xfffffff8
add edx, 8
push edx
call fcn.0056f8fe
inc edi
add ebx, 4
cmp edi, esi
jl 0x50a32c
xor ebp, ebp
mov eax, dword [esp + 0x18]
mov eax, dword [eax + 0x1dc]
cmp eax, ebp
je 0x50a362
push eax
call dword [0x49c5b8]
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x28]
push ebp
push ebp
push 0x7da
mov dword [edx + 0x1dc], ecx
call fcn.0050c030
push ebp
mov ecx, dword [esp + 0x18]
call fcn.00506ab0
mov edi, eax
lea eax, [esp + 0xb8]
mov esi, dword [esp + 0x4c]
push ebp
push eax
push 0x7d8
mov dword [esp + 0xc4], esi
mov dword [esp + 0xc8], edi
mov dword [esp + 0xcc], ebp
mov dword [esp + 0xd0], ebp
mov dword [esp + 0xe8], ebp
mov dword [esp + 0xec], ebp
call fcn.0050c030
mov ebx, dword [esp + 0x9c]
push ebx
call dword [fcn.0049c678]
test eax, eax
je 0x50a630
lea ecx, [esp + 0xb8]
push ebp
push ecx
push 0x7d8
mov dword [esp + 0xc4], esi
mov dword [esp + 0xc8], edi
mov dword [esp + 0xcc], 3
mov dword [esp + 0xd0], ebp
mov dword [esp + 0xe8], ebp
mov dword [esp + 0xec], ebp
call fcn.0050c030
push ebx
call dword [fcn.0049c678]
test eax, eax
je 0x50a630
lea edx, [esp + 0xb8]
push ebp
push edx
push 0x7d8
mov dword [esp + 0xc4], esi
mov dword [esp + 0xc8], edi
mov dword [esp + 0xcc], 4
mov dword [esp + 0xd0], ebp
mov dword [esp + 0xe8], ebp
mov dword [esp + 0xec], ebp
call fcn.0050c030
push ebx
call dword [fcn.0049c678]
test eax, eax
je 0x50a630
mov eax, dword [esp + 0x44]
mov edx, dword [esp + 0x3c]
neg eax
sbb eax, eax
and eax, edx
cmp byte [eax], 0
je 0x50a4ad
mov eax, dword [esp + 0xec]
mov ecx, dword [esp + 0xe8]
push eax
push ecx
push esi
mov ecx, 0x5ca5b0
call fcn.00509940
push ebx
call dword [fcn.0049c678]
test eax, eax
je 0x50a580
mov ecx, dword [esp + 0xf4]
mov eax, 1
cmp ecx, eax
jne 0x50a580
mov edx, dword [esp + 0x18]
xor esi, esi
mov dword [edx + 0x1bc], eax
lea ecx, [esp + 0x30]
mov eax, esi
push ecx
mov ecx, dword [esp + 0x54]
push eax
inc esi
call fcn.00507070
test eax, eax
je 0x50a580
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0xe8]
cmp eax, ecx
je 0x50a4dc
push ebp
push ebp
lea ecx, [eax + 0x14]
call fcn.00506a60
mov edi, eax
add edi, 0x18
push edi
call fcn.004f9150
add edi, eax
push edi
call fcn.004f9150
add edi, eax
add esp, 8
mov edi, dword [edi]
cmp edi, ebp
je 0x50a4dc
mov edx, dword [edi + 0x1c]
push edx
call dword [fcn.0049c678]
test eax, eax
je 0x50a4dc
mov eax, dword [edi + 0x1c]
push eax
call dword [fcn.0049c66c]
push eax
call fcn.0056cec8
test eax, eax
jne 0x50a4dc
mov ecx, dword [esp + 0x18]
mov edx, dword [edi + 0x1c]
push edx
lea ebx, [ecx + 0x1c0]
mov ecx, ebx
call fcn.004f89a0
mov ecx, edi
call fcn.0056f925
push eax
mov ecx, ebx
call fcn.004f89a0
push ebp
mov ecx, edi
call fcn.0056f940
jmp 0x50a4dc
call dword [fcn.0049c668]
mov esi, eax
mov eax, dword [esp + 0xe8]
mov dword [esp + 0x50], esi
mov ebx, dword [eax + 0x18]
dec ebx
js 0x50a602
lea esi, [ebx + 1]
mov ecx, dword [esp + 0x14]
mov eax, ebx
push ebp
dec ebx
push eax
dec esi
call fcn.00506a60
mov edi, eax
cmp edi, ebp
je 0x50a5fe
mov ecx, dword [esp + 0x14]
push esi
call fcn.00507290
test eax, eax
jne 0x50a5fa
add edi, 0x18
push edi
call fcn.004f9150
add edi, eax
push edi
call fcn.004f9150
add edi, eax
add esp, 8
mov edi, dword [edi]
cmp edi, ebp
je 0x50a5fa
mov ecx, dword [edi + 0x1c]
push ecx
call dword [fcn.0049c678]
test eax, eax
je 0x50a5fa
mov edx, dword [edi + 0x1c]
push ebp
push ebp
push 0x8076
push edx
call dword [fcn.0049c684]
cmp ebx, ebp
jge 0x50a59c
mov esi, dword [esp + 0x50]
cmp esi, ebp
je 0x50a622
push esi
call dword [fcn.0049c678]
test eax, eax
je 0x50a622
call dword [fcn.0049c668]
cmp eax, esi
je 0x50a622
push esi
call dword [fcn.0049c5ac]
mov eax, dword [esp + 0x18]
mov dword [eax + 0x1b8], 1
mov esi, 0x5978c8
lea ecx, [esp + 0x34]
mov dword [esp + 0x34], esi
call fcn.004f8910
lea ecx, [esp + 0x68]
mov dword [esp + 0x68], esi
call fcn.004f8910
lea ecx, [esp + 0x7c]
mov dword [esp + 0x7c], esi
call fcn.004f8910
lea ecx, [esp + 0x54]
mov dword [esp + 0x54], esi
call fcn.004f8910
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xd4
ret 0x14