Function at 0x51fdd0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x30
mov ebx, dword [ebp + 0xc]
mov esi, ecx
test ebx, ebx
je 0x51fdfa
push edx
call sub.KERNEL32.DLL_GetStdHandle
test eax, eax
je 0x51fe06
mov edi, eax
cmp eax, 0xffffffff
jne 0x51fe19
call sub.KERNEL32.DLL_GetLastError
jmp 0x51fe0b
mov dword [esi + 4], 0
mov byte [esi], 4
jmp 0x51fe11
mov eax, 6
mov byte [esi], 0
mov dword [esi + 4], eax
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [ebp - 0x28], 0
lea eax, [ebp - 0x28]
push eax
push edi
call sub.KERNEL32.DLL_GetConsoleMode
test eax, eax
je 0x51fe86
mov ecx, dword [ebp + 0x10]
movzx eax, byte [ecx + 4]
test eax, eax
je 0x51fea5
mov ebx, ecx
mov ecx, dword [ebp + 8]
cmp al, 4
jae 0x51fffd
movzx ecx, byte [ecx]
mov edx, ecx
and dl, 0xc0
cmp dl, 0x80
jne 0x51ff02
mov byte [ebx + eax], cl
mov edx, ebx
movzx ecx, byte [ebx + 4]
inc cl
mov byte [ebx + 4], cl
movzx eax, byte [ebx]
movzx ebx, byte [eax + 0x69dbec]
cmp cl, bl
mov dword [ebp - 0x38], ebx
jae 0x51ff08
mov dword [esi + 4], 1
mov byte [esi], 4
jmp 0x51fe11
mov edx, edi
lea ecx, [ebp - 0x28]
push ebx
push dword [ebp + 8]
call fcn.00520070
add esp, 8
movsd xmm0, qword [ebp - 0x28]
movsd qword [esi], xmm0
jmp 0x51fe11
cmp ebx, 0x1000
mov eax, 0x1000
cmovb eax, ebx
mov edx, dword [ebp + 8]
lea ecx, [ebp - 0x34]
push eax
call fcn.0043e6d0
add esp, 4
cmp dword [ebp - 0x34], 0
je 0x51ff3c
mov edx, dword [ebp - 0x30]
test edx, edx
je 0x51ff55
xor ecx, ecx
push 0x69dd48
push ebx
push dword [ebp + 8]
call fcn.005204f0
add esp, 0xc
mov ebx, edx
lea ecx, [ebp - 0x28]
mov edx, eax
push ebx
call fcn.0043e6d0
add esp, 4
lea ecx, [ebp - 0x28]
call fcn.00520520
mov ebx, edx
jmp 0x51ff42
mov byte [ebx + 4], 0
jmp 0x51ff2d
movzx eax, cl
cmp cl, 5
jae 0x52002d
lea ecx, [ebp - 0x34]
push eax
call fcn.0043e6d0
add esp, 4
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x34], 0
mov byte [eax + 4], 0
je 0x51ff84
mov byte [esi], 2
mov dword [esi + 4], 0x69dd3c
jmp 0x51fe11
mov eax, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x2c]
mov ecx, esi
mov edx, edi
push ebx
push eax
call fcn.00520140
add esp, 8
jmp 0x51fe11
mov eax, dword [ebp + 8]
movzx eax, byte [eax]
movzx ecx, byte [eax + 0x69dbec]
cmp ecx, 2
jb 0x51ffd1
cmp ecx, ebx
jbe 0x51ffd1
mov ecx, dword [ebp + 0x10]
mov dword [esi + 4], 1
mov byte [ecx], al
mov byte [ecx + 4], 1
mov cl, 4
mov byte [esi], cl
jmp 0x51fe11
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x30]
cmp ecx, ebx
mov dword [ebp - 0x10], ecx
jne 0x52003e
lea ecx, [ebp - 0x28]
mov edx, edi
push ebx
push eax
call fcn.00520140
add esp, 8
movzx eax, byte [ebp - 0x28]
cmp al, 4
jne 0x51ffe1
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x10], ebx
cmp eax, ebx
mov dword [ebp - 0x3c], eax
je 0x51fe7a
mov dword [ebp - 0x28], 0
lea ecx, [ebp - 0x3c]
lea edx, [ebp - 0x10]
push 0x69dddc
jmp 0x520050
mov al, 2
mov dword [esi + 4], 0x69dd3c
mov byte [esi], al
jmp 0x51fe11
movzx ecx, byte [ebp - 0x25]
movzx edi, word [ebp - 0x27]
mov edx, dword [ebp - 0x24]
mov byte [esi + 3], cl
mov word [esi + 1], di
mov byte [esi], al
mov dword [esi + 4], edx
jmp 0x51fe11
mov dword [ebp - 0x28], 0x69dda4
mov dword [ebp - 0x24], 1
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x20], 0x6c4590
mov dword [ebp - 0x1c], 0
lea ecx, [ebp - 0x28]
mov edx, 0x69ddac
call fcn.00439fc0
mov ecx, eax
mov edx, 4
push 0x69ddbc
call fcn.0043a6f0
mov dword [ebp - 0x28], 0
lea ecx, [ebp - 0x38]
lea edx, [ebp - 0x10]
push 0x69ddcc
lea eax, [ebp - 0x28]
push eax
call fcn.0051f730
mov esi, eax
push edi
call sub.KERNEL32.DLL_CloseHandle
push esi
call fcn.0056dac0
nop word [eax + eax]