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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x539a3b
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x102dc
call fcn.0050c350
mov eax, dword [0x5ac020]
xor eax, esp
mov dword [esp + 0x102d8], eax
push ebx
push esi
push edi
mov eax, dword [0x5ac020]
xor eax, esp
push eax
lea eax, [esp + 0x102f0]
mov dword fs:[0], eax
mov ebx, ecx
mov eax, dword [ebx + 0x21c]
lea esi, [ebx + 0x128]
test eax, eax
je 0x4056f9
cmp dword [eax + 0xb0], 0
je 0x4056f9
mov dword [esp + 0x24], 0
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x102f8], 0
cmp dword [0x5be2b0], 0
mov dword [esp + 0x14], 0
je 0x405235
mov eax, dword [ebx + 0x78]
mov ecx, 0x5be2ac
push dword [eax + 0x260]
call fcn.004a6f60
mov edi, eax
cmp edi, 0xffffffff
je 0x405235
cmp dword [0x5be2b0], 0
je 0x4051e4
lea eax, [esp + 0x4c]
mov ecx, 0x5be2ac
push eax
push edi
call fcn.004a72e0
test eax, eax
je 0x4051e4
mov eax, dword [esp + 0x29c]
mov dword [esp + 0x14], eax
jmp 0x4051ec
mov dword [esp + 0x14], 0
lea edx, [esp + 0x2e4]
mov ecx, edi
call fcn.0040d860
test eax, eax
je 0x405418
mov eax, dword [esi + 0xf4]
test eax, eax
je 0x405226
add eax, 0xa0
cmp dword [eax + 0x14], 8
jb 0x405228
mov eax, dword [eax]
lea ecx, [esp + 0x2e4]
push ecx
jmp 0x4052cb
xor eax, eax
lea ecx, [esp + 0x2e4]
push ecx
jmp 0x4052cb
mov edx, 1
xor ecx, ecx
call fcn.0040d140
test eax, eax
je 0x405345
mov ecx, dword [ebx + 0x78]
mov ecx, dword [ecx + 0x260]
call fcn.0040dce0
test eax, eax
je 0x405345
lea eax, [esp + 0x2e4]
push 0x10000
push eax
call fcn.0051b090
mov ecx, dword [ebx + 0x78]
lea edx, [esp + 0x2ec]
add esp, 8
mov ecx, dword [ecx + 0x260]
call fcn.0040e140
test eax, eax
je 0x4052bc
call fcn.00477390
push eax
call fcn.00477390
push eax
push 0xefffffff
push 1
push 1
push str.0049
push 3
push dword [0x5bdd04]
call fcn.004a3b30
add esp, 0x20
jmp 0x405418
lea eax, [esp + 0x2e4]
mov ecx, esi
push eax
call fcn.004c7080
push eax
lea ecx, [esp + 0x2c]
call fcn.004b8d90
test eax, eax
jne 0x4054d5
mov eax, dword [ebx]
mov ecx, ebx
push 0xefffffff
push 1
push 1
push str.0036
push 4
call dword [eax + 0x3c]
push eax
call fcn.004a3b30
add esp, 0x18
test byte [esi + 0x60], 1
je 0x405418
mov eax, dword [esi + 0x64]
test al, 0x40
jne 0x405418
shr eax, 7
and eax, 1
je 0x405418
mov ecx, dword [esi + 0x78]
test ecx, ecx
je 0x405418
push 0
push esi
call fcn.004c78d0
test eax, eax
je 0x405418
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x20]
jmp 0x405418
mov eax, dword [ebx + 0x78]
push 0
push 0
push 3
push 0
push 0
push Ordinal_1
push dword [eax + 0x260]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
test edi, edi
je 0x4053ba
cmp edi, 0xffffffff
je 0x4053ba
push 0
lea eax, [esp + 0x1c]
push eax
push 0x10000
lea eax, [esp + 0x2f0]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40568a
cmp dword [esp + 0x18], 0x10000
jne 0x40568a
lea eax, [esp + 0x1c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
push edi
test eax, eax
jne 0x40543a
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebx]
mov ecx, ebx
mov esi, eax
call dword [edx + 0x3c]
push 0
push 0
mov edi, eax
mov dword [esp + 0x1c], 0
lea eax, [esp + 0x1c]
push eax
push 0
push esi
push 0
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
mov eax, dword [esp + 0x14]
test eax, eax
je 0x405418
push eax
push 0xefffffff
push 1
push 1
push str.0029
push 4
push edi
call fcn.004a3b30
add esp, 0x1c
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [esp + 0x102f8], 0xffffffff
mov ecx, dword [esp + 0x24]
test ecx, ecx
je 0x405742
mov eax, dword [ecx]
push 1
call dword [eax]
jmp 0x405742
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esp + 0x2e4]
mov ecx, esi
push eax
call fcn.004c7080
push eax
lea ecx, [esp + 0x2c]
call fcn.004b8d90
test eax, eax
jne 0x4054b9
mov eax, dword [ebx]
mov ecx, ebx
push 0xefffffff
push 1
push 1
push str.0036
push 4
call dword [eax + 0x3c]
push eax
call fcn.004a3b30
add esp, 0x18
test byte [esi + 0x60], 1
je 0x405418
mov eax, dword [esi + 0x64]
test al, 0x40
jne 0x405418
shr eax, 7
and eax, 1
je 0x405418
mov ecx, dword [esi + 0x78]
test ecx, ecx
je 0x405418
push 0
push esi
call fcn.004c78d0
test eax, eax
je 0x405418
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x20]
jmp 0x405418
mov eax, dword [esp + 0x1c]
cmp eax, dword [esp + 0x3c]
jne 0x40562e
mov eax, dword [esp + 0x20]
cmp eax, dword [esp + 0x40]
jne 0x40562e
cmp dword [0x5be248], 0
je 0x40561b
cmp dword [esp + 0x14], 0
je 0x40550e
push 0xefffffff
push 1
push 1
push str.0050
mov eax, dword [ebx]
mov ecx, ebx
push 3
call dword [eax + 0x3c]
push eax
call fcn.004a3b30
add esp, 0x18
jmp 0x405418
or eax, 0xffffffff
lea edi, [ebx + 0x518]
mov ecx, edi
mov dword [esp + 0x14], eax
call fcn.004c70a0
test eax, eax
je 0x4055d5
push 0
push 0
push 3
push 0
push 0
push Ordinal_1
call fcn.004c7080
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x14], eax
cmp eax, 0xffffffff
jne 0x405596
test byte [edi + 0x60], 1
je 0x4053ba
mov eax, dword [edi + 0x64]
test al, 0x40
jne 0x4053ba
shr eax, 7
and eax, 1
je 0x4053ba
mov ecx, dword [edi + 0x78]
test ecx, ecx
je 0x4053ba
push 0
push edi
call fcn.004c78d0
test eax, eax
je 0x4053ba
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x20]
jmp 0x4053ba
lea ecx, [esp + 0x1c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x4055b3
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40554e
mov eax, dword [esp + 0x1c]
or eax, dword [esp + 0x20]
jne 0x4055d5
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x26
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40554e
mov edi, dword [esp + 0x14]
mov ecx, esi
mov edx, dword [ebx + 0x78]
push edi
call fcn.004c7080
push eax
push dword [edx + 0x260]
mov ecx, ebx
call fcn.00405950
cmp edi, 0xffffffff
je 0x4055fe
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebx + 0x78]
mov eax, dword [ecx + 0xd8]
mov dword [eax + 0x28], 1
mov eax, dword [ecx]
call dword [eax + 0xcc]
jmp 0x405418
push 0xefffffff
push 1
push 1
push str.0046
jmp 0x4054f7
mov eax, dword [ebx]
mov ecx, ebx
push 0xefffffff
push 1
push 1
push str.0036
push 4
call dword [eax + 0x3c]
push eax
call fcn.004a3b30
add esp, 0x18
test byte [esi + 0x60], 1
je 0x40567d
mov eax, dword [esi + 0x64]
test al, 0x40
jne 0x40567d
shr eax, 7
and eax, 1
je 0x40567d
mov ecx, dword [esi + 0x78]
test ecx, ecx
je 0x40567d
push 0
push esi
call fcn.004c78d0
test eax, eax
je 0x40567d
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x20]
push 0x72
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x405418
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebx]
mov ecx, ebx
push 0xefffffff
push 1
push 1
push str.0036
push 4
call dword [eax + 0x3c]
push eax
call fcn.004a3b30
add esp, 0x18
test byte [esi + 0x60], 1
je 0x405418
mov eax, dword [esi + 0x64]
test al, 0x40
jne 0x405418
shr eax, 7
and eax, 1
je 0x405418
mov ecx, dword [esi + 0x78]
test ecx, ecx
je 0x405418
push 0
push esi
call fcn.004c78d0
test eax, eax
je 0x405418
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x20]
jmp 0x405418
mov eax, dword [ebx]
push 0xefffffff
push 1
push 1
push str.0007
push 3
call dword [eax + 0x3c]
push eax
call fcn.004a3b30
add esp, 0x18
test byte [esi + 0x60], 1
je 0x405742
mov eax, dword [esi + 0x64]
test al, 0x40
jne 0x405742
test al, al
jns 0x405742
mov ecx, dword [esi + 0x78]
test ecx, ecx
je 0x405742
push 0
push esi
call fcn.004c78d0
test eax, eax
je 0x405742
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x20]
mov ecx, dword [esp + 0x102f0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x102d8]
xor ecx, esp
call fcn.004ffcef
mov esp, ebp
pop ebp
ret