Function at 0x405850
Capabilities:
Check if file exists

Disassembly:
push 0xffffffffffffffff
push 0x41f7c2
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x12c
mov eax, dword [0x428990]
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x138], eax
push 0x104
lea eax, [esp + 0x38]
push eax
xor ebx, ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [esp + 0x34]
push ecx
lea ecx, [esp + 0x1c]
call fcn.00401210
mov dword [esp + 0x144], ebx
call fcn.0041634a
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [esp + 0x20], eax
mov byte [esp + 0x144], 1
mov eax, dword [esp + 0x18]
push 0x5c
push eax
call fcn.0040a07c
add esp, 8
cmp eax, ebx
jne 0x4058d6
or eax, 0xffffffff
jmp 0x4058da
sub eax, dword [esp + 0x18]
inc eax
push eax
lea ecx, [esp + 0x14]
push ecx
lea ecx, [esp + 0x20]
call fcn.00402350
push eax
mov ecx, 0x4391fc
mov byte [esp + 0x148], 2
call fcn.00401430
mov byte [esp + 0x144], 1
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405923
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov dword [esp + 0x10], ebx
mov dword [esp + 0x1c], ebx
jmp 0x405930
mov eax, dword [esp + 0x14c]
mov ebp, dword [eax + 4]
test ebp, ebp
je 0x405c14
mov eax, dword [eax + 8]
mov ecx, dword [esp + 0x10]
sub eax, ebp
sar eax, 4
cmp ecx, eax
jae 0x405c14
mov esi, dword [ebx + ebp]
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
sub esi, 0x10
call dword [eax + 0x10]
mov edx, dword [esi + 0xc]
test edx, edx
lea ecx, [esi + 0xc]
jl 0x40597f
cmp eax, dword [esi]
jne 0x40597f
mov eax, esi
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x4059b1
mov ecx, dword [esi + 4]
mov edx, dword [eax]
push 1
push ecx
mov ecx, eax
call dword [edx]
test eax, eax
je 0x405c0f
mov edx, dword [esi + 4]
mov dword [eax + 4], edx
mov ecx, dword [esi + 4]
inc ecx
mov edx, ecx
shr ecx, 2
add esi, 0x10
lea edi, [eax + 0x10]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add eax, 0x10
mov dword [esp + 0x24], eax
mov byte [esp + 0x144], 3
mov esi, dword [ebx + ebp + 4]
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
sub esi, 0x10
call dword [eax + 0x10]
mov ecx, dword [esi + 0xc]
test ecx, ecx
lea edx, [esi + 0xc]
jl 0x4059ea
cmp eax, dword [esi]
jne 0x4059ea
mov eax, esi
mov ecx, 1
lock xadd dword [edx], ecx
jmp 0x405a1c
mov ecx, dword [esi + 4]
mov edx, dword [eax]
push 1
push ecx
mov ecx, eax
call dword [edx]
test eax, eax
je 0x405c0f
mov edx, dword [esi + 4]
mov dword [eax + 4], edx
mov ecx, dword [esi + 4]
inc ecx
mov edx, ecx
shr ecx, 2
add esi, 0x10
lea edi, [eax + 0x10]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ebx, [eax + 0x10]
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + ebp + 8]
mov edx, dword [eax + ebp + 0xc]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], edx
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x18]
push 0x4391fc
push ecx
mov byte [esp + 0x150], 4
call fcn.00406320
mov byte [esp + 0x150], 5
mov edx, dword [esp + 0x30]
push 0x4233b8
push edx
call fcn.0040a2a7
add esp, 0x14
test eax, eax
je 0x405a81
push 1
push 0x4233b8
lea ecx, [esp + 0x1c]
call fcn.004025c0
mov eax, dword [ebx - 0xc]
push eax
push ebx
lea ecx, [esp + 0x1c]
call fcn.004025c0
mov ebp, dword [esp + 0x14]
push ebp
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x405b92
mov eax, dword [ebx - 0xc]
test eax, eax
mov dword [esp + 0x2c], 0
jl 0x405b38
push 0x423410
push ebx
call fcn.0040ad98
add esp, 8
test eax, eax
je 0x405b38
sub eax, ebx
cmp eax, 0xffffffff
je 0x405b38
push 0x423414
push ebp
or edi, 0xffffffff
call fcn.0040a3ad
mov esi, eax
add esp, 8
test esi, esi
je 0x405b34
push 2
push 0
push esi
call fcn.0040abce
push esi
call fcn.0040aafe
push 0
push 0
push esi
mov edi, eax
call fcn.0040abce
push edi
call fcn.00417477
push esi
push edi
mov ebp, eax
push 1
push ebp
call fcn.0040a8b6
mov edx, edi
mov ecx, ebp
or eax, 0xffffffff
call fcn.00408620
push esi
mov edi, eax
call fcn.0040a55f
push ebp
call fcn.0041747c
mov ebp, dword [esp + 0x4c]
add esp, 0x38
mov dword [esp + 0x2c], edi
mov edi, dword [esp + 0x150]
mov edx, dword [edi + 4]
test edx, edx
jne 0x405b4a
xor ecx, ecx
jmp 0x405b52
mov ecx, dword [edi + 8]
sub ecx, edx
sar ecx, 4
test edx, edx
je 0x405b82
mov eax, dword [edi + 0xc]
sub eax, edx
sar eax, 4
cmp ecx, eax
jae 0x405b82
mov eax, dword [esp + 0x20]
mov esi, dword [edi + 8]
push eax
lea ecx, [esp + 0x28]
push ecx
push 1
push esi
call fcn.00406d30
add esp, 0x10
add esi, 0x10
mov dword [edi + 8], esi
jmp 0x405b92
mov eax, dword [edi + 8]
push 1
push eax
push edi
lea ecx, [esp + 0x30]
call fcn.00406780
lea eax, [ebp - 0x10]
mov byte [esp + 0x144], 4
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405bb4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
lea eax, [ebx - 0x10]
mov byte [esp + 0x144], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405bd6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405bf4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x1c]
inc ecx
add eax, 0x10
mov dword [esp + 0x10], ecx
mov dword [esp + 0x1c], eax
mov ebx, eax
jmp 0x405930
call fcn.00401960
mov byte [esp + 0x144], 0
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405c3a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov dword [esp + 0x144], 0xffffffff
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405c63
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov ecx, dword [esp + 0x13c]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x12c]
pop ebx
call fcn.0040b285
add esp, 0x138
ret 8