Function at 0x4e4c8b
Capabilities:
Write file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x3c
mov ebp, dword [esp + 0x54]
mov esi, ecx
test ebp, ebp
je 0x4e4cba
push edx
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp eax, 0xffffffff
je 0x4e4cc9
mov edi, eax
test eax, eax
jne 0x4e4ceb
mov eax, edi
push 6
pop edi
mov dword [esi + 4], edi
mov dword [esi], eax
jmp 0x4e4cc1
and dword [esi + 4], 0
mov byte [esi], 4
add esp, 0x3c
pop esi
pop edi
pop ebx
pop ebp
ret
lea edi, [esp + 0x14]
mov ecx, edi
call fcn.004e4bad
cmp byte [edi], 4
jne 0x4e4cdf
mov edi, dword [esp + 0x18]
jmp 0x4e4ceb
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
cmp al, 4
jne 0x4e4cb3
lea eax, [esp + 0x14]
mov ebx, dword [esp + 0x50]
and dword [eax], 0
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x4e4dae
mov eax, dword [esp + 0x58]
movzx eax, byte [eax + 4]
test eax, eax
je 0x4e4e02
cmp al, 4
jae 0x4e4edb
mov cl, byte [ebx]
mov edx, ecx
and dl, 0xc0
neg dl
jno 0x4e4e57
mov ebx, dword [esp + 0x58]
mov byte [ebx + eax], cl
mov al, byte [ebx + 4]
inc al
mov byte [ebx + 4], al
movzx ecx, byte [ebx]
movzx ecx, byte [ecx + 0x4e7e93]
cmp cl, al
ja 0x4e4ecb
movzx eax, al
mov dword [esp + 0x10], ecx
cmp al, 5
jae 0x4e4edb
lea ebp, [esp + 0x14]
mov edx, ebx
mov ecx, ebp
push eax
call fcn.004e29b1
pop eax
test byte [ebp], 1
mov byte [ebx + 4], 0
jne 0x4e4e5f
mov eax, dword [esp + 0x10]
cmp dword [esp + 0x1c], eax
jne 0x4e4edb
lea ebx, [esp + 4]
mov edx, edi
mov ecx, ebx
push eax
push dword [esp + 0x1c]
call fcn.004e4f2a
pop eax
pop ecx
cmp byte [ebx], 4
jne 0x4e4eb8
mov eax, dword [esp + 8]
jmp 0x4e4ec5
lea eax, [esp + 0x2c]
mov ecx, 0x103
and dword [eax + 4], 0
mov dword [eax], ecx
push 0
push 0
push ebp
push ebx
push eax
push 0
push 0
push 0
push edi
call dword [sym.imp.ntdll.dll_NtWriteFile]
mov ecx, 0x103
cmp eax, ecx
jne 0x4e4df2
push 0xffffffffffffffff
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [esp + 0x2c]
cmp eax, 0x103
je 0x4e4edd
test eax, eax
js 0x4e4e71
mov eax, dword [esp + 0x30]
mov dword [esi + 4], eax
jmp 0x4e4cbe
mov eax, 0x1000
lea ecx, [esp + 4]
mov edx, ebx
cmp ebp, eax
cmovb eax, ebp
push eax
call fcn.004e29b1
pop eax
lea eax, [esp + 4]
test byte [eax], 1
je 0x4e4e83
cmp dword [esp + 8], 0
je 0x4e4e9e
mov eax, dword [esp + 8]
cmp eax, ebp
ja 0x4e4edb
mov edx, ebx
lea ebx, [esp + 0x14]
mov ecx, ebx
push eax
call fcn.004e29b1
pop eax
cmp dword [ebx], 1
je 0x4e4edb
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x1c]
jmp 0x4e4e8b
mov eax, dword [esp + 0x58]
mov byte [eax + 4], 0
mov dword [esi + 4], str.Windows_stdio_in_console_mode_does_not_support_writing_non_UTF_8_byte_sequences
mov dword [esi], 2
jmp 0x4e4cc1
push eax
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
and dword [esi], 0
mov dword [esi + 4], eax
jmp 0x4e4cc1
mov eax, dword [esp + 8]
mov ebx, dword [esp + 0xc]
mov ecx, esi
mov edx, edi
push ebx
push eax
call fcn.004e4f2a
add esp, 0x44
jmp 0x4e4cc4
movzx eax, byte [ebx]
movzx ecx, byte [eax + 0x4e7e93]
cmp ecx, ebp
jbe 0x4e4e5f
mov ecx, dword [esp + 0x58]
mov byte [ecx], al
mov byte [ecx + 4], 1
jmp 0x4e4ecb
mov ecx, dword [esp + 4]
mov eax, dword [esp + 8]
cmp cl, 4
jne 0x4e4ed7
cmp eax, dword [esp + 0x10]
jne 0x4e4edb
mov dword [esi + 4], 1
jmp 0x4e4cbe
mov dword [esi], ecx
jmp 0x4e4e7b
ud2
lea edx, [esp + 0x34]
mov eax, esp
mov dword [esp + 0x14], 0x4e8080
mov dword [esp + 0x18], 1
and dword [esp + 0x24], 0
lea esi, [esp + 4]
mov dword [esp + 0x1c], eax
and dword [edx], 0
and dword [esp + 0x20], 0
lea eax, [esp + 0x14]
mov byte [edx + 4], 0
mov ecx, esi
push eax
call fcn.004e50e8
pop eax
mov ecx, dword [esi]
mov edx, dword [esi + 4]
call fcn.004e4c7c
push 7
pop ecx
int 0x29
ud2