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 GOLDEN_EYE_SOURCE = "Gr3naDes";
27constexpr std::string_view HALF_LIFE_2_CTF = "R1dj3axP";
28constexpr std::string_view HALF_LIFE_2_DM = DEFAULT;
29constexpr std::string_view INSURGENCY = "DrA5e3EB";
30constexpr std::string_view LEFT_4_DEAD_2 = "SDhfi878";
31constexpr std::string_view NO_MORE_ROOM_IN_HELL = "lREeeapA";
32constexpr std::string_view NUCLEAR_DAWN = "TA+*veh9";
33constexpr std::string_view TACTICAL_INTERVENTION = "71B4Dt1Z";
34constexpr std::string_view TEAM_FORTRESS_2 = "E2NcUkG2";
35constexpr std::string_view TEAM_FORTRESS_2_ITEMS = "A5fSXbf7";
36constexpr std::string_view THE_SHIP = "eb3A4m79";
37constexpr std::string_view ZOMBIE_PANIC_SOURCE = "5R0ni0pZ";
38
39constexpr std::string_view EKV_GPU_DEFAULT = "X8bU2qll";
40constexpr std::string_view EKV_GPU_ALIEN_SWARM = "sW9.JupP";
41constexpr std::string_view EKV_GPU_LEFT_4_DEAD_1 = "zp14Hi(]";
42constexpr std::string_view EKV_GPU_LEFT_4_DEAD_2 = EKV_GPU_LEFT_4_DEAD_1;
43constexpr std::string_view EKV_GPU_PORTAL_2 = "UrE66!Ap";
44
45} // namespace KnownCodes
46
47[[nodiscard]] std::vector<std::byte> encrypt(std::span<const std::byte> data, std::string_view code = KnownCodes::DEFAULT);
48
49[[nodiscard]] std::vector<std::byte> decrypt(std::span<const std::byte> data, std::string_view code = KnownCodes::DEFAULT);
50
51} // namespace vcryptpp::VICE
constexpr std::string_view DYSTOPIA_1_3
Definition: VICE.h:25
constexpr std::string_view EKV_GPU_LEFT_4_DEAD_2
Definition: VICE.h:42
constexpr std::string_view CONTAGION_SCRIPTS
Definition: VICE.h:18
constexpr std::string_view NO_MORE_ROOM_IN_HELL
Definition: VICE.h:31
constexpr std::string_view DYSTOPIA_1_2
Definition: VICE.h:24
constexpr std::string_view HALF_LIFE_2_CTF
Definition: VICE.h:27
constexpr std::string_view COUNTER_STRIKE_SOURCE
Definition: VICE.h:19
constexpr std::string_view EKV_GPU_DEFAULT
Definition: VICE.h:39
constexpr std::string_view COUNTER_STRIKE_PROMOD
Definition: VICE.h:22
constexpr std::string_view COUNTER_STRIKE_GLOBAL_OFFENSIVE
Definition: VICE.h:20
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 EKV_GPU_LEFT_4_DEAD_1
Definition: VICE.h:41
constexpr std::string_view EKV_GPU_PORTAL_2
Definition: VICE.h:43
constexpr std::string_view THE_SHIP
Definition: VICE.h:36
constexpr std::string_view ZOMBIE_PANIC_SOURCE
Definition: VICE.h:37
constexpr std::string_view TEAM_FORTRESS_2_ITEMS
Definition: VICE.h:35
constexpr std::string_view INSURGENCY
Definition: VICE.h:29
constexpr std::string_view TEAM_FORTRESS_2
Definition: VICE.h:34
constexpr std::string_view HALF_LIFE_2_DM
Definition: VICE.h:28
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 EKV_GPU_ALIEN_SWARM
Definition: VICE.h:40
constexpr std::string_view BLOODY_GOOD_TIME
Definition: VICE.h:16
constexpr std::string_view NUCLEAR_DAWN
Definition: VICE.h:32
constexpr std::string_view GOLDEN_EYE_SOURCE
Definition: VICE.h:26
constexpr std::string_view LEFT_4_DEAD_2
Definition: VICE.h:30
constexpr std::string_view TACTICAL_INTERVENTION
Definition: VICE.h:33
std::vector< std::byte > decrypt(std::span< const std::byte > data, std::string_view code=KnownCodes::DEFAULT)
Definition: VICE.cpp:44
std::vector< std::byte > encrypt(std::span< const std::byte > data, std::string_view code=KnownCodes::DEFAULT)
Definition: VICE.cpp:40