rpcs3/rpcs3/Loader/ELF.h
nohbdy d136adc73f RSX Bugfixes and plugging memory leaks
BUGFIX: Add break after NV4097_SET_TEXTURE_BORDER_COLOR in RSXThread.cpp
BUGFIX: Fix parameters passed to RSXTexture::SetControl3 (they were being
passed in reverse order)
BUGFIX: Remove invalid, non-sensical call to glPixelStorei in GLGSRender.h
BUGFIX: Fix signed/unsigned comparison compiler warnings in GLGSRender.h
CHANGE: Make GLFragmentProgram::Decompiler synchronous by default
CHANGE: Update wxWidgets submodule to latest commit
BUGFIX: Fix several memory leaks
ADDED: Created a new MSVC debug configuration to output locations
  of allocations that end up leaking after the program
  is closed.
BUGFIX: Fix the stupid PadHandler crash due to the lack of a virtual d'tor
2014-04-17 15:15:43 -05:00

56 lines
769 B
C++

#pragma once
#include "ELF64.h"
#include "ELF32.h"
#include "Emu/FS/vfsStream.h"
enum ElfClass
{
CLASS_Unknown,
CLASS_ELF32,
CLASS_ELF64,
};
struct Elf_Ehdr
{
u32 e_magic;
u8 e_class;
virtual void Show()
{
}
virtual void Load(vfsStream& f)
{
e_magic = Read32(f);
e_class = Read8(f);
}
bool CheckMagic() const { return e_magic == 0x7F454C46; }
ElfClass GetClass() const
{
switch(e_class)
{
case 1: return CLASS_ELF32;
case 2: return CLASS_ELF64;
}
return CLASS_Unknown;
}
};
class ELFLoader : public LoaderBase
{
vfsStream& elf_f;
LoaderBase* loader;
public:
Elf_Ehdr ehdr;
ELFLoader(vfsStream& f);
virtual ~ELFLoader() {Close();}
virtual bool LoadInfo();
virtual bool LoadData(u64 offset = 0);
virtual bool Close();
};