Function at 0x1004191
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x838
mov eax, dword [0x1009004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
and dword [ebp - 0x828], 0
push ebx
mov dword [ebp - 0x82c], eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
xor eax, eax
push edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov word [ebp - 0x61c], ax
mov eax, dword [0x1009bcc]
mov ebx, 0x208
jmp 0x10043e5
mov eax, dword [ebp - 0x830]
cmp dword [eax + 0x20], 0
jne 0x10043dc
push dword [eax + 4]
lea eax, [ebp - 0x61c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
test eax, eax
je 0x100429a
mov eax, dword [ebp - 0x830]
push dword [eax + 4]
lea eax, [ebp - 0x61c]
push 0x104
push eax
call fcn.0100170e
test eax, eax
jge 0x100422a
cmp eax, 0x8007007a
jne 0x100429a
push 0x2a
push 0x104
lea eax, [ebp - 0x824]
push eax
call fcn.01005682
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x824]
push eax
lea eax, [ebp - 0x414]
push ebx
push eax
call fcn.01003257
add esp, 0x10
test eax, eax
jge 0x1004266
cmp eax, 0x8007007a
jne 0x100429a
push 0
lea eax, [ebp - 0x838]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x82c]
call esi
test eax, eax
jne 0x100429a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x828], eax
push 0x2c
push 0x104
lea eax, [ebp - 0x824]
push eax
call fcn.01005682
mov eax, dword [ebp - 0x830]
push dword [eax]
lea eax, [ebp - 0x824]
push eax
lea eax, [ebp - 0x414]
push ebx
push eax
call fcn.01003257
add esp, 0x10
test eax, eax
jge 0x10042d7
cmp eax, 0x8007007a
jne 0x100430b
push 0
lea eax, [ebp - 0x838]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x82c]
call esi
test eax, eax
jne 0x100430b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x828], eax
mov eax, dword [ebp - 0x830]
mov eax, dword [eax + 0x28]
xor ecx, ecx
cmp eax, ecx
je 0x1004399
cmp eax, 2
jne 0x1004323
push 0x1a
jmp 0x100439b
push ecx
push ecx
lea edx, [ebp - 0x834]
push edx
push 0x400
push eax
push ecx
push 0x1300
mov dword [ebp - 0x834], ecx
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
test eax, eax
je 0x10043dc
cmp dword [ebp - 0x834], 0
je 0x10043dc
push 0
lea eax, [ebp - 0x838]
push eax
push dword [ebp - 0x834]
call edi
add eax, eax
push eax
push dword [ebp - 0x834]
push dword [ebp - 0x82c]
call esi
test eax, eax
jne 0x100438b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x828], eax
push dword [ebp - 0x834]
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x10043dc
push 0x34
push ebx
lea eax, [ebp - 0x414]
push eax
call fcn.01005682
push 0
lea eax, [ebp - 0x838]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x82c]
call esi
test eax, eax
jne 0x10043dc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x828], eax
mov eax, dword [ebp - 0x830]
mov eax, dword [eax + 0x3c]
mov dword [ebp - 0x830], eax
test eax, eax
jne 0x10041dd
push 0x34
push ebx
lea eax, [ebp - 0x414]
push eax
call fcn.01005682
push 0
lea eax, [ebp - 0x838]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x82c]
call esi
pop edi
pop esi
pop ebx
test eax, eax
jne 0x1004439
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x828], eax
push dword [ebp - 0x828]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [ebp - 4]
xor eax, eax
cmp dword [ebp - 0x828], eax
sete al
xor ecx, ebp
call fcn.01007194
leave
ret 4