Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Fetch hash lists
run: |
mkdir _rpkg
Invoke-WebRequest -Uri "https://github.com/glacier-modding/Hitman-Hashes/releases/latest/download/latest-hashes.7z" -OutFile "latest-hashes.7z"
Invoke-WebRequest -Uri "https://github.com/glacier-modding/Game-Hashes/releases/latest/download/latest-hashes.7z" -OutFile "latest-hashes.7z"
Invoke-WebRequest -Uri "https://github.com/glacier-modding/Hitman-l10n-Hashes/releases/latest/download/hash_list.hmla" -OutFile "_rpkg/hash_list.hmla"

- name: Prepare build
Expand Down
4 changes: 2 additions & 2 deletions rpkg-gui/DownloadExtractionProgress.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e)

webClient.DownloadFileCompleted += WebClient_DownloadFileCompleted;

Uri uri = new Uri("https://github.com/glacier-modding/Hitman-Hashes/releases/latest/download/latest-hashes.7z");
Uri uri = new Uri("https://github.com/glacier-modding/Game-Hashes/releases/latest/download/latest-hashes.7z");

webClient.DownloadFileAsync(uri, "latest-hashes.7z");
}
Expand Down Expand Up @@ -118,7 +118,7 @@ void worker_DoWork(object sender, DoWorkEventArgs e)
{
HttpClient http = new HttpClient() { Timeout = TimeSpan.FromSeconds(10) };

int.TryParse(http.GetAsync("https://github.com/glacier-modding/Hitman-Hashes/releases/latest/download/version").Result.Content.ReadAsStringAsync().Result, out currentVersionAvailable);
int.TryParse(http.GetAsync("https://github.com/glacier-modding/Game-Hashes/releases/latest/download/version").Result.Content.ReadAsStringAsync().Result, out currentVersionAvailable);
}
else if (operation == 4)
{
Expand Down
2 changes: 1 addition & 1 deletion rpkg-gui/HashCalculator.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private string checkHashes(string inputtext, Canceller canceller)
byte[] stringBytes = Encoding.UTF8.GetBytes(lineString);
byte[] hashBytes = md5.ComputeHash(stringBytes);

StringBuilder ioiHashsb = new StringBuilder("00", 16);
StringBuilder ioiHashsb = new StringBuilder("01", 16);
for (int i = 1; i < 8; i++)
{
ioiHashsb.Append(hashBytes[i].ToString("X2"));
Expand Down
10 changes: 5 additions & 5 deletions rpkg-gui/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private void DownloadExtractHashList()
{
DownloadExtractionProgress downloadExtractionProgress1 = new DownloadExtractionProgress();
downloadExtractionProgress1.operation = 0;
downloadExtractionProgress1.message.Content = "Downloading https://github.com/glacier-modding/Hitman-Hashes/releases/latest/download/latest-hashes.7z...";
downloadExtractionProgress1.message.Content = "Downloading https://github.com/glacier-modding/Game-Hashes/releases/latest/download/latest-hashes.7z...";
downloadExtractionProgress1.ShowDialog();

DownloadExtractionProgress downloadExtractionProgress2 = new DownloadExtractionProgress();
Expand Down Expand Up @@ -201,7 +201,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
if (!File.Exists("hash_list.txt"))
{
MessageQuestion messageBox = new MessageQuestion();
messageBox.message.Content = "Error: The hash list file (hash__list.txt) is missing.\n\nIt's necessary for several functions.\n\nClick OK to automatically download it.\n\nYou can also download it manually from https://github.com/glacier-modding/Hitman-Hashes/releases/latest/download/latest-hashes.7z and extract it to the same directory as this program.";
messageBox.message.Content = "Error: The hash list file (hash__list.txt) is missing.\n\nIt's necessary for several functions.\n\nClick OK to automatically download it.\n\nYou can also download it manually from https://github.com/glacier-modding/Game-Hashes/releases/latest/download/latest-hashes.7z and extract it to the same directory as this program.";
messageBox.ShowDialog();

if (messageBox.buttonPressed == "OKButton")
Expand Down Expand Up @@ -232,7 +232,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
DownloadExtractionProgress downloadExtractionProgress = new DownloadExtractionProgress();
downloadExtractionProgress.operation = (int)Progress.Operation.MASS_EXTRACT;
downloadExtractionProgress.ProgressBar.IsIndeterminate = true;
downloadExtractionProgress.message.Content = "Checking https://github.com/glacier-modding/Hitman-Hashes/releases/latest/download/version to see if a new hash list is available...";
downloadExtractionProgress.message.Content = "Checking https://github.com/glacier-modding/Game-Hashes/releases/latest/download/version to see if a new hash list is available...";
downloadExtractionProgress.ShowDialog();

if (currentVersion < downloadExtractionProgress.currentVersionAvailable)
Expand Down Expand Up @@ -851,7 +851,7 @@ private void MainTreeView_AfterSelect(object sender, System.Windows.Forms.TreeVi
}
}

if (resourceType == "WWEM" || resourceType == "WWES")
/*if (resourceType == "WWEM" || resourceType == "WWES")
{
if (OGGPlayerTimer != null)
{
Expand Down Expand Up @@ -1036,7 +1036,7 @@ private void MainTreeView_AfterSelect(object sender, System.Windows.Forms.TreeVi

FirstTabRight.IsSelected = true;
}
}
}*/
}

//GC.Collect();
Expand Down
2 changes: 1 addition & 1 deletion src/compute_ioi_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ std::string generic_function::compute_ioi_hash(const std::string& input_to_ioi_h

std::stringstream ss;

ss << "00";
ss << "01";

for (uint64_t m = 1; m < 8; m++) {
ss << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << static_cast<int>(signature[m]);
Expand Down
2 changes: 1 addition & 1 deletion src/compute_ioi_hash_from_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void generic_function::compute_ioi_hash_from_file(std::string& input_path) {

ss.str(std::string());

ss << "00";
ss << "01";

for (uint64_t m = 1; m < 8; m++) {
ss << std::hex << std::setw(2) << std::setfill('0') << std::uppercase << static_cast<int>(signature[m]);
Expand Down
4 changes: 2 additions & 2 deletions src/crypto.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "crypto.h"

constexpr unsigned int num_rounds = 32;
constexpr uint32_t l10n_key[4] = {0x53527737, 0x7506499E, 0xBD39AEE3, 0xA59E7268};
constexpr uint32_t thumbs_key[4] = {0x30F95282, 0x1F48C419, 0x295F8548, 0x2A78366D};
constexpr uint32_t l10n_key[4] = {0x68AC3361, 0x562B4AA0, 0xB9F2771F, 0x28EB3CE7};
constexpr uint32_t thumbs_key[4] = {0x71482CF0, 0x5FDC4B9F, 0x86CE569D, 0x0509FC1E};
constexpr uint32_t thumbs_delta = 0x61C88647;
constexpr uint32_t l10n_delta = 0x9E3779B9;

Expand Down
8 changes: 4 additions & 4 deletions src/extract_hash_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ void rpkg_function::extract_hash_meta(const uint64_t i, const uint64_t j, std::s
meta_data.push_back(*(reinterpret_cast<char*>(&rpkgs.at(i).hash.at(j).data.resource.reference_table_size) + k));
}

for (int k = 0; k < sizeof(hash::data.resource.reference_table_dummy); k++) {
meta_data.push_back(
*(reinterpret_cast<char*>(&rpkgs.at(i).hash.at(j).data.resource.reference_table_dummy) + k));
}
//for (int k = 0; k < sizeof(hash::data.resource.reference_table_dummy); k++) {
// meta_data.push_back(
// *(reinterpret_cast<char*>(&rpkgs.at(i).hash.at(j).data.resource.reference_table_dummy) + k));
//}

for (int k = 0; k < sizeof(hash::data.resource.size_final); k++) {
meta_data.push_back(*(reinterpret_cast<char*>(&rpkgs.at(i).hash.at(j).data.resource.size_final) + k));
Expand Down
2 changes: 1 addition & 1 deletion src/extract_ores_from.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void rpkg_function::extract_ores_from(std::string& input_path, std::string& filt

log_output = false;

uint64_t temp_hash_value = 0x00858D45F5F9E3CA;
uint64_t temp_hash_value = 0x01FBE4097B698967;

uint32_t rpkg_index = rpkg_function::get_latest_hash(temp_hash_value);

Expand Down
2 changes: 1 addition & 1 deletion src/generate_hash_meta_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ std::string rpkg_function::generate_hash_meta_json(const uint64_t rpkg_index, co
json["hash_size"] = rpkgs.at(rpkg_index).hash.at(hash_index).data.header.data_size;
json["hash_resource_type"] = std::string(rpkgs.at(rpkg_index).hash.at(hash_index).hash_resource_type.data(), 4);
json["hash_reference_table_size"] = rpkgs.at(rpkg_index).hash.at(hash_index).data.resource.reference_table_size;
json["hash_reference_table_dummy"] = rpkgs.at(rpkg_index).hash.at(hash_index).data.resource.reference_table_dummy;
//json["hash_reference_table_dummy"] = rpkgs.at(rpkg_index).hash.at(hash_index).data.resource.reference_table_dummy;
json["hash_size_final"] = rpkgs.at(rpkg_index).hash.at(hash_index).data.resource.size_final;
json["hash_size_in_memory"] = rpkgs.at(rpkg_index).hash.at(hash_index).data.resource.size_in_memory;
json["hash_size_in_video_memory"] = rpkgs.at(rpkg_index).hash.at(hash_index).data.resource.size_in_video_memory;
Expand Down
14 changes: 7 additions & 7 deletions src/generate_rpkg_from.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void rpkg_function::generate_rpkg_from(std::string& input_path, std::string& out
//temp_hash_data.hash_string = util::uint64_t_to_hex_string(meta_data.hash_value);
temp_hash_data.hash_resource_type = meta_data.hash_resource_type;
temp_hash_data.data.resource.reference_table_size = meta_data.data.resource.reference_table_size;
temp_hash_data.data.resource.reference_table_dummy = meta_data.data.resource.reference_table_dummy;
//temp_hash_data.data.resource.reference_table_dummy = meta_data.data.resource.reference_table_dummy;
temp_hash_data.data.resource.size_final = static_cast<uint32_t>(input_file_size);

if (meta_data.data.resource.size_in_memory == 0xFFFFFFFF) {
Expand All @@ -330,7 +330,7 @@ void rpkg_function::generate_rpkg_from(std::string& input_path, std::string& out
//temp_hash_data.hash_string = hash_strings.at(files_index.at(i));
temp_hash_data.hash_resource_type = hash_resource_types.at(files_index.at(i));
temp_hash_data.data.resource.reference_table_size = 0x0;
temp_hash_data.data.resource.reference_table_dummy = 0x0;
//temp_hash_data.data.resource.reference_table_dummy = 0x0;
temp_hash_data.data.resource.size_final = static_cast<uint32_t>(input_file_size);
temp_hash_data.data.resource.size_in_memory = static_cast<uint32_t>(compressed_size_final);
temp_hash_data.data.resource.size_in_video_memory = 0x0;
Expand Down Expand Up @@ -359,7 +359,7 @@ void rpkg_function::generate_rpkg_from(std::string& input_path, std::string& out
//temp_hash_data.hash_string = util::uint64_t_to_hex_string(meta_data.hash_value);
temp_hash_data.hash_resource_type = meta_data.hash_resource_type;
temp_hash_data.data.resource.reference_table_size = meta_data.data.resource.reference_table_size;
temp_hash_data.data.resource.reference_table_dummy = meta_data.data.resource.reference_table_dummy;
//temp_hash_data.data.resource.reference_table_dummy = meta_data.data.resource.reference_table_dummy;
temp_hash_data.data.resource.size_final = static_cast<uint32_t>(input_file_size);

if (meta_data.data.resource.size_in_memory == 0xFFFFFFFF) {
Expand All @@ -386,7 +386,7 @@ void rpkg_function::generate_rpkg_from(std::string& input_path, std::string& out
//temp_hash_data.hash_string = hash_strings.at(files_index.at(i));
temp_hash_data.hash_resource_type = hash_resource_types.at(files_index.at(i));
temp_hash_data.data.resource.reference_table_size = 0x0;
temp_hash_data.data.resource.reference_table_dummy = 0x0;
//temp_hash_data.data.resource.reference_table_dummy = 0x0;
temp_hash_data.data.resource.size_final = static_cast<uint32_t>(input_file_size);
temp_hash_data.data.resource.size_in_memory = static_cast<uint32_t>(input_file_size);
temp_hash_data.data.resource.size_in_video_memory = 0x0;
Expand Down Expand Up @@ -427,7 +427,7 @@ void rpkg_function::generate_rpkg_from(std::string& input_path, std::string& out
table_size = 0x0;

for (auto& j : temp_rpkg_data.hash) {
table_size += 0x18;
table_size += 0x14;
table_size += j.data.resource.reference_table_size;
}

Expand Down Expand Up @@ -565,8 +565,8 @@ void rpkg_function::generate_rpkg_from(std::string& input_path, std::string& out

std::memcpy(&char4, &temp_rpkg_data.hash.at(i).data.resource.reference_table_size, sizeof(uint32_t));
file.write(char4, sizeof(uint32_t));
std::memcpy(&char4, &temp_rpkg_data.hash.at(i).data.resource.reference_table_dummy, sizeof(uint32_t));
file.write(char4, sizeof(uint32_t));
//std::memcpy(&char4, &temp_rpkg_data.hash.at(i).data.resource.reference_table_dummy, sizeof(uint32_t));
//file.write(char4, sizeof(uint32_t));
std::memcpy(&char4, &temp_rpkg_data.hash.at(i).data.resource.size_final, sizeof(uint32_t));
file.write(char4, sizeof(uint32_t));
std::memcpy(&char4, &temp_rpkg_data.hash.at(i).data.resource.size_in_memory, sizeof(uint32_t));
Expand Down
2 changes: 1 addition & 1 deletion src/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class hash {
struct HashResource {
char resource_type[4];
uint32_t reference_table_size = 0;
uint32_t reference_table_dummy = 0;
//uint32_t reference_table_dummy = 0;
uint32_t size_final = 0;
uint32_t size_in_memory = 0;
uint32_t size_in_video_memory = 0;
Expand Down
10 changes: 5 additions & 5 deletions src/hash_meta_to_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ void rpkg_function::hash_meta_to_json(std::string& input_path) {
json_string += "\"hash_reference_table_size\":" +
util::uint32_t_to_string(meta_data.data.resource.reference_table_size) + ",";

meta_file.read(input, sizeof(bytes4));
std::memcpy(&bytes4, input, sizeof(bytes4));
meta_data.data.resource.reference_table_dummy = bytes4;
json_string += "\"hash_reference_table_dummy\":" +
util::uint32_t_to_string(meta_data.data.resource.reference_table_dummy) + ",";
//meta_file.read(input, sizeof(bytes4));
//std::memcpy(&bytes4, input, sizeof(bytes4));
//meta_data.data.resource.reference_table_dummy = bytes4;
//json_string += "\"hash_reference_table_dummy\":" +
// util::uint32_t_to_string(meta_data.data.resource.reference_table_dummy) + ",";

meta_file.read(input, sizeof(bytes4));
std::memcpy(&bytes4, input, sizeof(bytes4));
Expand Down
6 changes: 3 additions & 3 deletions src/import_hash_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ void rpkg_function::import_hash_meta(hash& meta_data, const std::string& hash_me
std::memcpy(&bytes4, input, sizeof(bytes4));
meta_data.data.resource.reference_table_size = bytes4;

meta_file.read(input, sizeof(bytes4));
std::memcpy(&bytes4, input, sizeof(bytes4));
meta_data.data.resource.reference_table_dummy = bytes4;
//meta_file.read(input, sizeof(bytes4));
//std::memcpy(&bytes4, input, sizeof(bytes4));
//meta_data.data.resource.reference_table_dummy = bytes4;

meta_file.read(input, sizeof(bytes4));
std::memcpy(&bytes4, input, sizeof(bytes4));
Expand Down
12 changes: 6 additions & 6 deletions src/import_hash_meta_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ bool rpkg_function::import_hash_meta_json(hash& meta_data, const std::string& in
}

// hash_reference_table_dummy
const rapidjson::Value& hash_reference_table_dummy = document["hash_reference_table_dummy"];
if (hash_reference_table_dummy.IsNull()) {
LOG("Error: hash_reference_table_dummy is missing from the JSON.");
return false;
}
meta_data.data.resource.reference_table_dummy = hash_reference_table_dummy.GetUint();
//const rapidjson::Value& hash_reference_table_dummy = document["hash_reference_table_dummy"];
//if (hash_reference_table_dummy.IsNull()) {
// LOG("Error: hash_reference_table_dummy is missing from the JSON.");
// return false;
//}
//meta_data.data.resource.reference_table_dummy = hash_reference_table_dummy.GetUint();

// hash_size_final
const rapidjson::Value& hash_size_final = document["hash_size_final"];
Expand Down
24 changes: 12 additions & 12 deletions src/json_to_hash_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,25 +150,25 @@ std::vector<char> rpkg_function::json_to_hash_meta(std::string& json_string) {
meta_data.push_back(j);
}

const rapidjson::Value& hash_reference_table_dummy = document["hash_reference_table_dummy"];
//const rapidjson::Value& hash_reference_table_dummy = document["hash_reference_table_dummy"];

if (hash_reference_table_dummy.IsNull()) {
LOG("Error: hash_reference_table_dummy is missing from the JSON.");
//if (hash_reference_table_dummy.IsNull()) {
// LOG("Error: hash_reference_table_dummy is missing from the JSON.");

response_string = "Error: hash_reference_table_dummy is missing from the JSON.";
// response_string = "Error: hash_reference_table_dummy is missing from the JSON.";

return {};
}
// return {};
//}

std::cout << hash_reference_table_dummy.GetUint() << std::endl;
//std::cout << hash_reference_table_dummy.GetUint() << std::endl;

temp_uint32_t = hash_reference_table_dummy.GetUint();
//temp_uint32_t = hash_reference_table_dummy.GetUint();

std::memcpy(&char4, &temp_uint32_t, 0x4);
//std::memcpy(&char4, &temp_uint32_t, 0x4);

for (char& j : char4) {
meta_data.push_back(j);
}
//for (char& j : char4) {
// meta_data.push_back(j);
//}

const rapidjson::Value& hash_size_final = document["hash_size_final"];

Expand Down
Loading
Loading