Function at 0x40a240
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x421b20
mov eax, dword fs:[0]
push eax
sub esp, 0x34
mov eax, dword [0x42c00c]
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 dword [ebp - 0x3c], edx
mov dword [ebp - 0x30], ecx
xor eax, eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 4], eax
call fcn.00407950
mov edi, eax
test edi, edi
je case.0x40a609.0
mov eax, dword [edi]
mov esi, dword [eax + 0xc]
mov ecx, esi
call dword [0x42227c]
mov ecx, edi
call esi
add eax, 0x10
mov dword [ebp - 0x18], eax
xor ebx, ebx
mov dword [ebp - 4], 1
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x28], ebx
mov byte [ebp - 4], 2
call fcn.00407950
mov edi, eax
test edi, edi
je 0x40a7ad
mov eax, dword [edi]
mov esi, dword [eax + 0xc]
mov ecx, esi
call dword [0x42227c]
mov ecx, edi
call esi
lea esi, [eax + 0x10]
mov dword [ebp - 0x14], esi
push dword [ebp - 0x30]
lea eax, [ebp - 0x18]
mov byte [ebp - 4], 3
push str..Scsi_u:
push eax
call fcn.0040bd90
mov edi, dword [ebp - 0x18]
add esp, 0xc
mov dword [ebp - 0x24], edi
push ebx
push ebx
push 3
push ebx
push 3
push 0xc0000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x30], eax
cmp eax, 0xffffffff
jne 0x40a323
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x2c], eax
jmp 0x40a71d
push 0x3c
call fcn.00415b3d
mov ebx, eax
add esp, 4
mov dword [ebp - 0x34], ebx
test ebx, ebx
jne 0x40a342
mov dword [ebp - 0x2c], 8
jmp 0x40a714
push 0x22c
call fcn.00415b3d
mov ecx, eax
add esp, 4
mov dword [ebp - 0x28], ecx
test ecx, ecx
jne 0x40a364
mov dword [ebp - 0x2c], 8
jmp 0x40a714
mov byte [ebp - 0x1d], 0
jmp 0x40a373
mov ecx, dword [ebp - 0x28]
mov dword [ebx + 4], 0
mov dword [ebx + 8], 0
mov dword [ebx + 0x14], 0
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x20], 0
mov dword [ebx + 0x24], 0
mov dword [ebx + 0x28], 0
mov dword [ebx + 0x2c], 0
push 0x22c
mov dword [ebx + 0x30], 0
push 0
mov dword [ebx + 0x34], 0
push ecx
mov dword [ebx + 0x38], 0
call fcn.00410b20
add esp, 0xc
mov dword [ebx], 0x1c
lea eax, [ebx + 4]
mov dword [ebx + 0xc], 0x1388
mov dword [ebx + 0x18], 0x210
mov dword [ebx + 0x10], 0x1b0501
push 8
push str.SCSIDISK
push eax
call fcn.00415970
mov al, byte [ebp - 0x1d]
add esp, 0xc
mov ecx, dword [ebp - 0x28]
mov byte [ebx + 0x28], al
lea eax, [ebp - 0x1c]
mov byte [ebx + 0x26], 0xec
push 0
push eax
push 0x22c
push ecx
push 0x3c
push ebx
push 0x4d008
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x40a44a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x2c], eax
mov al, byte [ebp - 0x1d]
inc al
mov byte [ebp - 0x1d], al
cmp al, 2
jb 0x40a370
jmp 0x40a714
mov edx, dword [ebp - 0x28]
mov ebx, 0xa
add edx, 0x41
mov cl, byte [edx - 1]
lea edx, [edx + 2]
mov al, byte [edx - 2]
mov byte [edx - 3], al
mov byte [edx - 2], cl
sub ebx, 1
jne 0x40a455
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x15
or eax, ecx
jge 0x40a488
push 0x15
lea ecx, [ebp - 0x14]
call fcn.0040b980
mov esi, dword [ebp - 0x14]
mov eax, dword [ebp - 0x28]
push 0x14
add eax, 0x40
mov byte [esi + 0x14], 0
push eax
push esi
call fcn.00415970
add esp, 0xc
push dword [esi - 8]
push esi
call fcn.004138d5
add esp, 8
test eax, eax
js case.0x40a609.21
cmp eax, dword [esi - 8]
jg case.0x40a609.21
mov dword [esi - 0xc], eax
xor ebx, ebx
mov byte [eax + esi], 0
mov al, byte [esi]
test al, al
je 0x40a53a
mov edi, esi
nop dword [eax]
movsx eax, al
push eax
call fcn.0041559f
add esp, 4
test eax, eax
je 0x40a4eb
test ebx, ebx
mov eax, edi
cmovne eax, ebx
mov ebx, eax
jmp 0x40a4ed
xor ebx, ebx
push edi
call fcn.00413ba7
mov edi, eax
add esp, 4
mov al, byte [edi]
test al, al
jne 0x40a4d0
mov edi, dword [ebp - 0x24]
test ebx, ebx
je 0x40a53a
sub ebx, esi
js case.0x40a609.21
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, ebx
or eax, ecx
jge 0x40a52a
push ebx
lea ecx, [ebp - 0x14]
call fcn.0040b980
mov esi, dword [ebp - 0x14]
cmp ebx, dword [esi - 8]
jg case.0x40a609.21
mov dword [esi - 0xc], ebx
mov byte [ebx + esi], 0
movsx eax, byte [esi]
mov ebx, esi
push eax
call fcn.0041559f
add esp, 4
test eax, eax
je 0x40a628
push ebx
call fcn.00413ba7
mov ebx, eax
add esp, 4
movsx ecx, byte [ebx]
push ecx
call fcn.0041559f
add esp, 4
test eax, eax
jne 0x40a550
cmp ebx, esi
je 0x40a628
mov ecx, dword [esi - 0xc]
sub ebx, esi
test ecx, ecx
js 0x40a7c1
mov eax, dword [esi - 8]
mov edx, 1
sub edx, dword [esi - 4]
sub eax, ecx
or eax, edx
jge 0x40a59d
push ecx
lea ecx, [ebp - 0x14]
call fcn.0040b980
mov esi, dword [ebp - 0x14]
mov ecx, dword [esi - 0xc]
lea eax, [ebx + esi]
sub ecx, ebx
mov dword [ebp - 0x24], ecx
lea edx, [ecx + 1]
test edx, edx
je 0x40a600
test eax, eax
jne 0x40a5cd
call fcn.00415b0d
mov dword [eax], 0x16
call fcn.00412f78
mov ecx, dword [ebp - 0x24]
mov eax, 0x16
jmp 0x40a602
mov eax, dword [esi - 0xc]
inc eax
cmp eax, edx
jae 0x40a5ef
call fcn.00415b0d
mov dword [eax], 0x22
call fcn.00412f78
mov ecx, dword [ebp - 0x24]
mov eax, 0x22
jmp 0x40a602
push edx
lea eax, [ebx + esi]
push eax
push esi
call fcn.00410d70
mov ecx, dword [ebp - 0x24]
add esp, 0xc
xor eax, eax
movzx eax, byte [eax + 0x40a7ec]
jmp dword [eax*4 + 0x40a7dc]
test ecx, ecx
js case.0x40a609.21
cmp ecx, dword [esi - 8]
jg case.0x40a609.21
mov dword [esi - 0xc], ecx
mov byte [ecx + esi], 0
mov ebx, dword [ebp - 0x3c]
lea ecx, [esi - 0x10]
mov edx, dword [ebx]
sub edx, 0x10
mov dword [ebp - 0x38], edx
cmp ecx, edx
je 0x40a711
lea eax, [edx + 0xc]
mov dword [ebp - 0x40], eax
mov eax, dword [eax]
shr eax, 0x1f
test al, al
jne 0x40a706
mov eax, dword [ecx]
mov dword [ebp - 0x24], eax
cmp eax, dword [edx]
jne 0x40a706
mov eax, dword [eax]
mov ebx, dword [eax + 0x10]
mov ecx, ebx
call dword [0x42227c]
mov ecx, dword [ebp - 0x24]
call ebx
lea edx, [esi - 0x10]
mov dword [ebp - 0x24], eax
mov ecx, dword [edx + 0xc]
lea ebx, [edx + 0xc]
shr ecx, 0x1f
test cl, cl
jne 0x40a68f
cmp eax, dword [edx]
jne 0x40a68f
mov dword [ebp - 0x24], edx
lock inc dword [ebx]
jmp 0x40a6cb
mov eax, dword [eax]
push 1
push dword [edx + 4]
mov ebx, dword [eax]
mov ecx, ebx
call dword [0x42227c]
mov ecx, dword [ebp - 0x24]
call ebx
mov ebx, eax
mov dword [ebp - 0x24], ebx
test ebx, ebx
je 0x40a7d5
mov eax, dword [esi - 0xc]
lea ecx, [ebx + 0x10]
mov dword [ebx + 4], eax
mov eax, esi
mov edx, dword [esi - 0xc]
inc edx
push edx
push eax
call fcn.004076d0
add esp, 8
mov ecx, dword [ebp - 0x40]
or eax, 0xffffffff
mov byte [ebp - 4], 4
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x40a6f9
mov ecx, dword [ebp - 0x38]
push ecx
mov eax, dword [ecx]
mov dword [ebp - 0x38], eax
mov eax, dword [eax]
mov ebx, dword [eax + 4]
mov ecx, ebx
call dword [0x42227c]
mov ecx, dword [ebp - 0x38]
call ebx
mov ecx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x24]
add eax, 0x10
mov dword [ecx], eax
jmp 0x40a711
push dword [ecx + 4]
mov ecx, ebx
push esi
call fcn.0040b9e0
mov ebx, dword [ebp - 0x34]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call fcn.00415b20
add esp, 4
push dword [ebp - 0x28]
call fcn.00415b20
add esp, 4
lea ecx, [esi - 0x10]
mov byte [ebp - 4], 5
or eax, 0xffffffff
lock xadd dword [ecx + 0xc], eax
dec eax
test eax, eax
jg 0x40a759
mov ebx, dword [ecx]
push ecx
mov eax, dword [ebx]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x42227c]
mov ecx, ebx
call esi
lea ecx, [edi - 0x10]
mov dword [ebp - 4], 6
or eax, 0xffffffff
lock xadd dword [ecx + 0xc], eax
dec eax
test eax, eax
jg 0x40a784
mov edi, dword [ecx]
push ecx
mov eax, dword [edi]
mov esi, dword [eax + 4]
mov ecx, esi
call dword [0x42227c]
mov ecx, edi
call esi
mov eax, dword [ebp - 0x2c]
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.0040f2ed
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00407790
push 0x80004005
call fcn.00407790
push 0x80070057
call fcn.00407790
push 0x80070057
call fcn.00407790
push 0x8007000e
call fcn.00407790
call fcn.0040bc50
nop
adc byte [esi - 0x5834ffc0], ah
inc eax
add byte [edi - 0x5cffbf59], dh
cmpsd dword [esi], dword es:[edi]
inc eax
add byte [eax], al
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ecx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [edx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [edx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [eax]
int3