Function at 0x51de30
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov esi, dword [ecx + 0x10]
cmp esi, dword [ecx + 0xc]
je 0x51df80
cmp byte [esi - 4], 0
mov ebp, ecx
mov edx, dword [esi - 8]
je 0x51deb0
test edx, edx
je 0x51de8b
mov ebx, dword [ecx]
mov eax, dword [ebx + 0xc]
cmp eax, dword [ebx + 8]
jae 0x51e110
lea edx, [eax + 1]
mov dword [ebx + 0xc], edx
mov byte [eax], 0x2c
test byte [ebp + 0x28], 1
je 0x51dff0
mov ebx, dword [ebp]
mov eax, dword [ebx + 0xc]
cmp eax, dword [ebx + 8]
jae 0x51e1e0
lea edx, [eax + 1]
mov dword [ebx + 0xc], edx
mov byte [eax], 0x20
test byte [ebp + 0x28], 1
je 0x51dff0
mov eax, dword [esi - 8]
add eax, 1
mov dword [esi - 8], eax
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret 4
mov ebx, dword [ecx]
test edx, edx
mov eax, dword [ebx + 0xc]
mov edi, dword [ebx + 8]
jne 0x51df90
cmp eax, edi
jae 0x51e140
lea edx, [eax + 1]
mov dword [ebx + 0xc], edx
mov byte [eax], 0xa
mov eax, dword [esi - 8]
test al, 1
jne 0x51de98
mov ebx, dword [ebp + 0x10]
sub ebx, dword [ebp + 0xc]
movsx eax, byte [ebp + 0x21]
mov edi, dword [ebp]
shr ebx, 3
imul ebx, dword [ebp + 0x24]
mov dword [esp + 0x1c], eax
mov ebp, dword [edi + 8]
mov eax, dword [edi + 0xc]
sub ebp, eax
cmp ebx, ebp
jbe 0x51df54
lea esi, [esi]
mov ecx, dword [esp + 0x1c]
mov dword [esp + 8], ebp
mov dword [esp], eax
mov dword [esp + 4], ecx
call sub.msvcrt.dll_memset
mov eax, dword [edi + 0xc]
mov edx, dword [edi + 4]
add eax, ebp
cmp eax, edx
mov dword [edi + 0xc], eax
je 0x51e095
mov ecx, dword [edi]
sub eax, edx
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov dword [esp], edx
sub ebx, ebp
mov dword [esp + 0xc], ecx
call sub.msvcrt.dll_fwrite
mov eax, dword [edi + 4]
mov ebp, dword [edi + 8]
sub ebp, eax
mov dword [edi + 0xc], eax
cmp ebp, ebx
jb 0x51df00
test ebx, ebx
je 0x51de95
mov edx, dword [esp + 0x1c]
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.msvcrt.dll_memset
add dword [edi + 0xc], ebx
jmp 0x51de95
mov byte [ecx + 0x20], 1
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret 4
and edx, 1
jne 0x51e0b0
cmp eax, edi
jae 0x51e1b0
lea edx, [eax + 1]
mov dword [ebx + 0xc], edx
mov byte [eax], 0x2c
mov ebx, dword [ebp]
mov eax, dword [ebx + 0xc]
cmp eax, dword [ebx + 8]
jb 0x51dec8
mov edx, dword [ebx + 4]
cmp eax, edx
je 0x51dec8
mov edi, dword [ebx]
sub eax, edx
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov dword [esp], edx
mov dword [esp + 0xc], edi
call sub.msvcrt.dll_fwrite
mov eax, dword [ebx + 4]
jmp 0x51dec8
mov ebx, dword [ebp]
mov eax, dword [ebx + 0xc]
cmp eax, dword [ebx + 8]
jae 0x51e0e0
lea edx, [eax + 1]
mov dword [ebx + 0xc], edx
mov byte [eax], 0xa
mov ebx, dword [ebp + 0x10]
sub ebx, dword [ebp + 0xc]
movsx eax, byte [ebp + 0x21]
mov edi, dword [ebp]
shr ebx, 3
imul ebx, dword [ebp + 0x24]
mov dword [esp + 0x1c], eax
mov ebp, dword [edi + 8]
mov eax, dword [edi + 0xc]
sub ebp, eax
cmp ebx, ebp
jbe 0x51df54
mov ecx, dword [esp + 0x1c]
mov dword [esp + 8], ebp
mov dword [esp], eax
mov dword [esp + 4], ecx
call sub.msvcrt.dll_memset
mov eax, dword [edi + 0xc]
mov edx, dword [edi + 4]
add eax, ebp
cmp eax, edx
mov dword [edi + 0xc], eax
je 0x51e085
mov ecx, dword [edi]
sub eax, edx
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov dword [esp], edx
sub ebx, ebp
mov dword [esp + 0xc], ecx
call sub.msvcrt.dll_fwrite
mov eax, dword [edi + 4]
mov ebp, dword [edi + 8]
sub ebp, eax
mov dword [edi + 0xc], eax
cmp ebp, ebx
jb 0x51e030
jmp 0x51df54
sub ebx, ebp
mov ebp, dword [edi + 8]
sub ebp, eax
cmp ebx, ebp
ja 0x51e030
jmp 0x51df54
sub ebx, ebp
mov ebp, dword [edi + 8]
sub ebp, eax
cmp ebx, ebp
ja 0x51df00
jmp 0x51df54
cmp eax, edi
jae 0x51e180
lea edx, [eax + 1]
mov dword [ebx + 0xc], edx
mov byte [eax], 0x3a
mov ebx, dword [ebp]
mov eax, dword [ebx + 0xc]
cmp eax, dword [ebx + 8]
jae 0x51e150
lea edx, [eax + 1]
mov dword [ebx + 0xc], edx
mov byte [eax], 0x20
jmp 0x51ded1
mov edx, dword [ebx + 4]
cmp eax, edx
je 0x51dfff
mov edi, dword [ebx]
sub eax, edx
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov dword [esp], edx
mov dword [esp + 0xc], edi
call sub.msvcrt.dll_fwrite
mov eax, dword [ebx + 4]
jmp 0x51dfff
mov edx, dword [ebx + 4]
cmp eax, edx
je 0x51de60
mov edi, dword [ebx]
sub eax, edx
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov dword [esp], edx
mov dword [esp + 0xc], edi
call sub.msvcrt.dll_fwrite
mov eax, dword [ebx + 4]
jmp 0x51de60
mov edx, dword [ebx + 4]
cmp edx, eax
jne 0x51dfc4
jmp 0x51dec8
mov edx, dword [ebx + 4]
cmp eax, edx
je 0x51e0d0
mov edi, dword [ebx]
sub eax, edx
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov dword [esp], edx
mov dword [esp + 0xc], edi
call sub.msvcrt.dll_fwrite
mov eax, dword [ebx + 4]
jmp 0x51e0d0
mov edx, dword [ebx + 4]
cmp edx, eax
je 0x51e0b8
mov edi, dword [ebx]
sub eax, edx
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov dword [esp], edx
mov dword [esp + 0xc], edi
call sub.msvcrt.dll_fwrite
mov eax, dword [ebx + 4]
jmp 0x51e0b8
mov edx, dword [ebx + 4]
cmp edx, eax
je 0x51dfa1
mov edi, dword [ebx]
sub eax, edx
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov dword [esp], edx
mov dword [esp + 0xc], edi
call sub.msvcrt.dll_fwrite
mov eax, dword [ebx + 4]
jmp 0x51dfa1
mov edx, dword [ebx + 4]
cmp eax, edx
je 0x51de82
mov edi, dword [ebx]
sub eax, edx
mov dword [esp + 4], 1
mov dword [esp + 8], eax
mov dword [esp], edx
mov dword [esp + 0xc], edi
call sub.msvcrt.dll_fwrite
mov eax, dword [ebx + 4]
jmp 0x51de82