Function at 0x409060
Capabilities:
Create directory
Delete file
Get common file path
Move file

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40c8c6
mov eax, dword fs:[0]
push eax
sub esp, 0x190
mov eax, dword [0x413034]
xor eax, esp
mov dword [esp + 0x188], eax
push ebx
push esi
push edi
mov eax, dword [0x413034]
xor eax, esp
push eax
lea eax, [esp + 0x1a0]
mov dword fs:[0], eax
lea eax, [esp + 0x8c]
push eax
xor ebx, ebx
push ebx
push ebx
push 0x23
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
cmp eax, ebx
jl 0x40933e
lea eax, [esp + 0x8c]
dec eax
mov cl, byte [eax + 1]
inc eax
cmp cl, bl
jne 0x4090c5
mov ecx, dword [0x40f03c]
mov edx, dword [0x40f040]
mov dword [eax], ecx
mov ecx, dword [0x40f044]
mov dword [eax + 4], edx
mov edx, dword [0x40f048]
mov dword [eax + 8], ecx
mov cx, word [0x40f04c]
mov dword [eax + 0xc], edx
push ebx
lea edx, [esp + 0x90]
push edx
mov word [eax + 0x10], cx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
cmp eax, ebx
jne 0x40911f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x40933e
lea eax, [esp + 0x8c]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x24], ebx
mov byte [esp + 0x20], bl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x409135
lea ecx, [esp + 0x8c]
push ecx
sub eax, edx
lea ecx, [esp + 0x20]
call fcn.00409510
push 0x10
push str.TerNumaHost.txt
lea eax, [esp + 0x24]
mov dword [esp + 0x1b0], ebx
call fcn.00409450
mov eax, dword [esp + 0x20]
mov esi, 1
cmp dword [esp + 0x28], esi
jae 0x409179
lea eax, [esp + 0x20]
push 0x40f064
push eax
call dword [sym.imp.MSVCR100.dll_fopen]
add esp, 8
mov dword [0x413e58], eax
cmp eax, ebx
jne 0x4091a5
cmp dword [esp + 0x28], esi
jb 0x40933e
mov edx, dword [esp + 0x20]
push edx
jmp 0x409335
push ebx
call dword [sym.imp.MSVCR100.dll__time64]
mov dword [esp + 0x18], eax
lea eax, [esp + 0x18]
push eax
mov dword [esp + 0x20], edx
call dword [sym.imp.MSVCR100.dll__localtime64]
push eax
push str._Y__m__d__H:_M:_S
lea ecx, [esp + 0x4c]
push 0x50
push ecx
call dword [sym.imp.MSVCR100.dll_strftime]
mov edx, dword [0x413e58]
push 2
push ebx
push edx
call dword [sym.imp.MSVCR100.dll_fseek]
mov eax, dword [0x413e58]
push eax
call dword [sym.imp.MSVCR100.dll_ftell]
mov esi, dword [sym.imp.MSVCR100.dll_fputs]
mov edi, dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0x28
cmp eax, 0xf4240
jle 0x409306
mov ecx, dword [0x413e58]
push ecx
push str._n
call esi
mov eax, dword [0x413e58]
lea edx, [esp + 0x44]
push edx
push str._s_File_rollover_n
push eax
call edi
lea eax, [esp + 0xa0]
add esp, 0x14
mov dword [esp + 0x38], ebx
mov dword [esp + 0x34], ebx
mov byte [esp + 0x30], bl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x409241
lea ecx, [esp + 0x8c]
push ecx
sub eax, edx
lea ecx, [esp + 0x30]
call fcn.00409510
push 0x11
push str.TerNumaHost2.txt
lea eax, [esp + 0x34]
mov byte [esp + 0x1b0], 1
call fcn.00409450
mov edx, dword [0x413e58]
push edx
call dword [sym.imp.MSVCR100.dll_fclose]
mov eax, dword [esp + 0x34]
add esp, 4
cmp dword [esp + 0x38], 1
jae 0x409292
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov ecx, dword [esp + 0x30]
mov eax, 1
cmp dword [esp + 0x38], eax
jae 0x4092ac
lea ecx, [esp + 0x30]
cmp dword [esp + 0x28], eax
mov eax, dword [esp + 0x20]
jae 0x4092ba
lea eax, [esp + 0x20]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileA]
cmp dword [esp + 0x28], 1
mov eax, dword [esp + 0x20]
jae 0x4092d1
lea eax, [esp + 0x20]
push 0x40f0fc
push eax
call dword [sym.imp.MSVCR100.dll_fopen]
add esp, 8
cmp dword [esp + 0x38], 1
mov dword [0x413e58], eax
jb 0x4092fa
mov eax, dword [esp + 0x30]
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov dword [esp + 0x38], ebx
mov dword [esp + 0x34], ebx
mov byte [esp + 0x30], bl
mov ecx, dword [0x413e58]
push ecx
push str._n
call esi
mov eax, dword [0x413e58]
lea edx, [esp + 0x44]
push edx
push str._s_Parent_TerNumaHost_started_n
push eax
call edi
add esp, 0x14
cmp dword [esp + 0x28], 1
jb 0x40933e
mov ecx, dword [esp + 0x20]
push ecx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov ecx, dword [esp + 0x1a0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x188]
xor ecx, esp
call fcn.0040be38
mov esp, ebp
pop ebp
ret