Function at 0x1004197
Capabilities:
Set current directory
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xa44
mov eax, dword [0x1009088]
push ebx
push 0xffffffffffffffec
push dword [0x10092e0]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0xa30], eax
call dword [sym.imp.USER32.dll_GetWindowLongW]
mov ebx, dword [0x1009d1c]
and word [ebp - 0xa2c], 0
and eax, 0x400000
test ebx, ebx
mov dword [ebp - 0xa40], eax
je 0x10045d7
push esi
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp dword [ebx + 0x20], 0
je 0x10045ca
push dword [ebx + 4]
lea eax, [ebp - 0xa2c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
test eax, eax
je 0x1004278
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push dword [ebx + 4]
lea eax, [ebp - 0xa2c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push 0x2a
lea eax, [ebp - 0x61c]
push eax
call fcn.01005095
lea eax, [ebp - 0xa2c]
push eax
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0
lea eax, [ebp - 0xa34]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0xa30]
call esi
push 0x2c
lea eax, [ebp - 0x61c]
push eax
call fcn.01005095
push dword [ebx]
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0
lea eax, [ebp - 0xa34]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0xa30]
call esi
push 0x35
lea eax, [ebp - 0x414]
push eax
call fcn.01005095
push 0
lea eax, [ebp - 0xa34]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0xa30]
call esi
push 0x32
lea eax, [ebp - 0x61c]
push eax
call fcn.01005095
mov eax, dword [ebp - 0xa40]
neg eax
sbb eax, eax
xor edx, edx
push edx
push edx
push edx
lea ecx, [ebx + 0x2c]
and eax, 0x20
inc eax
push ecx
push eax
push 0x800
mov dword [ebp - 0xa44], eax
call dword [sym.imp.KERNEL32.dll_GetDateFormatW]
test eax, eax
mov dword [ebp - 0xa3c], eax
je 0x100439e
lea eax, [eax + eax + 2]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
test eax, eax
mov dword [ebp - 0xa38], eax
je 0x100439e
push dword [ebp - 0xa3c]
push eax
push 0
lea eax, [ebx + 0x2c]
push eax
push dword [ebp - 0xa44]
push 0x800
call dword [sym.imp.KERNEL32.dll_GetDateFormatW]
test eax, eax
je 0x1004389
push dword [ebp - 0xa38]
lea eax, [ebp - 0x61c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push dword [ebp - 0xa38]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push 0x50
lea eax, [ebp - 0x824]
push eax
call fcn.01005095
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x824]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0
lea eax, [ebp - 0xa34]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0xa30]
call esi
push 0x35
lea eax, [ebp - 0x414]
push eax
call fcn.01005095
push 0
lea eax, [ebp - 0xa34]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0xa30]
call esi
mov eax, dword [ebx + 8]
test eax, eax
je 0x100443d
cmp word [eax], 0
je 0x100443d
push eax
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
jmp 0x100444b
push 0x1f
lea eax, [ebp - 0x824]
push eax
call fcn.01005095
push 0x2c
lea eax, [ebp - 0x61c]
push eax
call fcn.01005095
lea eax, [ebp - 0x824]
push eax
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0
lea eax, [ebp - 0xa34]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0xa30]
call esi
push 0x2c
lea eax, [ebp - 0x61c]
push eax
call fcn.01005095
mov eax, dword [ebx + 0x1c]
neg eax
sbb eax, eax
add eax, 0xf
push eax
lea eax, [ebp - 0x824]
push eax
call fcn.01005095
lea eax, [ebp - 0x824]
push eax
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0
lea eax, [ebp - 0xa34]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0xa30]
call esi
mov eax, dword [ebx + 0xc]
test eax, eax
je 0x1004519
push eax
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
jmp 0x1004527
push 0x33
lea eax, [ebp - 0x824]
push eax
call fcn.01005095
push 0x2c
lea eax, [ebp - 0x61c]
push eax
call fcn.01005095
lea eax, [ebp - 0x824]
push eax
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0
lea eax, [ebp - 0xa34]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0xa30]
call esi
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x1004598
push 0
lea ecx, [ebp - 0xa34]
push ecx
push eax
call edi
shl eax, 1
push eax
push dword [ebx + 0x10]
push dword [ebp - 0xa30]
call esi
push 0x34
lea eax, [ebp - 0x414]
push eax
call fcn.01005095
push 0
lea eax, [ebp - 0xa34]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0xa30]
call esi
mov ebx, dword [ebx + 0x3c]
test ebx, ebx
jne 0x10041f1
pop edi
pop esi
mov ecx, dword [ebp - 4]
pop ebx
call fcn.01006e99
leave
ret 4