Function at 0x402f03
Capabilities:
Get file size
Print debug messages
Read file on windows
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
push ebx
push esi
push edi
xor ebx, ebx
push ebx
push ebx
push 3
push ebx
push 1
push 0x80000000
push 0x42e788
mov byte [ebp - 1], bl
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 8], eax
cmp eax, 0xffffffff
je 0x40325f
push ebx
push ebx
push ebx
push 2
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x40324e
push ebx
push ebx
push ebx
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ecx, eax
mov dword [ebp - 0x24], ecx
cmp ecx, ebx
je 0x403246
mov eax, dword [ecx + 0x3c]
add eax, ecx
movzx ecx, word [eax + 0x14]
movzx edx, word [eax + 6]
lea ecx, [ecx + eax + 0x18]
xor eax, eax
xor esi, esi
xor edi, edi
cmp ax, dx
jae 0x402f97
lea eax, [ecx + 0x14]
mov ecx, dword [eax]
cmp ecx, esi
jbe 0x402f91
mov edi, dword [eax - 4]
mov esi, ecx
add edi, esi
add eax, 0x28
dec edx
jne 0x402f84
push ebx
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, edi
jbe 0x40323d
push ebx
push ebx
lea eax, [esi - 5]
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x10]
push eax
push 5
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40323d
cmp dword [ebp - 0x10], 5
jne 0x40323d
xor eax, eax
mov byte [ebp - 0x38], bl
lea edi, [ebp - 0x37]
stosd dword es:[edi], eax
push ebx
stosb byte es:[edi], al
push ebx
lea eax, [esi - 0xa]
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x10]
push eax
push 5
lea eax, [ebp - 0x38]
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40323d
cmp dword [ebp - 0x10], 5
jne 0x40323d
push ebx
push 5
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x30]
push 5
push eax
call fcn.0040686f
add esp, 0x14
lea eax, [ebp - 0x38]
call fcn.0040930e
push ebx
mov edi, eax
mov dword [ebp - 0xc], eax
call fcn.00405fb6
mov edi, eax
pop ecx
mov dword [ebp - 0x20], edi
cmp edi, ebx
je 0x40323d
sub esi, dword [ebp - 0xc]
push ebx
push ebx
sub esi, 0xa
push esi
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0xc]
push edi
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
push dword [ebp - 0xc]
lea eax, [ebp - 0x30]
push edi
push 5
push eax
call fcn.0040686f
add esp, 0x14
push ebx
push 0xa441ce6e
push 6
mov esi, 0x41233c
push esi
call fcn.00408397
push eax
push dword [ebp - 0xc]
call fcn.00402ec3
mov edi, eax
add esp, 0x18
cmp edi, ebx
je 0x403235
push ebx
push 0xa441ce6e
push 6
add edi, 6
push esi
mov dword [ebp - 0x18], edi
call fcn.00408397
add esp, 0x10
push eax
push edi
call dword [sym.imp.SHLWAPI.dll_StrStrA]
mov dword [ebp - 0x1c], eax
cmp eax, ebx
je 0x403235
push dword [ebp + 8]
mov byte [eax], bl
call fcn.0040410d
pop ecx
test al, al
je 0x403121
push ebx
push 0xe8c0353f
push 0x19
push 0x412344
call fcn.00408397
push edi
push dword [ebp - 0xc]
lea ecx, [ebp - 0x14]
push eax
call fcn.0040972c
add esp, 0x1c
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov esi, dword [ebp - 0x14]
call fcn.004060d7
mov edi, dword [ebp - 0x1c]
sub edi, dword [ebp - 0x18]
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 0x18]
call fcn.0040f87c
mov esi, eax
pop ecx
pop ecx
mov dword [ebp - 0x18], esi
cmp esi, ebx
je 0x403235
push ebx
push 0x595e8931
push 1
push 0x412360
call fcn.00408397
push eax
mov eax, esi
call fcn.0040f6a0
add esp, 0x14
mov edi, eax
call fcn.0040f7c3
push eax
call fcn.00409555
pop ecx
mov dword [0x42e990], eax
cmp eax, ebx
je 0x40322d
push ebx
push 0x68a4c5a0
push 1
push 0x412364
call fcn.00408397
push eax
mov eax, esi
call fcn.0040f6a0
mov esi, eax
add esp, 0x14
mov dword [ebp - 0x1c], esi
cmp esi, ebx
je 0x403205
call fcn.0040f643
cmp eax, 5
jbe 0x4031af
push 5
pop eax
jmp 0x4031b6
mov eax, esi
call fcn.0040f643
mov edi, eax
shl edi, 2
push 8
mov dword [0x42e994], eax
call fcn.00405fb6
xor esi, esi
pop ecx
mov dword [0x42e784], eax
cmp dword [0x42e994], ebx
jbe 0x403201
mov eax, dword [ebp - 0x1c]
push esi
call fcn.0040f66a
pop ecx
mov edi, eax
call fcn.0040f7c3
push eax
call fcn.00409555
pop ecx
mov ecx, dword [0x42e784]
mov dword [ecx + esi*4], eax
inc esi
cmp esi, dword [0x42e994]
jb 0x4031d7
mov byte [ebp - 1], 1
push ebx
push 0x55fb37e0
push 1
push 0x412368
call fcn.00408397
push eax
mov eax, dword [ebp - 0x18]
call fcn.0040f6a0
add esp, 0x14
call fcn.0040f75c
mov dword [0x414c14], eax
mov eax, dword [ebp - 0x18]
call fcn.0040f58d
mov esi, dword [ebp - 0x20]
call fcn.004060d7
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov esi, dword [ebp - 0x28]
call fcn.004087bc
mov esi, dword [ebp - 8]
call fcn.004087bc
cmp byte [ebp - 1], bl
jne 0x403330
push ebx
push 0x538144c8
push 7
push 0x41236c
call fcn.00408397
push eax
mov eax, dword [ebp + 8]
call fcn.0040f6a0
add esp, 0x14
mov dword [ebp - 0x18], eax
cmp eax, ebx
je 0x403330
push ebx
push 0xda48c98f
push 3
push 0x412374
call fcn.00408397
push eax
mov eax, dword [ebp - 0x18]
call fcn.0040f6a0
add esp, 0x14
mov edi, eax
call fcn.0040f7c3
push eax
call fcn.00409555
pop ecx
push 8
push 0x14
pop edi
mov dword [0x42e990], eax
mov dword [0x42e994], 5
call fcn.00405fb6
xor esi, esi
inc esi
pop ecx
mov dword [0x42e784], eax
cmp dword [0x42e994], esi
jb 0x403330
push esi
push ebx
push 0xa2f79c26
push 7
push 0x412378
call fcn.00408397
add esp, 0x10
push eax
lea eax, [ebp - 0x58]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ebp - 0x58]
add esp, 0xc
push eax
mov eax, dword [ebp - 0x18]
call fcn.0040f6a0
pop ecx
mov edi, eax
call fcn.0040f7c3
push eax
call fcn.00409555
pop ecx
mov ecx, dword [0x42e784]
mov dword [ecx + esi*4 - 4], eax
inc esi
cmp esi, dword [0x42e994]
jbe 0x4032de
pop edi
pop esi
pop ebx
leave
ret