mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Device: Add readCoreminiHeader()
- Fixes NeoMemoryDiskDriver::readLogicalDiskAligned() for flash - Adds FlashMemoryMessage
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#ifndef __COREMINI_H_
|
||||
#define __COREMINI_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
struct CoreminiHeader {
|
||||
uint16_t coreminiVersion;
|
||||
uint32_t storedFileSize;
|
||||
// 32-bit word checksum on the entire (decompressed) binary, with the checksum and hash fields set to 0
|
||||
uint32_t fileChecksum;
|
||||
// SHA256 hash of the entire (decompressed) binary, with the checksum, hash, and create time fields set to 0
|
||||
bool skipDecompression;
|
||||
bool encryptedMode;
|
||||
std::array<uint8_t, 32> fileHash;
|
||||
std::chrono::time_point<std::chrono::system_clock> timestamp;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <optional>
|
||||
#include <unordered_map>
|
||||
#include <set>
|
||||
#include <chrono>
|
||||
#include "icsneo/api/eventmanager.h"
|
||||
#include "icsneo/api/lifetime.h"
|
||||
#include "icsneo/device/neodevice.h"
|
||||
@@ -21,6 +22,7 @@
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/device/deviceversion.h"
|
||||
#include "icsneo/device/founddevice.h"
|
||||
#include "icsneo/device/coremini.h"
|
||||
#include "icsneo/disk/diskreaddriver.h"
|
||||
#include "icsneo/disk/diskwritedriver.h"
|
||||
#include "icsneo/disk/nulldiskdriver.h"
|
||||
@@ -163,6 +165,7 @@ public:
|
||||
bool stopScript();
|
||||
bool clearScript(Disk::MemoryType memType = Disk::MemoryType::SD);
|
||||
bool uploadCoremini(std::istream& stream, Disk::MemoryType memType = Disk::MemoryType::SD);
|
||||
std::optional<CoreminiHeader> readCoreminiHeader(Disk::MemoryType memType = Disk::MemoryType::SD);
|
||||
|
||||
bool eraseScriptMemory(Disk::MemoryType memType, uint64_t amount);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user