Function at 0x10012fc0
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 0x10012fe8
push edx
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
test eax, eax
je 0x10012ff4
cmp eax, 0xffffffff
jne 0x10013007
call sub.KERNEL32.dll_GetLastError
jmp 0x10012ff9
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x10012fff
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 0x1001307a
mov ebx, dword [esp + 0x58]
movzx eax, byte [ebx + 4]
test eax, eax
je 0x100130d3
cmp al, 4
jae 0x100131c1
movzx ecx, byte [ebp]
mov edx, ecx
and dl, 0xc0
neg dl
jno 0x1001312f
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 + 0x10085bcc]
cmp al, cl
jae 0x10013171
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x10012fff
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 0x100130c7
push 0xffffffffffffffff
push dword [esp + 4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [esp + 0x14]
cmp eax, 0x103
je 0x10013211
test eax, eax
js 0x10013142
mov eax, dword [esp + 0x18]
mov bl, 4
jmp 0x1001314b
cmp edi, 0x1000
mov eax, 0x1000
lea ecx, [esp + 4]
mov edx, ebp
cmovb eax, edi
push eax
call fcn.1000f420
add esp, 4
test byte [esp + 4], 1
je 0x10013155
mov eax, dword [esp + 8]
test eax, eax
je 0x100131c3
cmp eax, edi
ja 0x100131c1
lea ecx, [esp + 0x1c]
mov edx, ebp
push eax
call fcn.1000f420
add esp, 4
test byte [esp + 0x1c], 1
jne 0x100131c1
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
jmp 0x1001315d
mov byte [ebx + 4], 0
mov byte [esi], 2
mov dword [esi + 4], 0x10085d1c
jmp 0x10012fff
xor ebx, ebx
push eax
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov dword [esi + 4], eax
mov byte [esi], bl
jmp 0x10012fff
mov eax, dword [esp + 8]
mov edi, dword [esp + 0xc]
mov edx, dword [esp]
mov ecx, esi
push edi
push eax
call fcn.10013270
add esp, 8
jmp 0x10012fff
cmp al, 4
ja 0x100131c1
mov edi, ecx
movzx eax, al
lea ecx, [esp + 0x1c]
mov edx, ebx
push eax
call fcn.1000f420
add esp, 4
test byte [esp + 0x1c], 1
mov byte [ebx + 4], 0
jne 0x10013133
cmp dword [esp + 0x24], edi
jne 0x100131c1
mov edx, dword [esp]
lea ecx, [esp + 4]
push edi
push dword [esp + 0x24]
call fcn.10013270
add esp, 8
movzx eax, byte [esp + 4]
cmp al, 4
jne 0x100131e1
cmp dword [esp + 8], edi
je 0x1001306e
ud2
movzx eax, byte [ebp]
movzx ecx, byte [eax + 0x10085bcc]
cmp ecx, edi
jbe 0x10013200
mov byte [ebx], al
mov byte [ebx + 4], 1
mov al, 4
mov ecx, 1
jmp 0x10013207
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 0x10012fff
mov al, 2
mov ecx, 0x10085d1c
mov dword [esi + 4], ecx
mov byte [esi], al
jmp 0x10012fff
lea eax, [esp + 0x10]
mov dword [esp + 0x34], 0
mov dword [esp + 0x1c], 0x10085bc4
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.100135a0
add esp, 4
mov ecx, dword [esp + 4]
mov edx, dword [esp + 8]
call fcn.10013640
mov ecx, 7
int 0x29
ud2