Function at 0x1000f630
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
mov ebx, dword [ebp + 8]
cmp ebx, 0x3c
jae 0x1000f69a
mov ecx, dword [ebp + 0x10]
or ecx, ecx
je 0x1000f696
test byte [ebx + 0x1001a4a8], 0x14
jne 0x1000f6b7
mov edx, dword [ebp + 0xc]
cmp ebx, 3
jae 0x1000f664
mov eax, dword [0x1001a6c0]
or eax, eax
jne 0x1000f68c
push ecx
push edx
push 0
lea eax, [ebp - 0x18]
push eax
push ecx
push edx
push dword [ebx*4 + 0x1001a4e4]
call sub.KERNEL32.dll_WriteFile
pop edx
pop ecx
or eax, eax
je 0x1000f69a
mov eax, dword [ebp - 0x18]
or eax, eax
je 0x1000f6a6
pop ebx
mov esp, ebp
pop ebp
ret
push ecx
push edx
push ebx
call eax
add esp, 0xc
jmp 0x1000f683
xor eax, eax
jmp 0x1000f687
push 9
call fcn.1000d7f8
jmp 0x1000f6b0
push 0x1c
call fcn.1000d7f8
mov eax, 0xffffffff
jmp 0x1000f687
test byte [ebx + 0x1001a4a8], 4
je 0x1000f6e9
push ecx
push edx
push 2
push 0
push 0
push dword [ebx*4 + 0x1001a4e4]
call sub.KERNEL32.dll_SetFilePointer
pop edx
pop ecx
cmp ax, 0xffff
je 0x1000f69a
test byte [ebx + 0x1001a4a8], 0x10
je 0x1000f64f
cld
push ds
pop es
push edi
mov edi, dword [ebp + 0xc]
mov al, 0xa
mov edx, 0
repne scasb al, byte es:[edi]
jne 0x1000f6fe
inc edx
jmp 0x1000f6f7
pop edi
cmp edx, 0
jne 0x1000f70c
mov ecx, dword [ebp + 0x10]
jmp 0x1000f64f
mov dword [ebp - 0x10], edx
mov edx, dword [ebp + 0x10]
add edx, dword [ebp - 0x10]
jb 0x1000f69a
add edx, 4
jb 0x1000f69a
and edx, 0xfffffffc
push edx
push edx
push 0
call sub.KERNEL32.dll_GlobalAlloc
or eax, eax
je 0x1000f69a
mov dword [ebp - 0xc], eax
pop edx
push esi
push edi
mov edi, dword [ebp - 0xc]
dec edx
add edx, edi
mov dword [ebp - 8], edx
mov esi, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
mov byte [ebp - 0x14], 0
mov edx, edi
mov edi, esi
mov al, 0xa
repne scasb al, byte es:[edi]
jne 0x1000f78c
mov dword [ebp - 4], ecx
mov ecx, edi
sub ecx, esi
mov edi, edx
add edx, ecx
cmp edx, dword [ebp - 8]
ja 0x1000f792
cmp byte [ebp - 0x14], 1
je 0x1000f799
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov word es:[edi - 1], 0xa0d
inc edi
mov ecx, dword [ebp - 4]
or ecx, ecx
jne 0x1000f74d
jmp 0x1000f7ac
mov byte [ebp - 0x14], 1
jmp 0x1000f757
mov ecx, dword [ebp - 8]
sub ecx, edi
jbe 0x1000f7a7
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
sub edx, edi
add dword [ebp - 4], edx
mov edx, dword [ebp - 0xc]
mov ecx, edi
sub ecx, dword [ebp - 0xc]
cmp ebx, 3
jae 0x1000f7c6
mov eax, dword [0x1001a6c0]
or eax, eax
jne 0x1000f7f8
push ecx
push edx
push 0
lea eax, [ebp - 0x18]
push eax
push ecx
push edx
push dword [ebx*4 + 0x1001a4e4]
call sub.KERNEL32.dll_WriteFile
pop edx
pop ecx
or eax, eax
je 0x1000f835
mov eax, dword [ebp - 0x18]
sub ecx, eax
jne 0x1000f806
mov ecx, dword [ebp - 4]
or ecx, ecx
je 0x1000f846
mov edi, dword [ebp - 0xc]
jmp 0x1000f74d
push ecx
push edx
push ecx
push edx
push ebx
call eax
add esp, 0xc
pop edx
pop ecx
jmp 0x1000f7e5
mov ebx, edi
mov edi, dword [ebp - 0xc]
add edi, eax
inc edi
mov edx, ecx
dec ecx
je 0x1000f81d
mov al, 0xa
repne scasb al, byte es:[edi]
jne 0x1000f81d
dec dx
jmp 0x1000f815
mov edi, ebx
mov eax, dword [ebp + 0x10]
sub eax, dword [ebp - 4]
sub eax, edx
jne 0x1000f849
push 0x1c
call fcn.1000d7f8
jmp 0x1000f83f
push 9
call fcn.1000d7f8
mov eax, 0xffffffff
jmp 0x1000f849
mov eax, dword [ebp + 0x10]
push eax
push dword [ebp - 0xc]
call sub.KERNEL32.dll_GlobalFree
pop eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret