diff --git a/sample/string_obfs.cpp b/sample/string_obfs.cpp index 05a9410..1bb760b 100644 --- a/sample/string_obfs.cpp +++ b/sample/string_obfs.cpp @@ -3,11 +3,29 @@ #include template -constexpr char enc_xor(char c) { +constexpr char xor_(char c) { return c ^ key; } +template +constexpr char add(char c) { + return c + Key; +} + +template +constexpr char comp(char c) { + return f(g(c)); +} + int main() { - constexpr auto str = obfs::make_string, enc_xor<0x50>>("Hello World !"); + using table = obfs::make_table< + obfs::encoder_seq, add<10>, comp, add<10>>>, + obfs::decoder_seq, add<-10>, comp, xor_<0x50>>>>; + + std::cout << __TIME__ << std::endl; + std::cout << obfs::SEED << std::endl; + std::cout << obfs::RAND_VAL<__LINE__, 3> << std::endl; + + constexpr auto str = obfs::make_string("Hello World !"); std::cout << str.decode() << std::endl; } \ No newline at end of file