Function at 0x4c7070
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x4c
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x4f6b20
mov esi, ecx
lea eax, [ebp - 0x18]
mov ecx, dword fs:[0]
test edi, edi
mov dword [ebp - 0x18], ecx
mov dword fs:[0], eax
je 0x4c70bd
push edx
call dword [sym.imp.kernel32.dll_GetStdHandle]
test eax, eax
je 0x4c70c9
cmp eax, 0xffffffff
jne 0x4c70e5
call sub.kernel32.dll_GetLastError
jmp 0x4c70ce
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x4c70d4
mov eax, 6
mov byte [esi], 0
mov dword [esi + 4], eax
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
add esp, 0x4c
pop esi
pop edi
pop ebx
pop ebp
ret
lea ecx, [ebp - 0x54]
mov dword [ebp - 0x54], 0
push ecx
push eax
mov ebx, eax
call dword [sym.imp.kernel32.dll_GetConsoleMode]
test eax, eax
je 0x4c715d
mov dword [ebp - 0x20], ebx
mov ebx, dword [ebp + 0x10]
movzx eax, byte [ebx + 4]
test eax, eax
je 0x4c71ad
mov ecx, dword [ebp + 8]
cmp al, 4
jae 0x4c7314
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x4c71ff
mov byte [ebx + eax], cl
mov edi, ebx
movzx ecx, byte [ebx + 4]
inc cl
mov byte [ebx + 4], cl
movzx eax, byte [ebx]
movzx ebx, byte [eax + 0x549aa0]
cmp cl, bl
mov dword [ebp - 0x58], ebx
jae 0x4c721b
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x4c70d4
lea eax, [ebp - 0x28]
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x28], 0x103
push 0
push 0
push edi
push dword [ebp + 8]
push eax
push 0
push 0
push 0
push ebx
call dword [sym.imp.ntdll.dll_NtWriteFile]
cmp eax, 0x103
jne 0x4c71a2
push 0xffffffffffffffff
push ebx
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov eax, dword [ebp - 0x28]
cmp eax, 0x103
je 0x4c7346
test eax, eax
js 0x4c7205
mov eax, dword [ebp - 0x24]
mov bl, 4
jmp 0x4c720e
mov edx, dword [ebp + 8]
cmp edi, 0x1000
mov eax, 0x1000
lea ecx, [ebp - 0x34]
cmovb eax, edi
push eax
call fcn.00422f40
add esp, 4
cmp dword [ebp - 0x34], 0
je 0x4c724e
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x4c7268
mov edx, dword [ebp + 8]
cmp eax, edi
ja 0x4c73b3
lea edi, [ebp - 0x54]
mov ecx, edi
push eax
call fcn.00422f40
add esp, 4
mov ecx, edi
call fcn.004c77b0
mov edi, edx
jmp 0x4c7254
mov byte [ebx + 4], 0
jmp 0x4c723f
xor ebx, ebx
push eax
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
movzx ecx, bl
mov dword [esi + 4], eax
mov dword [esi], ecx
jmp 0x4c70d4
movzx eax, cl
cmp cl, 5
jae 0x4c73a5
lea ecx, [ebp - 0x34]
mov edx, edi
push eax
call fcn.00422f40
add esp, 4
cmp dword [ebp - 0x34], 0
mov byte [edi + 4], 0
je 0x4c7294
mov byte [esi], 2
mov dword [esi + 4], 0x549bf0
jmp 0x4c70d4
mov eax, dword [ebp - 0x30]
mov edi, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x20]
mov ecx, esi
push edi
push eax
call fcn.004c7410
add esp, 8
jmp 0x4c70d4
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x549aa0]
cmp ecx, 2
jb 0x4c72e8
cmp ecx, edi
jbe 0x4c72e8
mov cl, 4
mov byte [ebx], al
mov dword [esi + 4], 1
mov byte [ebx + 4], 1
mov byte [esi], cl
jmp 0x4c70d4
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x30]
cmp ecx, ebx
mov dword [ebp - 0x28], ecx
jne 0x4c73c6
mov edx, dword [ebp - 0x20]
lea edi, [ebp - 0x54]
mov ecx, edi
push ebx
push eax
call fcn.004c7410
add esp, 8
movzx eax, byte [ebp - 0x54]
cmp al, 4
jne 0x4c72f8
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0x28], ebx
cmp eax, ebx
mov dword [ebp - 0x3c], eax
je 0x4c714e
lea ecx, [ebp - 0x3c]
lea edx, [ebp - 0x28]
mov dword [ebp - 0x54], 0
push 0x549c90
push edi
jmp 0x4c73dc
mov al, 2
mov dword [esi + 4], 0x549bf0
mov byte [esi], al
jmp 0x4c70d4
movzx ecx, byte [ebp - 0x51]
movzx edi, word [ebp - 0x53]
mov edx, dword [ebp - 0x50]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x4c70d4
lea ecx, [ebp - 0x54]
mov edx, 0x549c60
mov dword [ebp - 0x54], 0x549c58
mov dword [ebp - 0x50], 1
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x4c], str.OutOfRangeImpossibleNotEnoughInvalidTooShortTooLongBadFormat__NonexhaustiveEmpty
mov dword [ebp - 0x48], 0
call fcn.00506b50
ud2
lea edx, [ebp - 0x54]
lea eax, [ebp - 0x58]
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x54], 0x5496b0
mov dword [ebp - 0x50], 1
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x20], ebx
mov byte [ebp - 0x38], 0
mov dword [ebp - 0x10], 0
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], 0
lea eax, [ebp - 0x3c]
push edx
push eax
push ecx
call fcn.004c5c90
add esp, 0xc
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 0x30]
call fcn.004c5dc0
mov ecx, 7
int 0x29
ud2
mov ecx, eax
mov edx, 4
push 0x549c70
jmp 0x4c73bc
mov ecx, eax
mov edx, edi
push 0x549bfc
call fcn.00506c60
add esp, 4
ud2
lea ecx, [ebp - 0x58]
lea edx, [ebp - 0x28]
mov dword [ebp - 0x54], 0
push 0x549c80
lea eax, [ebp - 0x54]
push eax
call fcn.0050a840
add esp, 8
ud2