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

Disassembly:
sub esp, 0x30
push ebx
mov ebx, dword [esp + 0x38]
push ebp
mov ebp, dword [esp + 0x40]
push esi
push edi
xor edi, edi
mov esi, eax
mov eax, dword [ebx]
mov dword [esp + 0x28], eax
mov dword [esp + 0x3c], edi
mov dword [esp + 0x38], edi
mov dword [esp + 0x20], edi
cmp esi, edi
je 0x509164
cmp dword [ebx + 0x214], edi
jne 0x509164
cmp dword [esi + 0x44], edi
jne 0x509164
push ebp
mov eax, ebx
call fcn.004c8c70
add esp, 4
test eax, eax
jne 0x509164
test byte [ebp + 0x2a], 0x10
jne 0x509164
cmp dword [esp + 0x4c], 0xa
jne 0x508f81
cmp word [ebp + 0x20], di
jl 0x508f79
movzx eax, byte [ebp + 0x2b]
mov dword [esp + 0x4c], eax
cmp eax, 0xa
jne 0x508f81
mov dword [esp + 0x4c], 2
mov eax, dword [esi + 0x20]
cmp dword [eax], 1
jne 0x509164
cmp dword [eax + 0x1c], edi
jne 0x509164
cmp dword [esi + 0x24], edi
jne 0x509164
cmp dword [esi + 0x30], edi
jne 0x509164
cmp dword [esi + 0x28], edi
jne 0x509164
cmp dword [esi + 0x3c], edi
jne 0x509164
cmp dword [esi + 0x34], edi
jne 0x509164
test byte [esi + 6], 1
jne 0x509164
mov esi, dword [esi]
cmp dword [esi], 1
jne 0x509164
mov ecx, dword [esi + 4]
mov edx, dword [ecx]
cmp byte [edx], 0x9e
jne 0x509164
add eax, 8
push eax
push edi
mov eax, ebx
call fcn.004f1a10
mov esi, eax
add esp, 8
mov dword [esp + 0x1c], esi
cmp esi, edi
je 0x509164
cmp esi, ebp
je 0x509164
mov al, byte [esi + 0x2a]
movzx edx, byte [ebp + 0x2a]
movzx ecx, al
shr ecx, 5
shr edx, 5
not ecx
not edx
xor ecx, edx
test cl, 1
jne 0x509164
test al, 0x10
jne 0x509164
cmp dword [esi + 0xc], edi
jne 0x509164
movzx eax, word [ebp + 0x22]
cmp ax, word [esi + 0x22]
jne 0x509164
mov cx, word [ebp + 0x20]
cmp cx, word [esi + 0x20]
jne 0x509164
cwde
cmp eax, edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x34], eax
jle 0x509130
mov ebp, dword [ebp + 4]
mov esi, dword [esi + 4]
add ebp, 8
add esi, 0x10
mov dword [esp + 0x2c], esi
jmp 0x509080
mov dl, byte [ebp + 0xd]
cmp dl, byte [esi + 5]
jne 0x509164
mov eax, dword [esi]
mov ecx, dword [ebp + 8]
push eax
push ecx
call fcn.004bf990
add esp, 8
test eax, eax
jne 0x509164
cmp byte [ebp + 0xc], al
je 0x5090b1
cmp byte [esi + 4], al
je 0x509164
test edi, edi
jle 0x509109
mov edx, dword [esp + 0x2c]
mov esi, dword [edx - 8]
mov edi, dword [ebp]
xor eax, eax
test esi, esi
sete al
xor ecx, ecx
test edi, edi
sete cl
cmp ecx, eax
jne 0x509164
test edi, edi
je 0x509109
mov eax, edi
jmp 0x5090e0
mov cl, byte [eax]
cmp cl, byte [esi]
jne 0x509100
test cl, cl
je 0x5090fc
mov cl, byte [eax + 1]
cmp cl, byte [esi + 1]
jne 0x509100
add eax, 2
add esi, 2
test cl, cl
jne 0x5090e0
xor eax, eax
jmp 0x509105
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x509164
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x2c]
inc edi
add esi, 0x18
add ebp, 0x18
cmp edi, dword [esp + 0x34]
mov dword [esp + 0x18], edi
mov dword [esp + 0x2c], esi
jl 0x509080
mov ebp, dword [esp + 0x48]
xor edi, edi
mov esi, dword [ebp + 8]
cmp esi, edi
je 0x509179
cmp byte [esi + 0x36], 0
je 0x509145
mov dword [esp + 0x20], 1
mov edx, dword [esp + 0x1c]
mov edi, dword [edx + 8]
test edi, edi
je 0x509164
push esi
call fcn.004d3360
add esp, 4
test eax, eax
jne 0x50916e
mov edi, dword [edi + 0x14]
test edi, edi
jne 0x509150
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30
ret
test edi, edi
je 0x509164
mov esi, dword [esi + 0x14]
test esi, esi
jne 0x509137
mov eax, dword [esp + 0x48]
mov eax, dword [eax + 0x18]
test eax, eax
je 0x50919a
mov ecx, dword [esp + 0x1c]
mov edi, dword [ecx + 0x18]
push 0xffffffffffffffff
push eax
call fcn.004c7000
add esp, 8
test eax, eax
jne 0x509164
mov edx, dword [esp + 0x28]
mov eax, dword [edx + 0x18]
test eax, 0x80000
je 0x5091b2
mov ecx, dword [esp + 0x48]
cmp dword [ecx + 0x10], 0
jne 0x509164
test al, al
js 0x509164
mov edx, dword [esp + 0x1c]
mov esi, dword [edx + 0x40]
mov ecx, dword [esp + 0x28]
call fcn.004c86c0
mov esi, eax
mov edi, ebx
mov dword [esp + 0x30], esi
call fcn.004d8f30
mov ecx, esi
mov edx, ebx
mov ebp, eax
call fcn.00508af0
mov esi, dword [ebx + 0x44]
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x50]
lea edi, [esi + 1]
push ecx
lea eax, [edi + 1]
push edx
mov ecx, ebx
mov dword [esp + 0x1c], edi
mov dword [ebx + 0x44], eax
call fcn.004d32c0
mov dword [esp + 0x20], eax
mov eax, ebx
call fcn.004c7150
mov dword [esp + 0x34], eax
mov eax, ebx
call fcn.004c7150
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x58]
push 0x38
push eax
mov eax, dword [esp + 0x58]
push edi
push ebx
call fcn.004f9730
mov ecx, dword [esp + 0x40]
add esp, 0x18
test dword [ecx + 0x18], 0x8000000
jne 0x509290
mov eax, dword [esp + 0x48]
cmp word [eax + 0x20], 0
jge 0x50924c
cmp dword [eax + 8], 0
jne 0x509261
cmp dword [esp + 0x20], 0
jne 0x509261
mov eax, dword [esp + 0x4c]
cmp eax, 2
je 0x509290
cmp eax, 1
je 0x509290
push 0
push 0
mov edx, edi
push edx
push 0x6e
push ebp
call fcn.004cf760
push 0
push 0
push 0
push 0xe
push ebp
mov edi, eax
call fcn.004cf760
mov dword [esp + 0x64], eax
add esp, 0x28
mov ecx, edi
mov eax, ebp
call fcn.004cf9b0
mov edi, dword [esp + 0x1c]
test byte [edi + 0x2a], 0x20
jne 0x50941f
mov eax, dword [esp + 0x30]
push 0x37
push eax
push esi
push ebx
mov eax, edi
call fcn.004f9730
push 0
push 0
push esi
push 0x6e
push ebp
call fcn.004cf760
mov ecx, dword [esp + 0x6c]
add esp, 0x24
cmp word [ecx + 0x20], 0
mov dword [esp + 0x38], eax
push 0
jl 0x509323
mov edi, dword [esp + 0x28]
push edi
push esi
push 0x69
push ebp
call fcn.004cf760
mov edx, dword [esp + 0x28]
push edi
push 0
push edx
push 0x4a
push ebp
mov dword [esp + 0x48], eax
call fcn.004cf760
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x74]
push eax
mov eax, dword [esp + 0x74]
mov edi, ebx
call fcn.004e4e10
mov ecx, dword [esp + 0x60]
mov eax, ebp
call fcn.004cf9b0
mov ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x44]
push ebx
call fcn.004d3340
add esp, 0x30
jmp 0x50934c
cmp dword [ecx + 8], 0
jne 0x509337
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x18]
push edx
push eax
push 0x54
jmp 0x50933f
mov ecx, dword [esp + 0x28]
push ecx
push esi
push 0x69
push ebp
call fcn.004cf760
mov dword [esp + 0x34], eax
add esp, 0x14
mov edi, dword [esp + 0x2c]
push 0
push edi
push esi
push 0x68
push ebp
call fcn.004cf760
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x28]
push edx
push edi
push eax
push 0x5f
push ebp
call fcn.004cf760
add esp, 0x28
mov dl, 0xb
mov ecx, ebp
call fcn.004cf980
mov ecx, dword [esp + 0x48]
mov ebx, dword [ebp + 4]
mov edi, dword [ecx]
mov ecx, dword [ebp]
test ebx, ebx
je 0x5093df
cmp byte [ecx + 0x41], 0
jne 0x5093df
mov eax, dword [ebp + 0x20]
dec eax
lea edx, [eax + eax*4]
movsx eax, byte [ebx + edx*4 + 1]
lea ebx, [ebx + edx*4]
push ecx
mov ecx, dword [ebx + 0x10]
call fcn.004cf9f0
add esp, 4
mov dword [ebx + 0x10], 0
test edi, edi
jne 0x5093c0
mov dword [ebx + 0x10], edi
mov byte [ebx + 1], 0
jmp 0x5093ec
mov eax, edi
call fcn.004bf8c0
cdq
push edx
mov edx, dword [ebp]
push eax
push edi
call fcn.004cbb70
add esp, 0xc
mov dword [ebx + 0x10], eax
mov byte [ebx + 1], 0xff
jmp 0x5093ec
push ecx
mov ecx, edi
xor eax, eax
call fcn.004cf9f0
add esp, 4
mov eax, dword [esp + 0x20]
push 0
push eax
push esi
push 8
push ebp
call fcn.004cf760
push 0
push 0
push esi
push 0x3e
push ebp
call fcn.004cf760
mov ecx, dword [esp + 0x3c]
push 0
push 0
push ecx
push 0x3e
push ebp
call fcn.004cf760
add esp, 0x3c
jmp 0x50944e
mov eax, dword [esp + 0x48]
mov edx, dword [eax]
mov eax, dword [eax + 0x1c]
mov ecx, dword [esp + 0x50]
push edx
push 1
push eax
push ecx
push ebx
call fcn.004d2240
mov edx, dword [edi]
mov eax, dword [edi + 0x1c]
mov ecx, dword [esp + 0x44]
push edx
push 0
push eax
push ecx
push ebx
call fcn.004d2240
add esp, 0x28
mov edx, dword [esp + 0x48]
mov ebx, dword [edx + 8]
test ebx, ebx
je 0x5095db
lea ecx, [ecx]
mov eax, dword [esp + 0x1c]
mov edi, dword [eax + 8]
mov byte [esp + 0x13], 0
test edi, edi
je 0x509484
push ebx
call fcn.004d3360
add esp, 4
test eax, eax
jne 0x509484
mov edi, dword [edi + 0x14]
test edi, edi
jne 0x509470
mov ecx, dword [esp + 0x30]
mov edx, dword [edi + 0x2c]
push ecx
push edx
push esi
push 0x37
push ebp
call fcn.004cf760
mov eax, dword [esp + 0x58]
mov ecx, edi
call fcn.004f8750
mov eax, dword [esp + 0x64]
mov ecx, dword [ebx + 0x2c]
mov edx, dword [esp + 0x28]
push eax
push ecx
push edx
push 0x38
push ebp
call fcn.004cf760
mov eax, dword [esp + 0x6c]
mov ecx, ebx
call fcn.004f8750
mov dl, 1
mov ecx, ebp
call fcn.004cf980
push 0
push 0
push esi
push 0x6e
push ebp
call fcn.004cf760
push 0
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x6c]
push eax
push esi
push 0x67
push ebp
call fcn.004cf760
mov ecx, dword [esp + 0x78]
add esp, 0x50
test dword [ecx + 0x18], 0x8000000
je 0x50955e
movzx eax, word [edi + 0x34]
mov dword [esp + 0x18], 0
mov dword [esp + 0x34], eax
test eax, eax
jle 0x509539
mov edi, dword [edi + 0x20]
mov edx, dword [edi]
push edx
push 0x58aa84
call fcn.004bf990
add esp, 8
test eax, eax
jne 0x509539
mov eax, dword [esp + 0x18]
inc eax
add edi, 4
cmp eax, dword [esp + 0x34]
mov dword [esp + 0x18], eax
jl 0x509513
mov eax, dword [esp + 0x34]
cmp dword [esp + 0x18], eax
jne 0x50955e
mov edi, dword [esp + 0x14]
push 0xffffffffffffffff
push 0
push edi
push 0x6b
push ebp
mov byte [esp + 0x27], 0x10
call fcn.004cf760
add esp, 0x14
jmp 0x509562
mov edi, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
test byte [ecx + 0x2a], 0x20
je 0x50957c
mov edx, dword [ebx + 0x38]
and dl, 3
cmp dl, 2
jne 0x50957c
or byte [esp + 0x13], 1
mov eax, dword [esp + 0x2c]
push 1
push eax
push edi
push 0x70
push ebp
call fcn.004cf760
mov dl, byte [esp + 0x27]
mov ecx, ebp
call fcn.004cf980
mov ecx, dword [esp + 0x34]
push 0
inc ecx
push ecx
push esi
push 8
push ebp
call fcn.004cf760
mov ecx, dword [esp + 0x48]
mov eax, ebp
call fcn.004cf9b0
push 0
push 0
push esi
push 0x3e
push ebp
call fcn.004cf760
push 0
push 0
push edi
push 0x3e
push ebp
call fcn.004cf760
mov ebx, dword [ebx + 0x14]
add esp, 0x50
test ebx, ebx
jne 0x509460
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x5095ea
mov eax, ebp
call fcn.004cf9b0
mov esi, dword [esp + 0x24]
mov edx, dword [esp + 0x44]
call fcn.004c7170
mov esi, dword [esp + 0x2c]
call fcn.004c7170
mov esi, dword [esp + 0x3c]
test esi, esi
je 0x50963d
push 0
push 0
push 0
push 0x16
push ebp
call fcn.004cf760
mov ecx, esi
mov eax, ebp
call fcn.004cf9b0
mov edx, dword [esp + 0x28]
push 0
push 0
push edx
push 0x3e
push ebp
call fcn.004cf760
add esp, 0x28
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x30
ret
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x30
ret