I agree such a (built-in) Function would be useful.
With this said., here's said Function in AppGameKit Script.
+ Code SnippetFunction CreateMemblockFromFileblock( MemblockID As Integer, Filename As String, EntryPoint As Integer, SizeInBytes As Integer )
Local FileID As Integer = 0
Local FilePos As Integer = 0
FileID = OpenToRead( Filename )
FilePos = 0
Repeat
ReadByte( FileID )
Inc FilePos
Until FilePos = EntryPoint
If MemblockID <> 0
CreateMemblock( MemblockID, SizeInBytes )
Else
MemblockID = CreateMemblock( SizeInBytes )
EndIf
For Offset = 0 To SizeInBytes - 1
SetMemblockByte( MemblockID, Offset, ReadByte( FileID ) )
Next
CloseFile( FileID )
EndFunction MemblockID