Function at 0x405670
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4605fb
mov eax, dword fs:[0]
push eax
sub esp, 0x2a0
mov eax, dword [0x47908c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
cmp dword [ebp + 0x14], 0
je 0x4056a7
mov eax, dword [ebp + 0x14]
mov byte [eax], 0
mov ecx, dword [ebp + 0x10]
xor edx, edx
xor eax, eax
mov dword [ecx], edx
mov dword [ecx + 4], eax
mov dword [ebp - 0x234], 0
mov ecx, 0x104
test ecx, ecx
je 0x4056d3
mov edx, 0x104
cmp edx, 0x7fffffff
jbe 0x4056dd
mov dword [ebp - 0x234], 0x80070057
mov eax, dword [ebp - 0x234]
mov dword [ebp - 0x230], eax
cmp dword [ebp - 0x230], 0
jl 0x405716
push 0x7ffffffe
mov ecx, dword [ebp + 8]
push ecx
push 0
push 0x104
lea edx, [ebp - 0x218]
push edx
call fcn.00401de0
mov dword [ebp - 0x230], eax
jmp 0x405728
mov eax, 0x104
test eax, eax
jbe 0x405728
xor ecx, ecx
mov word [ebp - 0x218], cx
cmp dword [ebp - 0x230], 0
jl 0x40573d
mov dword [ebp - 0x24c], 1
jmp 0x405747
mov dword [ebp - 0x24c], 0
push 0x470c5c
push 0x104
lea edx, [ebp - 0x218]
push edx
call fcn.00401b90
test eax, eax
jl 0x40576d
mov dword [ebp - 0x250], 1
jmp 0x405777
mov dword [ebp - 0x250], 0
xor eax, eax
mov dword [ebp - 0x21c], eax
lea ecx, [ebp - 0x218]
push ecx
push 0
push 0x1f0003
call dword [sym.imp.KERNEL32.dll_OpenSemaphoreW]
mov dword [ebp - 0x254], eax
lea edx, [ebp - 0x254]
mov dword [ebp - 0x258], edx
mov eax, dword [ebp - 0x258]
push eax
lea ecx, [ebp - 0x21c]
call fcn.00420060
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x21c]
mov dword [ebp - 0x2a8], ecx
cmp dword [ebp - 0x2a8], 0
je 0x4057df
mov dword [ebp - 0x238], 1
jmp 0x4057e9
mov dword [ebp - 0x238], 0
mov dl, byte [ebp - 0x238]
mov byte [ebp - 0x22a], dl
mov al, byte [ebp - 0x22a]
mov byte [ebp - 0x22b], al
mov cl, byte [ebp - 0x22b]
mov byte [ebp - 0x22c], cl
movzx edx, byte [ebp - 0x22c]
test edx, edx
jne 0x4058d0
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x405830
mov byte [ebp - 0x229], 1
jmp 0x405837
mov byte [ebp - 0x229], 0
movzx eax, byte [ebp - 0x229]
test eax, eax
je 0x405893
mov dword [ebp - 0x2ac], 0
xor ecx, ecx
je 0x405868
push 0
push 0x470bb0
push 0xc8
mov edx, dword [ebp + 4]
push edx
call fcn.00404c30
add esp, 0x10
mov dword [ebp - 0x25c], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00412270
mov eax, dword [ebp - 0x25c]
jmp 0x405baf
xor ecx, ecx
jne 0x40581c
push 0x470bb0
push 0xc9
mov edx, dword [ebp + 4]
push edx
call fcn.00404ca0
add esp, 0xc
mov dword [ebp - 0x260], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00412270
mov eax, dword [ebp - 0x260]
jmp 0x405baf
mov dword [ebp - 0x224], 0
mov dword [ebp - 0x228], 0
mov eax, dword [ebp - 0x21c]
mov dword [ebp - 0x264], eax
mov ecx, dword [ebp - 0x264]
mov dword [ebp - 0x268], ecx
lea edx, [ebp - 0x224]
push edx
mov eax, dword [ebp - 0x268]
push eax
call fcn.00405330
add esp, 8
mov dword [ebp - 0x26c], eax
mov ecx, dword [ebp - 0x26c]
mov dword [ebp - 0x23c], ecx
cmp dword [ebp - 0x23c], 0
jge 0x405983
mov edx, dword [ebp - 0x23c]
mov dword [ebp - 0x240], edx
mov eax, dword [ebp - 0x240]
push eax
push 0x470bb0
push 0xcf
mov ecx, dword [ebp + 4]
push ecx
call fcn.00404c30
add esp, 0x10
mov edx, dword [ebp - 0x240]
mov dword [ebp - 0x270], edx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00412270
mov eax, dword [ebp - 0x270]
jmp 0x405baf
xor ecx, ecx
jne 0x4058e4
movzx edx, byte [ebp + 0xc]
test edx, edx
je 0x405b34
push 0x470c64
push 0x104
lea eax, [ebp - 0x218]
push eax
call fcn.00401b90
test eax, eax
jl 0x4059bd
mov dword [ebp - 0x274], 1
jmp 0x4059c7
mov dword [ebp - 0x274], 0
xor ecx, ecx
mov dword [ebp - 0x220], ecx
lea edx, [ebp - 0x218]
push edx
push 0
push 0x1f0003
call dword [sym.imp.KERNEL32.dll_OpenSemaphoreW]
mov dword [ebp - 0x278], eax
lea eax, [ebp - 0x278]
mov dword [ebp - 0x27c], eax
mov ecx, dword [ebp - 0x27c]
push ecx
lea ecx, [ebp - 0x220]
call fcn.00420060
mov byte [ebp - 4], 1
push 0
lea edx, [ebp - 0x220]
push edx
call fcn.0041a800
add esp, 8
movzx eax, al
test eax, eax
je 0x405a6b
push 0x470bb0
push 0xd5
mov ecx, dword [ebp + 4]
push ecx
call fcn.00404ca0
add esp, 0xc
mov dword [ebp - 0x280], eax
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x220]
call fcn.00412270
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00412270
mov eax, dword [ebp - 0x280]
jmp 0x405baf
xor edx, edx
jne 0x405a0b
mov eax, dword [ebp - 0x220]
mov dword [ebp - 0x284], eax
mov ecx, dword [ebp - 0x284]
mov dword [ebp - 0x288], ecx
lea edx, [ebp - 0x228]
push edx
mov eax, dword [ebp - 0x288]
push eax
call fcn.00405330
add esp, 8
mov dword [ebp - 0x28c], eax
mov ecx, dword [ebp - 0x28c]
mov dword [ebp - 0x244], ecx
cmp dword [ebp - 0x244], 0
jge 0x405b1d
mov edx, dword [ebp - 0x244]
mov dword [ebp - 0x248], edx
mov eax, dword [ebp - 0x248]
push eax
push 0x470bb0
push 0xd7
mov ecx, dword [ebp + 4]
push ecx
call fcn.00404c30
add esp, 0x10
mov edx, dword [ebp - 0x248]
mov dword [ebp - 0x290], edx
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x220]
call fcn.00412270
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00412270
mov eax, dword [ebp - 0x290]
jmp 0x405baf
xor ecx, ecx
jne 0x405a6f
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x220]
call fcn.00412270
mov eax, dword [ebp - 0x228]
cdq
mov cl, 0x1f
call fcn.0045f410
mov dword [ebp - 0x29c], eax
mov dword [ebp - 0x298], edx
mov eax, dword [ebp - 0x224]
cdq
mov dword [ebp - 0x2a4], eax
mov dword [ebp - 0x2a0], edx
cmp dword [ebp + 0x14], 0
je 0x405b6d
mov edx, dword [ebp + 0x14]
mov byte [edx], 1
mov eax, dword [ebp - 0x29c]
or eax, dword [ebp - 0x2a4]
mov ecx, dword [ebp - 0x298]
or ecx, dword [ebp - 0x2a0]
mov edx, dword [ebp + 0x10]
mov dword [edx], eax
mov dword [edx + 4], ecx
mov dword [ebp - 0x294], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x21c]
call fcn.00412270
mov eax, dword [ebp - 0x294]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00439e40
mov esp, ebp
pop ebp
ret