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

Disassembly:
push 0xffffffffffffffff
push 0x50f60f
mov eax, dword fs:[0]
push eax
sub esp, 0xe0
mov eax, dword [0x5426a0]
xor eax, esp
mov dword [esp + 0xdc], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5426a0]
xor eax, esp
push eax
lea eax, [esp + 0xf4]
mov dword fs:[0], eax
mov edi, ecx
mov dword [esp + 0x1c], edi
lea esi, [esp + 0x40]
mov eax, edi
mov dword [esp + 0xfc], 0
call fcn.00429de0
mov esi, eax
push 0x5233e4
lea eax, [esp + 0x108]
push eax
lea ecx, [esp + 0x58]
push ecx
mov byte [esp + 0x108], 1
call fcn.0040dd70
push esi
push eax
lea edx, [esp + 0x6c]
push edx
mov byte [esp + 0x114], 2
call fcn.0040dcb0
push 0x5233e4
push eax
lea eax, [esp + 0x6c]
push eax
mov byte [esp + 0x120], 3
call fcn.0040dd70
push str.rif.dat
push eax
lea ecx, [esp + 0x60]
push ecx
mov byte [esp + 0x12c], 4
call fcn.0040dd70
add esp, 0x30
mov byte [esp + 0xfc], 6
mov eax, dword [esp + 0x4c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40ca47
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 7
mov eax, dword [esp + 0x58]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ca6f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 8
mov eax, dword [esp + 0x50]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ca97
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 9
mov eax, dword [esp + 0x40]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cabf
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea esi, [esp + 0x48]
mov eax, edi
call fcn.00429de0
mov esi, eax
push 0x5233e4
lea ecx, [esp + 0x108]
push ecx
lea edx, [esp + 0x68]
push edx
mov byte [esp + 0x108], 0xa
call fcn.0040dd70
push esi
push eax
lea eax, [esp + 0x50]
push eax
mov byte [esp + 0x114], 0xb
call fcn.0040dcb0
push 0x5233e4
push eax
lea ecx, [esp + 0x64]
push ecx
mov byte [esp + 0x120], 0xc
call fcn.0040dd70
push str.arif.dat
push eax
lea edx, [esp + 0x64]
push edx
mov byte [esp + 0x12c], 0xd
call fcn.0040dd70
add esp, 0x30
mov byte [esp + 0xfc], 0xf
mov eax, dword [esp + 0x44]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cb5a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x10
mov eax, dword [esp + 0x3c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cb82
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x11
mov eax, dword [esp + 0x60]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cbaa
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x12
mov eax, dword [esp + 0x48]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cbd2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
call fcn.0047a7de
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40cbec
push 0x80004005
call fcn.00404150
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea ebp, [eax + 0x10]
mov dword [esp + 0x14], ebp
push 0
push 0x80
push 3
push 0
push 3
mov byte [esp + 0x110], 0x13
mov ecx, dword [esp + 0x48]
push SysReAllocString
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40ce2f
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, eax
mov eax, 0xd41d41d5
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 7
test ecx, ecx
jle 0x40ce2f
mov dword [esp + 0x18], ecx
push 0x8c
lea edx, [esp + 0x68]
push 0
push edx
call fcn.004a0080
add esp, 0xc
push 0
lea eax, [esp + 0x58]
push eax
push 0x8c
lea ecx, [esp + 0x70]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea esi, [esp + 0x20]
mov eax, edi
call fcn.00429de0
mov esi, eax
push 0x5233e4
lea edx, [esp + 0x108]
push edx
lea eax, [esp + 0x34]
push eax
mov byte [esp + 0x108], 0x14
call fcn.0040dd70
push esi
push eax
lea ecx, [esp + 0x44]
push ecx
mov byte [esp + 0x114], 0x15
call fcn.0040dcb0
push 0x5233e4
push eax
lea edx, [esp + 0x48]
push edx
mov byte [esp + 0x120], 0x16
call fcn.0040dd70
lea ecx, [esp + 0xb0]
push ecx
push eax
lea edx, [esp + 0x50]
push edx
mov byte [esp + 0x12c], 0x17
call fcn.0040dd70
add esp, 0x30
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x100], 0x18
call fcn.00404a60
mov byte [esp + 0xfc], 0x17
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cd2f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x16
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cd57
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x15
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cd7f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x14
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cda7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x13
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cdcf
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebp, dword [esp + 0x14]
cmp dword [ebp - 4], 1
mov esi, dword [ebp - 0xc]
jle 0x40cdec
mov ecx, esi
push ecx
lea ecx, [esp + 0x18]
call fcn.00404ae0
mov ebp, dword [esp + 0x14]
push esi
lea edx, [esp + 0x90]
push ebp
push edx
call fcn.004a55f0
mov eax, dword [esp + 0x28]
sub esp, 0x80
mov edi, esp
add eax, 0x148
mov ecx, 0x23
lea esi, [esp + 0xf0]
push eax
rep movsd dword es:[edi], dword [esi]
call fcn.0040eab0
sub dword [esp + 0x18], 1
mov edi, dword [esp + 0x1c]
jne 0x40cc53
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x38]
push 0
push 0x80
push 3
push 0
push 3
push SysReAllocString
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40d068
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, eax
mov eax, 0xd41d41d5
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 7
test ecx, ecx
jle 0x40d068
lea edx, [edi + 0x134]
mov dword [esp + 0x5c], edx
mov dword [esp + 0x18], ecx
jmp 0x40ce95
mov edi, dword [esp + 0x1c]
push 0x8c
lea eax, [esp + 0x68]
push 0
push eax
call fcn.004a0080
add esp, 0xc
push 0
lea ecx, [esp + 0x58]
push ecx
push 0x8c
lea edx, [esp + 0x70]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea esi, [esp + 0x24]
mov eax, edi
call fcn.00429de0
mov esi, eax
push 0x5233e4
lea eax, [esp + 0x108]
push eax
lea ecx, [esp + 0x30]
push ecx
mov byte [esp + 0x108], 0x19
call fcn.0040dd70
push esi
push eax
lea edx, [esp + 0x44]
push edx
mov byte [esp + 0x114], 0x1a
call fcn.0040dcb0
push 0x5233e4
push eax
lea eax, [esp + 0x4c]
push eax
mov byte [esp + 0x120], 0x1b
call fcn.0040dd70
lea ecx, [esp + 0xb0]
push ecx
push eax
lea edx, [esp + 0x4c]
push edx
mov byte [esp + 0x12c], 0x1c
call fcn.0040dd70
add esp, 0x30
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x100], 0x1d
call fcn.00404a60
mov byte [esp + 0xfc], 0x1c
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cf71
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x1b
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cf99
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x1a
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cfc1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x19
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cfe9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0x13
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d011
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebp, dword [esp + 0x14]
cmp dword [ebp - 4], 1
mov esi, dword [ebp - 0xc]
jle 0x40d02e
mov ecx, esi
push ecx
lea ecx, [esp + 0x18]
call fcn.00404ae0
mov ebp, dword [esp + 0x14]
push esi
lea edx, [esp + 0x90]
push ebp
push edx
call fcn.004a55f0
mov eax, dword [esp + 0x68]
sub esp, 0x80
mov edi, esp
mov ecx, 0x23
lea esi, [esp + 0xf0]
push eax
rep movsd dword es:[edi], dword [esi]
call fcn.0040eab0
sub dword [esp + 0x18], 1
jne 0x40ce91
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
add ebp, 0xfffffff0
mov byte [esp + 0xfc], 0x12
lea ecx, [ebp + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d094
mov ecx, dword [ebp]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push ebp
call edx
mov byte [esp + 0xfc], 9
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d0bc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xfc], 0
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d0e4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0xfc], 0xffffffff
mov eax, dword [esp + 0x104]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d112
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0xf4]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0xdc]
xor ecx, esp
call fcn.0049795d
add esp, 0xec
ret 4