Function at 0x4f59a0
Capabilities:
Write file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x34
mov ebx, dword [esp + 0x4c]
mov esi, ecx
test ebx, ebx
je 0x4f59cb
push edx
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
test eax, eax
je 0x4f59da
mov edi, eax
cmp eax, 0xffffffff
jne 0x4f59f7
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x4f59df
mov dword [esi + 4], 0
mov dword [esi], 0
jmp 0x4f59ef
mov eax, 6
mov dword [esi + 4], 0
mov dword [esi + 8], eax
mov dword [esi], 1
add esp, 0x34
pop esi
pop edi
pop ebx
pop ebp
ret
lea ebp, [esp + 0x14]
mov dword [esp + 0x14], 0
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x4f5a66
mov ebp, dword [esp + 0x50]
movzx eax, byte [ebp + 4]
test eax, eax
je 0x4f5a92
cmp al, 4
jae 0x4f5bfb
mov ecx, dword [esp + 0x48]
mov cl, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x4f5af5
mov byte [ebp + eax], cl
mov al, byte [ebp + 4]
inc al
mov byte [ebp + 4], al
movzx ecx, byte [ebp]
movzx ebx, byte [ecx + 0x5f5250]
cmp bl, al
mov dword [esp + 0x2c], ebx
jbe 0x4f5b41
mov dword [esi + 4], 1
jmp 0x4f59d2
mov dword [esp + 0x14], 0
push 0
push ebp
push ebx
push dword [esp + 0x54]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4f5b0c
mov ecx, dword [esp + 0x14]
xor eax, eax
xor edx, edx
jmp 0x4f5b19
cmp ebx, 0x1000
mov eax, 0x1000
mov ecx, esp
cmovb eax, ebx
push eax
push dword [esp + 0x4c]
push ecx
call fcn.00506cb0
add esp, 0xc
cmp dword [esp], 1
jne 0x4f5b26
cmp dword [esp + 4], 0
je 0x4f5b9d
mov eax, dword [esp + 4]
mov ecx, dword [esp + 0x48]
cmp eax, ebx
ja 0x4f5c1e
push eax
push ecx
lea eax, [esp + 0x1c]
push eax
call fcn.00506cb0
add esp, 0xc
cmp dword [esp + 0x14], 1
je 0x4f5c2f
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x1c]
jmp 0x4f5b2e
mov byte [ebp + 4], 0
mov dword [esi + 8], 0x5f7c1c
mov dword [esi + 4], 0x1502
jmp 0x4f59e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ecx, ecx
mov edx, 1
mov dword [esi], edx
mov dword [esi + 4], ecx
mov dword [esi + 8], eax
jmp 0x4f59ef
mov eax, dword [esp + 4]
mov ebx, dword [esp + 8]
mov ecx, esi
mov edx, edi
push ebx
push eax
call fcn.004f5ca0
add esp, 8
jmp 0x4f59ef
movzx ecx, al
cmp al, 5
jae 0x4f5c14
mov eax, esp
push ecx
push ebp
push eax
call fcn.00506cb0
add esp, 0xc
cmp dword [esp], 1
mov byte [ebp + 4], 0
je 0x4f5af9
mov ecx, dword [esp + 8]
mov eax, dword [esp + 4]
cmp ecx, ebx
mov dword [esp + 0xc], ecx
jne 0x4f5c5b
lea ebp, [esp + 0x14]
mov edx, edi
mov ecx, ebp
push ebx
push eax
call fcn.004f5ca0
add esp, 8
cmp dword [esp + 0x14], 1
jne 0x4f5bbd
movsd xmm0, qword [esp + 0x18]
movsd qword [esi + 4], xmm0
jmp 0x4f5bef
mov eax, dword [esp + 0x48]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x5f5250]
cmp ecx, 2
jb 0x4f5be1
cmp ecx, ebx
jbe 0x4f5be1
mov byte [ebp], al
mov byte [ebp + 4], 1
jmp 0x4f5bd1
mov eax, dword [esp + 0x18]
mov dword [esp + 0xc], ebx
cmp eax, ebx
mov dword [esp + 0x30], eax
jne 0x4f5c77
xor eax, eax
mov dword [esi + 4], 1
mov dword [esi], eax
jmp 0x4f59ef
mov dword [esi + 8], 0x5f7c1c
mov dword [esi + 4], 0x1502
mov eax, 1
mov dword [esi], eax
jmp 0x4f59ef
mov ecx, 0x5f7b5d
mov edx, 0x3a
push 0x5f7bbc
call fcn.005701e0
add esp, 4
ud2
push 0x5f7c24
push 4
push ecx
jmp 0x4f5c25
push 0x5f7c54
push ebx
push eax
call fcn.005709d0
add esp, 0xc
ud2
movsd xmm0, qword [esp + 0x18]
lea eax, [esp + 0xc]
movsd qword [esp + 0xc], xmm0
push 0x5f7c64
push 0x5f5660
push eax
push 0x2b
push 0x5f5634
call fcn.005708f0
add esp, 0x14
ud2
lea ecx, [esp + 0x2c]
lea edx, [esp + 0xc]
mov dword [esp + 0x14], 0
push 0x5f7c34
lea eax, [esp + 0x18]
push eax
jmp 0x4f5c8d
lea ecx, [esp + 0x30]
lea edx, [esp + 0xc]
mov dword [esp + 0x14], 0
push 0x5f7c44
push ebp
call fcn.0056f900
add esp, 8
ud2