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

Disassembly:
push 0xffffffffffffffff
push 0x520c8e
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x164
push ebx
push ebp
mov ebx, ecx
push esi
push edi
mov ecx, 0x40
xor eax, eax
lea edi, [ebx + 4]
xor ebp, ebp
rep stosd dword es:[edi], eax
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x20], ebp
lea eax, [esp + 0x48]
mov dword [esp + 0x17c], ebp
push eax
call fcn.00506780
add esp, 4
mov eax, dword [esp + 0x50]
mov byte [esp + 0x17c], 1
cmp eax, ebp
je 0x509e17
lea edx, [esp + 0x48]
lea ecx, [esp + 0x14]
call fcn.0050a0f0
mov ecx, dword [eax]
add eax, 4
mov dword [esp + 0x1c], ecx
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0x180], 2
call fcn.004f9190
mov ecx, dword [esp + 0x18]
mov byte [esp + 0x17c], 1
cmp ecx, ebp
je 0x509d2c
call fcn.00496d10
cmp dword [esp + 0x1c], ebp
jne 0x509e21
mov dl, byte [esp + 0x12]
push ebp
lea ecx, [esp + 0x2c]
mov byte [esp + 0x2c], dl
call fcn.004f8a23
mov edi, 0x5e6130
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push 0x5e6130
lea ecx, [esp + 0x30]
call fcn.004f8a5f
lea eax, [esp + 0x48]
lea ecx, [esp + 0x28]
push eax
lea edx, [esp + 0x3c]
push ecx
push edx
mov byte [esp + 0x188], 3
call fcn.005083d0
add esp, 0xc
mov esi, eax
lea eax, [esp + 0x14]
lea ecx, [esp + 0x58]
push eax
mov byte [esp + 0x180], 4
mov dword [esp + 0x18], 0x63f984
call fcn.004ec06f
push esi
lea ecx, [esp + 0x68]
mov byte [esp + 0x180], 5
call fcn.004fa800
mov esi, 0x5b8e24
mov dword [esp + 0x58], esi
push 1
lea ecx, [esp + 0x3c]
mov byte [esp + 0x180], 7
call fcn.004f8a23
lea ecx, [esp + 0x58]
call fcn.00509250
mov dword [esp + 0x58], esi
push 1
lea ecx, [esp + 0x68]
mov byte [esp + 0x180], 8
call fcn.004f8a23
lea ecx, [esp + 0x58]
mov byte [esp + 0x17c], 3
call fcn.004ec0f6
push 1
lea ecx, [esp + 0x2c]
mov byte [esp + 0x180], 1
call fcn.004f8a23
cmp dword [esp + 0x1c], ebp
je 0x509f2e
mov byte [esp + 0x11], 1
mov dword [esp + 0x14], 1
mov cl, byte [esp + 0x11]
call fcn.00509850
mov cl, byte [esp + 0x12]
push 0
mov byte [esp + 0x3c], cl
lea ecx, [esp + 0x3c]
mov esi, eax
call fcn.004f8a23
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
lea ecx, [esp + 0x3c]
push ebp
call fcn.004f8afb
test al, al
je 0x509e88
mov edi, dword [esp + 0x3c]
mov ecx, ebp
mov edx, ecx
push ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x3c]
call fcn.004f9200
mov ecx, dword [esp + 0x14]
mov edx, dword [ebx]
lea eax, [esp + 0x38]
mov byte [esp + 0x17c], 9
push eax
push ecx
push edx
lea edx, [esp + 0x28]
lea ecx, [esp + 0x34]
call fcn.0050a1d0
push 1
lea ecx, [esp + 0x3c]
mov byte [esp + 0x180], 0xb
call fcn.004f8a23
mov eax, dword [esp + 0x30]
xor esi, esi
test eax, eax
jbe 0x509efe
cmp eax, esi
jb 0x509ee4
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x509ee4
lea ecx, [esp + 0x28]
call fcn.004f9061
mov eax, dword [esp + 0x2c]
add eax, esi
jmp 0x509ee9
mov eax, 0x5b8dec
mov dl, byte [esp + 0x11]
xor ecx, ecx
mov cl, byte [eax]
inc esi
mov byte [ecx + ebx + 4], dl
mov eax, dword [esp + 0x30]
cmp eax, esi
ja 0x509ecb
push 1
lea ecx, [esp + 0x2c]
mov byte [esp + 0x180], 1
call fcn.004f8a23
mov al, byte [esp + 0x11]
mov edx, dword [esp + 0x14]
inc al
inc edx
cmp al, 0x39
mov byte [esp + 0x11], al
mov dword [esp + 0x14], edx
jb 0x509e2e
jmp 0x509f65
mov byte [esp + 0x11], 1
mov cl, byte [esp + 0x11]
call fcn.00509850
test eax, eax
je 0x509f57
mov cl, byte [eax]
test cl, cl
je 0x509f57
mov dl, byte [esp + 0x11]
and ecx, 0xff
inc eax
mov byte [ecx + ebx + 4], dl
jne 0x509f40
mov al, byte [esp + 0x11]
inc al
cmp al, 0x39
mov byte [esp + 0x11], al
jb 0x509f33
mov edi, dword [0x5211f0]
mov al, 0x41
mov byte [esp + 0x11], al
lea esi, [ebx + 0x45]
cmp byte [esi], 0
jne 0x509fc9
lea ecx, [esp + 0x26]
lea edx, [esp + 0x13]
push ecx
mov byte [esp + 0x17], al
mov eax, dword [ebx]
push 1
push edx
push 1
push eax
call edi
test eax, eax
je 0x509fa0
test byte [esp + 0x26], 2
je 0x509fa0
mov byte [esi], 0x16
jmp 0x509fc9
mov al, byte [esp + 0x11]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x16]
mov byte [esp + 0x16], al
mov eax, dword [ebx]
push 1
push edx
push 1
push eax
call edi
test eax, eax
je 0x509fc9
test byte [esp + 0x14], 1
je 0x509fc9
mov byte [esi], 0x17
mov al, byte [esp + 0x11]
mov cl, al
inc al
inc esi
cmp cl, 0xff
mov byte [esp + 0x11], al
jne 0x509f74
xor ebp, ebp
xor eax, eax
mov byte [esp + eax + 0x74], al
inc eax
cmp eax, 0x100
jl 0x509fdf
mov eax, dword [ebx]
lea esi, [ebx + 0x104]
push 0x100
push esi
lea edx, [esp + 0x7c]
push 0x100
push edx
push 0x100
push eax
call dword [fcn.00521290]
cmp eax, 0x100
jge 0x50a021
mov byte [esi + eax], al
inc eax
cmp eax, 0x100
jl 0x50a016
mov eax, dword [ebx]
lea ecx, [ebx + 0x204]
push ecx
lea edx, [esp + 0x78]
push 0x100
push edx
push 1
push eax
call edi
mov eax, dword [esp + 0x4c]
cmp eax, ebp
je 0x50a05e
lea ecx, [eax - 1]
mov al, byte [eax - 1]
test al, al
je 0x50a055
cmp al, 0xff
je 0x50a055
dec al
mov byte [ecx], al
jmp 0x50a05e
push ecx
call fcn.0050d7be
add esp, 4
mov esi, dword [esp + 0x20]
mov dword [esp + 0x4c], ebp
cmp esi, ebp
mov dword [esp + 0x50], ebp
mov dword [esp + 0x54], ebp
mov dword [esp + 0x17c], 0xffffffff
je 0x50a0ad
lea ecx, [esi + 4]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
mov eax, edx
test eax, eax
jne 0x50a0ad
mov edx, dword [esi]
mov ecx, esi
call dword [edx + 4]
lea eax, [esi + 8]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
mov edx, ecx
test edx, edx
jne 0x50a0ad
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 8]
mov ecx, dword [esp + 0x174]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x170
ret