Function at 0x404370
Capabilities:
Create directory
Get common file path
Get file attributes
Set current directory
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x634
mov eax, dword [0x42f040]
xor eax, esp
mov dword [esp + 0x630], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
mov dword [esp + 0x10], eax
xor ecx, ecx
mov dword [esp + 0xc], ebx
mov dword [esp + 8], ecx
mov eax, 0x2aaaaaab
push esi
mov ecx, dword [ebx + 0x60]
mov esi, dword [ebx + 0x5c]
sub ecx, esi
imul ecx
push edi
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
test eax, eax
jle 0x404736
xor edi, edi
mov dword [esp + 0xc], edi
nop word [eax + eax]
push 0x104
lea eax, [esp + 0x534]
push 0
push eax
call fcn.0040f700
lea eax, [edi + esi]
add esp, 0xc
cmp dword [eax + 0x14], 0xf
jbe 0x4043f2
mov eax, dword [eax]
push eax
lea eax, [esp + 0x534]
push 0x42c55c
push eax
call fcn.00404ee0
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x53c]
add esp, 0xc
push eax
call fcn.00406300
mov edi, eax
test edi, edi
je 0x404704
push pe_nt_image_headers32
lea eax, [esp + 0x24]
push 0
push eax
call fcn.0040f700
add esp, 0xc
lea eax, [esp + 0x430]
push pe_nt_image_headers32
push 0
push eax
call fcn.0040f700
mov esi, dword [ebx + 0x5c]
add esp, 0xc
add esi, dword [esp + 0xc]
cmp dword [esi + 0x14], 0xf
jbe 0x40445d
mov esi, dword [esi]
test esi, esi
je 0x4044bf
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404466
sub ecx, edx
push esi
lea eax, [ecx + 1]
push eax
lea eax, [esp + 0x28]
push eax
call fcn.00415abf
mov ecx, esi
add esp, 0xc
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404486
sub ecx, edx
lea eax, [ecx - 1]
test eax, eax
js 0x4044ba
nop word [eax + eax]
mov cl, byte [eax + esi]
cmp cl, 0x5c
je 0x404752
cmp cl, 0x2f
je 0x404752
sub eax, 1
jns 0x4044a0
mov byte [esp + 0x20], 0
mov ecx, dword [ebx + 0x5c]
add ecx, dword [esp + 0xc]
call fcn.00408740
cmp byte [esp + 0x20], 0
je 0x4045fc
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x124]
push 0x104
push eax
call fcn.00415abf
lea ecx, [esp + 0x12c]
add esp, 0xc
lea edx, [ecx + 1]
nop word [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404500
sub ecx, edx
cmp byte [esp + ecx + 0x11f], 0x5c
je 0x40452d
push 0x42c528
lea eax, [esp + 0x124]
push 0x104
push eax
call fcn.00415cad
add esp, 0xc
lea eax, [esp + 0x120]
push 0x5c
push eax
call fcn.0040ee60
mov esi, eax
add esp, 8
test esi, esi
je 0x404573
cmp byte [esi - 1], 0x3a
je 0x404561
push 0
lea eax, [esp + 0x124]
mov byte [esi], 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov byte [esi], 0x5c
push 0x5c
inc esi
push esi
call fcn.0040ee60
mov esi, eax
add esp, 8
test esi, esi
jne 0x404545
lea eax, [esp + 0x430]
push eax
push pe_nt_image_headers32
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push pe_nt_image_headers32
lea eax, [esp + 0x334]
push 0
push eax
call fcn.0040f700
add esp, 0xc
lea eax, [esp + 0x430]
push eax
lea eax, [esp + 0x334]
push pe_nt_image_headers32
push eax
call fcn.00415abf
add esp, 0xc
lea eax, [esp + 0x330]
push 0x42c528
push pe_nt_image_headers32
push eax
call fcn.00415cad
add esp, 0xc
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x334]
push pe_nt_image_headers32
push eax
call fcn.00415cad
add esp, 0xc
lea eax, [esp + 0x330]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea edx, [edi + 4]
test edx, edx
je 0x40465e
mov ecx, edx
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404608
sub ecx, esi
lea eax, [ecx - 1]
mov esi, eax
test eax, eax
js 0x40463a
nop word [eax + eax]
mov cl, byte [eax + edx]
cmp cl, 0x5c
je 0x40475c
cmp cl, 0x2f
je 0x40475c
sub eax, 1
jns 0x404620
mov ecx, edx
lea esi, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404640
sub ecx, esi
push edx
lea eax, [ecx + 1]
push eax
lea eax, [esp + 0x230]
push eax
call fcn.00415abf
add esp, 0xc
lea eax, [esp + 0x228]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
test al, 1
je 0x404682
and eax, 0xfffffffe
push eax
lea eax, [esp + 0x22c]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
lea eax, [esp + 0x240]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x404801
push 0
lea eax, [esp + 0x20]
mov dword [esp + 0x20], 0
push eax
push dword [edi + 0x108]
push dword [edi + 0x140]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
test eax, eax
je 0x4047fb
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [esp + 0x20], 0
je 0x4046f3
lea eax, [esp + 0x430]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [edi]
mov ecx, edi
push 1
call dword [eax]
inc dword [ebx + 0x74]
cmp dword [ebx + 0x34], 0
jne 0x40477d
mov ecx, dword [ebx + 0x60]
mov eax, 0x2aaaaaab
mov esi, dword [ebx + 0x5c]
sub ecx, esi
mov edi, dword [esp + 0xc]
inc dword [esp + 0x10]
add edi, 0x18
imul ecx
mov dword [esp + 0xc], edi
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp dword [esp + 0x10], eax
jl 0x4043d0
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x630]
xor ecx, esp
call fcn.0040d81c
mov esp, ebp
pop ebp
ret 4
mov byte [esp + eax + 0x21], 0
jmp 0x4044bf
sub esi, eax
inc edx
add eax, edx
push esi
push eax
lea eax, [esp + 0x230]
push eax
call fcn.0040f180
mov byte [esp + esi + 0x234], 0
jmp 0x40465b
mov eax, dword [ebx + 0x3c]
xor esi, esi
mov ecx, dword [ebx + 0x38]
sub eax, ecx
test eax, 0xfffffffc
jle 0x4047d6
xor edi, edi
xor ebx, ebx
mov ecx, dword [ecx + edi]
call fcn.00405c20
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx + 0x38]
mov ecx, dword [ebx + eax]
test ecx, ecx
je 0x4047bc
mov eax, dword [ecx]
push 1
call dword [eax]
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx + 0x38]
mov dword [eax + esi*4], 0
mov eax, dword [esp + 0x14]
inc esi
add edi, 4
add ebx, 4
mov ecx, dword [eax + 0x38]
mov eax, dword [eax + 0x3c]
sub eax, ecx
sar eax, 2
cmp esi, eax
jl 0x404792
mov ecx, dword [esp + 0x18]
call fcn.00405c20
mov eax, 4
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x630]
xor ecx, esp
call fcn.0040d81c
mov esp, ebp
pop ebp
ret 4
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [edi]
mov ecx, edi
push 1
call dword [eax]
mov ecx, dword [esp + 0x18]
call fcn.00405c20
mov ecx, dword [esp + 0x63c]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040d81c
mov esp, ebp
pop ebp
ret 4