mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 23:00:42 +00:00
Add unpacktool
This commit is contained in:
29
unpacktool/NullDecompressor.cpp
Normal file
29
unpacktool/NullDecompressor.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "NullDecompressor.h"
|
||||
#include "CSInputBuffer.h"
|
||||
|
||||
NullDecompressor::NullDecompressor()
|
||||
: m_input(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
bool NullDecompressor::Reset(CSInputBuffer *input, size_t compressedSize, size_t decompressedSize)
|
||||
{
|
||||
m_input = input;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NullDecompressor::ReadBytes(void *dest, size_t numBytes)
|
||||
{
|
||||
uint8_t *output = static_cast<uint8_t *>(dest);
|
||||
|
||||
for (size_t i = 0; i < numBytes; i++)
|
||||
{
|
||||
int byte;
|
||||
if (!CSInputNextByte(m_input, byte))
|
||||
return false;
|
||||
|
||||
output[i] = byte;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
Reference in New Issue
Block a user