mirror of
https://github.com/revsic/cpp-obfuscator
synced 2026-06-08 17:08:30 +00:00
obfs, rand: Add sample for random generator
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@
|
||||
#define COMPILE_TIME_SEQUENCE
|
||||
#define OBFS_FINITE_STATE_MACHINE
|
||||
#define COMPILE_TIME_RANDOM
|
||||
#define MAKE_RAND_VAL(MOD) RAND_VAL<__LINE__, MOD>
|
||||
#define MAKE_RAND_VAL(MOD) obfs::RAND_VAL<__LINE__, MOD>
|
||||
#define OBFS_STRING
|
||||
#define MAKE_STRING(Var, String, ...) constexpr auto Var = obfs::make_string<__VA_ARGS__>(String);
|
||||
|
||||
|
||||
@@ -42,6 +42,6 @@ namespace obfs {
|
||||
constexpr size_t RAND_VAL = Xorshiftplus<SEED, Idx>::value % Mod;
|
||||
}
|
||||
|
||||
#define MAKE_RAND_VAL(MOD) RAND_VAL<__LINE__, MOD>
|
||||
#define MAKE_RAND_VAL(MOD) obfs::RAND_VAL<__LINE__, MOD>
|
||||
|
||||
#endif
|
||||
@@ -4,3 +4,4 @@ project(sample)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
add_executable(string_obfs string_obfs.cpp)
|
||||
add_executable(state_machine state_machine.cpp)
|
||||
add_executable(random random.cpp)
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "../obfuscator.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << MAKE_RAND_VAL(100) << std::endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user