Function at 0x51ac60
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x54
push ebx
push ebp
mov ebp, dword [esp + 0x60]
push esi
xor esi, esi
push edi
mov eax, dword [ebp + 0x758c]
cmp eax, esi
je 0x51ac80
push eax
call sub.MSVCRT.dll_free
add esp, 4
fild dword [ebp + 0x7590]
sub esp, 8
fmul qword [0x564728]
fadd qword [0x564720]
fmul qword [0x564718]
fstp qword [esp]
call sub.MSVCRT.dll_floor
fmul qword [0x564710]
call sub.MSVCRT.dll__ftol
mov edi, eax
mov eax, dword [ebp + 0x7594]
imul eax, edi
push eax
mov dword [esp + 0x34], edi
call sub.MSVCRT.dll_malloc
mov cl, byte [ebp + 0x14]
mov ebx, eax
push ecx
call fcn.005163b0
mov dl, byte [ebp + 0x15]
shl eax, 4
push edx
mov dword [esp + 0x7c], eax
call fcn.005163b0
mov ecx, dword [esp + 0x7c]
mov dl, byte [ebp + 0x16]
add ecx, eax
push edx
mov dword [esp + 0x3c], ecx
call fcn.005163b0
shl eax, 4
mov dword [esp + 0x80], eax
mov al, byte [ebp + 0x17]
push eax
call fcn.005163b0
mov ecx, dword [esp + 0x84]
mov dl, byte [ebp + 0x18]
add ecx, eax
push edx
mov dword [esp + 0x40], ecx
call fcn.005163b0
shl eax, 4
mov dword [esp + 0x88], eax
mov al, byte [ebp + 0x19]
push eax
call fcn.005163b0
mov ecx, dword [esp + 0x8c]
mov dl, byte [ebp + 0x1e]
add ecx, eax
push edx
mov dword [esp + 0x44], ecx
call fcn.005163b0
shl eax, 4
mov dword [esp + 0x90], eax
mov al, byte [ebp + 0x1f]
push eax
call fcn.005163b0
mov ecx, dword [esp + 0x94]
mov dl, byte [ebp + 0x20]
add ecx, eax
push edx
mov dword [esp + 0x48], ecx
call fcn.005163b0
shl eax, 4
mov dword [esp + 0x98], eax
mov al, byte [ebp + 0x21]
push eax
call fcn.005163b0
mov ecx, dword [esp + 0x9c]
mov dl, byte [ebp + 0x22]
add ecx, eax
push edx
mov dword [esp + 0x4c], ecx
call fcn.005163b0
shl eax, 4
mov dword [esp + 0xa0], eax
mov al, byte [ebp + 0x23]
push eax
call fcn.005163b0
add esp, 0x3c
mov edx, dword [esp + 0x68]
mov dword [esp + 0x68], esi
add edx, eax
mov eax, dword [ebp + 0x7594]
cmp eax, esi
jle 0x51ae4c
mov dword [esp + 0x10], esi
mov ecx, dword [ebp + 0x7590]
cmp ecx, esi
jle 0x51ae2b
mov eax, dword [esp + 0x10]
mov edi, dword [ebp + 0x7594]
sub edi, dword [esp + 0x68]
dec edi
imul edi, ecx
mov ecx, dword [esp + 0x6c]
add edi, esi
cmp byte [edi + ecx], 0x31
je 0x51ae00
mov cl, byte [esp + 0x14]
mov byte [eax + ebx], dl
mov byte [eax + ebx + 1], cl
mov cl, byte [esp + 0x18]
jmp 0x51ae13
mov cl, byte [esp + 0x1c]
mov byte [eax + ebx], cl
mov cl, byte [esp + 0x20]
mov byte [eax + ebx + 1], cl
mov cl, byte [esp + 0x24]
mov byte [eax + ebx + 2], cl
mov ecx, dword [ebp + 0x7590]
inc esi
add eax, 3
cmp esi, ecx
jl 0x51add5
mov edi, dword [esp + 0x28]
xor esi, esi
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x68]
add ecx, edi
inc eax
mov dword [esp + 0x10], ecx
mov ecx, dword [ebp + 0x7594]
cmp eax, ecx
mov dword [esp + 0x68], eax
jl 0x51adc7
mov ecx, dword [ebp + 0x7594]
mov edx, dword [ebp + 0x7590]
mov eax, ecx
mov word [esp + 0x2c], 0x4d42
imul eax, edi
mov dword [esp + 0x6c], eax
mov dword [ebp + 0x7598], eax
lea edi, [eax + 0x36]
mov dword [esp + 0x32], esi
push edi
mov dword [esp + 0x32], edi
mov dword [esp + 0x3a], 0x36
mov dword [esp + 0x40], 0x28
mov dword [esp + 0x44], edx
mov dword [esp + 0x48], ecx
mov word [esp + 0x4c], 1
mov word [esp + 0x4e], 0x18
mov dword [esp + 0x50], esi
mov dword [esp + 0x54], esi
mov dword [esp + 0x58], esi
mov dword [esp + 0x5c], esi
mov dword [esp + 0x60], esi
mov dword [esp + 0x64], esi
call sub.MSVCRT.dll_malloc
mov ecx, edi
mov edx, eax
mov esi, ecx
or eax, 0xffffffff
mov edi, edx
mov dword [esp + 0x6c], edx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
lea esi, [esp + 0x40]
and ecx, 3
add esp, 4
rep stosb byte es:[edi], al
mov ecx, dword [esp + 0x2c]
mov eax, edx
mov dword [eax], ecx
mov ecx, dword [esp + 0x30]
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x34]
mov dword [eax + 8], ecx
mov cx, word [esp + 0x38]
mov word [eax + 0xc], cx
lea eax, [edx + 0xe]
mov ecx, 0xa
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x6c]
mov esi, ebx
mov edx, ecx
lea edi, [eax + 0x28]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
test byte [ebp + 0x10], 8
je 0x51afab
mov eax, dword [sym.imp.MSVCRT.dll_vsprintf]
push 0x8000
push eax
call sub.MSVCRT.dll__setmode
add esp, 8
cmp eax, 0xffffffff
jne 0x51af75
lea edi, [ebp + 0x7528]
mov ecx, 7
mov esi, str.600:_Cant_open_output_file
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x68]
push ecx
call sub.MSVCRT.dll_free
push ebx
call sub.MSVCRT.dll_free
add esp, 8
mov eax, 0xa
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret
mov esi, sym.imp.MSVCRT.dll_fopen
mov ecx, dword [esp + 0x2e]
mov edi, dword [esp + 0x68]
push esi
push 1
push ecx
push edi
call sub.MSVCRT.dll_fwrite
push esi
call sub.MSVCRT.dll_fclose
push edi
call sub.MSVCRT.dll_free
push ebx
call sub.MSVCRT.dll_free
add esp, 0x1c
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret
lea edx, [ebp + 0x28]
push 0x56c254
push edx
call sub.MSVCRT.dll_fopen
mov esi, eax
add esp, 8
test esi, esi
jne 0x51af7a
mov eax, dword [esp + 0x68]
push eax
call sub.MSVCRT.dll_free
push ebx
call sub.MSVCRT.dll_free
lea edi, [ebp + 0x7528]
mov ecx, 7
mov esi, str.601:_Cant_open_output_file
add esp, 8
rep movsd dword es:[edi], dword [esi]
pop edi
pop esi
pop ebp
mov eax, 0xa
pop ebx
add esp, 0x54
ret