From 40221c326851f2fe7355fac36d1a40f14d3e2e2f Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 00:57:25 +0000 Subject: [PATCH] Decompile fn_09683 (CSkinMgr::Prepare) Batch #11502 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_09683 CSkinMgr::Prepare: logic confirmed by peer review Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/SkinInfo.cpp | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/Source/Contents/SkinInfo.cpp b/Source/Contents/SkinInfo.cpp index 83d08c97..46bb785f 100644 --- a/Source/Contents/SkinInfo.cpp +++ b/Source/Contents/SkinInfo.cpp @@ -2,6 +2,7 @@ #include "Resource/ResourceMgr.h" #include +#include #include #include #include @@ -59,25 +60,37 @@ void CSkinMgr::Prepare() { return; } - char directory[2048]; - std::sprintf(directory, "%s\\_tmpskin_", g_applicationDirectory); - const std::string target = std::string(directory) + "\\" + this->names[this->selected]; - - if (_access(target.c_str(), 0) == 0) { + char path[2048]; + std::sprintf(path, "%s\\_tmpskin_", g_applicationDirectory); + std::strcat(path, "\\"); + std::strcat(path, this->names[this->selected].c_str()); + if (_access(path, 0) == 0) { return; } - if (_access(directory, 0) != 0 && _mkdir(directory) != 0) { + std::sprintf(path, "%s\\_tmpskin_", g_applicationDirectory); + if (_access(path, 0) != 0 && _mkdir(path) != 0) { return; } - if (_access(target.c_str(), 0) != 0 && _mkdir(target.c_str()) != 0) { + std::sprintf(path, "%s\\_tmpskin_", g_applicationDirectory); + std::strcat(path, "\\"); + std::strcat(path, this->names[this->selected].c_str()); + if (_access(path, 0) != 0 && _mkdir(path) != 0) { return; } - const std::string input = std::string("skin/") + this->names[this->selected]; - const std::string output = std::string("_tmpskin_/") + this->names[this->selected]; - _spawnl(_P_WAIT, "runzip.exe", "runzip.exe", "-n", input.c_str(), "-d", output.c_str(), nullptr); + char noOverwrite[128]; + char input[128]; + char directoryOption[128]; + char output[128]; + std::strcpy(noOverwrite, "-n"); + std::strcpy(input, "skin/"); + std::strcat(input, this->names[this->selected].c_str()); + std::strcpy(directoryOption, "-d"); + std::strcpy(output, "_tmpskin_/"); + std::strcat(output, this->names[this->selected].c_str()); + _spawnl(_P_WAIT, "runzip.exe", "runzip.exe", noOverwrite, input, directoryOption, output, nullptr); this->prepared[this->selected] = 1; }