Function at 0x408860
Capabilities:
Check if file exists
Create directory
Delete file
Move file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x46e0
call fcn.004bec10
mov eax, dword [0x5383c4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov dword [ebp - 0x4670], eax
xor edi, edi
mov eax, dword [ebp + 0x10]
push 0x1f4
mov dword [ebp - 0x467c], eax
mov dword [ebp - 0x465c], edi
call fcn.004c465e
mov ecx, dword [ebp - 0x4670]
add esp, 4
mov dword [ebp - 0x4664], eax
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4088b3
sub ecx, edx
mov dword [ebp - 0x466c], edi
sar ecx, 1
movzx eax, cx
push 0x4ef818
push esi
mov dword [ebp - 0x468c], eax
mov dword [ebp - 0x630], 0x4085a0
mov dword [ebp - 0x62c], 0x4085c0
mov dword [ebp - 0x638], 0x4085a0
mov dword [ebp - 0x634], 0x4085c0
call fcn.004c7e99
add esp, 8
mov dword [ebp - 0x620], eax
test eax, eax
jne 0x408930
call fcn.004c45cc
cmp dword [eax], edi
je 0x408930
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004bebdd
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x628]
mov dword [ebp - 0x628], 0x409000
mov dword [ebp - 0x624], 0x409050
mov dword [ebp - 0x4654], 0x409210
mov dword [ebp - 0x4650], 0x4092e0
mov dword [ebp - 0x464c], 0x409270
mov dword [ebp - 0x4648], 0x4092c0
mov dword [ebp - 0x4644], eax
mov dword [ebp - 0x463c], edi
mov dword [ebp - 0x4640], edi
call fcn.0040d700
lea eax, [ebp - 0x46e0]
push eax
call fcn.0040e800
lea eax, [ebp - 0x638]
push eax
lea eax, [ebp - 0x630]
push eax
lea eax, [ebp - 0x4654]
push eax
lea eax, [ebp - 0x46e0]
push eax
call fcn.0040aa60
add esp, 0x14
test eax, eax
je 0x4089d5
lea eax, [ebp - 0x630]
push eax
lea eax, [ebp - 0x46e0]
push eax
call fcn.0040e790
jmp 0x408e9c
xor edx, edx
mov dword [ebp - 0x4688], 0xffffffff
xor ecx, ecx
mov dword [ebp - 0x4658], edx
mov dword [ebp - 0x4684], edx
mov dword [ebp - 0x4660], ecx
cmp dword [ebp - 0x46c4], ecx
jbe 0x408e3b
mov dword [ebp - 0x4680], edx
nop word [eax + eax]
mov eax, dword [ebp - 0x46a0]
mov edi, dword [eax + ecx*4 + 4]
lea esi, [eax + ecx*4]
mov ebx, dword [ebp - 0x46d0]
sub edi, dword [esi]
add ebx, edx
mov dword [ebp - 0x4678], 0
mov dword [ebp - 0x4674], 0
mov dword [ebp - 0x4690], ebx
cmp edi, dword [ebp - 0x466c]
jbe 0x408a87
push dword [ebp - 0x465c]
call fcn.004c4643
add esp, 4
mov dword [ebp - 0x466c], edi
add edi, edi
je 0x408e53
push edi
call fcn.004c465e
mov edi, eax
add esp, 4
mov dword [ebp - 0x465c], edi
test edi, edi
je 0x408e35
mov edx, dword [esi + 4]
mov ecx, dword [esi]
sub edx, ecx
jmp 0x408a98
mov edx, dword [esi + 4]
mov ecx, dword [esi]
sub edx, ecx
mov edi, dword [ebp - 0x465c]
test edi, edi
je 0x408ac0
mov eax, dword [ebp - 0x469c]
lea esi, [eax + ecx*2]
test edx, edx
je 0x408ac0
mov ecx, edi
sub esi, edi
nop dword [eax]
mov ax, word [esi + ecx]
lea ecx, [ecx + 2]
mov word [ecx - 2], ax
sub edx, 1
jne 0x408ab0
cmp byte [ebx + 0x19], 0
jne 0x408b1b
lea eax, [ebp - 0x638]
push eax
lea eax, [ebp - 0x630]
push eax
lea eax, [ebp - 0x4674]
push eax
lea eax, [ebp - 0x4678]
push eax
lea eax, [ebp - 0x4684]
push eax
lea eax, [ebp - 0x4658]
push eax
lea eax, [ebp - 0x4688]
push eax
push dword [ebp - 0x4660]
lea eax, [ebp - 0x4654]
push eax
lea eax, [ebp - 0x46e0]
push eax
call fcn.0040e4e0
add esp, 0x28
test eax, eax
jne 0x408e35
mov esi, dword [ebp - 0x4664]
push 0x1f4
push 0
push esi
call fcn.004c0a60
mov ecx, dword [ebp - 0x4670]
mov edx, esi
add esp, 0xc
sub edx, ecx
nop dword [eax + eax]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [ecx + edx - 2], ax
test ax, ax
jne 0x408b40
movzx eax, word [edi]
xor esi, esi
mov ecx, eax
test ax, ax
je 0x408ba5
mov eax, dword [ebp - 0x468c]
mov edx, edi
mov ebx, dword [ebp - 0x4664]
movzx eax, ax
lea edi, [ebx + eax*2]
mov ebx, dword [ebp - 0x465c]
movzx eax, cx
mov ecx, eax
cmp eax, 0x2f
jne 0x408b8a
mov ecx, 0x5c
mov eax, ecx
mov word [edx], ax
inc esi
mov word [edi], cx
movzx eax, word [ebx + esi*2]
lea edx, [ebx + esi*2]
add edi, 2
mov ecx, eax
test ax, ax
jne 0x408b76
mov ebx, dword [ebp - 0x4690]
mov esi, dword [ebp - 0x4664]
mov edi, esi
lea ecx, [edi + 2]
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x408bb0
push 0x208
lea eax, [ebp - 0x20c]
sub edi, ecx
push 0
push eax
sar edi, 1
call fcn.004c0a60
push esi
lea eax, [edi + 1]
push eax
lea eax, [ebp - 0x20c]
push eax
call fcn.004c45df
add esp, 0x18
xor esi, esi
test edi, edi
js 0x408c46
nop dword [eax]
cmp word [ebp + esi*2 - 0x20c], 0x5c
jne 0x408c41
cmp esi, 0x104
jae 0x408feb
xor eax, eax
mov word [ebp + esi*2 - 0x20c], ax
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x408c34
push eax
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x408c46
mov eax, 0x5c
mov word [ebp + esi*2 - 0x20c], ax
inc esi
cmp esi, edi
jle 0x408bf0
cmp byte [ebx + 0x19], 0
jne 0x408de9
mov ebx, dword [ebp - 0x4664]
lea eax, [ebp - 0x4668]
push ebx
push eax
call fcn.0040a7a0
add esp, 8
test eax, eax
je 0x408d86
push 0x208
lea eax, [ebp - 0x414]
push 0
push eax
call fcn.004c0a60
lea edx, [ebp - 0x414]
add esp, 0xc
mov ecx, ebx
sub edx, ebx
nop
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [ecx + edx - 2], ax
test ax, ax
jne 0x408c90
lea eax, [ebp - 0x414]
push str..del
push eax
call fcn.004c025d
add esp, 8
test eax, eax
je 0x408cc3
lea eax, [ebp - 0x414]
jmp 0x408d63
xor esi, esi
nop word [eax + eax]
push 0x208
lea eax, [ebp - 0x61c]
push 0
push eax
call fcn.004c0a60
add esp, 0xc
lea eax, [ebp - 0x414]
test esi, esi
jne 0x408d07
push eax
lea eax, [ebp - 0x61c]
push str._s.del
push eax
call fcn.004085d0
add esp, 0xc
jmp 0x408d1d
push esi
push eax
lea eax, [ebp - 0x61c]
push str._s.del_d
push eax
call fcn.004085d0
add esp, 0x10
lea eax, [ebp - 0x61c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x408d47
lea eax, [ebp - 0x61c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x408d47
cmp esi, 0xa
jge 0x408d6e
inc esi
jmp 0x408cd0
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x414]
push eax
call fcn.004c4669
add esp, 8
lea eax, [ebp - 0x61c]
push 5
push 0
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
lea eax, [ebp - 0x4668]
push ebx
push eax
call fcn.0040a7a0
add esp, 8
test eax, eax
jne 0x408e57
mov ebx, dword [ebp - 0x4674]
mov esi, dword [ebp - 0x4668]
test ebx, ebx
je 0x408dce
mov eax, dword [ebp - 0x4678]
add eax, dword [ebp - 0x4658]
push esi
push ebx
push 1
push eax
call fcn.004c8db7
mov edi, eax
add esp, 0x10
cmp edi, ebx
je 0x408dce
push esi
call fcn.004c7dab
add esp, 4
test eax, eax
jne 0x408e6b
cmp edi, ebx
jne 0x408e6b
test esi, esi
je 0x408de9
push esi
call fcn.004c7cfb
add esp, 4
test eax, eax
jne 0x408e7f
mov dword [ebp - 0x4668], eax
mov ebx, dword [ebp - 0x467c]
test ebx, ebx
je 0x408e07
mov eax, dword [ebp - 0x4660]
mov ecx, ebx
push dword [ebp - 0x46c4]
mov edx, dword [ebx]
inc eax
push eax
call dword [edx]
mov ecx, dword [ebp - 0x4660]
mov edx, dword [ebp - 0x4680]
inc ecx
add edx, 0x20
mov dword [ebp - 0x4660], ecx
mov dword [ebp - 0x4680], edx
cmp ecx, dword [ebp - 0x46c4]
jb 0x408a10
mov edi, dword [ebp - 0x465c]
mov edx, dword [ebp - 0x4658]
mov eax, dword [ebp - 0x62c]
push edx
cmp eax, 0x4085c0
jne 0x408e93
call fcn.004c4643
add esp, 4
jmp 0x408e9f
xor edi, edi
jmp 0x408e35
push str.can_not_open_output_file
push str._nERROR:__s_n
call fcn.004084c0
add esp, 8
jmp 0x408e2f
push str.can_not_write_output_file
push str._nERROR:__s_n
call fcn.004084c0
add esp, 8
jmp 0x408e2f
push str.can_not_close_output_file
push str._nERROR:__s_n
call fcn.004084c0
add esp, 8
jmp 0x408e2f
lea ecx, [ebp - 0x630]
push ecx
call eax
add esp, 8
mov eax, dword [ebp - 0x62c]
push dword [ebp - 0x46b0]
cmp eax, 0x4085c0
jne 0x408ebc
call fcn.004c4643
add esp, 4
jmp 0x408ec8
lea ecx, [ebp - 0x630]
push ecx
call eax
add esp, 8
mov eax, dword [ebp - 0x62c]
push dword [ebp - 0x46ac]
cmp eax, 0x4085c0
jne 0x408ee5
call fcn.004c4643
add esp, 4
jmp 0x408ef1
lea ecx, [ebp - 0x630]
push ecx
call eax
add esp, 8
mov eax, dword [ebp - 0x62c]
push dword [ebp - 0x46a8]
cmp eax, 0x4085c0
jne 0x408f0e
call fcn.004c4643
add esp, 4
jmp 0x408f1a
lea ecx, [ebp - 0x630]
push ecx
call eax
add esp, 8
mov eax, dword [ebp - 0x62c]
push dword [ebp - 0x46a4]
cmp eax, 0x4085c0
jne 0x408f37
call fcn.004c4643
add esp, 4
jmp 0x408f43
lea ecx, [ebp - 0x630]
push ecx
call eax
add esp, 8
mov eax, dword [ebp - 0x62c]
push dword [ebp - 0x46a0]
cmp eax, 0x4085c0
jne 0x408f60
call fcn.004c4643
add esp, 4
jmp 0x408f6c
lea ecx, [ebp - 0x630]
push ecx
call eax
add esp, 8
mov eax, dword [ebp - 0x62c]
push dword [ebp - 0x469c]
cmp eax, 0x4085c0
jne 0x408f89
call fcn.004c4643
add esp, 4
jmp 0x408f95
lea ecx, [ebp - 0x630]
push ecx
call eax
add esp, 8
lea eax, [ebp - 0x630]
mov dword [ebp - 0x469c], 0
push eax
lea eax, [ebp - 0x46e0]
mov dword [ebp - 0x4698], 0
push eax
call fcn.0040e870
push edi
call fcn.004c4643
mov eax, dword [ebp - 0x620]
add esp, 0xc
test eax, eax
je 0x408fd8
push eax
call fcn.004c7cfb
add esp, 4
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004bebdd
mov esp, ebp
pop ebp
ret
call fcn.004beb02
int3