use fmt.dev's fmt::print functions, factor out command line functions from main to cli.cpp
This commit is contained in:
12
src/header.h
12
src/header.h
@@ -19,10 +19,12 @@
|
||||
#include <random>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <openssl/bn.h>
|
||||
@@ -52,6 +54,9 @@
|
||||
#define BYDWORD(n) (DWORD)(*((n) + 0) | *((n) + 1) << 8 | *((n) + 2) << 16 | *((n) + 3) << 24)
|
||||
#define BITMASK(n) ((1ULL << (n)) - 1)
|
||||
|
||||
using json = nlohmann::json;
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
// Confirmation ID generator constants
|
||||
#define SUCCESS 0
|
||||
#define ERR_TOO_SHORT 1
|
||||
@@ -98,14 +103,17 @@ void print_product_id(DWORD *pid);
|
||||
struct Options {
|
||||
std::string binkid;
|
||||
int channelID;
|
||||
std::string keysFilename;
|
||||
bool verbose;
|
||||
bool help;
|
||||
bool list;
|
||||
bool error;
|
||||
};
|
||||
|
||||
Options parseCommandLine(int argc, char* argv[]);
|
||||
void showHelp(char *argv[]);
|
||||
int parseCommandLine(int argc, char* argv[], Options* output);
|
||||
int validateCommandLine(Options* options, char* argv[], json* output);
|
||||
void showHelp(char* argv[]);
|
||||
bool loadJSON(const fs::path& filename, json *output);
|
||||
|
||||
// xp.cpp
|
||||
bool verifyXPKey(
|
||||
|
||||
Reference in New Issue
Block a user