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

Disassembly:
push ebp
mov ebp, esp
mov edx, dword [edi]
sub esp, 0x24
push ebx
mov ebx, dword [ebp + 8]
push esi
xor esi, esi
push esi
lea eax, [ebp - 8]
push eax
push 4
lea ecx, [ebp + 8]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 8]
sub dword [edi + 8], eax
cmp eax, 4
jne 0x49d874
lea eax, [ebp - 0x24]
mov dword [ebx + 0x1c], esi
mov ecx, dword [edi]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x49d6b9
mov dword [ebp - 0x18], esi
jmp 0x49d6c2
mov edx, dword [ebp - 0x20]
mov esi, dword [ebp - 0x24]
mov dword [ebp - 0x18], edx
push 1
lea edx, [ebp - 0x1c]
push edx
xor ecx, ecx
xor eax, eax
push ecx
push eax
mov eax, dword [edi]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x49d6e0
mov dword [ebp - 0x20], eax
jmp 0x49d6e9
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x20], ecx
sub esi, eax
mov dword [ebp - 0x14], esi
mov edi, edi
mov ecx, dword [ebp + 8]
mov edx, ecx
or edx, 0xff000000
cmp edx, 0xff334449
jne 0x49d7d6
mov edx, dword [edi]
push 0
lea eax, [ebp - 8]
push eax
push 6
lea ecx, [ebp - 0x24]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 8]
sub dword [edi + 8], eax
cmp eax, 6
jne 0x49d874
add dword [ebx + 0x1c], eax
cmp byte [ebp - 0x24], 0xff
jae 0x49d7d3
cmp byte [ebp - 0x23], 0xff
jae 0x49d7d3
mov dl, byte [ebp - 0x22]
cmp dl, 0x80
jae 0x49d7d3
cmp byte [ebp - 0x21], 0x80
jae 0x49d7d3
mov cl, byte [ebp - 0x20]
cmp cl, 0x80
jae 0x49d7d3
mov al, byte [ebp - 0x1f]
cmp al, 0x80
jae 0x49d7d3
movzx esi, dl
movzx edx, byte [ebp - 0x21]
shl esi, 7
add esi, edx
movzx ecx, cl
shl esi, 7
movzx edx, al
add esi, ecx
shl esi, 7
add esi, edx
push 1
mov eax, esi
cdq
push 0
push edx
push eax
mov eax, dword [edi]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov eax, dword [edi]
push 0
lea ecx, [ebp - 0xc]
push ecx
push 4
lea edx, [ebp + 8]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0xc]
sub dword [edi + 8], eax
cmp eax, 4
jne 0x49d874
mov ecx, dword [ebp + 8]
add esi, eax
add dword [ebx + 0x1c], esi
mov edx, ecx
or edx, 0xff000000
cmp edx, 0xff334449
je 0x49d707
jmp 0x49d7d6
mov ecx, dword [ebp + 8]
cmp cl, 0xff
jne 0x49d83f
cmp ch, 0xe0
jb 0x49d83f
movzx esi, ch
mov eax, esi
shr eax, 3
and eax, 3
mov eax, dword [eax*4 + 0x541210]
cmp eax, 4
mov dword [ebx], eax
jge 0x49d83f
mov dl, ch
and dl, 6
cmp dl, 2
jne 0x49d83f
xor edx, edx
mov eax, esi
and eax, 1
cmp dword [ebx], edx
mov dword [ebx + 4], eax
setne dl
mov dword [ebp - 0x18], eax
movzx eax, byte [ebp + 0xa]
mov esi, eax
shr esi, 4
shl edx, 4
add edx, esi
mov edx, dword [edx*4 + 0x541220]
test edx, edx
mov dword [ebx + 8], edx
je 0x49d83f
shr eax, 2
and eax, 3
cmp eax, 3
mov dword [ebx + 0xc], eax
jl 0x49d87e
mov edx, dword [edi]
push 0
shr ecx, 8
lea eax, [ebp - 0x10]
push eax
mov dword [ebp + 8], ecx
push 1
lea ecx, [ebp + 0xb]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x10]
sub dword [edi + 8], eax
cmp eax, 1
jne 0x49d874
add dword [ebx + 0x1c], eax
mov eax, dword [ebp - 0x14]
cmp dword [ebx + 0x1c], eax
jl 0x49d6f0
xor al, al
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
movzx eax, byte [ebp + 0xa]
shr eax, 1
and eax, 1
mov dword [ebx + 0x10], eax
movzx eax, byte [ebp + 0xb]
mov ecx, eax
shr eax, 4
shr ecx, 6
and eax, 3
cmp dword [ebp - 0x18], 0
mov dword [ebx + 0x14], ecx
mov dword [ebx + 0x18], eax
jne 0x49d8c0
mov ecx, dword [edi]
push 0
lea edx, [ebp - 0x18]
push edx
push 2
lea eax, [ebp + 8]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [ebp - 0x18]
sub dword [edi + 8], edx
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 4