From 96c3974f4ca4a5caeb35d2dc049fe03e085eff42 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 19:44:47 +0000 Subject: [PATCH] Decompile fn_17830 (SanitizeScreenshotName) Batch #1616 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_17830 SanitizeScreenshotName: logic confirmed by peer review Reviewed-by: ragnarok-clanker Adds to the build: Source/Client/ModeScreenshot.cpp --- Source/Client/ModeScreenshot.cpp | 12 ++++++++++++ Source/Client/ModeScreenshot.h | 8 ++++++++ data/compile.json | 1 + 3 files changed, 21 insertions(+) create mode 100644 Source/Client/ModeScreenshot.cpp create mode 100644 Source/Client/ModeScreenshot.h diff --git a/Source/Client/ModeScreenshot.cpp b/Source/Client/ModeScreenshot.cpp new file mode 100644 index 0000000..85eb644 --- /dev/null +++ b/Source/Client/ModeScreenshot.cpp @@ -0,0 +1,12 @@ +#include "Client/ModeScreenshot.h" + +// OFFSET: 0x00AD63F0 +// FUNCTION: fn_17830 +void SanitizeScreenshotName(std::string& name) { + for (std::size_t i = 0; i < name.size(); ++i) { + const char c = name[i]; + if (c == '\\' || c == '/' || c == ':' || c == '*' || c == '?' || c == '"' || c == '<' || c == '>' || c == '|') { + name[i] = '_'; + } + } +} diff --git a/Source/Client/ModeScreenshot.h b/Source/Client/ModeScreenshot.h new file mode 100644 index 0000000..71a1250 --- /dev/null +++ b/Source/Client/ModeScreenshot.h @@ -0,0 +1,8 @@ +#ifndef RAGNAROK_SOURCE_CLIENT_MODESCREENSHOT_H +#define RAGNAROK_SOURCE_CLIENT_MODESCREENSHOT_H + +#include + +void SanitizeScreenshotName(std::string& name); + +#endif diff --git a/data/compile.json b/data/compile.json index 3e6b785..37a9adf 100644 --- a/data/compile.json +++ b/data/compile.json @@ -260,6 +260,7 @@ "Source/Client/ModeBaseEvents.cpp": 0, "Source/Client/ModeFade.cpp": 0, "Source/Client/ModeFadeOut.cpp": 0, + "Source/Client/ModeScreenshot.cpp": 0, "Source/Client/ModeTransitions.cpp": 0, "Source/Client/Registry.cpp": 0, "Source/Client/Replay.cpp": 0,