Function at 0x406220
Capabilities:
Create directory
Set file attributes

Disassembly:
sub esp, 0x18
push esi
push edi
mov edi, dword [eax*4 + 0x420c60]
xor esi, esi
mov dword [esp + 0x10], esi
mov dword [0x42005c], 1
mov dword [esp + 8], edi
cmp edi, esi
jne 0x40624f
pop edi
mov eax, 0x86180002
pop esi
add esp, 0x18
ret
mov dword [esp + 0x14], esi
cmp dword [edi + 0x4054], esi
jbe 0x4065fe
push ebx
lea ecx, [edi + 0x409c]
push ebp
lea ebp, [edi + 0x609c]
mov dword [esp + 0x20], esi
mov dword [esp + 0x14], ecx
jmp 0x406284
mov esi, dword [esp + 0x1c]
mov edx, dword [edi + 0x709c]
mov ecx, dword [edi + 0x4078]
mov ebx, dword [edi + 0x4048]
add ebx, dword [esp + 0x20]
lea eax, [edi + edx*2 + 0x609c]
lea edx, [ecx + esi*4]
mov ecx, dword [edx + 4]
sub ecx, dword [edx]
test eax, eax
je 0x4062d4
mov edx, dword [edi + 0x4078]
mov edx, dword [edx + esi*4]
mov esi, dword [edi + 0x407c]
lea edx, [esi + edx*2]
test ecx, ecx
jbe 0x4062d4
sub edx, eax
mov si, word [edx + eax]
mov word [eax], si
add eax, 2
sub ecx, 1
jne 0x4062c5
mov eax, dword [edi + 0x709c]
cmp word [edi + eax*2 + 0x609c], 0
lea esi, [edi + eax*2 + 0x609c]
je 0x40631e
lea esp, [esp]
cmp word [esi], 0x2f
jne 0x406315
xor eax, eax
push eax
push ebp
mov word [esi], ax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40630d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, 0x5c
mov word [esi], cx
add esi, 2
cmp word [esi], 0
jne 0x4062f0
cmp byte [ebx + 0x19], 0
push 0
je 0x406340
push ebp
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x4065dd
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4065dd
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0x80
push 2
push 0
push 1
push 0x40000000
push ebp
call edi
mov esi, eax
mov dword [esp + 0x24], esi
cmp esi, 0xffffffff
jne 0x40643b
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x40643b
cmp dword [0x42005c], 0
je 0x406394
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [0x42005c], 0
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push ebp
call edi
mov esi, eax
mov dword [esp + 0x24], esi
cmp esi, 0xffffffff
jne 0x40643b
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x40643b
mov eax, ebp
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4063c7
mov esi, dword [esp + 0x2c]
sub eax, edx
sar eax, 1
lea edx, [eax + eax]
push edx
push ebp
push esi
call fcn.0040dd00
mov eax, ebp
add esp, 0xc
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4063f0
sub eax, edx
sar eax, 1
xor ecx, ecx
mov word [esi + eax*2], cx
mov eax, esi
add eax, 0xfffffffe
lea ebx, [ebx]
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x406410
mov edx, dword [str._Open]
mov dword [eax], edx
mov ecx, dword [0x41c4e4]
mov dword [eax + 4], ecx
mov edx, dword [0x41c4e8]
mov dword [eax + 8], edx
jmp 0x4065d1
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x14]
lea eax, [esp + 0x24]
push eax
mov eax, dword [ecx]
add edi, 0x1000
call fcn.00406610
add esp, 4
test eax, eax
jne 0x40655c
cmp esi, 0xffffffff
je 0x406542
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x406542
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
test eax, eax
je 0x406542
cmp dword [0x42005c], 0
je 0x4064a6
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [0x42005c], 0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x406542
call edi
test eax, eax
je 0x406542
mov eax, ebp
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4064c4
mov esi, dword [esp + 0x2c]
sub eax, edx
sar eax, 1
lea edx, [eax + eax]
push edx
push ebp
push esi
call fcn.0040dd00
mov eax, ebp
add esp, 0xc
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4064f0
sub eax, edx
sar eax, 1
xor ecx, ecx
mov word [esi + eax*2], cx
mov eax, esi
add eax, 0xfffffffe
lea ebx, [ebx]
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x406510
mov edx, dword [str._CLose]
mov dword [eax], edx
mov ecx, dword [0x41c500]
mov dword [eax + 4], ecx
mov edx, dword [0x41c504]
mov dword [eax + 8], edx
mov cx, word [0x41c508]
jmp 0x4065cd
cmp byte [ebx + 0x1d], 0
je 0x4065d9
mov edx, dword [ebx + 0x14]
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
jmp 0x4065d9
mov eax, ebp
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406561
mov esi, dword [esp + 0x2c]
sub eax, edx
sar eax, 1
add eax, eax
push eax
push ebp
push esi
call fcn.0040dd00
mov eax, ebp
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406586
sub eax, edx
sar eax, 1
xor ecx, ecx
mov word [esi + eax*2], cx
mov eax, esi
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x4065a0
mov edx, dword [str._Write]
mov dword [eax], edx
mov ecx, dword [0x41c4f0]
mov dword [eax + 4], ecx
mov edx, dword [0x41c4f4]
mov dword [eax + 8], edx
mov cx, word [0x41c4f8]
mov word [eax + 0xc], cx
mov dword [esp + 0x18], 0x86180003
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x1c]
add dword [esp + 0x20], 0x20
add dword [esp + 0x14], 4
inc eax
mov dword [esp + 0x1c], eax
cmp eax, dword [edi + 0x4054]
jb 0x406280
pop ebp
pop ebx
mov eax, dword [esp + 0x10]
pop edi
pop esi
add esp, 0x18
ret