Function at 0x40d9f0
Capabilities:
Check if file exists
Create thread
Delete file
Get file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x420020
mov eax, dword fs:[0]
push eax
sub esp, 0x9c
mov eax, dword [0x42807c]
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 ebx, ecx
mov eax, dword [ebx + 0x69c]
lea edi, [ebx + 0x69c]
push eax
push edi
mov dword [ebp - 0x9c], ebx
mov esi, edx
mov dword [ebp - 0xa8], 0
mov dword [ebp - 0xa4], edi
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
test eax, eax
je 0x40da5a
mov eax, 2
jmp 0x40de53
push 1
push edi
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov edi, ebx
call fcn.0040e010
push str.Update.WPS
lea ecx, [ebx + 0x14]
push 0x104
push ecx
call fcn.0040fdc6
push 0x2d
xor edi, edi
lea edx, [ebp - 0x94]
push edi
push edx
call fcn.00412f10
add esp, 0x18
xor eax, eax
lea esi, [ebx + 0x21c]
mov word [ebp - 0x48], ax
mov eax, esi
mov dword [ebp - 0x34], 7
mov dword [ebp - 0x38], edi
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40dab0
sub eax, edx
sar eax, 1
push eax
mov eax, esi
lea ecx, [ebp - 0x48]
call fcn.00401540
push 4
mov eax, str..dt_
lea ecx, [ebp - 0x48]
mov dword [ebp - 4], edi
call fcn.00402bd0
xor ecx, ecx
mov eax, esi
mov dword [ebp - 0x18], 7
mov dword [ebp - 0x1c], edi
mov word [ebp - 0x2c], cx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x40daf1
sub eax, edx
sar eax, 1
push eax
mov eax, esi
lea ecx, [ebp - 0x2c]
call fcn.00401540
push 5
mov eax, str..cfg_
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 1
call fcn.00402bd0
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
push esi
call edi
cmp eax, 0xffffffff
je 0x40db73
test al, 0x10
jne 0x40db73
mov ecx, esi
lea ebx, [ebp - 0x64]
call fcn.00402350
cmp dword [eax + 0x14], 8
mov dword [ebp - 0xa8], 1
jb 0x40db4c
mov eax, dword [eax]
mov edx, dword [ebp - 0x9c]
add edx, 0x62c
push edx
push eax
call fcn.0041011b
mov ebx, dword [ebp - 0x9c]
add esp, 8
mov byte [ebp - 0x95], 1
test eax, eax
je 0x40db7a
mov byte [ebp - 0x95], 0
test byte [ebp - 0xa8], 1
je 0x40db95
cmp dword [ebp - 0x50], 8
jb 0x40db95
mov eax, dword [ebp - 0x64]
push eax
call fcn.0040ed52
add esp, 4
cmp byte [ebp - 0x95], 0
je 0x40dc0c
mov ecx, dword [ebp - 0xa4]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov eax, dword [ebx + 0xc]
test eax, eax
je 0x40dbba
push 1
push 2
call eax
mov ebx, dword [ebx + 0xc]
test ebx, ebx
je 0x40dbc7
push 0
push 0xb
call ebx
mov esi, 8
cmp dword [ebp - 0x18], esi
jb 0x40dbdd
mov edx, dword [ebp - 0x2c]
push edx
call fcn.0040ed52
add esp, 4
xor eax, eax
mov dword [ebp - 0x18], 7
mov dword [ebp - 0x1c], 0
mov word [ebp - 0x2c], ax
cmp dword [ebp - 0x34], esi
jb 0x40dc02
mov ecx, dword [ebp - 0x48]
push ecx
call fcn.0040ed52
add esp, 4
mov eax, 0xb
jmp 0x40de53
cmp dword [ebp - 0x34], 8
mov eax, dword [ebp - 0x48]
jae 0x40dc18
lea eax, [ebp - 0x48]
push eax
call edi
cmp eax, 0xffffffff
je 0x40dcd1
test al, 0x10
jne 0x40dcd1
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x40dc38
lea eax, [ebp - 0x2c]
push eax
call edi
cmp eax, 0xffffffff
je 0x40dcd1
test al, 0x10
jne 0x40dcd1
mov eax, dword [ebp - 0x2c]
mov edi, 8
cmp dword [ebp - 0x18], edi
jae 0x40dc5c
lea eax, [ebp - 0x2c]
push eax
push ebx
lea ecx, [ebp - 0x94]
call fcn.0040e400
test eax, eax
je 0x40dcd6
lea edi, [ebp - 0x94]
mov esi, ebx
call fcn.0040e0a0
push str.Start_resume.
push str.kupdate::KHttpDownload::StartDownload
push str.webhttpdownload.cpp
push 7
mov edx, 0x1d1
call fcn.00402b80
mov eax, dword [ebp - 0x48]
mov ecx, 1
add dword [ebx + 0x68c], ecx
add esp, 0x10
cmp dword [ebp - 0x34], 8
mov dword [ebx + 0x678], ecx
jae 0x40dcb5
lea eax, [ebp - 0x48]
push 0
push 0x80
push 3
push 0
push ecx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
xor edi, edi
jmp 0x40dd1f
mov edi, 8
push esi
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileW]
call esi
mov eax, dword [ebp - 0x48]
cmp dword [ebp - 0x34], edi
jae 0x40dcea
lea eax, [ebp - 0x48]
push eax
call esi
mov eax, dword [ebp - 0x2c]
cmp dword [ebp - 0x18], edi
jae 0x40dcf8
lea eax, [ebp - 0x2c]
push eax
call esi
mov eax, dword [ebp - 0x48]
cmp dword [ebp - 0x34], edi
jae 0x40dd06
lea eax, [ebp - 0x48]
xor edi, edi
push edi
push 0x80
push 2
push edi
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebx + 0x10], eax
cmp eax, 0xffffffff
jne 0x40dd88
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [ebx + 0xc]
cmp ebx, edi
je 0x40dd39
push eax
push 1
call ebx
mov edx, dword [ebp - 0xa4]
push edi
push edx
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov esi, 8
cmp dword [ebp - 0x18], esi
jb 0x40dd5d
mov eax, dword [ebp - 0x2c]
push eax
call fcn.0040ed52
add esp, 4
xor ecx, ecx
mov dword [ebp - 0x18], 7
mov dword [ebp - 0x1c], edi
mov word [ebp - 0x2c], cx
cmp dword [ebp - 0x34], esi
jb 0x40dd7e
mov edx, dword [ebp - 0x48]
push edx
call fcn.0040ed52
add esp, 4
mov eax, 1
jmp 0x40de53
push 0x1c
call fcn.0040f26d
mov esi, eax
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
mov dword [esi + 0x18], eax
mov eax, dword [ebx + 0x10]
mov dword [esi + 0x14], eax
mov ecx, dword [ebx + 0x688]
mov dword [esi + 4], ecx
mov edx, dword [ebx + 0x684]
mov dword [esi + 8], edx
mov eax, dword [ebx + 0x674]
mov dword [esi + 0xc], eax
mov ecx, dword [ebx + 0x670]
sub ecx, dword [ebx + 0x674]
add esp, 4
mov dword [esi + 0x10], ecx
mov dword [esi + 0x18], ebx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edx, dword [ebx + 4]
push edx
mov dword [0x42aba0], eax
mov dword [ebx + 8], edi
call dword [sym.imp.KERNEL32.dll_ResetEvent]
lea eax, [ebp - 0xa0]
push eax
push edi
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateThread]
push 0x40cea0
push edi
push edi
mov dword [ebp - 0xa0], edi
call esi
lea ecx, [ebp - 0xa0]
push ecx
push 4
push ebx
push 0x40de70
push edi
push edi
mov dword [ebx + 0x67c], eax
call esi
mov edx, dword [ebx + 4]
push 0xffffffffffffffff
push edx
mov dword [ebx + 0x680], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ebx, dword [ebx + 8]
lea esi, [ebp - 0x2c]
call fcn.00401270
lea esi, [ebp - 0x48]
call fcn.00401270
mov eax, ebx
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.0040ed5d
mov esp, ebp
pop ebp
ret