Loader: Guess filetype from the magic, or fallback to the extension.
This commit is contained in:
parent
04622a859c
commit
82ec17db7d
8 changed files with 113 additions and 27 deletions
|
@ -38,6 +38,10 @@ enum class ResultStatus {
|
|||
ErrorMemoryAllocationFailed,
|
||||
};
|
||||
|
||||
static u32 MakeMagic(char a, char b, char c, char d) {
|
||||
return a | b << 8 | c << 16 | d << 24;
|
||||
}
|
||||
|
||||
/// Interface for loading an application
|
||||
class AppLoader : NonCopyable {
|
||||
public:
|
||||
|
@ -100,13 +104,6 @@ protected:
|
|||
bool is_loaded = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Identifies the type of a bootable file
|
||||
* @param filename String filename of bootable file
|
||||
* @return FileType of file
|
||||
*/
|
||||
FileType IdentifyFile(const std::string &filename);
|
||||
|
||||
/**
|
||||
* Identifies and loads a bootable file
|
||||
* @param filename String filename of bootable file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue