Function at 0x4040aa
Capabilities:
Get file attributes
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffdd8
push esi
push edi
push ebx
and dword [ebp - 4], 0
lea eax, [ebp - 0xc]
push eax
push dword [ebp + 8]
call sub.KERNEL32.dll_GetFileSizeEx
or eax, eax
je 0x4043be
cmp dword [ebp - 0xc], 0
je 0x4043be
cmp dword [ebp - 8], 0
jne 0x4043be
cmp dword [ebp - 0xc], 0x20000
jbe 0x4040f2
mov dword [ebp - 0xc], 0x20000
push dword [ebp - 0xc]
lea eax, [ebp - 0x24]
push eax
call fcn.00403940
mov esi, dword [ebp - 0x24]
push 0
lea eax, [ebp - 4]
push eax
push dword [ebp - 0xc]
push esi
push dword [ebp + 8]
call sub.KERNEL32.dll_ReadFile
or eax, eax
je 0x4043b6
and dword [ebp - 0x10], 0
push 0x200
lea eax, [ebp - 0x224]
push eax
call sub.KERNEL32.dll_RtlZeroMemory
add dword [ebp - 4], esi
jmp 0x40431c
mov ebx, dword [ebp - 4]
lea edi, [ebp - 0x20]
inc dword [0x47d130]
call fcn.00403f5a
or eax, eax
jne 0x404165
mov ecx, dword [0x47d130]
mov dword [0x47d138], ecx
cmpxchg dword [0x47d134], ecx
jmp 0x40431c
js 0x40431c
inc dword [0x47d12c]
push dword [ebp - 0x18]
push dword [ebp - 0x20]
call fcn.00402f27
lea edx, [0x47a190]
mov ecx, 0x14b
cmp eax, dword [edx + 4]
je 0x404192
add edx, 0x10
dec ecx
jne 0x404187
or ecx, ecx
je 0x40431c
movzx ebx, word [edx]
add ebx, dword [ebp + 0xc]
mov al, byte [edx + 2]
cmp al, 1
jne 0x4041ca
mov eax, dword [ebp - 0x14]
or eax, eax
je 0x40431c
shr eax, 1
push eax
push dword [ebp - 0x1c]
call fcn.00405ef1
mov dword [ebx], eax
inc dword [0x47d13c]
jmp 0x40431c
cmp al, 2
jne 0x4041f8
mov eax, dword [ebp - 0x14]
or eax, eax
je 0x40431c
shr eax, 1
push eax
push dword [ebp - 0x1c]
call fcn.00405ef1
add eax, 0xffffffff
sbb eax, eax
neg eax
mov dword [ebx], eax
inc dword [0x47d13c]
jmp 0x40431c
cmp al, 3
jne 0x40423e
mov ecx, dword [ebp - 0x14]
push esi
mov esi, dword [ebp - 0x1c]
call fcn.00404077
or edi, edi
je 0x404238
mov dword [ebx], eax
inc dword [0x47d13c]
call fcn.00404077
or edi, edi
je 0x404238
mov dword [ebx + 4], eax
call fcn.00404077
or edi, edi
je 0x404238
mov dword [ebx + 8], eax
call fcn.00404077
or edi, edi
je 0x404238
mov dword [ebx + 0xc], eax
pop esi
jmp 0x40431c
cmp al, 4
jne 0x404272
movzx eax, byte [edx + 3]
imul eax, eax, 0x208
mov ecx, dword [ebp - 0x14]
cmp ecx, eax
jae 0x40431c
mov ebx, dword [ebx]
or ebx, ebx
je 0x40426d
push ecx
push dword [ebp - 0x1c]
push ebx
call sub.KERNEL32.dll_RtlMoveMemory
inc dword [0x47d13c]
jmp 0x40431c
cmp al, 5
jne 0x4042b5
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
cmp dword [ebx], 0
je 0x40431c
cmp eax, 0x208
jae 0x40431c
cmp ecx, 0x40
jae 0x40431c
inc dword [0x47d13c]
mov dword [ebp + ecx*8 - 0x224], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp + ecx*8 - 0x220], eax
inc dword [ebp - 0x10]
jmp 0x40431c
cmp al, 6
jne 0x40431c
mov ecx, dword [ebp - 0x14]
push esi
mov esi, dword [ebp - 0x1c]
call fcn.00404077
or edi, edi
je 0x40431b
mov byte [ebx], al
inc dword [0x47d13c]
call fcn.00404077
or edi, edi
je 0x40431b
mov byte [ebx + 1], al
add ebx, 2
movzx edx, byte [edx + 3]
call fcn.00404077
or edi, edi
je 0x40431b
and eax, 0xfffffffc
and byte [ebx], 3
or byte [ebx], al
call fcn.00404077
or edi, edi
je 0x40431b
mov byte [ebx + 1], al
call fcn.00404077
or edi, edi
je 0x40431b
cmp eax, 0x7fff
ja 0x404315
mov word [ebx + 2], ax
add ebx, 4
dec edx
jne 0x4042e4
pop esi
cmp esi, dword [ebp - 4]
jb 0x404138
push 0x208
lea eax, [ebp - 0x228]
push eax
call fcn.00403940
mov esi, dword [ebp + 0xc]
mov eax, dword [esi + 0x10]
or eax, eax
je 0x4043ab
push dword [esi + 0x40]
push eax
call fcn.00403a4c
or eax, eax
je 0x4043ab
xor ebx, ebx
mov eax, dword [ebp + ebx*8 - 0x224]
or eax, eax
je 0x4043ab
mov ecx, dword [ebp - 0x228]
mov word [eax + ecx], 0
push eax
push dword [ebp + ebx*8 - 0x220]
push ecx
call sub.KERNEL32.dll_RtlMoveMemory
push dword [ebp - 0x228]
call sub.KERNEL32.dll_GetFileAttributesW
cmp dword [esi + 0x44], 0
je 0x40438a
cmp eax, 0xffffffff
je 0x4043a5
mov eax, dword [ebp + ebx*8 - 0x224]
add eax, 2
push 0
push eax
push dword [ebp - 0x228]
push dword [esi + 0x10]
call fcn.00403b89
inc ebx
cmp ebx, 0x40
jne 0x40434f
push dword [ebp - 0x228]
call fcn.0040398e
push dword [ebp - 0x24]
call fcn.0040398e
mov eax, dword [ebp - 4]
pop ebx
pop edi
pop esi
leave
ret 8