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

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
lea eax, [esp - 0x44]
cmp eax, dword [ecx + 8]
jbe 0x509f8a
sub esp, 0xc4
mov eax, dword [esp + 0x108]
test eax, eax
je 0x509f6e
mov ecx, dword [eax]
mov dword [esp + 0x4c], ecx
lea eax, [0x5beac0]
mov dword [esp], eax
mov dword [esp + 4], 0
mov dword [esp + 8], ecx
call fcn.00444f30
mov eax, dword [esp + 0xc]
mov dword [esp + 0x88], eax
mov dword [esp + 0x8c], 0
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x90], eax
lea edi, [esp + 0x94]
xor eax, eax
call fcn.0045e1f4
lea eax, [0x5c0100]
mov dword [esp], eax
mov ecx, dword [esp + 0x108]
mov dword [esp + 4], ecx
lea edx, [esp + 0x94]
mov dword [esp + 8], edx
call fcn.0040d650
jmp 0x5094f3
lea eax, [esp + 0x94]
mov dword [esp], eax
call fcn.0040d8c0
mov ecx, dword [esp + 0x94]
test ecx, ecx
je 0x5096cb
mov edx, dword [ecx + 4]
mov dword [esp + 0x40], edx
mov eax, dword [ecx]
mov dword [esp + 0x60], eax
mov ecx, dword [0x74d960]
lea ebx, [0x74d960]
cmp dword [ebx + 4], edx
je 0x50969b
mov ecx, dword [0x74d978]
lea ebp, [0x74d978]
cmp dword [ebp + 4], edx
je 0x509665
mov ecx, dword [0x74d968]
lea esi, [0x74d968]
cmp dword [esi + 4], edx
je 0x509629
mov ecx, dword [0x74d948]
cmp dword [0x74d94c], edx
je 0x5095ed
mov ecx, dword [esp + 0x8c]
lea esi, [ecx + 1]
mov ebp, dword [esp + 0x88]
mov ebx, dword [esp + 0x90]
cmp ebx, esi
jb 0x5095ab
lea ebx, [ecx + 1]
mov dword [esp + 0x8c], ebx
lea ebx, [ebp + ecx*8 + 4]
mov dword [ebx], edx
mov edx, dword [0x770e60]
lea edi, [ebp + ecx*8]
test edx, edx
jne 0x5095a1
mov dword [edi], eax
jmp 0x5094e4
call fcn.0045df70
jmp 0x5094e4
lea eax, [0x5beac0]
mov dword [esp], eax
mov dword [esp + 4], ebp
mov dword [esp + 8], ecx
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], esi
call fcn.004450a0
mov ebp, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x90], eax
mov dword [esp + 0x88], ebp
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x40]
jmp 0x50957c
mov dword [esp], eax
mov dword [esp + 4], ecx
mov dword [esp + 8], edx
call fcn.00402890
movzx eax, byte [esp + 0xc]
test al, al
jne 0x5094e4
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x40]
lea ebx, [0x74d960]
lea ebp, [0x74d978]
lea esi, [0x74d968]
jmp 0x509560
mov dword [esp], eax
mov dword [esp + 4], ecx
mov dword [esp + 8], edx
call fcn.00402890
movzx eax, byte [esp + 0xc]
test al, al
jne 0x5094e4
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x40]
lea ebx, [0x74d960]
lea ebp, [0x74d978]
lea esi, [0x74d968]
jmp 0x50954e
mov dword [esp], eax
mov dword [esp + 4], ecx
mov dword [esp + 8], edx
call fcn.00402890
movzx eax, byte [esp + 0xc]
test al, al
jne 0x5094e4
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x40]
lea ebx, [0x74d960]
lea ebp, [0x74d978]
jmp 0x509539
mov dword [esp], eax
mov dword [esp + 4], ecx
mov dword [esp + 8], edx
call fcn.00402890
movzx eax, byte [esp + 0xc]
test al, al
jne 0x5094e4
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x40]
lea ebx, [0x74d960]
jmp 0x509524
mov eax, dword [esp + 0x88]
mov ecx, dword [esp + 0x8c]
mov edx, dword [esp + 0x90]
mov dword [esp], eax
mov dword [esp + 4], ecx
mov dword [esp + 8], edx
call fcn.004091c0
mov eax, dword [esp + 0xc]
lea ecx, [0x63b35c]
mov dword [esp], ecx
mov dword [esp + 4], eax
call fcn.0048e400
mov eax, dword [esp + 0x8c]
test eax, eax
jg 0x509f55
mov eax, dword [esp + 0x8c]
mov dword [esp + 0x80], 0
mov dword [esp + 0x84], 0
lea ecx, [0x50c730]
mov dword [esp + 0x80], ecx
lea ecx, [esp + 0x88]
mov dword [esp + 0x84], ecx
mov dword [esp], eax
lea eax, [esp + 0x80]
mov dword [esp + 4], eax
call fcn.0048d890
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0x8c]
mov edx, dword [esp + 0x88]
cmp ecx, eax
jle 0x509f4e
jbe 0x509f84
lea edx, [edx + eax*8]
mov ebx, dword [edx + 4]
mov edx, dword [edx]
mov ebp, dword [0x74d950]
cmp dword [0x74d954], ebx
je 0x509f2c
xor ecx, ecx
test cl, cl
je 0x509995
mov edx, dword [esp + 0x88]
mov ecx, dword [esp + 0x8c]
cmp eax, ecx
jae 0x509f7f
lea ecx, [edx + eax*8 + 4]
mov dword [ecx], 0
lea edi, [edx + eax*8]
mov ecx, dword [0x770e60]
test ecx, ecx
jne 0x509f20
mov dword [edi], 0
lea eax, [0x5ba640]
mov dword [esp], eax
call fcn.0040b8e0
mov edi, dword [esp + 4]
mov eax, dword [0x74d950]
mov ecx, dword [0x74d954]
mov dword [edi + 4], ecx
mov ecx, dword [0x770e60]
test ecx, ecx
jne 0x509f16
mov dword [edi], eax
mov edx, dword [esp + 0x8c]
lea ecx, [edx + 1]
mov dword [esp + 0x2c], ecx
cmp ecx, 1
ja 0x509ed4
mov eax, 1
jb 0x509f75
mov dword [esp + 0x4c], eax
mov dword [esp + 0x74], edi
mov ecx, dword [esp + 0x88]
mov ebx, dword [esp + 0x8c]
lea ebp, [0x5beac0]
mov dword [esp], ebp
lea esi, [eax - 1]
xchg esi, ebx
neg ebx
xchg esi, ebx
sar esi, 0x1f
and esi, 8
add esi, edi
mov dword [esp + 4], esi
mov dword [esp + 8], edx
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], ebx
call fcn.004107d0
mov eax, dword [esp + 0x74]
mov dword [esp + 0x88], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x8c], eax
mov ecx, dword [esp + 0x4c]
mov dword [esp + 0x90], ecx
lea ecx, [0x5beac0]
mov dword [esp], ecx
mov dword [esp + 4], 0
mov dword [esp + 8], eax
call fcn.00444f30
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x88]
mov dword [esp + 0x74], ecx
mov edx, dword [esp + 0x8c]
mov dword [esp + 0x4c], edx
mov ebx, dword [esp + 0x2c]
xor ebp, ebp
xor esi, esi
jmp 0x5098d9
inc ebp
mov edx, dword [esp + 0x4c]
mov ecx, edi
cmp ebp, edx
jge 0x509980
mov edi, ecx
lea ecx, [ecx + ebp*8]
mov edx, dword [ecx + 4]
mov ecx, dword [ecx]
test edx, edx
je 0x5098d2
mov dword [esp + 0x48], ebp
lea ebp, [esi + 1]
cmp ebp, ebx
ja 0x509932
mov dword [esp + 0x2c], ebx
lea ebx, [eax + esi*8 + 4]
mov dword [ebx], edx
mov edx, dword [0x770e60]
lea ebx, [eax + esi*8]
test edx, edx
jne 0x50991f
mov dword [ebx], ecx
mov ebx, dword [esp + 0x2c]
mov esi, ebp
mov ebp, dword [esp + 0x48]
jmp 0x5098d2
mov edx, edi
mov edi, ebx
mov esi, eax
mov eax, ecx
call fcn.0045df70
mov eax, esi
mov edi, edx
jmp 0x509913
mov dword [esp + 0x28], esi
mov dword [esp + 0x64], ecx
mov dword [esp + 0x3c], edx
lea ecx, [0x5beac0]
mov dword [esp], ecx
mov dword [esp + 4], eax
mov dword [esp + 8], esi
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], ebp
call fcn.004450a0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0x1c]
lea ebp, [ecx + 1]
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x3c]
mov esi, dword [esp + 0x28]
mov edi, dword [esp + 0x74]
jmp 0x5098fa
mov dword [esp + 0x88], eax
mov dword [esp + 0x8c], esi
mov dword [esp + 0x90], ebx
mov eax, dword [esp + 0x88]
mov dword [esp + 0x74], eax
mov ecx, dword [esp + 0x8c]
mov dword [esp + 0x4c], ecx
xor edx, edx
jmp 0x5099ba
lea edx, [ecx + 1]
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x4c]
cmp edx, ecx
jge 0x509ecd
mov dword [esp + 0x34], edx
lea ebx, [eax + edx*8]
mov ebp, dword [ebx + 4]
mov dword [esp + 0x38], ebp
mov ebx, dword [ebx]
mov dword [esp + 0x5c], ebx
mov esi, dword [0x74d950]
lea edi, [0x74d950]
cmp dword [edi + 4], ebp
je 0x509e3a
mov esi, dword [esp + 0xf8]
test esi, esi
je 0x509e07
mov edi, dword [esp + 0xfc]
test edi, edi
je 0x509dfc
mov dword [esp + 0x58], esi
mov dword [esp + 0x54], edi
mov dword [esp], ebx
mov dword [esp + 4], ebp
call fcn.00409140
mov edx, dword [esp + 0x58]
mov eax, dword [edx]
mov ecx, dword [esp + 8]
lea ebx, [0x5beac0]
mov dword [esp], ebx
mov dword [esp + 4], ecx
call eax
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x10c]
mov dword [esp], edx
mov dword [esp + 4], eax
mov dword [esp + 8], ecx
call fcn.004ca7d0
lea eax, [0x5c0100]
mov dword [esp], eax
mov ecx, dword [esp + 0x108]
mov dword [esp + 4], ecx
mov edx, dword [esp + 0x5c]
mov dword [esp + 8], edx
mov edx, dword [esp + 0x38]
mov dword [esp + 0xc], edx
call fcn.0040f4f0
mov eax, dword [esp + 0x10]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
test ecx, ecx
je 0x509b22
mov edx, dword [ecx + 8]
cmp edx, 0x2bd6b23c
jne 0x509c84
lea edx, [0x5cc4a0]
cmp edx, ecx
jne 0x509b22
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp], ecx
mov dword [esp + 4], eax
call fcn.00409140
mov edx, dword [esp + 0x54]
mov eax, dword [edx]
mov ecx, dword [esp + 8]
lea ebx, [0x5cc4a0]
mov dword [esp], ebx
mov dword [esp + 4], ecx
call eax
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x10c]
mov dword [esp], edx
mov dword [esp + 4], eax
mov dword [esp + 8], ecx
call fcn.004ca7d0
mov eax, dword [esp + 0x8c]
dec eax
mov ecx, dword [esp + 0x34]
cmp ecx, eax
jge 0x5099af
mov eax, dword [esp + 0x10c]
mov dword [esp], eax
mov byte [esp + 4], 0x20
call fcn.004cac50
mov ecx, dword [esp + 0x34]
jmp 0x5099af
mov dword [esp], ecx
mov dword [esp + 4], eax
call fcn.004d3160
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov ebx, dword [esp + 8]
mov ebp, dword [esp + 0xc]
mov esi, dword [esp + 0x10]
test eax, eax
je 0x509bef
mov dword [esp + 0x70], ecx
mov dword [esp + 0x6c], edx
movzx eax, byte [esp + 0xd0]
lea ecx, [0x5beac0]
mov dword [esp], ecx
lea edx, [0x637bf0]
mov dword [esp + 4], edx
mov dword [esp + 8], 0x1f
mov byte [esp + 0xc], al
call fcn.0050a2e0
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
mov edx, dword [esp + 0x70]
test edx, edx
je 0x509ba5
mov edx, dword [edx + 4]
mov dword [esp + 0x78], edx
mov edx, dword [esp + 0x6c]
mov dword [esp + 0x7c], edx
lea edx, [0x639e8c]
mov dword [esp], edx
mov ebx, dword [esp + 0x10c]
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov dword [esp + 0xc], ecx
lea eax, [esp + 0x78]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], 1
mov dword [esp + 0x18], 1
call fcn.004c08e0
jmp 0x509af1
mov dword [esp], ebx
mov dword [esp + 4], ebp
mov dword [esp + 8], esi
call fcn.004091c0
mov edx, dword [esp + 0x54]
mov eax, dword [edx]
mov ecx, dword [esp + 0xc]
lea ebx, [0x5b7ee0]
mov dword [esp], ebx
mov dword [esp + 4], ecx
call eax
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0xc]
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
mov dword [esp], eax
mov dword [esp + 4], ecx
call fcn.00409140
mov eax, dword [esp + 8]
lea ecx, [0x5beac0]
mov dword [esp + 0x78], ecx
mov dword [esp + 0x7c], eax
lea eax, [0x639e8c]
mov dword [esp], eax
mov edx, dword [esp + 0x10c]
mov dword [esp + 4], edx
lea ebx, [esp + 0x78]
mov dword [esp + 8], ebx
mov dword [esp + 0xc], 1
mov dword [esp + 0x10], 1
call fcn.004c0a60
jmp 0x509af1
cmp edx, 0xe0ff5cb4
jne 0x509df4
lea edx, [0x5beac0]
cmp edx, ecx
jne 0x509de9
mov ecx, dword [eax + 4]
mov dword [esp + 0x30], ecx
mov eax, dword [eax]
mov dword [esp + 0x50], eax
mov dword [esp], eax
mov dword [esp + 4], ecx
call fcn.0050a220
movzx eax, byte [esp + 8]
test al, al
je 0x509d98
nop
lea eax, [0x5bec80]
mov dword [esp], eax
mov dword [esp + 4], 0
mov ecx, dword [esp + 0x30]
lea edx, [ecx + ecx*2]
mov ebx, edx
shr edx, 0x1f
add edx, ebx
sar edx, 1
mov dword [esp + 0x48], edx
mov dword [esp + 8], edx
call fcn.00444f30
mov eax, dword [esp + 0xc]
mov dword [esp], eax
mov dword [esp + 4], 0
mov eax, dword [esp + 0x48]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x50]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x10], eax
mov word [esp + 0x14], 0x22
mov byte [esp + 0x16], 0
call fcn.00474ab0
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov dword [esp], 0
mov dword [esp + 4], eax
mov dword [esp + 8], ecx
call fcn.00448580
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
mov dword [esp], eax
mov dword [esp + 4], ecx
call fcn.00409140
mov edx, dword [esp + 0x54]
mov eax, dword [edx]
mov ecx, dword [esp + 8]
lea ebx, [0x5beac0]
mov dword [esp], ebx
mov dword [esp + 4], ecx
call eax
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x10c]
mov dword [esp], edx
mov dword [esp + 4], eax
mov dword [esp + 8], ecx
call fcn.004ca7d0
jmp 0x509af1
mov eax, dword [esp + 0x50]
mov dword [esp], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 4], eax
call fcn.00409140
mov edx, dword [esp + 0x54]
mov eax, dword [edx]
mov ecx, dword [esp + 8]
lea ebx, [0x5beac0]
mov dword [esp], ebx
mov dword [esp + 4], ecx
call eax
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x10c]
mov dword [esp], edx
mov dword [esp + 4], eax
mov dword [esp + 8], ecx
call fcn.004ca7d0
jmp 0x509af1
lea edx, [0x5cc4a0]
jmp 0x509b22
lea edx, [0x5beac0]
jmp 0x509de9
lea edi, [0x601d24]
jmp 0x509a09
movzx eax, byte [esp + 0xd0]
mov byte [esp], al
call fcn.0050a5e0
mov esi, dword [esp + 4]
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0x34]
mov ebx, dword [esp + 0x5c]
mov ebp, dword [esp + 0x38]
lea edi, [0x74d950]
jmp 0x5099fa
mov dword [esp], ebx
mov dword [esp + 4], esi
mov dword [esp + 8], ebp
call fcn.00402890
movzx eax, byte [esp + 0xc]
test al, al
je 0x509eae
mov eax, dword [esp + 0x100]
test eax, eax
je 0x509e98
mov ecx, dword [esp + 0x104]
test ecx, ecx
je 0x509e7a
mov ebx, dword [esp + 0x5c]
mov ebp, dword [esp + 0x38]
mov esi, eax
mov edi, ecx
jmp 0x509a09
mov dword [esp + 0x68], eax
movzx eax, byte [esp + 0xd0]
mov byte [esp], al
call fcn.0050a700
mov ecx, dword [esp + 4]
mov eax, dword [esp + 0x68]
jmp 0x509e69
movzx eax, byte [esp + 0xd0]
mov byte [esp], al
call fcn.0050a6b0
mov eax, dword [esp + 4]
jmp 0x509e5e
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0x34]
mov ebx, dword [esp + 0x5c]
mov ebp, dword [esp + 0x38]
lea edi, [0x74d950]
jmp 0x5099eb
add esp, 0xc4
ret
mov dword [esp + 0x4c], edx
lea eax, [0x5beac0]
mov dword [esp], eax
mov dword [esp + 4], edi
mov dword [esp + 8], 1
mov dword [esp + 0xc], 1
mov dword [esp + 0x10], ecx
call fcn.004450a0
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x2c]
cmp ecx, 1
mov edx, dword [esp + 0x4c]
jmp 0x509828
call fcn.0045df70
jmp 0x50980c
xor eax, eax
call fcn.0045df70
jmp 0x5097db
mov dword [esp + 0x44], eax
mov dword [esp], edx
mov dword [esp + 4], ebp
mov dword [esp + 8], ebx
call fcn.00402890
movzx ecx, byte [esp + 0xc]
mov eax, dword [esp + 0x44]
jmp 0x50979c
xor ecx, ecx
jmp 0x50979c
mov eax, dword [esp + 0x10c]
mov dword [esp], eax
mov byte [esp + 4], 0x20
call fcn.004cac50
jmp 0x509715
xor ecx, ecx
jmp 0x509471
mov eax, 1
call fcn.0045e050
call fcn.0045dff0
call fcn.0045dff0
nop
call fcn.0045ca10
jmp fcn.00509440