Function at 0x497f30
Capabilities:
Get file size
Write file on windows

Disassembly:
sub esp, 0x7c
mov eax, dword [sym.imp.msvcrt.dll__osver]
mov dword [esp + 0x6c], ebx
mov ebx, dword [esp + 0x8c]
mov dword [esp + 0x70], esi
mov dword [esp + 0x74], edi
mov dword [esp + 0x78], ebp
cmp word [eax], 0
jns 0x497f5e
mov eax, dword [0x503520]
test eax, eax
jne 0x497fa0
mov eax, dword [esp + 0x88]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x84]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x80]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
mov ebx, dword [esp + 0x6c]
mov esi, dword [esp + 0x70]
mov edi, dword [esp + 0x74]
mov ebp, dword [esp + 0x78]
add esp, 0x7c
ret
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], 0
mov dword [esp], ebx
mov dword [0x503520], 0
call sub.msvcrt.dll_fflush
mov eax, dword [ebx + 0x10]
mov dword [esp], eax
call sub.msvcrt.dll__get_osfhandle
lea edx, [esp + 0x54]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_GetFileSize
sub esp, 8
cmp eax, 0xffffffff
mov dword [esp + 0x50], eax
je 0x498130
mov eax, dword [ebx + 0x10]
mov esi, dword [esp + 0x48]
mov dword [esp], eax
call sub.msvcrt.dll__get_osfhandle
lea edx, [esp + 0x4c]
mov dword [esp + 0xc], 1
mov dword [esp + 8], edx
mov dword [esp + 4], esi
mov dword [esp], eax
call sub.KERNEL32.dll_SetFilePointer
sub esp, 0x10
cmp eax, 0xffffffff
mov dword [esp + 0x48], eax
je 0x498170
mov eax, dword [esp + 0x4c]
cmp eax, dword [esp + 0x54]
mov edx, dword [esp + 0x48]
jb 0x497f5e
jbe 0x498147
mov eax, dword [ebx + 0x10]
mov dword [esp], eax
call sub.msvcrt.dll__get_osfhandle
mov dword [esp + 0xc], 2
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.KERNEL32.dll_SetFilePointer
sub esp, 0x10
mov esi, dword [esp + 0x48]
mov edi, dword [esp + 0x4c]
sub esi, dword [esp + 0x50]
sbb edi, dword [esp + 0x54]
cmp edi, 0
jl 0x498114
jle 0x49810b
lea esi, [esi]
cmp edi, 0
mov edx, esi
mov ecx, edi
jl 0x4980a6
jle 0x498156
mov edx, 0x200
xor ecx, ecx
mov eax, dword [ebx + 0x10]
lea ebp, [esp + 0x5c]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x3c], edx
mov dword [esp + 0x38], ecx
mov dword [esp], eax
call sub.msvcrt.dll__get_osfhandle
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebp
mov dword [esp + 4], 0x503320
mov dword [esp + 8], edx
mov dword [esp], eax
call sub.KERNEL32.dll_WriteFile
sub esp, 0x14
test eax, eax
je 0x498182
mov eax, dword [esp + 0x5c]
cmp dword [esp + 0x2c], eax
ja 0x498182
xor edx, edx
sub esi, eax
sbb edi, edx
cmp edi, 0
jg 0x498090
jl 0x498114
cmp esi, 0
ja 0x498090
mov eax, dword [ebx + 0x10]
mov dword [esp], eax
call sub.msvcrt.dll__get_osfhandle
mov dword [esp], eax
call sub.KERNEL32.dll_FlushFileBuffers
sub esp, 4
jmp 0x497f5e
call sub.KERNEL32.dll_GetLastError
test eax, eax
je 0x497fed
mov eax, 0xffffffff
jmp 0x497f87
cmp edx, dword [esp + 0x50]
jbe 0x497f5e
jmp 0x498040
cmp esi, 0x200
lea esi, [esi]
jbe 0x4980a6
jmp 0x49809f
call sub.KERNEL32.dll_GetLastError
test eax, eax
je 0x498028
lea esi, [esi]
jmp 0x49813d
mov eax, dword [ebx + 0x10]
mov dword [esp], eax
call sub.msvcrt.dll__get_osfhandle
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.KERNEL32.dll_SetFilePointer
mov eax, 0xffffffff
sub esp, 0x10
jmp 0x497f87