Function at 0x4058b0
Capabilities:
Create directory
Delete file
Get common file path
Write file on windows

Disassembly:
sub esp, 0x214
mov eax, dword [esp + 0x218]
push ebx
push ebp
mov ebx, ecx
push esi
push edi
test eax, eax
mov dword [esp + 0x18], ebx
je 0x405be0
mov ecx, dword [esp + 0x22c]
test ecx, ecx
je 0x405be2
lea eax, [esp + 0x120]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x405be0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebx + 4]
push eax
push ecx
lea edi, [esp + 0x128]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov edx, dword [str.Preload]
not ecx
dec ecx
push edx
push str._s__s__x
lea eax, [esp + ecx + 0x130]
push eax
call fcn.00406840
mov eax, dword [ebx + 0x24]
add esp, 0x14
test eax, eax
je 0x405948
push eax
call fcn.004060f0
add esp, 4
mov dword [ebx + 0x24], 0
lea edi, [esp + 0x120]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
call fcn.00406160
mov edx, eax
add esp, 4
test edx, edx
mov dword [ebx + 0x24], edx
je 0x405be0
lea edi, [esp + 0x120]
or ecx, 0xffffffff
xor eax, eax
push 6
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 0x24]
push ecx
call fcn.004068b0
mov ebp, dword [sym.imp.KERNEL32.dll_Sleep]
add esp, 8
test eax, eax
je 0x4059e0
call fcn.00406db0
cmp dword [eax], 2
jne 0x405be0
xor esi, esi
mov edx, dword [ebx + 0x24]
push 0
push edx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x4059d7
push 0xf7
call ebp
inc esi
cmp esi, 4
jl 0x4059ba
cmp esi, 4
jge 0x405be0
mov eax, dword [esp + 0x228]
mov edx, dword [ebx + 0x24]
push edx
push str._sDone.idx
mov ecx, dword [eax]
add eax, 4
mov dword [esp + 0x230], eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], ecx
call fcn.00406840
add esp, 0xc
lea ecx, [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileA]
xor ebx, ebx
push 0
push pe_nt_image_headers32
push 2
push 0
push 0
lea edx, [esp + 0x30]
push 0x40000000
push edx
call edi
mov esi, eax
cmp esi, 0xffffffff
jne 0x405a55
push 0x1ff
call ebp
inc ebx
cmp ebx, 4
jl 0x405a28
cmp ebx, 4
jge 0x405be0
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x228]
lea eax, [esp + 0x14]
push 0
push eax
push ecx
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x405be0
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
cmp eax, ecx
jne 0x405be0
mov eax, dword [esp + 0x228]
mov edx, dword [esp + 0x18]
add eax, ecx
mov ecx, dword [eax]
add eax, 4
mov dword [esp + 0x228], eax
mov eax, dword [edx + 0x24]
mov dword [esp + 0x10], ecx
push eax
lea ecx, [esp + 0x20]
push str._sDone.cdb
push ecx
call fcn.00406840
add esp, 0xc
lea edx, [esp + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
xor ebx, ebx
push 0
push pe_nt_image_headers32
push 2
push 0
push 0
lea eax, [esp + 0x30]
push 0x40000000
push eax
call edi
mov esi, eax
cmp esi, 0xffffffff
jne 0x405b07
push 0x1ff
call ebp
inc ebx
cmp ebx, 4
jl 0x405ada
cmp ebx, 4
jge 0x405be0
mov edx, dword [esp + 0x10]
mov ebx, dword [esp + 0x228]
lea ecx, [esp + 0x14]
push 0
push ecx
push edx
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x405be0
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
cmp ecx, eax
jne 0x405be0
mov edi, dword [esp + 0x18]
add ebx, eax
lea ecx, [esp + 0x1c]
mov eax, dword [edi + 0x24]
push eax
push str._sAds
push ecx
call fcn.00406840
add esp, 0xc
lea edx, [esp + 0x1c]
push 6
push edx
call fcn.004068b0
add esp, 8
test eax, eax
je 0x405baa
call fcn.00406db0
cmp dword [eax], 2
jne 0x405be0
xor esi, esi
lea eax, [esp + 0x1c]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x405ba5
push 0xf7
call ebp
inc esi
cmp esi, 4
jl 0x405b87
cmp esi, 4
jge 0x405be0
mov ebp, dword [esp + 0x22c]
xor esi, esi
test ebp, ebp
jbe 0x405bd1
push ebx
mov ecx, edi
call fcn.00405bf0
test eax, eax
mov dword [esp + 0x228], eax
je 0x405be0
inc esi
mov ebx, eax
cmp esi, ebp
jb 0x405bb7
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x214
ret 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x214
ret 8