Function at 0x10013550
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 0x10013578
push edx
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
test eax, eax
je 0x10013584
cmp eax, 0xffffffff
jne 0x10013597
call sub.KERNEL32.dll_GetLastError
jmp 0x10013589
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x1001358f
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 0x1001360a
mov ebx, dword [esp + 0x58]
movzx eax, byte [ebx + 4]
test eax, eax
je 0x10013663
cmp al, 4
jae 0x10013751
movzx ecx, byte [ebp]
mov edx, ecx
and dl, 0xc0
neg dl
jno 0x100136bf
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 + 0x1007cbcc]
cmp al, cl
jae 0x10013701
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x1001358f
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 0x10013657
push 0xffffffffffffffff
push dword [esp + 4]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [esp + 0x14]
cmp eax, 0x103
je 0x100137a1
test eax, eax
js 0x100136d2
mov eax, dword [esp + 0x18]
mov bl, 4
jmp 0x100136db
cmp edi, 0x1000
mov eax, 0x1000
lea ecx, [esp + 4]
mov edx, ebp
cmovb eax, edi
push eax
call fcn.1000f940
add esp, 4
test byte [esp + 4], 1
je 0x100136e5
mov eax, dword [esp + 8]
test eax, eax
je 0x10013753
cmp eax, edi
ja 0x10013751
lea ecx, [esp + 0x1c]
mov edx, ebp
push eax
call fcn.1000f940
add esp, 4
test byte [esp + 0x1c], 1
jne 0x10013751
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
jmp 0x100136ed
mov byte [ebx + 4], 0
mov byte [esi], 2
mov dword [esi + 4], 0x1007cd1c
jmp 0x1001358f
xor ebx, ebx
push eax
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov dword [esi + 4], eax
mov byte [esi], bl
jmp 0x1001358f
mov eax, dword [esp + 8]
mov edi, dword [esp + 0xc]
mov edx, dword [esp]
mov ecx, esi
push edi
push eax
call fcn.10013800
add esp, 8
jmp 0x1001358f
cmp al, 5
jae 0x10013751
mov edi, ecx
movzx eax, al
lea ecx, [esp + 0x1c]
mov edx, ebx
push eax
call fcn.1000f940
add esp, 4
test byte [esp + 0x1c], 1
mov byte [ebx + 4], 0
jne 0x100136c3
cmp dword [esp + 0x24], edi
jne 0x10013751
mov edx, dword [esp]
lea ecx, [esp + 4]
push edi
push dword [esp + 0x24]
call fcn.10013800
add esp, 8
movzx eax, byte [esp + 4]
cmp al, 4
jne 0x10013771
cmp dword [esp + 8], edi
je 0x100135fe
ud2
movzx eax, byte [ebp]
movzx ecx, byte [eax + 0x1007cbcc]
cmp ecx, edi
jbe 0x10013790
mov byte [ebx], al
mov byte [ebx + 4], 1
mov al, 4
mov ecx, 1
jmp 0x10013797
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 0x1001358f
mov al, 2
mov ecx, 0x1007cd1c
mov dword [esi + 4], ecx
mov byte [esi], al
jmp 0x1001358f
lea eax, [esp + 0x10]
mov dword [esp + 0x34], 0
mov dword [esp + 0x1c], 0x1007cbc4
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.10013040
add esp, 4
mov ecx, dword [esp + 4]
mov edx, dword [esp + 8]
call fcn.100130e0
mov ecx, 7
int 0x29
ud2