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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x432c35
mov eax, dword fs:[0]
push eax
sub esp, 0x18
push ebx
push esi
push edi
mov eax, dword [0x443080]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 4], 0
cmp dword [eax - 0xc], 0
jne 0x40cdc9
call fcn.0040f760
mov ecx, eax
test ecx, ecx
je 0x40d514
mov eax, dword [ecx]
call dword [eax + 0xc]
mov esi, dword [ebp + 8]
add eax, 0x10
mov dword [esi], eax
push 0x434308
mov ecx, esi
mov byte [ebp - 4], 1
call fcn.0040b4a0
test al, al
jne 0x40cd96
push 0
push 0x434308
mov ecx, esi
call fcn.004120f0
mov edx, dword [ebp + 0xc]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40d475
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov byte [ebp - 4], 2
call fcn.0040f760
mov ecx, eax
test ecx, ecx
je 0x40d514
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
push dword [ebp + 0xc]
mov byte [ebp - 4], 3
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
or ebx, 0xffffffff
test eax, eax
je 0x40ce0c
lea eax, [ebp + 0xc]
push eax
lea ecx, [ebp - 0x14]
call fcn.0040ae10
jmp 0x40d41c
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
push eax
call fcn.0040bba0
add esp, 4
mov dword [ebp - 0x18], eax
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
cmp dword [eax + 4], 1
mov byte [ebp - 4], 4
jg 0x40ce3c
push eax
call fcn.0040bba0
add esp, 4
add eax, 0x10
jmp 0x40ce9b
mov ecx, dword [eax]
test ecx, ecx
je 0x40ce4d
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x40ce63
call fcn.0040f760
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
test ecx, ecx
je 0x40d514
test esi, esi
je 0x40d50a
mov eax, dword [ecx]
push 2
push 1
call dword [eax]
test eax, eax
je 0x40d532
add eax, 0x10
cmp dword [eax - 8], 1
jl 0x40d50a
mov dword [eax - 0xc], 1
xor ecx, ecx
mov word [eax + 2], cx
mov cx, word [esi]
mov word [eax], cx
mov edx, 0x4345f0
mov ecx, eax
mov di, word [ecx]
cmp di, word [edx]
jne 0x40cec8
test di, di
je 0x40cec4
mov di, word [ecx + 2]
cmp di, word [edx + 2]
jne 0x40cec8
add ecx, 4
add edx, 4
test di, di
jne 0x40cea2
xor edi, edi
jmp 0x40cecd
sbb edi, edi
or edi, 1
lea edx, [eax - 0x10]
mov byte [ebp - 4], 4
mov eax, ebx
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40cee8
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test edi, edi
jne 0x40d0e8
mov eax, dword [ebp - 0x18]
cmp dword [eax + 4], 1
jl 0x40d093
lea eax, [esi + 2]
push 0x4345f0
push eax
call fcn.00415be7
add esp, 8
test eax, eax
je 0x40d093
sub eax, esi
sar eax, 1
cmp eax, 1
jle 0x40d093
dec eax
cmp eax, 0x7ffffffe
jg 0x40d51e
mov edx, dword [ebp - 0x18]
test eax, eax
cmovns edi, eax
mov edx, dword [edx + 4]
lea eax, [edi + 1]
cmp eax, edx
lea eax, [esi - 0x10]
lea ecx, [edx - 1]
mov dword [ebp - 0x1c], eax
cmovle ecx, edi
xor edi, edi
cmp edx, 1
cmovge edi, ecx
mov ecx, dword [eax]
mov dword [ebp - 0x18], edi
test ecx, ecx
je 0x40cf6c
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
je 0x40cf6c
lea eax, [esi + 2]
jmp 0x40cf85
call fcn.0040f760
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
lea eax, [esi + 2]
test ecx, ecx
je 0x40d514
test eax, eax
jne 0x40cf91
test edi, edi
jne 0x40d50a
mov eax, dword [ecx]
push 2
push edi
call dword [eax]
mov edi, eax
test edi, edi
je 0x40d532
mov eax, dword [ebp - 0x18]
lea ecx, [edi + 0x10]
mov dword [ebp - 0x24], ecx
test eax, eax
js 0x40d50a
cmp eax, dword [ecx - 8]
jg 0x40d50a
mov dword [ecx - 0xc], eax
xor edx, edx
add eax, eax
mov dword [ebp - 0x18], eax
mov word [eax + ecx], dx
test eax, eax
je 0x40d009
push dword [ebp - 0x18]
lea eax, [esi + 2]
test eax, eax
je 0x40cfe4
push eax
push ecx
call fcn.004162f0
add esp, 0xc
jmp 0x40d006
push 0
push ecx
call fcn.00416870
lea eax, [esi + 2]
add esp, 0xc
test eax, eax
jne 0x40d006
call fcn.00418421
mov dword [eax], 0x16
call fcn.0041828f
lea ecx, [edi + 0x10]
lea eax, [esi - 0x10]
mov byte [ebp - 4], 6
cmp edi, eax
je 0x40d05f
mov esi, dword [ebp - 0x1c]
cmp dword [esi + 0xc], 0
jl 0x40d050
mov eax, dword [edi]
cmp eax, dword [esi]
jne 0x40d050
push edi
call fcn.0040bba0
add esp, 4
mov dword [ebp - 0x1c], eax
mov ecx, ebx
lea edx, [esi + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40d048
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x1c]
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
jmp 0x40d05f
push dword [ecx - 0xc]
push ecx
lea ecx, [ebp - 0x10]
call fcn.004120f0
mov esi, dword [ebp - 0x10]
mov byte [ebp - 4], 4
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x40d077
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d093
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.0040ae10
jmp 0x40d401
mov eax, dword [ebp + 0xc]
lea edi, [esi - 0x10]
lea edx, [eax - 0x10]
cmp edx, edi
je 0x40d0e8
cmp dword [edi + 0xc], 0
lea esi, [edi + 0xc]
jl 0x40d0d9
mov ecx, dword [edx]
cmp ecx, dword [edi]
jne 0x40d0d9
push edx
call fcn.0040bba0
add esp, 4
mov dword [ebp - 0x1c], eax
mov ecx, ebx
lock xadd dword [esi], ecx
dec ecx
test ecx, ecx
jg 0x40d0d1
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x1c]
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
jmp 0x40d0e8
push dword [eax - 0xc]
lea ecx, [ebp - 0x10]
push eax
call fcn.004120f0
mov esi, dword [ebp - 0x10]
push 0x2c
push esi
call fcn.00415b44
mov edi, eax
add esp, 8
test edi, edi
je 0x40d1fa
sub edi, esi
sar edi, 1
mov dword [ebp - 0x18], edi
test edi, edi
jle 0x40d1fa
cmp edi, dword [esi - 0xc]
jl 0x40d125
lea eax, [esi - 0x10]
push eax
call fcn.0040bba0
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x1c], edi
jmp 0x40d18a
mov ecx, dword [esi - 0x10]
test ecx, ecx
je 0x40d137
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x40d14d
call fcn.0040f760
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
test ecx, ecx
je 0x40d514
mov eax, dword [ecx]
push 2
push edi
call dword [eax]
test eax, eax
je 0x40d532
mov ecx, dword [ebp - 0x18]
lea edi, [eax + 0x10]
mov eax, edi
mov dword [ebp - 0x1c], edi
cmp ecx, dword [edi - 8]
jg 0x40d50a
mov dword [edi - 0xc], ecx
xor edx, edx
add ecx, ecx
mov word [edi + ecx], dx
test ecx, ecx
je 0x40d18c
push ecx
push esi
push eax
call fcn.004162f0
add esp, 0xc
mov eax, edi
lea edx, [eax - 0x10]
mov byte [ebp - 4], 7
add esi, 0xfffffff0
cmp edx, esi
je 0x40d1df
cmp dword [esi + 0xc], 0
jl 0x40d1d3
mov ecx, dword [edx]
cmp ecx, dword [esi]
jne 0x40d1d3
push edx
call fcn.0040bba0
add esp, 4
mov dword [ebp - 0x1c], eax
mov ecx, ebx
lea edx, [esi + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40d1cb
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x1c]
add eax, 0x10
mov dword [ebp - 0x10], eax
jmp 0x40d1df
push dword [eax - 0xc]
lea ecx, [ebp - 0x10]
push eax
call fcn.004120f0
mov byte [ebp - 4], 4
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x40d1fa
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
push 0x434308
push 0x4345f0
lea ecx, [ebp - 0x10]
call fcn.00411d40
lea ecx, [ebp - 0x10]
call fcn.004122c0
mov esi, dword [ebp - 0x10]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d233
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebp - 0x14]
call fcn.0040ae10
jmp 0x40d401
mov eax, dword [ebp + 0xc]
lea edi, [esi - 0x10]
lea edx, [eax - 0x10]
cmp edx, edi
je 0x40d288
cmp dword [edi + 0xc], 0
lea esi, [edi + 0xc]
jl 0x40d279
mov ecx, dword [edx]
cmp ecx, dword [edi]
jne 0x40d279
push edx
call fcn.0040bba0
add esp, 4
mov dword [ebp - 0x1c], eax
mov ecx, ebx
lock xadd dword [esi], ecx
dec ecx
test ecx, ecx
jg 0x40d271
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x1c]
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
jmp 0x40d288
push dword [eax - 0xc]
lea ecx, [ebp - 0x10]
push eax
call fcn.004120f0
mov esi, dword [ebp - 0x10]
push 0x20
push esi
call fcn.00415b44
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x40d3fe
sub ebx, esi
sar ebx, 1
test ebx, ebx
jle 0x40d3fe
cmp ebx, dword [esi - 0xc]
jl 0x40d2c2
lea eax, [esi - 0x10]
push eax
call fcn.0040bba0
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x1c], edi
jmp 0x40d324
mov ecx, dword [esi - 0x10]
test ecx, ecx
je 0x40d2d4
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x40d2ea
call fcn.0040f760
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
test ecx, ecx
je 0x40d514
mov eax, dword [ecx]
push 2
push ebx
call dword [eax]
test eax, eax
je 0x40d532
lea edi, [eax + 0x10]
mov eax, edi
mov dword [ebp - 0x1c], edi
cmp ebx, dword [edi - 8]
jg 0x40d50a
mov dword [edi - 0xc], ebx
xor ecx, ecx
add ebx, ebx
mov word [ebx + edi], cx
test ebx, ebx
je 0x40d326
push ebx
push esi
push eax
call fcn.004162f0
add esp, 0xc
mov eax, edi
lea edx, [eax - 0x10]
mov byte [ebp - 4], 8
lea ebx, [esi - 0x10]
cmp edx, ebx
je 0x40d37d
cmp dword [ebx + 0xc], 0
lea esi, [ebx + 0xc]
jl 0x40d36e
mov ecx, dword [edx]
cmp ecx, dword [ebx]
jne 0x40d36e
push edx
call fcn.0040bba0
add esp, 4
mov dword [ebp - 0x1c], eax
or ecx, 0xffffffff
lock xadd dword [esi], ecx
dec ecx
test ecx, ecx
jg 0x40d366
mov ecx, dword [ebx]
push ebx
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x1c]
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
jmp 0x40d37d
push dword [eax - 0xc]
lea ecx, [ebp - 0x10]
push eax
call fcn.004120f0
mov esi, dword [ebp - 0x10]
or ebx, 0xffffffff
mov byte [ebp - 4], 4
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x40d39b
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d288
mov edi, dword [ebp - 0x14]
lea ecx, [esi - 0x10]
add edi, 0xfffffff0
cmp ecx, edi
je 0x40d401
cmp dword [edi + 0xc], 0
jl 0x40d3f0
mov eax, dword [ecx]
cmp eax, dword [edi]
jne 0x40d3f0
push ecx
call fcn.0040bba0
add esp, 4
mov dword [ebp - 0x1c], eax
mov ecx, ebx
lea edx, [edi + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40d3e8
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x1c]
add eax, 0x10
mov dword [ebp - 0x14], eax
jmp 0x40d401
push dword [esi - 0xc]
lea ecx, [ebp - 0x14]
push esi
call fcn.004120f0
jmp 0x40d401
or ebx, 0xffffffff
mov byte [ebp - 4], 3
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x40d41c
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x14]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d489
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
test al, 0x10
jne 0x40d489
lea edi, [esi - 0x10]
push edi
call fcn.0040bba0
mov esi, dword [ebp + 8]
add eax, 0x10
add esp, 4
mov dword [esi], eax
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x40d45d
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x40d475
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.0040f760
mov ecx, eax
test ecx, ecx
je 0x40d528
mov eax, dword [ecx]
call dword [eax + 0xc]
mov edi, dword [ebp + 8]
add eax, 0x10
mov dword [edi], eax
push 0x434308
mov ecx, edi
mov byte [ebp - 4], 9
call fcn.0040b4a0
test al, al
jne 0x40d4c7
push 0
push 0x434308
mov ecx, edi
call fcn.004120f0
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x40d4de
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x40d4f6
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.0040b460
push 0x80004005
call fcn.0040b460
push 0x80070216
call fcn.0040b460
push 0x80004005
call fcn.0040b460
call fcn.004122b0
int3