Function at 0x407817
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [ebp + 0x14]
push ebx
xor ebx, ebx
mov dword [eax], ebx
mov eax, dword [ebp + 0x10]
mov dword [eax], ebx
mov eax, dword [ebp + 0xc]
push 0x2000
mov dword [eax], ebx
mov dword [ebp - 0xc], 0xfffffffe
call fcn.00401000
mov dword [ebp - 0x14], eax
cmp eax, ebx
jne 0x407850
or dword [ebp - 0xc], 0xffffffff
jmp 0x407a67
push ebx
push 0x80
push 3
push ebx
push 1
push accept
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp + 8], eax
cmp eax, 0xffffffff
jne 0x40787d
mov dword [ebp - 0xc], 0xfffffffc
jmp 0x407a67
push edi
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
lea ecx, [ebp - 8]
push ecx
push 0xa
lea ecx, [ebp - 0x24]
push ecx
push eax
call edi
test eax, eax
jne 0x4078a2
mov dword [ebp - 0xc], 0xfffffffb
jmp 0x407a5d
cmp dword [ebp - 8], 0xa
jne 0x407a5d
push esi
lea esi, [ebp - 0x24]
mov dword [ebp - 0x18], ebx
call fcn.004071de
test eax, eax
je 0x4078ca
mov ecx, dword [ebp - 0x1e]
call fcn.004071b8
add eax, 0xa
mov dword [ebp - 0x18], eax
push 2
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0xffffffffffffff80
push dword [ebp + 8]
call ebx
mov dword [ebp - 0x10], eax
xor esi, esi
push esi
lea eax, [ebp - 8]
push eax
push 3
lea eax, [ebp - 4]
push eax
push dword [ebp + 8]
mov byte [ebp - 4], 0
call edi
push 3
push 0x438938
lea eax, [ebp - 4]
push eax
call fcn.0040143c
test eax, eax
je 0x40790b
sub dword [ebp - 0x10], 0xffffff80
mov eax, dword [ebp - 0x18]
sub dword [ebp - 0x10], eax
push esi
push esi
push eax
push dword [ebp + 8]
call ebx
push esi
lea eax, [ebp - 8]
push eax
push 0x2000
push dword [ebp - 0x14]
push dword [ebp + 8]
call edi
test eax, eax
jne 0x40793b
mov dword [ebp - 0xc], 0xfffffffb
jmp 0x407a5c
cmp dword [ebp - 8], 4
jb 0x407a5c
push 4
push str.Xing
push dword [ebp - 8]
push dword [ebp - 0x14]
call fcn.00401516
cmp eax, 0xffffffff
jne 0x407973
push 4
push str.VBRI
push dword [ebp - 8]
push dword [ebp - 0x14]
call fcn.00401516
cmp eax, 0xffffffff
je 0x407979
mov eax, dword [ebp + 0xc]
or dword [eax], 0xffffffff
mov eax, dword [ebp - 8]
add eax, 0xfffffffd
test eax, eax
jle 0x407a3b
mov eax, dword [ebp - 0x14]
push dword [esi + eax]
call fcn.004013cc
mov edi, eax
push edi
mov dword [ebp - 0x18], edi
call fcn.004077bc
test eax, eax
jne 0x4079b1
mov eax, dword [ebp - 8]
inc esi
add eax, 0xfffffffd
cmp esi, eax
jl 0x407987
jmp 0x407a3b
mov ecx, edi
mov edx, edi
mov eax, edi
mov edi, dword [ebp + 0xc]
shr ecx, 0xa
shr edx, 0x13
shr eax, 0xc
and ecx, 3
and edx, 3
and eax, 0xf
cmp dword [edi], 0xffffffff
je 0x4079e9
cmp edx, 3
jne 0x4079e0
movzx eax, word [eax*2 + 0x443694]
jmp 0x4079e7
movzx eax, byte [eax + 0x443684]
mov dword [edi], eax
cmp edx, 3
jne 0x4079f8
movzx eax, word [ecx*2 + 0x44367c]
jmp 0x407a0f
cmp edx, 2
jne 0x407a07
movzx eax, word [ecx*2 + 0x443674]
jmp 0x407a0f
movzx eax, word [ecx*2 + 0x44366c]
mov ecx, dword [ebp + 0x10]
movzx eax, ax
mov dword [ecx], eax
mov eax, dword [ebp - 0x18]
and eax, 0xc0
xor ecx, ecx
cmp al, 0xc0
mov eax, dword [ebp + 0x14]
push 1
setne cl
sub esi, dword [ebp - 8]
push 0
push esi
push dword [ebp + 8]
mov dword [eax], ecx
call ebx
mov dword [ebp - 0xc], eax
mov esi, dword [ebp + 0x18]
test esi, esi
je 0x407a5c
and dword [esi], 0
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
test ecx, ecx
jle 0x407a5c
mov eax, dword [ebp - 0x10]
imul ecx, ecx, 5
cdq
sar ecx, 2
idiv ecx
mov dword [esi], eax
pop esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
push dword [ebp - 0x14]
call fcn.00401019
mov eax, dword [ebp - 0xc]
pop ebx
leave
ret 0x14