mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-11-22 21:02:07 +00:00
Another refactor to remove leacy code that isn't used anymore
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -19,6 +19,3 @@
|
||||
[submodule "thirdparty/lz4"]
|
||||
path = thirdparty/lz4
|
||||
url = https://github.com/lz4/lz4.git
|
||||
[submodule "thirdparty/gsc-tool"]
|
||||
path = thirdparty/gsc-tool
|
||||
url = https://github.com/xensik/gsc-tool.git
|
||||
|
||||
@@ -302,7 +302,6 @@ namespace T6
|
||||
using AssetFootstepTable = Asset<ASSET_TYPE_FOOTSTEP_TABLE, FootstepTableDef>;
|
||||
using AssetFootstepFxTable = Asset<ASSET_TYPE_FOOTSTEPFX_TABLE, FootstepFXTableDef>;
|
||||
using AssetZBarrier = Asset<ASSET_TYPE_ZBARRIER, ZBarrierDef>;
|
||||
using AssetCustomMap = Asset<ASSET_TYPE_CUSTOM_MAP, customMapInfo>;
|
||||
} // namespace T6
|
||||
|
||||
DEFINE_ASSET_NAME_ACCESSOR(T6::AssetPhysPreset, name);
|
||||
|
||||
@@ -304,8 +304,6 @@ namespace T6
|
||||
ASSET_TYPE_REPORT = 0x3E,
|
||||
ASSET_TYPE_DEPEND = 0x3F,
|
||||
ASSET_TYPE_FULL_COUNT = 0x40,
|
||||
|
||||
ASSET_TYPE_CUSTOM_MAP = 0x41
|
||||
};
|
||||
|
||||
enum XFileBlock
|
||||
|
||||
@@ -131,9 +131,6 @@ XAssetInfoGeneric* AssetCreationContext::LoadDependencyGeneric(const asset_type_
|
||||
}
|
||||
else
|
||||
{
|
||||
if (assetName[0] == ',')
|
||||
return LoadDefaultAssetDependency(assetType, assetName);
|
||||
|
||||
std::cerr << std::format("Missing asset \"{}\" of type \"{}\"\n", assetName, *m_zone.m_pools->GetAssetTypeName(assetType));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#include "ScriptCompileT6.h"
|
||||
|
||||
#include <xsk/arc/engine/t6_pc.hpp>
|
||||
|
||||
|
||||
char* compileScriptT6(const std::string& gscName, char* gscCode, size_t gscCodeSize, size_t* out_CompiledSize)
|
||||
{
|
||||
try
|
||||
{
|
||||
xsk::arc::t6::pc::context context = xsk::arc::t6::pc::context(xsk::arc::instance::server);
|
||||
|
||||
std::vector<xsk::u8> scriptBuffer;
|
||||
scriptBuffer.resize(gscCodeSize);
|
||||
memcpy(&scriptBuffer[0], gscCode, gscCodeSize);
|
||||
|
||||
auto outasm = context.compiler().compile(gscName, scriptBuffer);
|
||||
auto outbin = context.assembler().assemble(*outasm);
|
||||
|
||||
char* compiledBuffer = new char[outbin.first.size];
|
||||
memcpy(compiledBuffer, outbin.first.data, outbin.first.size);
|
||||
|
||||
*out_CompiledSize = outbin.first.size;
|
||||
return compiledBuffer;
|
||||
|
||||
}
|
||||
catch (std::exception const& e)
|
||||
{
|
||||
printf(std::format("GSC Compile failed: {}\n", e.what()).c_str());
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
#include <string>
|
||||
|
||||
char* compileScriptT6(const std::string& gscName, char* gscCode, size_t gscCodeSize, size_t* out_CompiledSize);
|
||||
@@ -9,8 +9,6 @@ AssetNameResolver::AssetNameResolver()
|
||||
{
|
||||
for (auto assetType = 0; assetType < ASSET_TYPE_COUNT; assetType++)
|
||||
AddAssetTypeName(assetType, *GameAssetPoolT6::AssetTypeNameByType(assetType));
|
||||
|
||||
AddAssetTypeName(ASSET_TYPE_CUSTOM_MAP, "custom_map");
|
||||
}
|
||||
|
||||
GameId AssetNameResolver::GetGameId() const
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace
|
||||
|
||||
if (!m_algorithm->Verify(signatureData, signatureDataSize, signature, signatureSize))
|
||||
{
|
||||
//throw InvalidSignatureException();
|
||||
throw InvalidSignatureException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "Writing/Steps/StepWriteZoneContentToFile.h"
|
||||
#include "Writing/Steps/StepWriteZoneContentToMemory.h"
|
||||
#include "Writing/Steps/StepWriteZoneHeader.h"
|
||||
#include "Writing/Steps/StepWriteZoneRSA.h"
|
||||
#include "Writing/Steps/StepWriteZoneSizes.h"
|
||||
#include "Zone/XChunk/XChunkProcessorDeflate.h"
|
||||
#include "Zone/XChunk/XChunkProcessorSalsa20Encryption.h"
|
||||
@@ -100,9 +99,9 @@ std::unique_ptr<ZoneWriter> ZoneWriterFactory::CreateWriter(const Zone& zone) co
|
||||
{
|
||||
auto writer = std::make_unique<ZoneWriter>();
|
||||
|
||||
bool isSecure = true;
|
||||
// TODO Support signed fastfiles
|
||||
bool isSecure = false;
|
||||
bool isEncrypted = true;
|
||||
bool isOfficial = true;
|
||||
|
||||
SetupBlocks(*writer);
|
||||
|
||||
@@ -112,11 +111,7 @@ std::unique_ptr<ZoneWriter> ZoneWriterFactory::CreateWriter(const Zone& zone) co
|
||||
writer->AddWritingStep(std::move(contentInMemory));
|
||||
|
||||
// Write zone header
|
||||
writer->AddWritingStep(std::make_unique<StepWriteZoneHeader>(CreateHeaderForParams(isSecure, isOfficial, isEncrypted)));
|
||||
|
||||
// write RSA
|
||||
if (isSecure)
|
||||
writer->AddWritingStep(std::make_unique<StepWriteZoneRSA>(zone.m_name));
|
||||
writer->AddWritingStep(std::make_unique<StepWriteZoneHeader>(CreateHeaderForParams(isSecure, false, isEncrypted)));
|
||||
|
||||
// Setup loading XChunks from the zone from this point on.
|
||||
ICapturedDataProvider* dataToSignProvider;
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#include "StepWriteZoneRSA.h"
|
||||
|
||||
#include "Game/T6/ZoneConstantsT6.h"
|
||||
|
||||
StepWriteZoneRSA::StepWriteZoneRSA(std::string zoneName)
|
||||
: m_zoneName(zoneName)
|
||||
{
|
||||
}
|
||||
|
||||
void StepWriteZoneRSA::PerformStep(ZoneWriter* zoneWriter, IWritingStream* stream)
|
||||
{
|
||||
stream->Write(T6::ZoneConstants::MAGIC_AUTH_HEADER, strlen(T6::ZoneConstants::MAGIC_AUTH_HEADER));
|
||||
|
||||
uint32_t loadFlags = 0;
|
||||
stream->Write(&loadFlags, sizeof(uint32_t));
|
||||
|
||||
char fileName[32];
|
||||
memset(fileName, 0, 32);
|
||||
strncpy(fileName, m_zoneName.c_str(), 31);
|
||||
stream->Write(fileName, 32);
|
||||
|
||||
//char data[256] = {0x75, 0xc2, 0xca, 0x61, 0x15, 0xef, 0xcb, 0xde, 0x42, 0xfc, 0xa8, 0xed, 0xb1, 0x77, 0x79, 0x93, 0x73, 0x28, 0x3e, 0x7f, 0xca,
|
||||
// 0x76, 0x48, 0xc3, 0x21, 0x23, 0x86, 0xc3, 0x0f, 0xb6, 0xa6, 0xb5, 0xe9, 0xab, 0x40, 0x29, 0xb8, 0x3c, 0x03, 0xc4, 0xe0, 0x99, 0xed,
|
||||
// 0xf2, 0x96, 0xd7, 0xb3, 0x95, 0x0d, 0x2e, 0xdd, 0xf0, 0x08, 0x6d, 0x5a, 0x95, 0x0b, 0x61, 0xd9, 0xde, 0xb4, 0x9d, 0x8a, 0x1b, 0x19,
|
||||
// 0xa8, 0x88, 0xb4, 0x35, 0xe8, 0x25, 0x78, 0x21, 0x04, 0xbf, 0x36, 0x13, 0x9b, 0xf6, 0x10, 0x12, 0x8a, 0x08, 0x98, 0xf0, 0xb5, 0xdc,
|
||||
// 0x8c, 0xd6, 0x37, 0x6d, 0x9a, 0xd8, 0xe4, 0x62, 0x5d, 0x02, 0xc1, 0xf6, 0xf1, 0xa1, 0x95, 0x93, 0x42, 0xee, 0xc2, 0x1a, 0xd9, 0xf0,
|
||||
// 0x36, 0x36, 0x23, 0x50, 0x8b, 0x11, 0x90, 0x6a, 0xa1, 0x8d, 0xf6, 0xd0, 0xe4, 0xb5, 0x0f, 0xfd, 0x87, 0x2f, 0x46, 0xb9, 0x08, 0x3e,
|
||||
// 0x38, 0xf9, 0x81, 0xaa, 0x39, 0x2b, 0xf7, 0x44, 0x44, 0x75, 0x0e, 0x8a, 0x09, 0x6c, 0x6f, 0x6e, 0xea, 0xd0, 0x32, 0x62, 0xfd, 0x98,
|
||||
// 0x65, 0xb5, 0xbd, 0xc0, 0xae, 0x63, 0xf1, 0xe9, 0x24, 0x03, 0xfc, 0x34, 0xed, 0xb6, 0xbf, 0x0e, 0xd2, 0x56, 0x43, 0xea, 0xde, 0xff,
|
||||
// 0x51, 0xa8, 0xb1, 0x93, 0x47, 0xe3, 0xc3, 0xee, 0xc2, 0xa3, 0x0a, 0x93, 0x14, 0x8f, 0x98, 0x7c, 0xaf, 0x2d, 0xa2, 0x2c, 0x71, 0x23,
|
||||
// 0x60, 0x6a, 0x66, 0xd1, 0x6b, 0x55, 0xc0, 0x5d, 0x9b, 0xad, 0x18, 0xc5, 0xac, 0x2f, 0xa4, 0x00, 0xe8, 0xd0, 0xa6, 0xb4, 0x67, 0xa7,
|
||||
// 0xbb, 0x7d, 0x4a, 0xbe, 0x02, 0xd0, 0xb6, 0xe0, 0xc6, 0xac, 0x1e, 0x59, 0x88, 0xcd, 0x26, 0x41, 0x73, 0x10, 0x65, 0x13, 0x79, 0x72,
|
||||
// 0x5a, 0x26, 0x41, 0xe9, 0x89, 0x51, 0xc3, 0x79, 0x7d, 0x70, 0x3a, 0x5b, 0x94, 0x5d, 0xdd};
|
||||
|
||||
char data[256];
|
||||
memset(data, 0, 256);
|
||||
stream->Write(data, 256);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
#include "Writing/IWritingStep.h"
|
||||
|
||||
|
||||
class StepWriteZoneRSA final : public IWritingStep
|
||||
{
|
||||
std::string m_zoneName;
|
||||
|
||||
public:
|
||||
explicit StepWriteZoneRSA(std::string zoneName);
|
||||
|
||||
void PerformStep(ZoneWriter* zoneWriter, IWritingStream* stream) override;
|
||||
};
|
||||
Reference in New Issue
Block a user