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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffa8
mov eax, 0x4db8cc
call fcn.004c9c18
mov dword [ebp - 0x14], 1
lea edx, [ebp + 0xc]
lea eax, [ebp + 0xc]
call fcn.004d4474
inc dword [ebp - 0x14]
mov word [ebp - 0x20], 8
xor edx, edx
mov dword [ebp - 0x34], edx
xor ecx, ecx
mov dword [ebp - 0x38], ecx
push 0
push 0x20
push 3
push 0
push 1
push 0x80000000
cmp dword [ebp + 0xc], 0
je 0x40d7db
mov eax, dword [ebp + 0xc]
jmp 0x40d7e0
mov eax, 0x4d73d9
push eax
call sub.kernel32.dll_CreateFileA
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0xffffffff
jne 0x40d812
xor eax, eax
push eax
dec dword [ebp - 0x14]
lea eax, [ebp + 0xc]
mov edx, 2
call fcn.004d459c
pop eax
mov edx, dword [ebp - 0x30]
mov dword fs:[0], edx
jmp 0x40dbd0
push 0
push dword [ebp - 0x38]
call sub.kernel32.dll_GetFileSize
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jne 0x40d848
xor eax, eax
push eax
dec dword [ebp - 0x14]
lea eax, [ebp + 0xc]
mov edx, 2
call fcn.004d459c
pop eax
mov edx, dword [ebp - 0x30]
mov dword fs:[0], edx
jmp 0x40dbd0
mov word [ebp - 0x20], 0x14
xor ecx, ecx
mov dword [ebp - 4], ecx
lea edx, [ebp - 4]
inc dword [ebp - 0x14]
mov eax, dword [ebp + 0xc]
call fcn.0043ea80
lea edx, [ebp - 4]
mov eax, dword [ebp + 8]
add eax, 4
call fcn.004d45cc
dec dword [ebp - 0x14]
lea eax, [ebp - 4]
mov edx, 2
call fcn.004d459c
mov ecx, dword [ebp - 0x34]
mov eax, dword [ebp + 8]
mov dword [eax + 8], ecx
xor edx, edx
mov dword [ebp - 0x40], edx
mov word [ebp - 0x20], 8
xor ecx, ecx
mov dword [ebp - 0x44], ecx
push 0
push 0
push dword [ebp - 0x40]
push dword [ebp - 0x38]
call sub.kernel32.dll_SetFilePointer
push 0
lea eax, [ebp - 0x44]
push eax
push 4
lea edx, [ebp - 0x3c]
push edx
push dword [ebp - 0x38]
call sub.kernel32.dll_ReadFile
inc dword [ebp - 0x40]
xor ecx, ecx
mov cl, byte [ebp - 0x3c]
and ecx, 0xff
shl ecx, 0x18
xor eax, eax
mov al, byte [ebp - 0x3b]
and eax, 0xff
shl eax, 0x10
or ecx, eax
xor edx, edx
mov dl, byte [ebp - 0x3a]
and edx, 0xff
shl edx, 8
or ecx, edx
xor eax, eax
mov al, byte [ebp - 0x39]
and eax, 0xff
or ecx, eax
mov edx, dword [ebp + 8]
mov dword [edx + 0x20], ecx
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x20]
sar eax, 0x15
and eax, 0x7ff
cmp eax, 0x7ff
jne 0x40d96c
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x20]
sar ecx, 0x13
and ecx, 3
dec ecx
je 0x40d96c
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x20]
sar edx, 0x11
test dl, 3
je 0x40d96c
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x20]
sar eax, 0xc
test al, 0xf
je 0x40d96c
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x20]
sar ecx, 0xc
and ecx, 0xf
cmp ecx, 0xf
je 0x40d96c
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x20]
sar edx, 0xa
and edx, 3
cmp edx, 3
je 0x40d96c
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x20]
and eax, 3
cmp eax, 2
jne 0x40d970
xor edx, edx
jmp 0x40d975
mov edx, 1
test dl, dl
jne 0x40d986
mov ecx, dword [ebp - 0x40]
dec ecx
cmp ecx, dword [ebp - 0x34]
jne 0x40d898
mov eax, dword [ebp - 0x40]
dec eax
cmp eax, dword [ebp - 0x34]
je 0x40dbb2
add dword [ebp - 0x40], 3
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x20]
sar ecx, 0x13
and ecx, 3
cmp ecx, 3
jne 0x40d9c5
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x20]
sar edx, 6
and edx, 3
cmp edx, 3
jne 0x40d9bf
add dword [ebp - 0x40], 0x11
jmp 0x40d9e0
add dword [ebp - 0x40], 0x20
jmp 0x40d9e0
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x20]
sar eax, 6
and eax, 3
cmp eax, 3
jne 0x40d9dc
add dword [ebp - 0x40], 9
jmp 0x40d9e0
add dword [ebp - 0x40], 0x11
push 0
push 0
push dword [ebp - 0x40]
push dword [ebp - 0x38]
call sub.kernel32.dll_SetFilePointer
push 0
lea edx, [ebp - 0x44]
push edx
push 0xc
lea ecx, [ebp - 0x58]
push ecx
push dword [ebp - 0x38]
call sub.kernel32.dll_ReadFile
cmp byte [ebp - 0x58], 0x58
jne 0x40dac2
cmp byte [ebp - 0x57], 0x69
jne 0x40dac2
cmp byte [ebp - 0x56], 0x6e
jne 0x40dac2
cmp byte [ebp - 0x55], 0x67
jne 0x40dac2
xor eax, eax
mov al, byte [ebp - 0x54]
and eax, 0xff
shl eax, 0x18
xor edx, edx
mov dl, byte [ebp - 0x53]
and edx, 0xff
shl edx, 0x10
or eax, edx
xor ecx, ecx
mov cl, byte [ebp - 0x52]
and ecx, 0xff
shl ecx, 8
or eax, ecx
xor edx, edx
mov dl, byte [ebp - 0x51]
and edx, 0xff
or eax, edx
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x48]
and eax, 1
dec eax
jne 0x40dab4
xor ecx, ecx
mov cl, byte [ebp - 0x50]
and ecx, 0xff
shl ecx, 0x18
xor eax, eax
mov al, byte [ebp - 0x4f]
and eax, 0xff
shl eax, 0x10
or ecx, eax
xor edx, edx
mov dl, byte [ebp - 0x4e]
and edx, 0xff
shl edx, 8
or ecx, edx
xor eax, eax
mov al, byte [ebp - 0x4d]
and eax, 0xff
or ecx, eax
mov edx, dword [ebp + 8]
mov dword [edx + 0x24], ecx
mov cl, 1
jmp 0x40dac4
mov eax, dword [ebp + 8]
mov dword [eax + 0x24], 0xffffffff
mov cl, 1
jmp 0x40dac4
xor ecx, ecx
mov eax, dword [ebp + 8]
mov byte [eax + 0x1c], cl
push dword [ebp + 8]
call fcn.0040faec
pop ecx
mov edx, dword [ebp + 8]
mov dword [edx], eax
push dword [ebp + 8]
call fcn.0040fc5c
pop ecx
mov edx, dword [ebp + 8]
mov dword [edx + 0xc], eax
mov word [ebp - 0x20], 0x20
push dword [ebp + 8]
xor eax, eax
mov dword [ebp - 8], eax
lea ecx, [ebp - 8]
push ecx
inc dword [ebp - 0x14]
call fcn.0040fc9c
add esp, 8
lea edx, [ebp - 8]
mov eax, dword [ebp + 8]
add eax, 0x10
call fcn.004d45cc
dec dword [ebp - 0x14]
lea eax, [ebp - 8]
mov edx, 2
call fcn.004d459c
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 8]
shl eax, 3
mov ecx, 0x3e8
cdq
idiv ecx
mov dword [ebp - 0x4c], eax
push dword [ebp + 8]
call fcn.0040faec
pop ecx
push eax
mov eax, dword [ebp - 0x4c]
pop edx
mov ecx, edx
cdq
idiv ecx
mov edx, dword [ebp + 8]
mov dword [edx + 0x14], eax
mov word [ebp - 0x20], 0x2c
push dword [ebp + 8]
xor eax, eax
mov dword [ebp - 0xc], eax
lea ecx, [ebp - 0xc]
push ecx
inc dword [ebp - 0x14]
call fcn.0040fe18
add esp, 8
lea edx, [ebp - 0xc]
mov eax, dword [ebp + 8]
add eax, 0x18
call fcn.004d45cc
dec dword [ebp - 0x14]
lea eax, [ebp - 0xc]
mov edx, 2
call fcn.004d459c
push dword [ebp - 0x38]
call sub.kernel32.dll_CloseHandle
mov al, 1
push eax
dec dword [ebp - 0x14]
lea eax, [ebp + 0xc]
mov edx, 2
call fcn.004d459c
pop eax
mov edx, dword [ebp - 0x30]
mov dword fs:[0], edx
jmp 0x40dbd0
xor eax, eax
push eax
dec dword [ebp - 0x14]
lea eax, [ebp + 0xc]
mov edx, 2
call fcn.004d459c
pop eax
mov edx, dword [ebp - 0x30]
mov dword fs:[0], edx
mov esp, ebp
pop ebp
ret