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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4c64c0
mov eax, dword fs:[0]
push eax
mov eax, 0x2098
call fcn.004aa1a0
mov eax, dword [0x4fad60]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
xor esi, esi
mov dword [ebp - 0x20a0], eax
mov dword [ebp - 0x20a4], esi
mov dword [ebp - 4], esi
mov ebx, 7
xor ecx, ecx
mov dword [ebp - 0x2034], ebx
mov dword [ebp - 0x2038], esi
mov word [ebp - 0x2048], cx
xor edx, edx
mov dword [ebp - 0x2018], ebx
mov dword [ebp - 0x201c], esi
mov word [ebp - 0x202c], dx
xor eax, eax
movzx edx, ax
mov eax, edx
shl edx, 0x10
or eax, edx
push 0x800
mov byte [ebp - 4], 2
mov ecx, 0x400
lea edi, [ebp - 0x2010]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x2010]
push eax
push 0x1c
lea ecx, [ebp - 0x2064]
push ecx
push fcn.0040d810
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
neg eax
sbb eax, eax
and eax, dword [ebp - 0x2060]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor edx, edx
lea eax, [ebp - 0x2010]
mov word [ebp - 0x2080], dx
mov dword [ebp - 0x206c], ebx
mov dword [ebp - 0x2070], esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x40d8f1
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x2010]
lea esi, [ebp - 0x2080]
call fcn.00403e70
lea eax, [ebp - 0x2048]
push eax
mov ebx, esi
mov byte [ebp - 4], 3
call fcn.0044dbd0
mov ebx, 8
add esp, 4
mov byte [ebp - 4], 2
cmp dword [ebp - 0x206c], ebx
jb 0x40d947
mov ecx, dword [ebp - 0x2080]
push ecx
call fcn.00490a16
add esp, 4
lea edx, [ebp - 0x2048]
push edx
lea edx, [ebp + 0xc]
lea ecx, [ebp - 0x2064]
call fcn.0044e150
add esp, 4
mov edi, eax
lea esi, [ebp - 0x202c]
mov byte [ebp - 4], 4
call fcn.00409010
mov byte [ebp - 4], 2
cmp dword [ebp - 0x2050], ebx
jb 0x40d98b
mov eax, dword [ebp - 0x2064]
push eax
call fcn.00490a16
add esp, 4
mov eax, dword [ebp - 0x202c]
cmp dword [ebp - 0x2018], ebx
jae 0x40d99f
lea eax, [ebp - 0x202c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40da55
shr eax, 4
not eax
and eax, 1
je 0x40da55
mov esi, dword [ebp - 0x20a0]
xor ecx, ecx
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], 0
lea edi, [ebp - 0x202c]
mov word [esi], cx
call fcn.00409010
cmp dword [ebp - 0x2018], ebx
jb 0x40d9f8
mov edx, dword [ebp - 0x202c]
push edx
call fcn.00490a16
add esp, 4
xor edi, edi
xor eax, eax
mov word [ebp - 0x202c], ax
mov dword [ebp - 0x201c], edi
mov dword [ebp - 0x2018], 7
cmp dword [ebp - 0x2034], ebx
jb 0x40da2a
mov ecx, dword [ebp - 0x2048]
push ecx
call fcn.00490a16
add esp, 4
xor edx, edx
mov dword [ebp - 0x2034], 7
mov dword [ebp - 0x2038], edi
mov word [ebp - 0x2048], dx
cmp dword [ebp + 0x20], ebx
jb 0x40dce0
mov eax, dword [ebp + 0xc]
push eax
jmp 0x40dcd8
lea ecx, [ebp - 0x2048]
push ecx
mov ebx, ecx
call fcn.0044dbd0
mov edx, ebx
push edx
lea edx, [ebp + 0xc]
lea ecx, [ebp - 0x2064]
call fcn.0044e150
add esp, 8
mov edi, eax
lea esi, [ebp - 0x202c]
mov byte [ebp - 4], 5
call fcn.00409010
mov ebx, 8
mov byte [ebp - 4], 2
cmp dword [ebp - 0x2050], ebx
jb 0x40daa8
mov eax, dword [ebp - 0x2064]
push eax
call fcn.00490a16
add esp, 4
mov eax, dword [ebp - 0x202c]
cmp dword [ebp - 0x2018], ebx
jae 0x40dabc
lea eax, [ebp - 0x202c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40dad6
shr eax, 4
not eax
and eax, 1
jne 0x40d9bd
push 0xffe
xor esi, esi
lea edx, [ebp - 0x100e]
xor ecx, ecx
push esi
push edx
mov word [ebp - 0x1010], cx
call fcn.00497ad0
xor eax, eax
add esp, 0xc
mov dword [ebp - 0x2088], 7
mov dword [ebp - 0x208c], esi
mov word [ebp - 0x209c], ax
lea ecx, [ebp - 0x209c]
mov byte [ebp - 4], 6
call fcn.0044ee20
xor eax, eax
movzx edx, ax
mov eax, edx
shl edx, 0x10
or eax, edx
mov ecx, 0x400
lea edi, [ebp - 0x1010]
rep stosd dword es:[edi], eax
mov eax, dword [ebp - 0x209c]
cmp dword [ebp - 0x2088], ebx
jae 0x40db4b
lea eax, [ebp - 0x209c]
mov ecx, dword [ebp - 0x208c]
lea edx, [ecx + ecx]
push edx
push eax
lea eax, [ebp - 0x1010]
push eax
call fcn.00498770
add esp, 0xc
xor ecx, ecx
lea eax, [ebp - 0x1010]
mov dword [ebp - 0x206c], 7
mov dword [ebp - 0x2070], esi
mov word [ebp - 0x2080], cx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x40db87
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x1010]
lea esi, [ebp - 0x2080]
call fcn.00403e70
mov edx, esi
push edx
lea edx, [ebp + 0xc]
lea ecx, [ebp - 0x2064]
mov byte [ebp - 4], 7
call fcn.0044e150
add esp, 4
mov edi, eax
lea esi, [ebp - 0x202c]
mov byte [ebp - 4], bl
call fcn.00409010
cmp dword [ebp - 0x2050], ebx
jb 0x40dbe7
mov eax, dword [ebp - 0x2064]
push eax
call fcn.00490a16
add esp, 4
xor edi, edi
xor ecx, ecx
mov byte [ebp - 4], 6
mov dword [ebp - 0x2050], 7
mov dword [ebp - 0x2054], edi
mov word [ebp - 0x2064], cx
cmp dword [ebp - 0x206c], ebx
jb 0x40dc1d
mov edx, dword [ebp - 0x2080]
push edx
call fcn.00490a16
add esp, 4
mov esi, dword [ebp - 0x20a0]
mov dword [esi + 0x10], edi
xor eax, eax
mov dword [esi + 0x14], 7
lea edi, [ebp - 0x202c]
mov word [esi], ax
call fcn.00409010
cmp dword [ebp - 0x2088], ebx
jb 0x40dc54
mov ecx, dword [ebp - 0x209c]
push ecx
call fcn.00490a16
add esp, 4
xor edi, edi
xor edx, edx
mov dword [ebp - 0x2088], 7
mov dword [ebp - 0x208c], edi
mov word [ebp - 0x209c], dx
cmp dword [ebp - 0x2018], ebx
jb 0x40dc86
mov eax, dword [ebp - 0x202c]
push eax
call fcn.00490a16
add esp, 4
xor ecx, ecx
mov dword [ebp - 0x2018], 7
mov dword [ebp - 0x201c], edi
mov word [ebp - 0x202c], cx
cmp dword [ebp - 0x2034], ebx
jb 0x40dcb6
mov edx, dword [ebp - 0x2048]
push edx
call fcn.00490a16
add esp, 4
xor eax, eax
mov dword [ebp - 0x2034], 7
mov dword [ebp - 0x2038], edi
mov word [ebp - 0x2048], ax
cmp dword [ebp + 0x20], ebx
jb 0x40dce0
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.00490a16
add esp, 4
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00490a21
mov esp, ebp
pop ebp
ret