Function at 0x40f634
Capabilities:
Allocate or change rwx memory
Check if file exists
Delete file
Get file attributes

Disassembly:
push ebp
mov ebp, esp
mov ecx, 8
push 0
push 0
dec ecx
jne 0x40f63c
push ebx
push esi
push edi
xor eax, eax
push ebp
push 0x40fb35
push dword fs:[eax]
mov dword fs:[eax], esp
call fcn.0040f140
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_GetFileAttributesW
cmp eax, 0xffffffff
je 0x40f697
lea edx, [ebp - 0x30]
mov eax, dword [ebp - 0x10]
call fcn.0040d2fc
mov ebx, eax
cmp dword [ebp - 0x30], 3
jbe 0x40f689
lea edx, [ebp - 0x28]
mov eax, ebx
call fcn.0040f220
jmp 0x40f6a4
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_DeleteFileW
jmp 0x40fafa
lea eax, [ebp - 0x28]
mov edx, 0x40fb4c
call fcn.004039b0
mov eax, dword [ebp - 0x28]
call fcn.0040f234
lea edx, [ebp - 0x3c]
call fcn.0040f220
mov ecx, dword [ebp - 0x3c]
lea eax, [ebp - 4]
mov edx, 0x40fc10
call fcn.0040f064
dec eax
test eax, eax
jl 0x40fab4
inc eax
mov dword [ebp - 0x38], eax
xor ebx, ebx
mov eax, dword [ebp - 4]
cmp dword [eax + ebx*4], 0
je 0x40faaa
mov eax, dword [ebp - 4]
mov eax, dword [eax + ebx*4]
mov edx, 0x40fc1c
call fcn.00403ce4
je 0x40faaa
push 0x40
push 0x3000
mov eax, dword [ebp - 4]
mov eax, dword [eax + ebx*4]
call fcn.00403b98
push eax
push 0
call sub.kernel32.dll_VirtualAlloc_1
mov edi, eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + ebx*4]
call fcn.00403d98
push eax
push edi
call sub.kernel32.dll_lstrcpyA
mov al, 8
call fcn.0040d544
call fcn.0040d154
mov ecx, eax
xor edx, edx
xor eax, eax
call fcn.0040dafc
mov esi, eax
mov eax, edi
call fcn.0040d154
mov cl, 1
mov edx, esi
call fcn.0040d8e0
push 0x8000
push 0
push edi
call sub.kernel32.dll_VirtualFree_1
mov edx, dword [0x4177f8]
mov eax, esi
call fcn.0040d2fc
mov edi, eax
test edi, edi
je 0x40faaa
push 0x40fc20
mov ecx, 0x40fc2c
mov edx, dword [0x4177f8]
mov edx, dword [edx]
mov eax, edi
call fcn.0040ef18
mov dword [ebp - 0x34], eax
push 0x8000
push 0
push edi
call sub.kernel32.dll_VirtualFree_1
push esi
call sub.kernel32.dll_DeleteFileW
push 0x8000
push 0
push esi
call sub.kernel32.dll_VirtualFree_1
cmp dword [ebp - 0x34], 0
je 0x40faaa
lea eax, [ebp - 0x34]
call fcn.0040d4e4
push 0x40
push 0x3000
mov eax, dword [ebp - 0x34]
push eax
call sub.kernel32.dll_lstrlenA_1
push eax
push 0
call sub.kernel32.dll_VirtualAlloc_1
mov edi, eax
mov eax, dword [ebp - 0x34]
push eax
call sub.kernel32.dll_lstrlenA_1
mov edx, eax
mov ecx, edi
mov eax, dword [ebp - 0x34]
call fcn.00405504
mov dword [ebp - 0x2c], eax
mov edx, 0x40fc34
mov ecx, dword [ebp - 0x2c]
mov eax, edi
call fcn.0040d370
mov esi, eax
cmp esi, 0xffffffff
je 0x40faaa
push 0x40
push 0x3000
mov eax, dword [ebp - 0x2c]
push eax
push 0
call sub.kernel32.dll_VirtualAlloc_1
mov dword [ebp - 0x14], eax
push 0x40
push 0x3000
mov eax, dword [ebp - 0x2c]
push eax
push 0
call sub.kernel32.dll_VirtualAlloc_1
mov dword [ebp - 0x18], eax
mov ecx, esi
mov edx, edi
mov eax, dword [ebp - 0x14]
call fcn.0040d49c
lea eax, [esi + 4]
mov ecx, dword [ebp - 0x2c]
sub ecx, eax
mov edx, eax
add edx, edi
mov eax, dword [ebp - 0x18]
call fcn.0040d49c
push 0x8000
push 0
mov eax, dword [ebp - 0x34]
push eax
call sub.kernel32.dll_VirtualFree_1
push 0x8000
push 0
push edi
call sub.kernel32.dll_VirtualFree_1
mov eax, 0x411b44
mov edx, 0x80
call fcn.0040d61c
push 0x40
push 0x3000
push esi
push 0
call sub.kernel32.dll_VirtualAlloc_1
mov ebx, eax
mov edx, ebx
mov eax, dword [ebp - 0x14]
mov ecx, esi
call fcn.0040d834
push 0x40
push 0x3000
mov eax, dword [ebp - 0x18]
push eax
call sub.kernel32.dll_lstrlenA_1
push eax
push 0
call sub.kernel32.dll_VirtualAlloc_1
mov esi, eax
mov eax, dword [ebp - 0x18]
push eax
call sub.kernel32.dll_lstrlenA_1
mov edx, eax
mov ecx, esi
mov eax, dword [ebp - 0x18]
call fcn.00405504
mov edi, eax
push 0x8000
push 0
mov eax, dword [ebp - 0x14]
push eax
call sub.kernel32.dll_VirtualFree_1
push 0x8000
push 0
mov eax, dword [ebp - 0x18]
push eax
call sub.kernel32.dll_VirtualFree_1
push dword [0x411b38]
push dword [0x411b3c]
push dword [0x411b40]
lea eax, [ebp - 0x20]
mov edx, 3
call fcn.00403c58
lea eax, [ebp - 0x24]
mov edx, edi
call fcn.00403ec8
lea eax, [ebp - 0x24]
call fcn.00403df0
mov ecx, edi
mov edx, esi
call fcn.0040d49c
lea ecx, [ebp - 0x1c]
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x24]
call fcn.0040cbe0
push 0x8000
push 0
push esi
call sub.kernel32.dll_VirtualFree_1
lea edx, [ebp - 0x40]
mov eax, ebx
call fcn.0040f220
mov edx, dword [ebp - 0x40]
mov eax, dword [ebp - 0x1c]
call fcn.00403ce4
jne 0x40fa9b
push ebx
call sub.kernel32.dll_lstrlenA_1
mov ecx, eax
mov edx, 0x40fc3c
mov eax, ebx
call fcn.0040d370
test eax, eax
je 0x40f98f
push ebx
call sub.kernel32.dll_lstrlenA_1
mov ecx, eax
mov edx, 0x40fc44
mov eax, ebx
call fcn.0040d370
test eax, eax
jne 0x40f9ab
mov eax, dword [ebp - 0x1c]
call fcn.0040f418
test al, al
jne 0x40fa8c
mov eax, ebx
call fcn.0040f4dc
jmp 0x40fa8c
push ebx
call sub.kernel32.dll_lstrlenA_1
mov ecx, eax
mov edx, 0x40fc4c
mov eax, ebx
call fcn.0040d370
test eax, eax
jne 0x40fa41
lea eax, [ebp - 8]
mov ecx, dword [ebp - 0x1c]
mov edx, 0x40fc5c
call fcn.0040f064
cmp eax, 3
jne 0x40fa2a
mov eax, dword [ebp - 8]
mov eax, dword [eax + 4]
call fcn.00403d98
push eax
mov eax, dword [0x418d54]
push eax
call sub.kernel32.dll_lstrcpyA
call fcn.0040f404
mov eax, dword [0x418d54]
call fcn.0040f2e8
test al, al
jne 0x40fa0b
cmp byte [0x418d58], 0
je 0x40fa2a
mov eax, dword [ebp - 8]
mov eax, dword [eax + 8]
call fcn.0040f418
test al, al
jne 0x40fa2a
mov eax, dword [ebp - 8]
mov eax, dword [eax + 8]
call fcn.00403d98
call fcn.0040f4dc
mov byte [0x418d58], 0
push 0x40fc60
mov eax, dword [0x418d54]
push eax
call sub.kernel32.dll_lstrcpyA
push ebx
call sub.kernel32.dll_lstrlenA_1
mov ecx, eax
mov edx, 0x40fc64
mov eax, ebx
call fcn.0040d370
test eax, eax
jne 0x40fa8c
lea eax, [ebp - 0xc]
mov ecx, dword [ebp - 0x1c]
mov edx, 0x40fc5c
call fcn.0040f064
cmp eax, 2
jne 0x40fa8c
mov eax, 0x40fc68
call fcn.0040d8c0
test al, al
je 0x40fa8c
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 4]
call fcn.00403d98
call fcn.0040f520
push 0x8000
push 0
push ebx
call sub.kernel32.dll_VirtualFree_1
jmp 0x40fafa
push 0x8000
push 0
push ebx
call sub.kernel32.dll_VirtualFree_1
jmp 0x40fafa
inc ebx
dec dword [ebp - 0x38]
jne 0x40f6d3
push 0x493e0
call sub.kernel32.dll_Sleep
mov eax, 0x40fc88
call fcn.0040f234
call fcn.0040d154
call fcn.0040efb8
mov ebx, eax
test ebx, ebx
je 0x40faea
push ebx
call sub.kernel32.dll_lstrlenA_1
mov edx, eax
mov ecx, dword [ebp - 0x10]
mov eax, ebx
call fcn.0040dc10
push 0x8000
push 0
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_VirtualFree_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40fb3c
lea eax, [ebp - 0x40]
mov edx, 2
call fcn.0040393c
lea eax, [ebp - 0x28]
mov edx, 4
call fcn.0040393c
lea eax, [ebp - 0xc]
mov edx, dword [0x40d080]
mov ecx, 3
call fcn.004040a4
ret