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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x240c
call fcn.10044f70
mov eax, dword [0x10083adc]
xor eax, ebp
mov dword [ebp - 4], eax
push edi
push 0x3ff
xor edi, edi
lea eax, [ebp - 0x603]
push edi
push eax
mov byte [ebp - 0x604], 0
call fcn.10044b80
add esp, 0xc
cmp byte [0x101570e7], 0
je 0x10040481
lea eax, [ebp + 0x10]
push eax
push dword [ebp + 0xc]
lea eax, [ebp - 0x604]
push eax
call fcn.10047c1b
add esp, 0xc
cmp dword [ebp + 8], 2
mov eax, 0x2000
jne 0x1004046d
mov eax, 0x1000
push eax
lea eax, [ebp - 0x604]
push eax
call fcn.1000d648
pop ecx
pop ecx
jmp 0x100406ea
mov eax, dword [ebp + 8]
test dword [0x102dcdb0], eax
jne 0x100406ea
or dword [0x102dcdb0], eax
push esi
push 0x1ff
lea eax, [ebp - 0x203]
push edi
push eax
mov byte [ebp - 0x204], 0
call fcn.10044b80
mov esi, 0x9ff
push esi
lea eax, [ebp - 0x2403]
push edi
push eax
mov byte [ebp - 0x2404], 0
call fcn.10044b80
push esi
lea eax, [ebp - 0x1003]
push edi
push eax
mov byte [ebp - 0x1004], 0
call fcn.10044b80
push esi
lea eax, [ebp - 0x1a03]
push edi
push eax
mov byte [ebp - 0x1a04], 0
call fcn.10044b80
push 0x10153e28
lea eax, [ebp - 0x204]
push str._sLog
push eax
call fcn.10044ec8
lea eax, [ebp - 0x204]
push edi
push eax
call fcn.1004803c
add esp, 0x44
test eax, eax
je 0x1004052c
push edi
lea eax, [ebp - 0x204]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
lea eax, [ebp - 0x240c]
push ebx
push eax
call fcn.1004532b
lea eax, [ebp - 0x240c]
push eax
call fcn.10045304
mov ebx, eax
mov eax, dword [ebx + 0x10]
inc eax
push eax
mov eax, dword [ebx + 0x14]
add eax, 0x76c
push eax
lea eax, [ebp - 0x604]
push str._04d__02d_AT.txt
push eax
call fcn.10044ec8
lea eax, [ebp - 0x604]
add esp, 0x18
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10040571
lea edi, [ebp - 0x204]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x10040581
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea eax, [ebp - 0x204]
and ecx, 3
push 0
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.1004803c
pop ecx
test eax, eax
pop ecx
lea eax, [ebp - 0x204]
jne 0x100405ba
push 0x10070fe0
jmp 0x100405bf
push 0x10070fdc
push eax
call fcn.100478b7
mov esi, eax
pop ecx
pop ecx
test esi, esi
je 0x100406e8
lea eax, [ebp + 0x10]
push eax
push dword [ebp + 0xc]
lea eax, [ebp - 0x604]
push eax
call fcn.10047c1b
mov eax, dword [0x10184a50]
lea ecx, [ebp - 0x1a04]
push ecx
lea ecx, [ebp - 0x1004]
push ecx
lea ecx, [ebp - 0x204]
push ecx
push eax
call fcn.100403ad
lea ecx, [ebp - 0x1a04]
push ecx
lea ecx, [ebp - 0x1004]
push ecx
lea ecx, [ebp - 0x204]
push ecx
push eax
call fcn.100403ad
lea ecx, [ebp - 0x1a04]
push ecx
lea ecx, [ebp - 0x1004]
push ecx
lea ecx, [ebp - 0x204]
push ecx
push eax
call fcn.100403ad
lea ecx, [ebp - 0x1a04]
push ecx
lea ecx, [ebp - 0x1004]
push ecx
lea ecx, [ebp - 0x204]
push ecx
push eax
call fcn.100403ad
add esp, 0x4c
lea ecx, [ebp - 0x1a04]
push ecx
lea ecx, [ebp - 0x1004]
push ecx
lea ecx, [ebp - 0x204]
push ecx
push eax
call fcn.100403ad
lea eax, [ebp - 0x604]
push eax
push 0x10154228
lea eax, [ebp - 0x1004]
push eax
push dword [ebx]
lea eax, [ebp - 0x2404]
push dword [ebx + 4]
push dword [ebx + 8]
push dword [ebx + 0xc]
push 0x10070fb8
push eax
call fcn.10044ec8
lea eax, [ebp - 0x2404]
add esp, 0x34
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x100406ae
push esi
sub eax, ecx
push 1
push eax
lea eax, [ebp - 0x2404]
push eax
call fcn.10047771
push esi
call fcn.10047593
add esp, 0x14
cmp byte [0x101570e7], 0
je 0x100406e8
push 2
lea eax, [ebp - 0x204]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
pop ebx
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop edi
call fcn.10044b6f
leave
ret