Function at 0x5317e0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov eax, dword [esi + 0x7590]
imul eax, dword [esi + 0x7594]
add eax, 3
and al, 0xfc
call fcn.005322e0
mov al, byte [esi + 0x10]
xor ebx, ebx
test al, 8
mov dword [ebp + 8], esp
je 0x5319ed
mov eax, dword [sym.imp.MSVCRT.dll_strncmp]
push 0x8000
push eax
call sub.MSVCRT.dll__setmode
add esp, 8
cmp eax, 0xffffffff
jne 0x53184c
lea edi, [esi + 0x7528]
mov ecx, 7
mov esi, str.610:_Cant_open_output_file
mov eax, 0xa
rep movsd dword es:[edi], dword [esi]
lea esp, [ebp - 0x18]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, sym.imp.MSVCRT.dll__setjmp3
mov edx, dword [str.GIF87a]
mov ax, word [0x595f78]
push edi
push 1
lea ecx, [ebp - 0xc]
push 6
push ecx
mov dword [ebp - 0xc], edx
mov word [ebp - 8], ax
call sub.MSVCRT.dll_fwrite
mov ax, word [esi + 0x7590]
xor edx, edx
mov dl, ah
mov byte [ebp - 0xc], al
mov ax, word [esi + 0x7594]
mov byte [ebp - 0xb], dl
xor ecx, ecx
push edi
push 1
lea edx, [ebp - 0xc]
mov cl, ah
push 7
push edx
mov byte [ebp - 0xa], al
mov byte [ebp - 9], cl
mov byte [ebp - 8], 0xf0
mov byte [ebp - 7], bl
mov byte [ebp - 6], bl
call sub.MSVCRT.dll_fwrite
mov al, byte [esi + 0x1e]
push eax
call fcn.0052bf80
mov cl, byte [esi + 0x1f]
mov ebx, eax
push ecx
shl bl, 4
call fcn.0052bf80
mov dl, byte [esi + 0x20]
add bl, al
push edx
mov byte [ebp - 0xc], bl
call fcn.0052bf80
mov ebx, eax
mov al, byte [esi + 0x21]
push eax
shl bl, 4
call fcn.0052bf80
mov cl, byte [esi + 0x22]
add bl, al
push ecx
mov byte [ebp - 0xb], bl
call fcn.0052bf80
mov dl, byte [esi + 0x23]
mov ebx, eax
push edx
shl bl, 4
call fcn.0052bf80
add bl, al
mov al, byte [esi + 0x14]
push eax
mov byte [ebp - 0xa], bl
call fcn.0052bf80
mov cl, byte [esi + 0x15]
mov ebx, eax
push ecx
shl bl, 4
call fcn.0052bf80
mov dl, byte [esi + 0x16]
add esp, 0x40
add bl, al
push edx
mov byte [ebp - 9], bl
call fcn.0052bf80
mov ebx, eax
mov al, byte [esi + 0x17]
push eax
shl bl, 4
call fcn.0052bf80
mov cl, byte [esi + 0x18]
add bl, al
mov byte [ebp - 8], bl
push ecx
call fcn.0052bf80
mov dl, byte [esi + 0x19]
mov ebx, eax
push edx
shl bl, 4
call fcn.0052bf80
add bl, al
push edi
push 1
lea eax, [ebp - 0xc]
push 6
push eax
mov byte [ebp - 7], bl
call sub.MSVCRT.dll_fwrite
mov edx, dword [esi + 0x7590]
mov cl, byte [esi + 0x7590]
mov al, byte [esi + 0x7594]
mov byte [ebp - 7], cl
mov ecx, dword [esi + 0x7594]
push edi
sar edx, 8
mov byte [ebp - 6], dl
push 1
lea edx, [ebp - 0xc]
xor ebx, ebx
sar ecx, 8
push 0xa
push edx
mov byte [ebp - 0xc], 0x2c
mov byte [ebp - 0xb], bl
mov byte [ebp - 0xa], bl
mov byte [ebp - 9], bl
mov byte [ebp - 8], bl
mov byte [ebp - 5], al
mov byte [ebp - 4], cl
mov byte [ebp - 3], bl
call sub.MSVCRT.dll_fwrite
mov eax, dword [esi + 0x7590]
mov ecx, dword [ebp + 0xc]
imul eax, dword [esi + 0x7594]
mov esi, dword [ebp + 8]
push eax
push ecx
push eax
push esi
call fcn.00531320
add esp, 0x40
cmp eax, ebx
push edi
jg 0x531a29
call sub.MSVCRT.dll_fclose
add esp, 4
mov eax, 0xb
lea esp, [ebp - 0x18]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [esi + 0x28]
push 0x58518c
push ecx
call sub.MSVCRT.dll_fopen
mov edi, eax
add esp, 8
cmp edi, ebx
jne 0x531851
lea edi, [esi + 0x7528]
mov ecx, 7
mov esi, str.611:_Cant_open_output_file
mov eax, 0xa
rep movsd dword es:[edi], dword [esi]
lea esp, [ebp - 0x18]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 1
push eax
push esi
call sub.MSVCRT.dll_fwrite
push edi
push 0x3b
call sub.MSVCRT.dll_fputc
push edi
call sub.MSVCRT.dll_fclose
add esp, 0x1c
xor eax, eax
lea esp, [ebp - 0x18]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret