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

Disassembly:
mov eax, 0x6018
call fcn.0051c710
push ebp
push esi
push edi
mov edi, ecx
xor esi, esi
push 0x56c98c
mov dword [esp + 0x24], edi
mov dword [esp + 0x1c], esi
call fcn.0049f140
mov ebp, eax
test ebp, ebp
jne 0x49f53f
push 0x56c990
mov ecx, edi
call fcn.0049f140
mov ebp, eax
test ebp, ebp
je 0x49f822
mov esi, dword [esp + 0x6028]
xor eax, eax
mov ecx, 3
push ebx
mov ah, byte [esi + 2]
xor ebx, ebx
mov al, byte [esi + 5]
cdq
idiv ecx
cmp edx, 1
jne 0x49f582
mov ecx, dword [edi + 0x28]
mov edx, dword [edi + 0x110]
test ecx, ecx
jle 0x49f57f
mov eax, dword [edi + 0x2c]
mov edi, ecx
add eax, 5
xor ecx, ecx
mov cl, byte [eax]
add eax, 0x10
add ebx, ecx
dec edi
jne 0x49f573
imul ebx, edx
mov ecx, 0x7ff
xor eax, eax
lea edi, [esp + 0x29]
mov byte [esp + 0x28], 0
rep stosd dword es:[edi], eax
mov edx, dword [esp + 0x6030]
stosw word es:[edi], ax
stosb byte es:[edi], al
mov al, byte [esi + 4]
mov dword [esp + 0x18], edx
test al, al
jne 0x49f6b1
mov edi, dword [esi + 8]
push 0
shr edi, 3
lea eax, [edi + ebx]
push eax
push ebp
mov dword [esp + 0x20], eax
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
mov ecx, esi
call fcn.004b5410
mov ebx, eax
mov eax, dword [esi + 8]
push ebp
lea eax, [eax + ebx - 1]
shr eax, 3
sub eax, edi
inc eax
mov dword [esp + 0x14], eax
call dword [sym.imp.MSVCRT.dll_ftell]
mov ecx, dword [esp + 0x18]
add esp, 4
cmp eax, ecx
jne 0x49f6a7
mov ecx, dword [esp + 0x10]
push ebp
push ecx
lea edx, [esp + 0x30]
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fread]
mov esi, dword [esi + 8]
add esp, 0x10
and esi, 7
xor ecx, ecx
test ebx, ebx
jle 0x49f6a7
mov eax, ecx
cdq
and edx, 7
add eax, edx
mov edx, dword [esp + 0x6030]
sar eax, 3
mov al, byte [eax + edx]
mov edx, ecx
and edx, 0x80000007
jns 0x49f641
dec edx
or edx, 0xfffffff8
inc edx
test byte [edx*4 + 0x659a34], al
mov eax, esi
cdq
je 0x49f674
and edx, 7
add eax, edx
sar eax, 3
lea edi, [esp + eax + 0x28]
mov eax, esi
and eax, 0x80000007
jns 0x49f667
dec eax
or eax, 0xfffffff8
inc eax
mov dl, byte [eax*4 + 0x659a34]
mov al, byte [edi]
or al, dl
jmp 0x49f69b
and edx, 7
add eax, edx
sar eax, 3
lea edi, [esp + eax + 0x28]
mov eax, esi
and eax, 0x80000007
jns 0x49f68e
dec eax
or eax, 0xfffffff8
inc eax
mov dl, byte [eax*4 + 0x659a34]
mov al, byte [edi]
not dl
and al, dl
inc ecx
inc esi
cmp ecx, ebx
mov byte [edi], al
jl 0x49f61d
lea eax, [esp + 0x28]
mov dword [esp + 0x18], eax
jmp 0x49f6f7
mov ecx, dword [esi + 8]
xor edi, edi
lea edx, [ebx + ecx*2]
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x24]
mov ecx, dword [edx + 0x28]
test ecx, ecx
jle 0x49f6da
mov eax, dword [edx + 0x2c]
add eax, 5
xor ebx, ebx
mov bl, byte [eax]
add eax, 0x10
add edi, ebx
dec ecx
jne 0x49f6ce
mov ebx, dword [edx + 0x24]
mov ecx, esi
call fcn.004b53f0
imul edi, ebx
sub edi, dword [esp + 0x14]
cmp edi, eax
mov dword [esp + 0x10], edi
jl 0x49f6f7
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
test eax, eax
jle 0x49f7a0
mov ebx, dword [sym.imp.MSVCRT.dll_fwrite]
mov dword [esp + 0x20], 4
mov edi, dword [sym.imp.MSVCRT.dll_fseek]
push 2
push 0
push ebp
call edi
push ebp
call dword [sym.imp.MSVCRT.dll_ftell]
mov ecx, dword [esp + 0x24]
add esp, 0x10
mov esi, ecx
sub esi, eax
test esi, esi
jle 0x49f784
mov ecx, 0xfff
xor eax, eax
lea edi, [esp + 0x2029]
mov byte [esp + 0x2028], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
cmp esi, 0x4000
mov edi, esi
jl 0x49f75e
mov edi, 0x4000
push ebp
push 1
lea eax, [esp + 0x2030]
push edi
push eax
call ebx
sub esi, edi
add esp, 0x10
test esi, esi
jg 0x49f74f
mov eax, dword [esp + 0x20]
dec eax
test eax, eax
mov dword [esp + 0x20], eax
jg 0x49f711
jmp 0x49f7a0
push 0
push ecx
push ebp
call edi
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
push ebp
push 1
push ecx
push edx
call ebx
add esp, 0x1c
mov dword [esp + 0x1c], eax
call fcn.0047de30
mov ecx, eax
call fcn.0047e5d0
cmp eax, 0x80
pop ebx
jl 0x49f7c7
call fcn.0047de30
mov ecx, eax
call fcn.0047e5d0
cmp eax, 0x96
jl 0x49f7fc
call fcn.0047de30
mov ecx, eax
call fcn.0047e5d0
cmp eax, 0x96
jl 0x49f7ed
call fcn.0047de30
mov ecx, eax
call fcn.0047e5d0
cmp eax, 0xe6
jl 0x49f7fc
push 0
call fcn.004328b0
add esp, 4
cmp eax, 3
jl 0x49f808
call fcn.0047e0e0
mov ecx, eax
call fcn.0047e070
mov ecx, dword [esp + 0x20]
push ebp
call fcn.0049f1c0
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
add esp, 0x6018
ret 8
mov eax, esi
pop edi
pop esi
pop ebp
add esp, 0x6018
ret 8