Function at 0x10013000
Capabilities:
Write file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x3c
mov edi, dword [esp + 0x54]
mov esi, ecx
test edi, edi
je 0x10013028
push edx
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
test eax, eax
je 0x10013034
cmp eax, 0xffffffff
jne 0x10013047
call sub.KERNEL32.dll_GetLastError
jmp 0x10013039
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x1001303f
mov eax, 6
mov byte [esi], 0
mov dword [esi + 4], eax
add esp, 0x3c
pop esi
pop edi
pop ebx
pop ebp
ret
mov ebp, dword [esp + 0x50]
lea ebx, [esp + 0x1c]
mov dword [esp + 0x1c], 0
push ebx
mov dword [esp + 4], eax
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x100130ba
mov ebx, dword [esp + 0x58]
movzx eax, byte [ebx + 4]
test eax, eax
je 0x10013113
cmp al, 4
jae 0x10013201
movzx ecx, byte [ebp]
mov edx, ecx
and dl, 0xc0
neg dl
jno 0x1001316f
mov byte [ebx + eax], cl
movzx eax, byte [ebx + 4]
inc al
mov byte [ebx + 4], al
movzx ecx, byte [ebx]
movzx ecx, byte [ecx + 0x10082bcc]
cmp al, cl
jae 0x100131b1
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x1001303f
lea eax, [esp + 0x14]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x103
push 0
push 0
push edi
push ebp
push eax
push 0
push 0
push 0
push dword [esp + 0x20]
call dword [sym.imp.ntdll.dll_NtWriteFile]
cmp eax, 0x103
jne 0x10013107
push 0xffffffffffffffff
push dword [esp + 4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [esp + 0x14]
cmp eax, 0x103
je 0x10013251
test eax, eax
js 0x10013182
mov eax, dword [esp + 0x18]
mov bl, 4
jmp 0x1001318b
cmp edi, 0x1000
mov eax, 0x1000
lea ecx, [esp + 4]
mov edx, ebp
cmovb eax, edi
push eax
call fcn.1000f3f0
add esp, 4
test byte [esp + 4], 1
je 0x10013195
mov eax, dword [esp + 8]
test eax, eax
je 0x10013203
cmp eax, edi
ja 0x10013201
lea ecx, [esp + 0x1c]
mov edx, ebp
push eax
call fcn.1000f3f0
add esp, 4
test byte [esp + 0x1c], 1
jne 0x10013201
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
jmp 0x1001319d
mov byte [ebx + 4], 0
mov byte [esi], 2
mov dword [esi + 4], 0x10082d1c
jmp 0x1001303f
xor ebx, ebx
push eax
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov dword [esi + 4], eax
mov byte [esi], bl
jmp 0x1001303f
mov eax, dword [esp + 8]
mov edi, dword [esp + 0xc]
mov edx, dword [esp]
mov ecx, esi
push edi
push eax
call fcn.100132b0
add esp, 8
jmp 0x1001303f
cmp al, 4
ja 0x10013201
mov edi, ecx
movzx eax, al
lea ecx, [esp + 0x1c]
mov edx, ebx
push eax
call fcn.1000f3f0
add esp, 4
test byte [esp + 0x1c], 1
mov byte [ebx + 4], 0
jne 0x10013173
cmp dword [esp + 0x24], edi
jne 0x10013201
mov edx, dword [esp]
lea ecx, [esp + 4]
push edi
push dword [esp + 0x24]
call fcn.100132b0
add esp, 8
movzx eax, byte [esp + 4]
cmp al, 4
jne 0x10013221
cmp dword [esp + 8], edi
je 0x100130ae
ud2
movzx eax, byte [ebp]
movzx ecx, byte [eax + 0x10082bcc]
cmp ecx, edi
jbe 0x10013240
mov byte [ebx], al
mov byte [ebx + 4], 1
mov al, 4
mov ecx, 1
jmp 0x10013247
movzx ecx, byte [esp + 7]
movzx edi, word [esp + 5]
mov edx, dword [esp + 8]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x1001303f
mov al, 2
mov ecx, 0x10082d1c
mov dword [esi + 4], ecx
mov byte [esi], al
jmp 0x1001303f
lea eax, [esp + 0x10]
mov dword [esp + 0x34], 0
mov dword [esp + 0x1c], 0x10082bc4
mov dword [esp + 0x20], 1
mov dword [esp + 0x2c], 0
mov byte [esp + 0x38], 0
lea ecx, [esp + 4]
lea edx, [esp + 0x34]
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], 0
push ebx
call fcn.10012ae0
add esp, 4
mov ecx, dword [esp + 4]
mov edx, dword [esp + 8]
call fcn.10012b80
mov ecx, 7
int 0x29
ud2