Function at 0x4996d0
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x101c
call fcn.0051c710
push ebx
mov ebx, dword [esp + 0x1028]
mov dword [esp + 0x14], ecx
push ebp
movsx ecx, word [ebx + 4]
mov eax, ecx
push esi
cdq
and edx, 7
mov esi, dword [esp + 0x1034]
add eax, edx
push edi
mov edx, dword [esi]
sar eax, 3
mov dword [esp + 0x14], edx
movsx edx, word [esi + 2]
lea eax, [eax + eax*2]
lea ebp, [eax*8 + 0x6b5cc0]
mov eax, dword [esi + 4]
mov dword [esp + 0x18], eax
movsx eax, word [esi + 6]
sub eax, edx
inc eax
cmp ecx, eax
jge 0x499727
mov eax, ecx
mov ecx, dword [esp + 0x16]
lea edx, [eax + ecx - 1]
mov eax, dword [esp + 0x103c]
test eax, eax
mov word [esp + 0x1a], dx
mov dword [esp + 0x10], eax
jge 0x499758
mov edi, dword [esp + 0x1030]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x10], ecx
mov eax, dword [ebx]
and eax, 0xff000000
mov dword [esp + 0x1c], eax
mov al, byte [esp + 0x1f]
test al, al
je 0x4997ff
mov ecx, 0x1ff
xor eax, eax
lea edi, [esp + 0x2e]
mov word [esp + 0x2c], 0
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x2c]
stosw word es:[edi], ax
mov eax, dword [esp + 0x1030]
push ecx
push edx
push eax
call fcn.00472060
mov cl, byte [ebx + 7]
mov ebp, dword [esp + 0x104c]
add esp, 0xc
cmp cl, 3
jne 0x4997d8
test dword [0x659ab0], ebp
jne 0x4997d8
mov edx, dword [esp + 0x1030]
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
lea ecx, [esp + 0x30]
push ecx
push edx
call fcn.00472060
add esp, 0xc
mov edx, dword [esp + 0x1044]
mov ecx, dword [esp + 0x20]
push edx
push ebp
push eax
push esi
lea eax, [esp + 0x3c]
push ebx
push eax
call fcn.00499c80
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x101c
ret 0x18
mov al, byte [ebx + 7]
cmp al, 3
je 0x49980e
cmp al, 1
jne 0x49989c
mov esi, dword [esp + 0x1030]
or ecx, 0xffffffff
mov edi, esi
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
test ecx, ecx
jg 0x49986b
mov ecx, 0x3ff
lea edi, [esp + 0x2d]
mov byte [esp + 0x2c], al
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x10]
lea edi, [esp + 0x2c]
mov ecx, eax
push eax
mov edx, ecx
lea eax, [esp + 0x30]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call fcn.00471b20
lea edi, [esp + 0x34]
or ecx, 0xffffffff
xor eax, eax
add esp, 8
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov eax, dword [esp + 0x10]
mov dl, byte [ebx + 7]
sub eax, ecx
xor ecx, ecx
mov cl, byte [ebp + 4]
imul eax, ecx
xor ecx, ecx
cmp dl, 3
sete cl
cdq
inc ecx
idiv ecx
xor edx, edx
test eax, eax
setle dl
dec edx
and eax, edx
add word [esp + 0x14], ax
add word [esp + 0x18], ax
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
js 0x499b29
mov esi, dword [sym.imp.MSVCRT.dll_fseek]
mov edi, dword [sym.imp.MSVCRT.dll_fread]
mov ax, word [esp + 0x14]
cmp ax, word [esp + 0x18]
jg 0x499b29
mov cx, word [esp + 0x1a]
cmp word [esp + 0x16], cx
jg 0x499b29
mov ecx, dword [esp + 0x1030]
mov dl, byte [ecx]
inc ecx
mov byte [esp + 0x24], dl
mov dword [esp + 0x1030], ecx
mov eax, dword [esp + 0x24]
and eax, 0xff
je 0x499b09
cmp eax, 0x20
je 0x499b09
test byte [esp + 0x1040], 2
jne 0x499a92
mov edx, dword [esp + 0x10]
test edx, edx
je 0x499a92
mov dl, byte [ecx]
cmp dl, 0x40
jb 0x499a92
mov cl, byte [ecx - 1]
cmp cl, 0x80
jbe 0x499a92
test byte [esp + 0x1040], 4
jne 0x499951
cmp cl, 0xa0
jbe 0x499a8b
cmp dl, 0xa0
jbe 0x499a8b
mov al, byte [ebp + 0x11]
mov bl, byte [0x54bc98]
cmp al, bl
je 0x4999cc
cmp cl, 0xa0
jbe 0x4999cc
cmp dl, 0xa0
jbe 0x4999cc
cmp al, byte [0x54bc9b]
jne 0x49999e
mov edx, dword [esp + 0x1030]
mov dword [esp + 0x1c], 0
push 0x6598ac
mov ax, word [edx - 1]
mov word [esp + 0x20], ax
mov ecx, dword [esp + 0x20]
push ecx
mov ecx, 0x6b1658
call fcn.004b72a0
jmp 0x4999fa
mov edx, dword [esp + 0x1030]
mov dword [esp + 0x1c], 0
push 0x6598ac
mov ax, word [edx - 1]
mov word [esp + 0x20], ax
mov ecx, dword [esp + 0x20]
push ecx
mov ecx, 0x6b1658
call fcn.004b7310
jmp 0x4999fa
mov edx, dword [esp + 0x1030]
mov ax, word [edx - 1]
mov word [esp + 0x28], ax
mov ecx, dword [esp + 0x28]
push ecx
call fcn.00471e90
and eax, 0xffff
push 0x6598ac
push ebp
push eax
call fcn.00472250
add esp, 0x10
mov edx, dword [esp + 0x1030]
mov ecx, dword [esp + 0x10]
mov al, byte [ebp + 0x13]
inc edx
dec ecx
cmp al, 1
mov dword [esp + 0x1030], edx
mov dword [esp + 0x10], ecx
jbe 0x499a41
lea edx, [ebp + 0xc]
push edx
call fcn.00471dd0
mov ebx, dword [esp + 0x1038]
add esp, 4
xor eax, eax
lea ecx, [esp + 0x14]
mov al, byte [ebp + 0x12]
mov edx, dword [ebx]
push eax
push ecx
push edx
push 0x6578ac
jmp 0x499a5b
mov ebx, dword [esp + 0x1034]
xor eax, eax
mov al, byte [ebp + 0x12]
lea ecx, [esp + 0x14]
mov edx, dword [ebx]
push eax
push ecx
push edx
push 0x6598ac
mov ecx, dword [esp + 0x30]
call fcn.00499fc0
movzx ax, byte [ebp + 0x10]
add word [esp + 0x14], ax
mov al, byte [esp + 0x1040]
test al, 1
je 0x499b1a
mov cx, word [ebp + 0x14]
add word [esp + 0x14], cx
jmp 0x499b1a
mov ebx, dword [esp + 0x1034]
xor edx, edx
and eax, 0x7fff
mov dl, byte [ebp + 5]
mov ecx, dword [ebp]
imul eax, edx
add eax, ecx
push 0
push eax
mov eax, dword [0x659a18]
push eax
call esi
mov ecx, dword [0x659a18]
xor edx, edx
mov dl, byte [ebp + 5]
push ecx
push edx
push 1
push 0x6598ac
call edi
mov al, byte [ebp + 7]
add esp, 0x1c
cmp al, 1
jbe 0x499aed
push ebp
call fcn.00471dd0
mov edx, dword [ebx]
add esp, 4
xor eax, eax
lea ecx, [esp + 0x14]
mov al, byte [ebp + 6]
push eax
push ecx
push edx
push 0x6578ac
jmp 0x499b00
mov edx, dword [ebx]
xor eax, eax
mov al, byte [ebp + 6]
lea ecx, [esp + 0x14]
push eax
push ecx
push edx
push 0x6598ac
mov ecx, dword [esp + 0x30]
call fcn.00499fc0
movzx ax, byte [ebp + 4]
add eax, dword [esp + 0x1044]
add word [esp + 0x14], ax
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
jns 0x4998b7
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x101c
ret 0x18