Function at 0x51be80
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa0
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov eax, dword [esi + 0x7590]
lea eax, [eax + eax*2]
shl eax, 1
add eax, 3
and al, 0xfc
call fcn.0051c710
mov al, byte [esi + 0x14]
mov ebx, esp
push eax
call fcn.005163b0
mov cl, byte [esi + 0x15]
shl eax, 4
push ecx
mov dword [ebp + 8], eax
call fcn.005163b0
mov edx, dword [ebp + 8]
add edx, eax
mov al, byte [esi + 0x16]
push eax
mov dword [ebp - 0x14], edx
call fcn.005163b0
mov cl, byte [esi + 0x17]
shl eax, 4
push ecx
mov dword [ebp + 8], eax
call fcn.005163b0
mov edx, dword [ebp + 8]
add edx, eax
mov al, byte [esi + 0x18]
push eax
mov dword [ebp - 0xc], edx
call fcn.005163b0
mov cl, byte [esi + 0x19]
shl eax, 4
push ecx
mov dword [ebp + 8], eax
call fcn.005163b0
mov edx, dword [ebp + 8]
add edx, eax
mov al, byte [esi + 0x1e]
push eax
mov dword [ebp - 0x18], edx
call fcn.005163b0
mov cl, byte [esi + 0x1f]
shl eax, 4
push ecx
mov dword [ebp + 8], eax
call fcn.005163b0
mov edx, dword [ebp + 8]
add edx, eax
mov al, byte [esi + 0x20]
push eax
mov dword [ebp - 0x1c], edx
call fcn.005163b0
mov cl, byte [esi + 0x21]
shl eax, 4
push ecx
mov dword [ebp + 8], eax
call fcn.005163b0
mov edx, dword [ebp + 8]
add edx, eax
mov al, byte [esi + 0x22]
push eax
mov dword [ebp - 0x10], edx
call fcn.005163b0
mov cl, byte [esi + 0x23]
shl eax, 4
push ecx
mov dword [ebp + 8], eax
call fcn.005163b0
mov edx, dword [ebp + 8]
add esp, 0x30
add edx, eax
mov byte [ebp - 0xa0], 0xa
mov dword [ebp - 0x20], edx
mov byte [ebp - 0x9f], 5
mov byte [ebp - 0x9e], 1
mov dx, word [esi + 0x7590]
mov cx, word [esi + 0x7594]
xor eax, eax
dec cx
mov word [ebp - 0x9c], ax
mov word [ebp - 0x9a], ax
lea eax, [edx - 1]
mov word [ebp - 0x96], cx
mov word [ebp - 0x98], ax
mov eax, 0x12c
mov word [ebp - 0x94], ax
mov word [ebp - 0x92], ax
mov ecx, 0xc
xor eax, eax
lea edi, [ebp - 0x90]
mov byte [ebp - 0x9d], 8
rep stosd dword es:[edi], eax
mov byte [ebp - 0x60], al
mov eax, dword [esi + 0x7590]
and eax, 0x80000001
mov byte [ebp - 0x5f], 3
jns 0x51bff1
dec eax
or eax, 0xfffffffe
inc eax
je 0x51bffa
inc edx
mov word [ebp - 0x5e], dx
jmp 0x51c005
mov cx, word [esi + 0x7590]
mov word [ebp - 0x5e], cx
xor eax, eax
mov ecx, 0xd
lea edi, [ebp - 0x56]
mov word [ebp - 0x5c], 1
mov word [ebp - 0x5a], ax
mov word [ebp - 0x58], ax
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
test byte [esi + 0x10], 8
je 0x51c0d8
mov edx, dword [sym.imp.MSVCRT.dll_vsprintf]
push 0x8000
push edx
call sub.MSVCRT.dll__setmode
add esp, 8
cmp eax, 0xffffffff
jne 0x51c068
lea edi, [esi + 0x7528]
mov ecx, 7
mov esi, str.620:_Cant_open_output_file
mov eax, 0xa
rep movsd dword es:[edi], dword [esi]
lea esp, [ebp - 0xac]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp + 8], sym.imp.MSVCRT.dll_fopen
mov ecx, dword [ebp + 8]
lea edx, [ebp - 0xa0]
push ecx
push 1
push 0x80
push edx
call sub.MSVCRT.dll_fwrite
mov eax, dword [esi + 0x7594]
add esp, 0x10
xor edx, edx
test eax, eax
mov dword [ebp - 8], edx
jle 0x51c1fe
lea eax, [esi + 0x28]
push 0x56c254
push eax
call sub.MSVCRT.dll_fopen
add esp, 8
mov dword [ebp + 8], eax
test eax, eax
jne 0x51c06f
lea edi, [esi + 0x7528]
mov ecx, 7
mov esi, str.621:_Cant_open_output_file
mov eax, 0xa
rep movsd dword es:[edi], dword [esi]
lea esp, [ebp - 0xac]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret