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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov eax, dword [esp + 0x60]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov ebp, dword [esp + 0x68]
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x80000000
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
sub esp, 0x1c
mov dword [esp + 0x2c], eax
cmp eax, 0xffffffff
je 0x403100
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
sub esp, 8
lea eax, [eax + 1]
cmp ebx, 0xffffffff
jne 0x402e7d
mov eax, 1
xor ebx, ebx
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [esp + 0x3c], 0
mov dword [esp + 0x28], eax
mov edi, eax
lea eax, [esp + 0x3c]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
sub esp, 0x14
test eax, eax
jne 0x403080
mov eax, dword [esp + 0x28]
mov byte [eax], 0
mov eax, dword [esp + 0x64]
mov dword [eax], 0
mov dword [esp + 4], 4
mov dword [esp], 4
call sub.msvcrt.dll_calloc
mov edi, dword [esp + 0x28]
mov dword [esp + 0x20], eax
movzx esi, byte [edi]
mov eax, esi
test al, al
mov eax, dword [esp + 0x64]
mov ebx, dword [eax]
je 0x402f8a
mov dword [esp + 0x68], ebp
mov ebp, ebx
mov ebx, esi
mov dword [esp + 0x24], 4
jmp 0x402f3b
mov byte [eax], 0
movzx eax, byte [edi]
cmp al, 0xd
ja 0x403090
mov edx, 0x2401
bt edx, eax
jae 0x402f64
movzx ebx, byte [esi + 1]
lea edi, [esi + 1]
test bl, bl
je 0x402f88
mov dword [esp + 4], 0xa
mov dword [esp], edi
call sub.msvcrt.dll_strchr
mov esi, eax
test eax, eax
jne 0x402f18
cmp bl, 0xd
ja 0x4030b0
mov eax, 0x2401
bt eax, ebx
jb 0x402f88
cmp dword [esp + 0x24], ebp
jle 0x4030d0
mov eax, dword [esp + 0x20]
mov dword [eax + ebp*4], edi
mov eax, dword [esp + 0x64]
add ebp, 1
mov dword [eax], ebp
test esi, esi
jne 0x402f30
lea esi, [esi]
mov ebx, ebp
mov dword [esp], ebx
xor ebx, ebx
mov dword [esp + 4], 4
call sub.msvcrt.dll_calloc
mov esi, eax
mov eax, dword [esp + 0x64]
mov ecx, dword [eax]
test ecx, ecx
jle 0x40304d
lea esi, [esi]
mov eax, dword [esp + 0x20]
mov edi, dword [eax + ebx*4]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
sub esp, 0x18
mov ebp, eax
lea eax, [eax + eax]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [esi + ebx*4], eax
mov dword [esp + 0x14], ebp
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
sub esp, 0x18
mov dword [esp + 4], 0x40c12c
mov eax, dword [esi + ebx*4]
add ebx, 1
mov dword [esp], eax
call dword [sym.imp.SHLWAPI.dll_StrTrimW]
sub esp, 8
mov eax, dword [esp + 0x64]
cmp dword [eax], ebx
jg 0x402fb0
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call fcn.00409bb8
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call fcn.00409bb8
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
sub esp, 4
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov byte [edi + ebx], 0
jmp 0x402eca
mov edx, dword [esp + 0x68]
test edx, edx
je 0x402f64
cmp al, 0x23
je 0x402f30
jmp 0x402f64
mov eax, dword [esp + 0x68]
test eax, eax
je 0x402f64
cmp bl, 0x23
je 0x402f88
jmp 0x402f64
shl dword [esp + 0x24], 1
mov eax, dword [esp + 0x24]
shl eax, 2
mov dword [esp + 4], eax
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x64]
mov ebp, dword [eax]
jmp 0x402f6e
add esp, 0x4c
xor esi, esi
pop ebx
mov eax, esi
pop esi
pop edi
pop ebp
ret