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

Disassembly:
push 0xffffffffffffffff
push 0x50da3f
mov eax, dword fs:[0]
push eax
sub esp, 0xe0
mov eax, dword [0x5416a0]
xor eax, esp
mov dword [esp + 0xdc], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5416a0]
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.004286f0
mov esi, eax
push 0x52239c
lea eax, [esp + 0x108]
push eax
lea ecx, [esp + 0x58]
push ecx
mov byte [esp + 0x108], 1
call fcn.0040dd60
push esi
push eax
lea edx, [esp + 0x6c]
push edx
mov byte [esp + 0x114], 2
call fcn.0040dca0
push 0x52239c
push eax
lea eax, [esp + 0x6c]
push eax
mov byte [esp + 0x120], 3
call fcn.0040dd60
push str.rif.dat
push eax
lea ecx, [esp + 0x60]
push ecx
mov byte [esp + 0x12c], 4
call fcn.0040dd60
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 0x40c907
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 0x40c92f
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 0x40c957
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 0x40c97f
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.004286f0
mov esi, eax
push 0x52239c
lea ecx, [esp + 0x108]
push ecx
lea edx, [esp + 0x68]
push edx
mov byte [esp + 0x108], 0xa
call fcn.0040dd60
push esi
push eax
lea eax, [esp + 0x50]
push eax
mov byte [esp + 0x114], 0xb
call fcn.0040dca0
push 0x52239c
push eax
lea ecx, [esp + 0x64]
push ecx
mov byte [esp + 0x120], 0xc
call fcn.0040dd60
push str.arif.dat
push eax
lea edx, [esp + 0x64]
push edx
mov byte [esp + 0x12c], 0xd
call fcn.0040dd60
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 0x40ca1a
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 0x40ca42
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 0x40ca6a
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 0x40ca92
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
call fcn.00478c84
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40caac
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 0x40ccef
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 0x40ccef
mov dword [esp + 0x18], ecx
push 0x8c
lea edx, [esp + 0x68]
push 0
push edx
call fcn.0049e490
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.004286f0
mov esi, eax
push 0x52239c
lea edx, [esp + 0x108]
push edx
lea eax, [esp + 0x34]
push eax
mov byte [esp + 0x108], 0x14
call fcn.0040dd60
push esi
push eax
lea ecx, [esp + 0x44]
push ecx
mov byte [esp + 0x114], 0x15
call fcn.0040dca0
push 0x52239c
push eax
lea edx, [esp + 0x48]
push edx
mov byte [esp + 0x120], 0x16
call fcn.0040dd60
lea ecx, [esp + 0xb0]
push ecx
push eax
lea edx, [esp + 0x50]
push edx
mov byte [esp + 0x12c], 0x17
call fcn.0040dd60
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 0x40cbef
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 0x40cc17
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 0x40cc3f
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 0x40cc67
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 0x40cc8f
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 0x40ccac
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.004a3a40
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.0040eb00
sub dword [esp + 0x18], 1
mov edi, dword [esp + 0x1c]
jne 0x40cb13
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 0x40cf28
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 0x40cf28
lea edx, [edi + 0x134]
mov dword [esp + 0x5c], edx
mov dword [esp + 0x18], ecx
jmp 0x40cd55
mov edi, dword [esp + 0x1c]
push 0x8c
lea eax, [esp + 0x68]
push 0
push eax
call fcn.0049e490
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.004286f0
mov esi, eax
push 0x52239c
lea eax, [esp + 0x108]
push eax
lea ecx, [esp + 0x30]
push ecx
mov byte [esp + 0x108], 0x19
call fcn.0040dd60
push esi
push eax
lea edx, [esp + 0x44]
push edx
mov byte [esp + 0x114], 0x1a
call fcn.0040dca0
push 0x52239c
push eax
lea eax, [esp + 0x4c]
push eax
mov byte [esp + 0x120], 0x1b
call fcn.0040dd60
lea ecx, [esp + 0xb0]
push ecx
push eax
lea edx, [esp + 0x4c]
push edx
mov byte [esp + 0x12c], 0x1c
call fcn.0040dd60
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 0x40ce31
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 0x40ce59
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 0x40ce81
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 0x40cea9
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 0x40ced1
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 0x40ceee
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.004a3a40
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.0040eb00
sub dword [esp + 0x18], 1
jne 0x40cd51
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 0x40cf54
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 0x40cf7c
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 0x40cfa4
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 0x40cfd2
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.00495e54
add esp, 0xec
ret 4