SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
VICE.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <span>
5#include <string_view>
6#include <vector>
7
8namespace vcryptpp::VICE {
9
10// https://developer.valvesoftware.com/wiki/ICE
11// https://developer.valvesoftware.com/wiki/Encrypted_Key_Values
12// https://wiki.alliedmods.net/Vice_keys
13namespace KnownCodes {
14
15constexpr std::string_view DEFAULT = "x9Ke0BY7";
16constexpr std::string_view BLOODY_GOOD_TIME = "K4PeJwL7";
17constexpr std::string_view CONTAGION_WEAPONS = "fUk0fF69";
18constexpr std::string_view CONTAGION_SCRIPTS = "5!rrFz6p";
19constexpr std::string_view COUNTER_STRIKE_SOURCE = "d7NSuLq2";
22constexpr std::string_view COUNTER_STRIKE_PROMOD = "H1aRQ0n1";
23constexpr std::string_view DAY_OF_DEFEAT_SOURCE = "Wl0u5B3F";
24constexpr std::string_view DYSTOPIA_1_2 = "pH3apO8w";
25constexpr std::string_view DYSTOPIA_1_3 = "G8stUh3F";
26constexpr std::string_view FORTRESS_FOREVER_PRE_GREENLIGHT = "saxEWr5v";
27constexpr std::string_view GOLDEN_EYE_SOURCE = "Gr3naDes";
28constexpr std::string_view HALF_LIFE_2_CTF = "R1dj3axP";
29constexpr std::string_view HALF_LIFE_2_DM = DEFAULT;
30constexpr std::string_view INSURGENCY = "DrA5e3EB";
31constexpr std::string_view LEFT_4_DEAD_2 = "SDhfi878";
32constexpr std::string_view NO_MORE_ROOM_IN_HELL = "lREeeapA";
33constexpr std::string_view NUCLEAR_DAWN = "TA+*veh9";
34constexpr std::string_view TACTICAL_INTERVENTION = "71B4Dt1Z";
35constexpr std::string_view TEAM_FORTRESS_2 = "E2NcUkG2";
36constexpr std::string_view TEAM_FORTRESS_2_ITEMS = "A5fSXbf7";
37constexpr std::string_view THE_SHIP = "eb3A4m79";
38constexpr std::string_view ZOMBIE_PANIC_SOURCE = "5R0ni0pZ";
39
40constexpr std::string_view GPU_DEFAULT = "X8bU2qll";
41constexpr std::string_view GPU_ALIEN_SWARM = "sW9.JupP";
42constexpr std::string_view GPU_DOTA_2 = "dAIt1IL!";
43constexpr std::string_view GPU_HALF_LIFE_2_EPISODE_2 = "Xx81uBl)";
44constexpr std::string_view GPU_LEFT_4_DEAD_1 = "zp14Hi(]";
45constexpr std::string_view GPU_LEFT_4_DEAD_2 = GPU_LEFT_4_DEAD_1;
46constexpr std::string_view GPU_PORTAL_2 = "UrE66!Ap";
47constexpr std::string_view GPU_TEAM_FORTRESS_2 = TEAM_FORTRESS_2;
48
49} // namespace KnownCodes
50
51[[nodiscard]] std::vector<std::byte> encrypt(std::span<const std::byte> data, std::string_view code = KnownCodes::DEFAULT);
52
53[[nodiscard]] std::vector<std::byte> decrypt(std::span<const std::byte> data, std::string_view code = KnownCodes::DEFAULT);
54
55} // namespace vcryptpp::VICE
constexpr std::string_view DYSTOPIA_1_3
Definition: VICE.h:25
constexpr std::string_view GPU_ALIEN_SWARM
Definition: VICE.h:41
constexpr std::string_view CONTAGION_SCRIPTS
Definition: VICE.h:18
constexpr std::string_view GPU_TEAM_FORTRESS_2
Definition: VICE.h:47
constexpr std::string_view NO_MORE_ROOM_IN_HELL
Definition: VICE.h:32
constexpr std::string_view GPU_LEFT_4_DEAD_2
Definition: VICE.h:45
constexpr std::string_view DYSTOPIA_1_2
Definition: VICE.h:24
constexpr std::string_view GPU_HALF_LIFE_2_EPISODE_2
Definition: VICE.h:43
constexpr std::string_view HALF_LIFE_2_CTF
Definition: VICE.h:28
constexpr std::string_view COUNTER_STRIKE_SOURCE
Definition: VICE.h:19
constexpr std::string_view COUNTER_STRIKE_PROMOD
Definition: VICE.h:22
constexpr std::string_view GPU_DEFAULT
Definition: VICE.h:40
constexpr std::string_view COUNTER_STRIKE_GLOBAL_OFFENSIVE
Definition: VICE.h:20
constexpr std::string_view GPU_DOTA_2
Definition: VICE.h:42
constexpr std::string_view DAY_OF_DEFEAT_SOURCE
Definition: VICE.h:23
constexpr std::string_view DEFAULT
Definition: VICE.h:15
constexpr std::string_view GPU_PORTAL_2
Definition: VICE.h:46
constexpr std::string_view THE_SHIP
Definition: VICE.h:37
constexpr std::string_view ZOMBIE_PANIC_SOURCE
Definition: VICE.h:38
constexpr std::string_view TEAM_FORTRESS_2_ITEMS
Definition: VICE.h:36
constexpr std::string_view INSURGENCY
Definition: VICE.h:30
constexpr std::string_view TEAM_FORTRESS_2
Definition: VICE.h:35
constexpr std::string_view HALF_LIFE_2_DM
Definition: VICE.h:29
constexpr std::string_view COUNTER_STRIKE_2
Definition: VICE.h:21
constexpr std::string_view CONTAGION_WEAPONS
Definition: VICE.h:17
constexpr std::string_view BLOODY_GOOD_TIME
Definition: VICE.h:16
constexpr std::string_view NUCLEAR_DAWN
Definition: VICE.h:33
constexpr std::string_view FORTRESS_FOREVER_PRE_GREENLIGHT
Definition: VICE.h:26
constexpr std::string_view GOLDEN_EYE_SOURCE
Definition: VICE.h:27
constexpr std::string_view LEFT_4_DEAD_2
Definition: VICE.h:31
constexpr std::string_view GPU_LEFT_4_DEAD_1
Definition: VICE.h:44
constexpr std::string_view TACTICAL_INTERVENTION
Definition: VICE.h:34
std::vector< std::byte > decrypt(std::span< const std::byte > data, std::string_view code=KnownCodes::DEFAULT)
Definition: VICE.cpp:48
std::vector< std::byte > encrypt(std::span< const std::byte > data, std::string_view code=KnownCodes::DEFAULT)
Definition: VICE.cpp:44