Function at 0x507990
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push 0xffffffffffffffff
push 0x5206a7
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x220
push ebx
push ebp
xor ebx, ebx
push esi
push edi
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x10], ebx
mov ebp, dword [esp + 0x244]
mov dword [esp + 0x238], ebx
xor esi, esi
call fcn.00511770
cdq
mov ecx, 0x1e
idiv ecx
inc edx
test edx, edx
jle 0x507a09
lea edi, [esp + 0x28]
call fcn.00511770
cdq
mov ecx, 0x1a
add edi, 2
idiv ecx
add edx, 0x41
inc esi
mov word [edi - 2], dx
call fcn.00511770
cdq
mov ecx, 0x1e
idiv ecx
inc edx
cmp esi, edx
jl 0x5079df
mov ecx, dword [esp + 0x10]
mov word [esp + esi*2 + 0x28], bx
cmp ecx, ebx
je 0x507a1f
call fcn.004fdce0
mov dword [esp + 0x10], ebx
push 0xc
call fcn.005101d3
add esp, 4
mov dword [esp + 0x14], eax
cmp eax, ebx
mov byte [esp + 0x238], 1
je 0x507a47
lea edx, [esp + 0x28]
mov ecx, eax
push edx
call fcn.004fdc20
jmp 0x507a49
xor eax, eax
cmp ebp, ebx
mov byte [esp + 0x238], bl
mov dword [esp + 0x10], eax
je 0x507af7
push ebx
push ebp
call fcn.00510565
add esp, 8
cmp eax, ebp
jbe 0x507aba
cmp word [eax - 2], 0x5c
je 0x507aba
lea eax, [esp + 0x10]
lea ecx, [esp + 0x24]
push eax
push 0x525458
push ecx
call fcn.00506a70
mov esi, eax
add esp, 0xc
mov eax, dword [esi]
cmp eax, ebx
je 0x507a9a
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
lea ecx, [esp + 0x10]
call fcn.004fdbd0
mov ecx, dword [esp + 0x24]
mov edx, dword [esi]
cmp ecx, ebx
mov dword [esp + 0x10], edx
je 0x507aba
call fcn.004fdce0
mov dword [esp + 0x24], ebx
lea eax, [esp + 0x10]
lea ecx, [esp + 0x1c]
push eax
push ebp
push ecx
call fcn.00506a70
mov esi, eax
add esp, 0xc
mov eax, dword [esi]
cmp eax, ebx
je 0x507adf
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
lea ecx, [esp + 0x10]
call fcn.004fdbd0
mov edx, dword [esi]
lea ecx, [esp + 0x1c]
mov dword [esp + 0x10], edx
call fcn.004fdbd0
mov edi, dword [esp + 0x248]
cmp edi, ebx
je 0x507c3e
cmp word [edi], 0x2e
je 0x507ba9
push 0xc
call fcn.005101d3
add esp, 4
mov dword [esp + 0x14], eax
cmp eax, ebx
mov byte [esp + 0x238], 2
je 0x507b38
push 0x5252c8
mov ecx, eax
call fcn.004fdc20
jmp 0x507b3a
xor eax, eax
cmp eax, ebx
mov byte [esp + 0x238], bl
mov dword [esp + 0x20], eax
jne 0x507b53
push 0x8007000e
call fcn.0051f3e0
push 0xc
mov byte [esp + 0x23c], 3
call fcn.005101d3
add esp, 4
mov dword [esp + 0x14], eax
cmp eax, ebx
mov byte [esp + 0x238], 4
je 0x507b8a
lea ecx, [esp + 0x20]
lea edx, [esp + 0x10]
push ecx
push edx
mov ecx, eax
call fcn.00508f70
mov esi, eax
jmp 0x507b8c
xor esi, esi
lea ecx, [esp + 0x10]
call fcn.004fdbd0
lea ecx, [esp + 0x20]
mov dword [esp + 0x10], esi
mov byte [esp + 0x238], bl
call fcn.004fdbd0
push 0xc
call fcn.005101d3
add esp, 4
mov dword [esp + 0x14], eax
cmp eax, ebx
mov byte [esp + 0x238], 5
je 0x507bcd
push edi
mov ecx, eax
call fcn.004fdc20
jmp 0x507bcf
xor eax, eax
cmp eax, ebx
mov byte [esp + 0x238], bl
mov dword [esp + 0x18], eax
jne 0x507be8
push 0x8007000e
call fcn.0051f3e0
push 0xc
mov byte [esp + 0x23c], 6
call fcn.005101d3
add esp, 4
mov dword [esp + 0x14], eax
cmp eax, ebx
mov byte [esp + 0x238], 7
je 0x507c1f
lea ecx, [esp + 0x18]
lea edx, [esp + 0x10]
push ecx
push edx
mov ecx, eax
call fcn.00508f70
mov esi, eax
jmp 0x507c21
xor esi, esi
lea ecx, [esp + 0x10]
call fcn.004fdbd0
lea ecx, [esp + 0x18]
mov dword [esp + 0x10], esi
mov byte [esp + 0x238], bl
call fcn.004fdbd0
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x507c4a
mov eax, dword [eax]
jmp 0x507c4c
xor eax, eax
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x5079c7
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x240]
cmp eax, ebx
mov dword [esi], eax
je 0x507c84
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov ecx, dword [esp + 0x10]
cmp ecx, ebx
je 0x507c84
call fcn.004fdce0
mov ecx, dword [esp + 0x230]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x22c
ret