Function at 0x405810
Capabilities:
Check if file exists
Create directory
Get file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x420
mov eax, dword [0x470004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x404]
push edi
push 0x400
push 0
push eax
mov dword [ebp - 0x410], ecx
call fcn.0043e460
push esi
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.00444492
lea ebx, [ebp - 0x404]
add esp, 0x18
lea ecx, [ebx + 1]
mov al, byte [ebx]
inc ebx
test al, al
jne 0x405860
sub ebx, ecx
xor esi, esi
test ebx, ebx
jle 0x4058de
nop
mov al, byte [ebp + esi - 0x404]
cmp al, 0x2f
je 0x40587f
cmp al, 0x5c
jne 0x4058d9
cmp esi, 0x400
jae 0x405b3e
lea eax, [ebp - 0x404]
mov byte [ebp + esi - 0x404], 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x4058a9
test al, 0x10
ja 0x4058d1
lea eax, [ebp - 0x404]
push eax
push str.mkdir__s_n
call fcn.00405410
lea eax, [ebp - 0x404]
push eax
call fcn.00444148
add esp, 0xc
test eax, eax
jne 0x405ae6
mov byte [ebp + esi - 0x404], 0x5c
inc esi
cmp esi, ebx
jl 0x405870
dec ebx
push str.start_dec_n
mov dword [ebp - 0x414], ebx
call fcn.00405410
mov edx, dword [ebp - 0x410]
add esp, 4
mov dword [ebp - 0x41c], 0
mov edi, 1
movzx esi, byte [edx]
test esi, esi
je 0x405b10
cmp esi, 2
ja 0x405b0b
movzx ebx, byte [edx + edi]
lea ecx, [ebp - 0x404]
movzx eax, byte [edx + edi + 1]
add edi, 2
shl ebx, 8
or ebx, eax
mov eax, dword [ebp - 0x414]
add ecx, eax
mov dword [ebp - 0x40c], ecx
test ebx, ebx
je 0x405968
lea eax, [edx + edi]
push ebx
push eax
push ecx
call fcn.0043e5c0
mov ecx, dword [ebp - 0x40c]
add esp, 0xc
mov eax, dword [ebp - 0x414]
add edi, ebx
mov edx, dword [ebp - 0x410]
jmp 0x40596e
mov dword [ebp - 0x40c], ecx
add eax, ebx
cmp eax, 0x400
jae 0x405b3e
mov byte [ebp + eax - 0x404], 0
cmp esi, 1
jne 0x4059c9
lea eax, [ebp - 0x404]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x4059a2
test al, 0x10
ja 0x405ad1
lea eax, [ebp - 0x404]
push eax
push str.mkdir__s_n
call fcn.00405410
lea eax, [ebp - 0x404]
push eax
call fcn.00444148
add esp, 0xc
test eax, eax
jmp 0x405acf
movzx esi, byte [edx + edi]
movzx eax, byte [edx + edi + 1]
shl esi, 8
or esi, eax
movzx eax, byte [edx + edi + 2]
shl esi, 8
or esi, eax
movzx eax, byte [edx + edi + 3]
shl esi, 8
add edi, 4
or esi, eax
mov dword [ebp - 0x420], edi
cmp byte [ebp + 0xc], 0
mov dword [ebp - 0x418], esi
jne 0x405a36
push str.PxServer_
push ecx
call fcn.0043d9c0
add esp, 8
test eax, eax
jne 0x405a29
push 0x4699e0
push dword [ebp - 0x40c]
call fcn.0043d9c0
add esp, 8
test eax, eax
je 0x405a30
xor ebx, ebx
jmp 0x405aad
mov edx, dword [ebp - 0x410]
push 0x4699b8
lea eax, [ebp - 0x404]
push eax
lea eax, [ebp - 0x408]
push eax
lea ebx, [edx + edi]
call fcn.00444101
mov eax, dword [ebp - 0x408]
add esp, 0xc
test eax, eax
je 0x405aa8
test ebx, ebx
je 0x405a95
cmp dword [ebp - 0x418], 0
jle 0x405a95
mov edi, eax
nop dword [eax]
push edi
push esi
push 1
push ebx
call fcn.00444870
add esp, 0x10
test eax, eax
jle 0x405a89
sub esi, eax
add ebx, eax
test esi, esi
jg 0x405a70
mov eax, dword [ebp - 0x408]
mov edi, dword [ebp - 0x420]
push eax
call fcn.00443c4b
mov esi, dword [ebp - 0x418]
add esp, 4
xor ebx, ebx
jmp 0x405aad
mov ebx, 1
mov ecx, dword [0x472670]
add edi, esi
test ecx, ecx
je 0x405acd
mov edx, dword [ecx]
mov eax, edi
sub eax, dword [ebp - 0x41c]
push eax
call dword [edx + 4]
mov dword [ebp - 0x41c], edi
test ebx, ebx
jne 0x405ae6
mov edx, dword [ebp - 0x410]
movzx esi, byte [edx + edi]
inc edi
test esi, esi
jne 0x405912
jmp 0x405b10
lea eax, [ebp - 0x404]
push eax
call fcn.00443fea
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00405b44
mov esp, ebp
pop ebp
ret
cmp esi, 0xa
je 0x405b1e
push esi
push str.invalid_type__d_n
call fcn.00405410
add esp, 8
push str.extra_end_n
call fcn.00405410
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
xor eax, eax
pop edi
pop esi
pop ebx
call fcn.00405b44
mov esp, ebp
pop ebp
ret
call fcn.00405c76
int3