Function at 0x499c70
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
push ebx
mov ebx, dword [ebp + 8]
cmp byte [ebx + 0x103], 0
push esi
push edi
je 0x499e28
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx]
lea eax, [ebp - 0x20]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x499ca2
mov dword [ebp - 0xc], eax
jmp 0x499cab
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x10], eax
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 1
lea edx, [ebp - 0x28]
push edx
xor eax, eax
push eax
push eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
push ecx
call edi
test eax, eax
jne 0x499cce
xor ecx, ecx
jmp 0x499cd4
mov ecx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0xc]
ja 0x49a0dd
jb 0x499ce8
cmp ecx, dword [ebp - 0x10]
jae 0x49a0dd
mov eax, dword [ebx + 0x11]
sub eax, dword [ebx + 0xd]
jns 0x499cf3
add eax, dword [ebx + 5]
movzx esi, byte [ebx + 0x35]
push 1
lea edx, [ebp - 0x30]
push edx
xor ecx, ecx
shr esi, 3
add esi, eax
push ecx
xor eax, eax
push eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
push ecx
call edi
test eax, eax
je 0x499d5f
mov edx, dword [ebp - 0x2c]
xor eax, eax
cmp edx, eax
jb 0x499d5f
ja 0x499d26
mov eax, dword [ebp - 0x30]
cmp eax, esi
jbe 0x499d5f
push 1
lea edx, [ebp - 0x38]
push edx
xor ecx, ecx
push ecx
xor eax, eax
push eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
push ecx
call edi
test eax, eax
jne 0x499d4b
xor ecx, ecx
sub eax, esi
mov edx, ecx
sbb ecx, edx
mov dword [ebp - 0x1c], ecx
jmp 0x499d64
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x34]
sub eax, esi
mov edx, 0
sbb ecx, edx
mov dword [ebp - 0x1c], ecx
jmp 0x499d64
xor eax, eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], eax
mov eax, dword [ebx + 0x11]
sub eax, dword [ebx + 0xd]
jns 0x499d72
add eax, dword [ebx + 5]
cmp eax, 0x20
jae 0x499d9d
mov eax, dword [ebx + 1]
mov ecx, dword [ebp + 0xc]
push 0
lea edx, [ebp - 0x14]
push edx
mov edx, dword [ecx]
push 0x20
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebx + 1]
push 0x20
push eax
lea esi, [ebx + 5]
call fcn.004e552d
push 8
lea ecx, [ebp + 8]
lea edi, [ebx + 1]
push ecx
mov dword [ebp + 8], 0
call fcn.0043003a
test al, al
je 0x49a0dd
cmp dword [ebp + 8], 0xff
jne 0x499cae
push 8
lea edx, [ebp + 8]
push edx
call fcn.0043003a
test al, al
je 0x49a0dd
mov eax, dword [ebp + 8]
and eax, 0xfffffffe
cmp eax, 0xf8
jne 0x499cae
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x20]
mov edi, dword [ebp + 0xc]
mov eax, dword [edi]
push 0
push 0
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov ecx, dword [ebx + 0x11]
xor eax, eax
mov dword [ebx + 0xd], ecx
mov dword [ebx + 0x15], eax
mov dword [ebx + 0x19], eax
mov dword [ebx + 0x1d], eax
mov dword [ebx + 0x21], eax
mov dword [ebx + 0x25], eax
mov dword [ebx + 0x29], eax
mov dword [ebx + 0x2d], eax
mov dword [ebx + 0x31], eax
mov byte [ebx + 0x35], al
jmp 0x499e2b
mov edi, dword [ebp + 0xc]
mov eax, dword [ebx + 0x11]
sub eax, dword [ebx + 0xd]
jns 0x499e36
add eax, dword [ebx + 5]
cmp eax, 0x20
jae 0x499e5e
mov eax, dword [ebx + 1]
mov ecx, dword [edi]
push 0
lea edx, [ebp + 8]
push edx
push 0x20
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [ebx + 1]
push 0x20
push edx
lea esi, [ebx + 5]
call fcn.004e552d
lea esi, [ebx + 0x46]
lea eax, [ebx + 1]
push esi
call fcn.0049a230
cmp byte [esi], 0
jne 0x499e7f
mov byte [ebx + 0x103], 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebx + 0x11]
sub eax, dword [ebx + 0xd]
jns 0x499e8a
add eax, dword [ebx + 5]
cmp eax, 0x7fff
ja 0x499ef2
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx]
lea eax, [ebp - 0x38]
push eax
push edx
mov edi, 0x7fff
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x499eb1
xor esi, esi
mov dword [ebp - 0x2c], esi
jmp 0x499eba
mov eax, dword [ebp - 0x34]
mov esi, dword [ebp - 0x38]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.0042408e
sub esi, eax
cmp esi, edi
jae 0x499ecb
mov edi, esi
mov eax, dword [ebx + 1]
mov ecx, dword [ebp + 0xc]
push 0
lea edx, [ebp + 8]
push edx
mov edx, dword [ecx]
push edi
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebx + 1]
push edi
push eax
lea esi, [ebx + 5]
call fcn.004e552d
mov edi, dword [ebp + 0xc]
mov ecx, dword [ebx + 0x48]
mov dl, byte [ebx + 0x52]
xor al, al
cmp byte [ebx + 0xa0], al
mov dword [ebp - 0x14], ecx
mov cl, byte [ebx + 0x51]
mov byte [ebp + 0xb], dl
mov byte [ebp - 1], cl
mov byte [ebp + 0xf], al
jbe 0x499fc2
movzx ecx, cl
mov dword [ebp - 0xc], ecx
jmp 0x499f26
mov al, byte [ebp + 0xf]
mov dl, byte [ebp + 0xb]
mov ecx, dword [ebp - 0xc]
sub ecx, 1
je 0x499f69
sub ecx, 1
je 0x499f4d
sub ecx, 1
je 0x499f69
movzx esi, al
mov eax, dword [ebx + 0x98]
imul esi, esi, 0x40116
mov byte [eax + esi + 7], dl
jmp 0x499f83
movzx esi, al
imul esi, esi, 0x40116
test al, al
sete cl
add cl, dl
mov edx, dword [ebx + 0x98]
mov byte [edx + esi + 7], cl
jmp 0x499f83
mov ecx, dword [ebx + 0x98]
movzx esi, al
imul esi, esi, 0x40116
cmp al, 1
sete al
add al, dl
mov byte [ecx + esi + 7], al
mov ecx, dword [ebx + 0x98]
push edi
lea eax, [ebx + 1]
push eax
add ecx, esi
lea eax, [ebx + 0x46]
call fcn.0049a530
test al, al
sete al
test al, al
mov byte [ebx + 0x103], al
jne 0x49a0dd
mov al, byte [ebp + 0xf]
add al, 1
cmp al, byte [ebx + 0xa0]
mov byte [ebp + 0xf], al
jb 0x499f20
mov cl, byte [ebp - 1]
invalid