Function at 0x5016e0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push esi
mov esi, dword [ebp + 8]
add esi, 0x984
cmp dword [esi], 0
push edi
mov dword [ebp - 0x10], esi
jne 0x50170e
mov eax, dword [esi + 0x14]
sub eax, 3
neg eax
sbb eax, eax
and eax, 0xf
add eax, 0x11
movzx eax, ax
jmp 0x501721
xor ecx, ecx
cmp dword [esi + 0x14], 3
setne cl
lea ecx, [ecx*8 + 9]
movzx eax, cx
push ebx
mov edi, edx
push 0
lea edx, [ebp - 0xc]
push edx
mov edx, dword [edi + 0x73]
movzx eax, ax
push eax
add edi, 0x73
lea ecx, [ebp - 0x3e]
push ecx
push edx
mov dword [ebp - 0x18], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0xc]
sub dword [edi + 0xc], eax
movzx eax, byte [ebp - 0x3e]
sbb dword [edi + 0x10], 0
mov esi, dword [esi]
movzx ecx, byte [ebp - 0x3d]
test esi, esi
sete dl
add dl, 8
shl eax, 8
or eax, ecx
movsx edi, dl
mov ecx, 0x10
sub ecx, edi
sar eax, cl
mov ecx, edi
mov ebx, 1
shl ebx, cl
mov edi, esi
sub ebx, 1
and eax, ebx
xor ebx, ebx
mov dword [ebp - 0x14], eax
movsx ax, dl
mov edx, dword [ebp + 8]
cmp dword [edx + 0x998], 3
setne bl
add ebx, 1
neg edi
sbb edi, edi
add edi, 2
test esi, esi
mov dword [ebp - 0xc], ebx
mov dword [ebp - 8], edi
je 0x5017ad
mov cl, bl
jmp 0x5017b7
cmp ebx, 1
sete cl
lea ecx, [ecx + ecx + 3]
movsx cx, cl
add ax, cx
test ebx, ebx
mov word [ebp - 0x40], ax
jle 0x5017f6
lea ecx, [edx + 0x814]
mov esi, ebx
mov edi, edi
mov dword [ecx + 4], 0
mov dword [ecx], 0
mov dword [ecx - 4], 0
mov dword [ecx - 8], 0
add ecx, 0xc0
sub esi, 1
jne 0x5017d0
cmp edi, 2
jne 0x5018c6
test ebx, ebx
jle 0x5018c6
lea edi, [edx + 0x874]
mov esi, ebx
nop
movzx edx, ax
mov bl, dl
shr edx, 3
movzx edx, byte [ebp + edx - 0x3e]
and bl, 7
mov ecx, 7
sub cl, bl
shr edx, cl
add ax, 1
mov word [ebp - 0x40], ax
mov ecx, 7
and edx, 1
mov dword [edi - 8], edx
movzx edx, ax
mov bl, dl
shr edx, 3
movzx edx, byte [ebp + edx - 0x3e]
and bl, 7
sub cl, bl
shr edx, cl
add ax, 1
mov word [ebp - 0x40], ax
mov ecx, 7
and edx, 1
mov dword [edi - 4], edx
movzx edx, ax
mov bl, dl
shr edx, 3
movzx edx, byte [ebp + edx - 0x3e]
and bl, 7
sub cl, bl
shr edx, cl
add ax, 1
mov word [ebp - 0x40], ax
mov ecx, 7
and edx, 1
mov dword [edi], edx
movzx edx, ax
mov bl, dl
shr edx, 3
movzx edx, byte [ebp + edx - 0x3e]
and bl, 7
sub cl, bl
shr edx, cl
add ax, 1
add edi, 0xc0
mov word [ebp - 0x40], ax
and edx, 1
sub esi, 1
mov dword [edi - 0xbc], edx
jne 0x501810
mov ebx, dword [ebp - 0xc]
mov edi, dword [ebp - 8]
mov edx, dword [ebp + 8]
test edi, edi
mov dword [ebp - 4], 0
jle 0x501925
add edx, 0x804
mov dword [ebp - 0xc], edx
lea ebx, [ebx]
xor esi, esi
test ebx, ebx
jle 0x50190c
mov edi, edx
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 4]
push eax
lea eax, [ebp - 0x40]
mov dword [edi + 4], esi
mov dword [edi], edx
call fcn.00501960
add esi, 1
add edi, 0xc0
cmp esi, ebx
jl 0x5018e8
mov edi, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov edx, dword [ebp - 0xc]
add eax, 1
add edx, 0x60
cmp eax, edi
mov dword [ebp - 4], eax
mov dword [ebp - 0xc], edx
jl 0x5018e0
mov edx, dword [ebp + 8]
mov edi, dword [edx + 0x9c0]
cmp word [edi], 0
pop ebx
jne 0x501934
mov edi, edx
mov esi, dword [ebp - 0x10]
call fcn.00450d50
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x14]
push eax
push ecx
mov ecx, edi
mov edi, dword [ebp - 0x18]
call fcn.00450e40
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4