Function at 0x100380c
Capabilities:
Get file size
Read file on windows
Read file via mapping

Disassembly:
push 0x40
push 0x1001270
call fcn.01004cd4
mov eax, dword [0x10060b0]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x38], eax
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x3c], ebx
xor eax, eax
mov dword [0x1007788], eax
xor edi, edi
inc edi
mov dword [0x1007780], edi
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x34], eax
mov esi, dword [0x1006070]
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
xor ecx, ecx
cmp ebx, eax
sete cl
mov eax, ecx
mov dword [0x10087a8], eax
test eax, eax
jne 0x1003913
lea eax, [ebp - 0x44]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [0x1007770], eax
cmp eax, 0xffffffff
jne 0x100388f
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1003b4d
xor eax, eax
cmp dword [0x1007770], eax
jne 0x10038a2
cmp dword [ebp - 0x44], eax
je 0x1003b4d
cmp dword [ebp - 0x44], eax
je 0x10038af
mov dword [0x10087ac], edi
jmp 0x1003913
push eax
push eax
push eax
push 2
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov dword [ebp - 0x4c], eax
xor ecx, ecx
cmp eax, ecx
jne 0x10038e3
push dword [0x1007778]
push 0xd
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
call fcn.010029e1
add esp, 0xc
jmp 0x1003b4d
push ecx
push ecx
push ecx
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [0x10087a4], eax
push dword [ebp - 0x4c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x10087a4]
test eax, eax
je 0x10038a7
mov dword [0x1006070], eax
mov esi, eax
mov dword [0x1006750], edi
xor eax, eax
cmp dword [0x10087a8], eax
jne 0x1003925
cmp dword [0x10087ac], eax
je 0x1003948
mov esi, 0x100779c
mov dword [0x1006070], esi
push eax
push 0x1007770
push 0x800
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [0x1006750], eax
test byte [0x1007775], 1
je 0x1003984
mov dword [ebp - 0x40], esi
mov ebx, dword [0x1007770]
jmp 0x1003981
mov eax, dword [ebp - 0x40]
mov al, byte [eax]
cmp al, 0x20
jae 0x100397e
movzx eax, al
push eax
push 0x1001264
call dword [sym.imp.msvcrt.dll_strchr]
pop ecx
pop ecx
test eax, eax
je 0x1003b2b
inc dword [ebp - 0x40]
dec ebx
jne 0x100395c
call fcn.01002720
mov edx, eax
mov eax, dword [ebp - 0x30]
lea ecx, [edx + eax]
test ecx, ecx
jle 0x1003b2b
cmp dword [0x10087a8], 0
jne 0x10039c3
cmp dword [0x10087ac], 0
jne 0x10039c3
sub edx, eax
add edx, esi
mov ebx, edx
and dword [0x1007770], 0
mov dword [0x1006750], edi
jmp 0x1003a7a
cmp edx, 0xffffffff
jne 0x10039db
mov byte [esi], 0xd
inc esi
mov byte [esi], 0xa
inc esi
mov ebx, esi
and dword [ebp - 0x30], 0
jmp 0x1003a7a
lea eax, [edx + esi - 1]
push eax
call fcn.01002871
mov dword [ebp - 0x30], eax
sub edx, eax
add edx, esi
mov ebx, edx
mov ecx, dword [ebp - 0x34]
xor ecx, edi
lea edi, [ecx*4 + 0x1006070]
mov esi, dword [edi]
push eax
push ebx
push esi
call dword [sym.imp.msvcrt.dll_memmove]
add esp, 0xc
mov ecx, dword [ebp - 0x30]
add esi, ecx
mov eax, 0x800
cmp ecx, 0x400
jle 0x1003a69
cmp ecx, eax
jl 0x1003a65
add dword [0x1007788], ecx
and dword [ebp - 0x30], 0
mov esi, dword [edi]
push eax
push esi
push dword [ebp - 0x3c]
call fcn.010026e6
push 0xa
lea eax, [ebp - 0x2c]
push eax
push dword [0x1007780]
call dword [sym.imp.msvcrt.dll__ultoa]
lea eax, [ebp - 0x2c]
push eax
push dword [0x1007778]
push 0x12
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
call fcn.010029e1
add esp, 0x1c
jmp 0x1003a7a
sub eax, ecx
jmp 0x1003a70
sub eax, ecx
and eax, 0xfffffc00
push eax
push esi
push dword [ebp - 0x3c]
call fcn.010026e6
and dword [ebp - 4], 0
mov edi, dword [ebp - 0x34]
lea edi, [edi*4 + 0x1006070]
push dword [ebp - 0x38]
push ebx
push dword [edi]
call dword [ebp - 0x48]
mov dword [ebp - 0x50], eax
or dword [ebp - 4], 0xffffffff
test eax, eax
je 0x1003ae0
mov eax, dword [ebp - 0x38]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1003aa2
sub eax, edx
push 0
push eax
push dword [ebp - 0x38]
call dword [0x1006098]
xor esi, esi
push esi
push 2
push 0x1001260
call dword [0x1006098]
cmp dword [0x10087a8], esi
jne 0x1003b4d
cmp dword [0x10087ac], esi
jne 0x1003b4d
mov eax, dword [0x10087a4]
cmp eax, esi
jmp 0x1003b44
sub ebx, dword [edi]
add dword [0x1007788], ebx
xor dword [ebp - 0x34], 1
xor edi, edi
inc edi
jmp 0x1003984
cmp dword [0x10087a8], 0
jne 0x1003b4d
cmp dword [0x10087ac], 0
jne 0x1003b4d
mov eax, dword [0x10087a4]
test eax, eax
je 0x1003b4d
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [ebp - 0x1c]
jmp 0x100b423