rpcsx/rpcs3/Loader/SELF.cpp
Peter Tissen 40add8f9a2 Seperate ConLog.h and ConLogFrame.h (for now only seperate headers)
make precompiled header slimmer under Linux to increase CI and dev-machine build-times

make sure unused modules don't compile
add unused modules to the VS project to easier keep track of them
2014-06-06 02:50:22 +02:00

48 lines
841 B
C++

#include "stdafx.h"
#include "Emu/ConLog.h"
#include "SELF.h"
#include "ELF64.h"
SELFLoader::SELFLoader(vfsStream& f)
: self_f(f)
, LoaderBase()
{
}
bool SELFLoader::LoadInfo()
{
if(!self_f.IsOpened()) return false;
self_f.Seek(0);
sce_hdr.Load(self_f);
self_hdr.Load(self_f);
if(!sce_hdr.CheckMagic()) return false;
return true;
}
bool SELFLoader::LoadData(u64 offset)
{
if(!self_f.IsOpened()) return false;
sce_hdr.Show();
self_hdr.Show();
ELF64Loader l(self_f);
if( !l.LoadEhdrInfo(self_hdr.se_elfoff) ||
!l.LoadPhdrInfo(self_hdr.se_phdroff) ||
!l.LoadShdrInfo(self_hdr.se_shdroff) ||
!l.LoadData(self_hdr.se_appinfooff) )
{
ConLog.Error("Broken SELF file.");
return false;
}
machine = l.GetMachine();
entry = l.GetEntry();
return true;
ConLog.Error("Boot SELF not supported yet!");
return false;
}