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

Disassembly:
sub esp, 0x810
push ebx
push ebp
push esi
lea eax, [esp + 0x820]
push edi
lea ecx, [esp + 0x10]
xor esi, esi
push eax
push ecx
mov dword [esp + 0x20], esi
mov dword [esp + 0x1c], esi
call fcn.00403d60
add esp, 8
test eax, eax
je 0x40517d
mov eax, 0x15
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x810
ret
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x168e]
lea eax, [esp + 0x1389]
push edx
push eax
push ecx
call fcn.00403dc0
mov eax, dword [esp + 0x169a]
add esp, 0xc
cmp eax, 1
jne 0x4051f0
mov eax, dword [esp + 0x136e]
cmp eax, esi
je 0x4051f0
mov ecx, dword [esp + 0x10]
push eax
lea edx, [esp + 0x1265]
lea eax, [esp + 0x1164]
push edx
push eax
push ecx
call fcn.00403fa0
add esp, 0x10
test eax, eax
je 0x4051f0
lea edx, [esp + 0x10]
push edx
call fcn.00404920
add esp, 4
mov eax, 0x1e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x810
ret
mov eax, dword [esp + 0x1698]
mov ecx, dword [esp + 0x14]
mov ebp, dword [eax + ecx*4]
test ebp, ebp
je 0x405545
mov eax, dword [esp + 0x1366]
test eax, eax
je 0x405249
mov edx, dword [esp + 0x1362]
mov eax, dword [esp + 0x136a]
push edx
lea ecx, [esp + 0x1265]
push eax
lea edx, [esp + 0x1168]
push ecx
lea eax, [esp + 0x830]
push edx
push eax
call fcn.00404a00
add esp, 0x14
test eax, eax
jne 0x405555
mov ecx, dword [esp + 0x10]
push ecx
call fcn.004045e0
mov esi, eax
add esp, 4
test esi, esi
jne 0x4055a1
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x845]
push edx
push eax
call fcn.00404660
mov esi, eax
add esp, 8
test esi, esi
jne 0x405565
mov eax, 0x1b14
lea esi, [esp + 0x824]
call fcn.00406ba0
mov ecx, 0x6c5
mov edi, esp
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x1b24]
push ecx
call fcn.004055c0
add esp, 0x1b18
test eax, eax
jne 0x40553a
mov edx, dword [esp + 0x10]
push edx
call fcn.004047c0
mov esi, eax
add esp, 4
test esi, esi
jne 0x405583
lea eax, [esp + 0x15cb]
push eax
call fcn.004036a0
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
add esp, 4
lea ecx, [esp + 0x15cb]
lea edx, [esp + 0x20]
push ecx
push str.Date:__s_r_n
push edx
call ebx
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x2c]
push eax
push ecx
call fcn.00404830
lea edi, [esp + 0x89a]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x14
repne scasb al, byte es:[edi]
not ecx
dec ecx
jne 0x405333
lea edx, [esp + 0x845]
lea eax, [esp + 0x20]
push edx
push str.From:__s_r_n
push eax
call ebx
add esp, 0xc
jmp 0x405352
lea ecx, [esp + 0x845]
lea edx, [esp + 0x886]
push ecx
push edx
lea eax, [esp + 0x28]
push str.From:__s___s__r_n
push eax
call ebx
add esp, 0x10
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x20]
push ecx
push edx
call fcn.00404830
add esp, 8
mov eax, 0x1b14
lea esi, [esp + 0x824]
call fcn.00406ba0
mov eax, dword [esp + 0x1b24]
mov ecx, 0x6c5
mov edi, esp
push eax
rep movsd dword es:[edi], dword [esi]
call fcn.00405730
mov eax, dword [esp + 0x2e90]
add esp, 0x1b18
cmp eax, 1
jne 0x4053d9
mov eax, dword [esp + 0x16a4]
cmp eax, 1
jb 0x4053d9
mov ecx, dword [esp + 0x14]
inc eax
inc ecx
push eax
lea edx, [esp + 0x22b8]
push ecx
push edx
lea eax, [esp + 0x2c]
push str.Subject:__s__d__d__r_n
push eax
call ebx
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x34]
push ecx
push edx
call fcn.00404830
add esp, 0x1c
jmp 0x4053ff
lea eax, [esp + 0x22b4]
lea ecx, [esp + 0x20]
push eax
push str.Subject:__s_r_n
push ecx
call ebx
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x2c]
push edx
push eax
call fcn.00404830
add esp, 0x14
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40542d
lea ecx, [esp + 0x160c]
lea edx, [esp + 0x20]
push ecx
push str.References:___s__r_n
push edx
call ebx
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x2c]
push eax
push ecx
call fcn.00404830
add esp, 0x14
mov eax, dword [esp + 0x1692]
inc word [esp + 0x1692]
lea edx, [esp + 0x1380]
lea ecx, [esp + 0x160c]
push edx
push eax
lea eax, [esp + 0x84d]
push eax
push ecx
call fcn.00403970
add esp, 0x10
lea edx, [esp + 0x160c]
lea eax, [esp + 0x20]
push edx
push str.Message_Id:___s__r_n
push eax
call ebx
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x2c]
push ecx
push edx
call fcn.00404830
add esp, 0x14
lea eax, [esp + 0x1c]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, dword [esp + 0x1c]
xor esi, esi
push esi
push esi
shl ebx, 8
push esi
push ebp
add ebx, eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test ebx, ebx
jle 0x4054f9
mov ecx, 0x200
xor eax, eax
lea edi, [esp + 0x20]
push eax
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x24]
push ecx
push 0x800
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [esp + 0x18]
push 0
add esi, edx
push 0
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x20]
push eax
push ecx
push edx
call fcn.00404880
add esp, 0xc
cmp ebx, esi
jg 0x4054a8
mov eax, dword [esp + 0x10]
push eax
call fcn.004048b0
mov esi, eax
add esp, 4
test esi, esi
jne 0x4055a1
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x14]
push 0x3e8
inc esi
mov dword [esp + 0x18], esi
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp esi, dword [esp + 0x16a4]
jbe 0x4051f0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x810
ret
mov eax, 0x19
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x810
ret
mov eax, 0x1f
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x810
ret
lea edx, [esp + 0x10]
push edx
call fcn.00404920
push esi
call fcn.004049a0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x810
ret
lea eax, [esp + 0x10]
push eax
call fcn.00404920
push esi
call fcn.004049a0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x810
ret
lea ecx, [esp + 0x10]
push ecx
call fcn.00404920
push esi
call fcn.004049a0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x810
ret