mirror of
https://github.com/siemens-mobile-hacks/libffshit.git
synced 2026-11-25 23:57:31 +00:00
48 lines
1.5 KiB
C++
48 lines
1.5 KiB
C++
#ifndef LIBFFSHIT_FULLFLASH_FULLFLASH_H
|
|
#define LIBFFSHIT_FULLFLASH_FULLFLASH_H
|
|
|
|
#include "ffshit/platform/detector.h"
|
|
#include "ffshit/partition/partitions.h"
|
|
#include "ffshit/rawdata.h"
|
|
|
|
#include <filesystem>
|
|
#include <memory>
|
|
|
|
namespace FULLFLASH {
|
|
|
|
class FULLFLASH {
|
|
public:
|
|
using Ptr = std::shared_ptr<FULLFLASH>;
|
|
|
|
FULLFLASH(std::filesystem::path fullflash_path);
|
|
FULLFLASH(char *ff_data, size_t ff_data_size);
|
|
|
|
FULLFLASH(std::filesystem::path fullflash_path, Platform::Type platform);
|
|
FULLFLASH(char *ff_data, size_t ff_data_size, Platform::Type platform);
|
|
|
|
template<typename ...Args>
|
|
static Ptr build(Args... args) {
|
|
return std::make_shared<FULLFLASH>(args...);
|
|
}
|
|
|
|
void load_partitions(bool old_search_algorithm, uint32_t search_start_addr);
|
|
|
|
// Writes the fullflash, with what the filesystem wrote to it, in the format it was read in
|
|
void save(std::filesystem::path fullflash_path) const;
|
|
|
|
const Platform::Detector & get_detector() const;
|
|
Partitions::Partitions::Ptr get_partitions() const;
|
|
|
|
private:
|
|
RawData data;
|
|
RawData x65flasher_header;
|
|
Platform::Detector::Ptr detector;
|
|
Partitions::Partitions::Ptr partitions;
|
|
|
|
void x65flasher_fix();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
#endif
|