Function at 0x4849e6
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
mov ebx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
movzx edx, byte [ebp + 0x14]
mov byte [ebp - 0x25], dl
mov dword [ebp - 0x10], 0
cmp byte [ebp + 0x10], 0
je 0x484ace
mov dword [esp + 4], 0x9b34a8
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov dword [ebx + 4], eax
test eax, eax
je 0x484abd
mov esi, ebx
lea edi, [ebp - 0x10]
mov ebx, 0
movzx eax, byte [ebx + edi]
mov byte [ebp - 0x12], al
mov al, 0
test al, al
je 0x484a74
movzx eax, byte [ebp - 0x12]
add al, 3
cmp al, 2
ja 0x484a74
mov byte [ebp - 0x11], 0xfd
mov eax, dword [esi + 4]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 1
lea eax, [ebp - 0x11]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
cmp eax, 1
jne 0x484ab4
mov eax, dword [esi + 4]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 1
lea eax, [ebp - 0x12]
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
cmp eax, 1
jne 0x484aab
inc ebx
cmp ebx, 4
jl 0x484a32
mov eax, 1
jmp 0x484c7b
mov dword [esi + 8], 0xa
jmp 0x484aa1
mov dword [esi + 8], 0xa
jmp 0x484aa1
mov dword [ebx + 8], 3
mov eax, 0
jmp 0x484c7b
mov dword [esp + 4], 0x9b34ab
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov dword [ebx + 4], eax
test eax, eax
je 0x484c6f
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 4
lea eax, [ebp - 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_fread
test eax, eax
je 0x484c66
cmp dword [ebp - 0x10], 0
je 0x484b39
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [ebx + 4], 0
mov dword [ebx + 8], 1
mov eax, 0
jmp 0x484c7b
cmp byte [ebp - 0x25], 0
je 0x484bb8
mov byte [ebx + 0x18], 1
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.msvcrt.dll_ftell
mov ecx, eax
mov dword [ebp - 0x18], 0x2000
lea edx, [ebp - 0x18]
mov dword [esp + 4], edx
mov edx, 0x66666667
imul edx
sar edx, 3
mov eax, ecx
sar eax, 0x1f
sub edx, eax
mov dword [ebp - 0x1c], edx
lea eax, [ebp - 0x1c]
mov dword [esp], eax
call fcn.00982b64
mov dword [esp + 4], eax
mov dword [ebp - 0x20], 0x8000
lea eax, [ebp - 0x20]
mov dword [esp], eax
call fcn.00982bbc
mov eax, dword [eax]
and eax, 0xffffe000
mov dword [ebx + 0x1c], eax
mov dword [esp + 4], 4
mov dword [esp], ebx
call fcn.00823cf4
test al, al
je 0x484c5d
cmp dword [ebx + 0xc], 0
je 0x484be1
mov eax, dword [ebx + 0xc]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 4]
mov dword [esp], 0x18
call fcn.0080e1c4
mov dword [eax], vtable.ream.0
mov dword [eax + 0xc], 0
mov dword [eax + 8], 0
mov dword [eax + 0x14], 0
mov dword [eax + 0x10], 0
mov dword [ebx + 0xc], eax
mov dword [eax + 4], 4
mov dword [esp + 4], 4
mov dword [esp], ebx
call fcn.00823cf4
test al, al
je 0x484c76
lea eax, [ebp - 0x24]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.00823c34
test al, al
je 0x484c76
cmp dword [ebp - 0x24], 0xfe
jne 0x484c76
mov eax, dword [ebx + 0xc]
mov dword [esp + 4], eax
mov dword [esp], ebx
call fcn.00484c84
movzx eax, al
jmp 0x484c7b
mov dword [ebx + 8], 8
jmp 0x484c76
mov dword [ebx + 8], 4
jmp 0x484c76
mov dword [ebx + 8], 2
mov eax, 0
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret