Function at 0x40e570
Capabilities:
Get file size
Read file on windows
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x494306
mov eax, dword fs:[0]
push eax
sub esp, 0x468
mov eax, dword [0x4bd750]
xor eax, esp
mov dword [esp + 0x460], eax
push ebx
push esi
push edi
mov eax, dword [0x4bd750]
xor eax, esp
push eax
lea eax, [esp + 0x478]
mov dword fs:[0], eax
mov esi, ecx
mov edi, dword [esi + 0x54]
cmp dword [esi + 0x50], edi
lea ebx, [esi + 0x4c]
jbe 0x40e5c2
call fcn.0047263c
mov eax, dword [ebx + 4]
cmp eax, dword [ebx + 8]
mov dword [esp + 0x18], eax
jbe 0x40e5d7
call fcn.0047263c
mov eax, dword [esp + 0x18]
push edi
push ebx
push eax
push ebx
lea eax, [esp + 0x34]
push eax
call fcn.004126f0
mov edi, dword [esi + 0x64]
cmp dword [esi + 0x60], edi
lea ebx, [esi + 0x5c]
mov dword [esp + 0x2c], ebx
jbe 0x40e5f9
call fcn.0047263c
mov eax, dword [ebx + 4]
cmp eax, dword [ebx + 8]
mov dword [esp + 0x18], eax
jbe 0x40e60e
call fcn.0047263c
mov eax, dword [esp + 0x18]
push edi
push ebx
push eax
push ebx
lea ecx, [esp + 0x34]
push ecx
call fcn.00412810
mov edi, dword [esi + 0x74]
cmp dword [esi + 0x70], edi
lea ebx, [esi + 0x6c]
jbe 0x40e62c
call fcn.0047263c
mov eax, dword [ebx + 4]
cmp eax, dword [ebx + 8]
mov dword [esp + 0x18], eax
jbe 0x40e641
call fcn.0047263c
mov eax, dword [esp + 0x18]
push edi
push ebx
push eax
push ebx
lea edx, [esp + 0x34]
push edx
call fcn.00412810
mov edi, dword [esi + 0x84]
cmp dword [esi + 0x80], edi
lea ebx, [esi + 0x7c]
mov dword [esp + 0x24], ebx
jbe 0x40e669
call fcn.0047263c
mov eax, dword [ebx + 4]
cmp eax, dword [ebx + 8]
mov dword [esp + 0x18], eax
jbe 0x40e67e
call fcn.0047263c
mov eax, dword [esp + 0x18]
push edi
push ebx
push eax
push ebx
lea eax, [esp + 0x28]
push eax
call fcn.00412810
mov eax, dword [esi + 0x34]
add esi, 0x34
sub eax, 0x10
mov edi, 1
cmp dword [eax + 0xc], edi
jle 0x40e6aa
mov ecx, dword [eax + 4]
push ecx
mov ecx, esi
call fcn.00401b60
mov eax, dword [esi]
push 0
push 0x80
push 3
push 0
push edi
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x20], eax
jne 0x40e6f7
mov eax, dword [esi]
sub eax, 0x10
cmp dword [eax + 0xc], edi
jle 0x40e6e2
mov edx, dword [eax + 4]
push edx
mov ecx, esi
call fcn.00401b60
mov eax, dword [esi]
push eax
push str._s_File_Not_Found
call fcn.004169a0
add esp, 8
jmp 0x40e8ee
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
lea edi, [esi + 3]
push edi
call fcn.0044e523
add esp, 4
push edi
xor edi, edi
mov ebx, eax
push edi
push ebx
call fcn.00475860
mov edx, dword [esp + 0x2c]
add esp, 0xc
push edi
lea ecx, [esp + 0x34]
push ecx
push esi
push ebx
push edx
mov dword [esp + 0x2c], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov al, byte [ebx]
add ebx, 2
push 0xd
push ebx
mov byte [esp + 0x1f], al
call fcn.00473a80
add esp, 8
cmp eax, edi
je 0x40e8a3
mov esi, dword [esp + 0x18]
mov ecx, ebx
sub ecx, esi
cmp ecx, dword [esp + 0x30]
jg 0x40e8a3
push ebx
lea edx, [esp + 0x70]
push 0x400
push edx
mov byte [eax], 0
call fcn.004739e4
lea eax, [esp + 0x78]
add esp, 0xc
lea edx, [eax + 1]
nop
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40e780
sub eax, edx
mov cl, byte [esp + eax + 0x6b]
cmp cl, 0xd
je 0x40e799
cmp cl, 0xa
jne 0x40e79e
mov byte [esp + eax + 0x6b], 0
cmp byte [ebx + eax + 1], 0xa
lea ebx, [ebx + eax + 1]
jne 0x40e7ac
add ebx, 1
movsx eax, byte [esp + 0x17]
sub eax, 0x43
je 0x40e81d
sub eax, 1
jne 0x40e8c2
mov byte [esp + 0x38], al
lea eax, [esp + 0x6c]
mov dword [esp + 0x4c], 0xf
mov dword [esp + 0x48], edi
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40e7d6
sub eax, edx
push eax
lea eax, [esp + 0x70]
push eax
lea ecx, [esp + 0x3c]
call fcn.00403870
mov esi, dword [esp + 0x2c]
lea ecx, [esp + 0x34]
push ecx
mov dword [esp + 0x484], edi
call fcn.00412480
mov dword [esp + 0x480], 0xffffffff
cmp dword [esp + 0x4c], 0x10
jb 0x40e887
mov edx, dword [esp + 0x38]
jmp 0x40e87e
lea eax, [esp + 0x6c]
mov dword [esp + 0x68], 0xf
mov dword [esp + 0x64], edi
mov byte [esp + 0x54], 0
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40e835
sub eax, edx
push eax
lea eax, [esp + 0x70]
push eax
lea ecx, [esp + 0x58]
call fcn.00403870
lea ecx, [esp + 0x50]
mov dword [esp + 0x480], 1
mov esi, dword [esp + 0x24]
push ecx
call fcn.00412480
mov dword [esp + 0x480], 0xffffffff
cmp dword [esp + 0x68], 0x10
jb 0x40e887
mov edx, dword [esp + 0x54]
push edx
call fcn.0044e528
add esp, 4
mov al, byte [ebx]
add ebx, 2
push 0xd
push ebx
mov byte [esp + 0x1f], al
call fcn.00473a80
add esp, 8
cmp eax, edi
jne 0x40e750
mov ecx, dword [esp + 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x18]
push edx
call fcn.0044e528
add esp, 4
mov eax, 1
jmp 0x40e8f0
push 0x34c
push str..DnPatchThread.cpp
push str.0___Invalid_Patch_Code_
call dword [0x4bf2f8]
add esp, 0xc
push esi
call fcn.0044e528
mov eax, dword [esp + 0x24]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [esp + 0x478]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x460]
xor ecx, esp
call fcn.004716ba
mov esp, ebp
pop ebp
ret