Function at 0x402780
Capabilities:
Get file size
Link many functions at runtime
Read file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffa4
push ebx
push esi
push edi
xor ecx, ecx
mov dword [ebp - 0x5c], ecx
mov dword [ebp - 0x58], ecx
mov esi, edx
mov edi, eax
xor eax, eax
push ebp
push 0x402a0e
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x14]
push eax
push 0
push 0x402a1c
call sub.user32.dll_FindWindowA
push eax
call sub.user32.dll_GetWindowThreadProcessId
mov eax, dword [ebp - 0x14]
push eax
push 0
push 0x1f0fff
call sub.kernel32.dll_OpenProcess
mov ebx, eax
push 0x402a2c
push 0x402a3c
call sub.kernel32.dll_GetModuleHandleA_1
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [ebp - 0x50], eax
push 0x402a4c
push 0x402a5c
call sub.kernel32.dll_GetModuleHandleA_1
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [ebp - 0x4c], eax
push 0x402a64
push 0x402a3c
call sub.kernel32.dll_GetModuleHandleA_1
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [ebp - 0x40], eax
push 0x402a70
push 0x402a3c
call sub.kernel32.dll_GetModuleHandleA_1
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [ebp - 0x44], eax
push 0x402a7c
push 0x402a3c
call sub.kernel32.dll_GetModuleHandleA_1
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [ebp - 0x48], eax
push 0x402a90
push 0x402a3c
call sub.kernel32.dll_GetModuleHandleA_1
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [ebp - 0x3c], eax
push 0x402a9c
push 0x402a3c
call sub.kernel32.dll_GetModuleHandleA_1
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [ebp - 0x38], eax
push 0x402aa8
push 0x402a3c
call sub.kernel32.dll_GetModuleHandleA_1
push eax
call sub.kernel32.dll_GetProcAddress
mov dword [ebp - 0x34], eax
mov byte [ebp - 0x54], 1
mov dword [ebp - 0x18], esi
push 0x40
push 0x3000
lea eax, [ebp - 0x58]
mov edx, edi
call fcn.004017d0
mov eax, dword [ebp - 0x58]
call fcn.00401848
inc eax
push eax
push 0
push ebx
call dword [0x40617c]
mov esi, eax
mov dword [ebp - 0x1c], esi
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x5c]
mov edx, edi
call fcn.004017d0
mov eax, dword [ebp - 0x5c]
call fcn.00401848
inc eax
push eax
push edi
push esi
push ebx
call dword [0x406180]
push 0
push 0x80
push 4
push 0
push 1
push 0x80000000
push edi
call sub.kernel32.dll_CreateFileA
mov esi, eax
push 0
push esi
call sub.kernel32.dll_GetFileSize
mov dword [ebp - 0x30], eax
push esi
call sub.kernel32.dll_CloseHandle
push 0x40
push 0x3000
mov eax, dword [ebp - 0x30]
push eax
push 0
call dword [0x406178]
mov dword [ebp - 4], eax
push 0
push 0x80
push 4
push 0
push 0
push 0x80000000
push edi
call sub.kernel32.dll_CreateFileA
mov esi, eax
push 0
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x30]
push eax
mov eax, dword [ebp - 4]
push eax
push esi
call sub.kernel32.dll_ReadFile
push esi
call sub.kernel32.dll_CloseHandle
push 0x40
push 0x3000
mov eax, dword [ebp - 0x30]
push eax
push 0
push ebx
call dword [0x40617c]
mov esi, eax
mov dword [ebp - 0x20], esi
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 0x30]
inc eax
push eax
mov eax, dword [ebp - 4]
push eax
push esi
push ebx
call dword [0x406180]
push 0x40
push 0x3000
push 0x40
push 0
push ebx
call dword [0x40617c]
mov esi, eax
lea eax, [ebp - 8]
push eax
push 0x40
lea eax, [ebp - 0x54]
push eax
push esi
push ebx
call dword [0x406180]
push 0x40
push 0x3000
mov eax, 0x40277c
sub eax, 0x4026a8
push eax
push 0
push ebx
call dword [0x40617c]
mov edi, eax
lea eax, [ebp - 8]
push eax
mov eax, 0x40277c
sub eax, 0x4026a8
push eax
push 0x4026a8
push edi
push ebx
call dword [0x406180]
lea eax, [ebp - 0x10]
push eax
push 0
push esi
push edi
push 0
push 0
push ebx
call dword [0x406188]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x402a15
lea eax, [ebp - 0x5c]
mov edx, 2
call fcn.004016c0
ret