2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-06-06 16:52:35 +00:00

all known bugs fixed and loaded maps work correctly now.

This commit is contained in:
LJW-Dev
2025-08-28 23:34:06 +08:00
committed by Jan Laupetin
parent b0756ef8e1
commit 10da8b27b7
18 changed files with 40278 additions and 350 deletions
@@ -15,6 +15,7 @@
#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 +101,9 @@ std::unique_ptr<ZoneWriter> ZoneWriterFactory::CreateWriter(const Zone& zone) co
{
auto writer = std::make_unique<ZoneWriter>();
// TODO Support signed fastfiles
bool isSecure = false;
bool isSecure = true;
bool isEncrypted = true;
bool isOfficial = true;
SetupBlocks(*writer);
@@ -112,7 +113,11 @@ 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, false, isEncrypted)));
writer->AddWritingStep(std::make_unique<StepWriteZoneHeader>(CreateHeaderForParams(isSecure, isOfficial, isEncrypted)));
// write RSA
if (isSecure)
writer->AddWritingStep(std::make_unique<StepWriteZoneRSA>(zone.m_name));
// Setup loading XChunks from the zone from this point on.
ICapturedDataProvider* dataToSignProvider;
@@ -0,0 +1,35 @@
#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};
stream->Write(data, 256);
}
@@ -0,0 +1,13 @@
#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;
};