Skip to content

Instantly share code, notes, and snippets.

@PAMinerva
PAMinerva / WinProdKey.cpp
Last active February 2, 2025 09:00
Get Windows Product Key
#include <windows.h>
#include <iostream>
#include <vector>
#include <string>
static constexpr const int start = 52;
static const std::string digits = "BCDFGHJKMPQRTVWXY2346789";
// The Microsoft Windows product key is hidden in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion,
// which is base24-encoded & encrypted in a binary string.
@PAMinerva
PAMinerva / strToTp.cpp
Created January 25, 2025 08:18 — forked from franklinjr12/strToTp.cpp
C++ string to date (time_point)
#include <iostream>
#include <chrono>
#include <sstream>
#include <iomanip>
#include <format>
using namespace std;
using namespace std::chrono;
system_clock::time_point strToTp(string dateString)
@PAMinerva
PAMinerva / strconv.cpp
Last active January 17, 2025 18:49
Convert between std::string and std::wstring without using deprecated functionalities
#include "strconv.h"
// Per comprendere meglio il funzionamento di queste funzioni, si consiglia di leggere:
// https://en.wikipedia.org/wiki/UTF-8
// https://en.wikipedia.org/wiki/UTF-16
// https://en.wikipedia.org/wiki/UTF-32
// UTF-8 encodes code points in one to four bytes, depending on the value of the code point.