Function at 0x40e160
Capabilities:
Check if file exists

Disassembly:
push 0xffffffffffffffff
push 0x44bf48
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4638dc]
xor eax, esp
push eax
lea eax, [esp + 0x20]
mov dword fs:[0], eax
mov edi, ecx
call fcn.0041591e
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40e1a3
push 0x80004005
call fcn.00401010
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea ebp, [eax + 0x10]
mov dword [esp + 0x14], ebp
mov dword [esp + 0x28], 0
call fcn.0041591e
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40e1d5
push 0x80004005
call fcn.00401010
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [esp + 0x18], esi
mov ecx, dword [esp + 0x44]
mov ebx, dword [esp + 0x40]
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x34]
push ecx
mov ecx, dword [esp + 0x40]
push ebx
push edx
push eax
push ecx
mov ecx, edi
mov byte [esp + 0x3c], 1
call fcn.0040bd70
test eax, eax
je 0x40e25b
lea eax, [esi - 0x10]
mov byte [esp + 0x28], 0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40e22f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov dword [esp + 0x28], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e253
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
or eax, 0xffffffff
jmp 0x40e5b6
movzx ecx, word [ebx + 0x11a]
push ecx
lea edx, [esp + 0x48]
push edx
mov ecx, edi
call fcn.0040ddd0
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2c], 2
call fcn.00401bd0
mov eax, dword [esp + 0x44]
add eax, 0xfffffff0
mov byte [esp + 0x28], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e2a3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, dword [esp + 0x30]
push esi
lea ecx, [esp + 0x18]
push str.._s
push ecx
call fcn.00402cf0
mov edx, dword [esp + 0x20]
mov ebx, dword [sym.imp.KERNEL32.DLL_CreateFileA]
add esp, 0xc
push 0
push 0x20000000
push 3
push 0
push 3
push 0xc0000000
push edx
call ebx
mov ebp, eax
cmp ebp, 0xffffffff
je 0x40e3a0
push esi
push str._s_is_already_being_used.
add edi, 0x17c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push edi
call fcn.00402e90
add esp, 0x10
push ebp
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea eax, [esp + 0x40]
push eax
mov ecx, edi
call fcn.00401a10
mov eax, dword [eax]
push 0
push 0
push eax
mov byte [esp + 0x34], 3
call fcn.0041d02a
mov eax, dword [esp + 0x40]
add eax, 0xfffffff0
mov byte [esp + 0x28], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e349
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
mov byte [esp + 0x28], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e36e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov dword [esp + 0x28], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e396
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 0xfffffffe
jmp 0x40e5b6
mov ebp, dword [esp + 0x18]
push ebp
push esi
push 1
call dword [sym.imp.KERNEL32.DLL_DefineDosDeviceA]
test eax, eax
jne 0x40e467
push esi
push str.Failed_to_create__s.
add edi, 0x17c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push edi
call fcn.00402e90
add esp, 0x10
lea ecx, [esp + 0x40]
push ecx
mov ecx, edi
call fcn.00401a10
mov eax, dword [eax]
push 0
push 0
push eax
mov byte [esp + 0x34], 4
call fcn.0041d02a
mov eax, dword [esp + 0x40]
add eax, 0xfffffff0
mov byte [esp + 0x28], 1
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40e414
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov byte [esp + 0x28], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e435
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov dword [esp + 0x28], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e45d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 0xfffffffd
jmp 0x40e5b6
mov ecx, dword [esp + 0x14]
push 0
push 0x20000000
push 3
push 0
push 3
push 0xc0000000
push ecx
call ebx
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x40e505
push esi
push 0x44fb68
add edi, 0x17c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push edi
call fcn.00402e90
add esp, 0x10
push 0
push esi
push 2
call dword [sym.imp.KERNEL32.DLL_DefineDosDeviceA]
cmp dword [edi], 2
jne 0x40e4c3
push 0x450e80
push 0
push edi
call fcn.00402e90
add esp, 0xc
lea edx, [esp + 0x40]
push edx
mov ecx, edi
call fcn.00401a10
mov eax, dword [eax]
push 0
push 0
push eax
mov byte [esp + 0x34], 5
call fcn.0041d02a
lea ecx, [esp + 0x40]
call fcn.00401410
lea ecx, [esp + 0x18]
call fcn.00401410
lea ecx, [esp + 0x14]
call fcn.00401410
mov eax, 0xfffffffc
jmp 0x40e5b6
mov edx, dword [esp + 0x40]
push 0
lea ecx, [esp + 0x20]
push ecx
push 0
push 0
push 0x128
push edx
push 0x8000e000
push ebp
call dword [sym.imp.KERNEL32.DLL_DeviceIoControl]
test eax, eax
jne 0x40e59b
mov eax, dword [esp + 0x3c]
push eax
push 0x44fb68
add edi, 0x17c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push edi
call fcn.00402e90
add esp, 0x10
push ebp
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push 0
push esi
push 2
call dword [sym.imp.KERNEL32.DLL_DefineDosDeviceA]
lea ecx, [esp + 0x40]
push ecx
mov ecx, edi
call fcn.00401a10
mov edx, dword [eax]
push 0
push 0
push edx
mov byte [esp + 0x34], 6
call fcn.0041d02a
lea ecx, [esp + 0x40]
call fcn.00401410
lea ecx, [esp + 0x18]
call fcn.00401410
lea ecx, [esp + 0x14]
call fcn.00401410
mov eax, 0xfffffffb
jmp 0x40e5b6
push ebp
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea ecx, [esp + 0x18]
call fcn.00401410
lea ecx, [esp + 0x14]
call fcn.00401410
xor eax, eax
mov ecx, dword [esp + 0x20]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0x18