Function at 0x409cc0
Capabilities:
Create directory
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x280
mov eax, dword [0x432040]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
mov ebx, ecx
mov dword [ebp - 0xc], 0xffffffff
xor edx, edx
mov dword [ebp - 0x27c], 0
push esi
push edi
mov dword [ebp - 0x274], 0
mov dword [ebp - 0x26c], edx
cmp dword [ebx + 0x80], edx
jbe 0x40a03b
lea ecx, [ebx + 0x38]
nop word [eax + eax]
mov eax, dword [ecx + 0x7c]
mov dword [ebp - 0x268], 0
mov dword [ebp - 0x278], 0
mov ecx, dword [eax + edx*4]
mov edx, dword [eax + edx*4 + 4]
sub edx, ecx
cmp edx, 0x104
jae 0x40a031
mov edi, dword [ebx + 0x6f0]
add edi, 0x6a
lea edi, [ebx + edi*2]
mov dword [ebp - 0x270], edi
test edi, edi
je 0x409d73
mov eax, dword [ebx + 0xb8]
lea esi, [eax + ecx*2]
test edx, edx
je 0x409d73
mov ecx, edi
sub esi, edi
mov ax, word [ecx + esi]
lea ecx, [ecx + 2]
mov word [ecx - 2], ax
sub edx, 1
jne 0x409d63
lea eax, [ebx + 0xcc]
push eax
lea eax, [ebx + 0xc4]
push eax
lea eax, [ebp - 0x278]
push eax
lea eax, [ebp - 0x268]
push eax
lea eax, [ebp - 0x274]
push eax
lea eax, [ebp - 0x27c]
push eax
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 0x26c]
lea edx, [ebx + 0x10]
lea ecx, [ebx + 0x38]
call fcn.004039e0
add esp, 0x20
mov dword [ebx + 0xc0], eax
test eax, eax
jne 0x40a03b
movzx eax, word [edi]
xor edx, edx
xor esi, esi
mov ecx, eax
test ax, ax
je 0x409e1d
cmp cx, 0x2f
jne 0x409e03
xor eax, eax
push eax
mov word [edi], ax
lea eax, [ebx + 0xd4]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x409df4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, 0x5c
lea edx, [esi + 1]
mov word [edi], ax
mov esi, edx
jmp 0x409e04
inc esi
mov eax, dword [ebp - 0x270]
lea edi, [eax + esi*2]
movzx eax, word [edi]
mov ecx, eax
test ax, ax
jne 0x409dd1
mov edi, dword [ebp - 0x270]
lea esi, [edi + edx*2]
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
push esi
call edi
push esi
call edi
mov eax, dword [ebp + 8]
nop
mov cx, word [esi]
cmp cx, word [eax]
jne 0x409e56
test cx, cx
je 0x409e52
mov cx, word [esi + 2]
cmp cx, word [eax + 2]
jne 0x409e56
add esi, 4
add eax, 4
test cx, cx
jne 0x409e30
xor eax, eax
jmp 0x409e5b
sbb eax, eax
or eax, 1
test eax, eax
je 0x409e80
mov edx, dword [ebp - 0x26c]
lea ecx, [ebx + 0x38]
inc edx
mov dword [ebp - 0x26c], edx
cmp edx, dword [ebx + 0x80]
jb 0x409d10
jmp 0x40a03b
lea eax, [ebp - 0x264]
push eax
lea esi, [ebx + 0xd4]
push esi
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
jne 0x40a02a
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x409ecb
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40a031
mov edx, dword [ebp - 0x268]
add edx, dword [ebp - 0x27c]
mov edi, dword [ebp - 0x278]
mov dword [ebp - 0x274], edx
mov dword [ebp - 0x270], 0
test edi, edi
je 0x409f56
mov ecx, 0x400000
push 0
lea eax, [ebp - 0x268]
mov dword [ebp - 0x268], 0
push eax
cmp edi, 0x400000
mov eax, edi
cmova eax, ecx
push eax
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x268]
sub edi, ecx
mov edx, dword [ebp - 0x274]
add dword [ebp - 0x270], ecx
add edx, ecx
mov dword [ebp - 0x274], edx
test eax, eax
je 0x409f4c
test ecx, ecx
je 0x409f56
mov ecx, 0x400000
test edi, edi
jne 0x409ef6
jmp 0x409f56
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x409f64
mov edx, dword [ebp - 0x278]
cmp dword [ebp - 0x270], edx
je 0x409f6e
mov dword [ebx + 0xc0], 0xb
mov edi, dword [ebx + 0x9c]
test edi, edi
je 0x409fbd
mov eax, dword [ebp - 0x26c]
mov edx, 0x80
mov ecx, eax
shr eax, 3
and ecx, 7
sar edx, cl
test byte [eax + edi], dl
mov edi, dword [ebp - 0x26c]
je 0x409fc3
mov eax, dword [ebx + 0xa0]
lea ecx, [eax + edi*8]
mov eax, dword [ecx]
mov dword [ebp - 0x10], eax
mov eax, dword [ecx + 4]
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x10]
push eax
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
jmp 0x409fc3
mov edi, dword [ebp - 0x26c]
cmp esi, 0xffffffff
je 0x409fdb
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x409fdb
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x409fdd
xor eax, eax
cmp dword [ebx + 0xc0], 0
jne 0x40a03b
test eax, eax
je 0x409ff2
mov dword [ebx + 0xc0], eax
jmp 0x40a03b
mov esi, dword [ebx + 0x94]
test esi, esi
je 0x40a03b
mov eax, edi
mov ecx, edi
and ecx, 7
shr eax, 3
mov edx, 0x80
sar edx, cl
test byte [eax + esi], dl
je 0x40a03b
mov eax, dword [ebx + 0x98]
push dword [eax + edi*4]
lea eax, [ebx + 0xd4]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
jmp 0x40a03b
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
mov dword [ebx + 0xc0], 0xb
push dword [ebp - 0x27c]
lea ecx, [ebx + 0xc4]
push ecx
mov ecx, dword [ebx + 0xc8]
call ecx
mov ecx, dword [ebp - 8]
add esp, 8
mov eax, dword [ebx + 0xc0]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0040cc8c
mov esp, ebp
pop ebp
ret 4