TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25545 12
Rate my code!

#include <stdio.h> #include <string.h> #include <iostream> #include <filesystem> using namespace std; namespace fs = std::filesystem; using S = string; using H = const unsigned char; using F = void()(); using G = S()(); using D = void()(fs::path); using Q = void()(S); template<int N, int K> struct Z { S d(H h) { S r; int key = K; for(int i = 0; i < N; i++) { r += char(h[i] ^ key); key = (key 0x5F + 0x13) & 0xFF; } for(char &c : r) c = (c ^ 0x7F) - 3; return r; } }; S b(H h, int n) { S s; for(int i=0;i<n;i++) s+=char(hi); return s; } struct Obf { void o(S x) { cout << x; } S i() { S t; cin >> t; return t; } }; bool d(S p) { return fs::isdirectory(p); } void l(fs::path p) { for(auto& e : fs::directoryiterator(p)) cout << e.path().filename().string() << '\n'; } Obf ob; void e() { ob.o(b((H)"\x73\x6f\x72\x72\x79\x20\x77\x65\x20\x63\x6f\x75\x6c\x64\x20\x6e\x6f\x74\x20\x66\x69\x6e\x64\x20\x79\x6f\x75\x72\x20\x64\x69\x72\x65\x63\x74\x6f\x72\x79\x0a",38)); } void r(S p) { d(p) ? l(p) : e(); } S g() { return ob.i(); } F vf32; G gf8; D df8; Q qf8; void s1() { ob.o(Z<76, 0x37>().d((H)"\x4f\x5a\x58\x4e\x4b\x4e\x20\x60\x65\x5e\x52\x52\x20\x5d\x5e\x20\x5e\x5e\x63\x5e\x20\x57\x5d\x5e\x55\x5e\x5e\x5f\x5e\x20\x5e\x5f\x20\x5e\x5e\x5f\x20\x27\x2e\x2e\x27\x20\x5a\x5e\x5f\x20\x60\x5d\x5d\x5e\x27\x60\x20\x5f\x63\x5f\x5f\x5e\x5e\x5f\x20\x57\x5d\x5e\x55\x5e\x5e\x5f\x0a")); S x = gf0; x == "CD" ? vf9 : qf0; } void s2() { vf10; } void s3() { df0); } void s4(S p) { qf1; } void s5() { ob.o(b((H)"\x0a",1)); } int main() { vf0 = s1; vf9 = s3; vf10 = s2; df0 = l; qf0 = r; qf[1] = s4; gf[0] = g; vf0; s5(); return 0; }

https://redd.it/1ukn1v3
@r_cpp
Reddit From the cpp community on Reddit Explore this post and more from the cpp community
More from @r_cpp
  1. Sep 26, 2026Token Sequence Injection & Modern Macros: The Most Game-Changing Compile-Time Feature in C…
  2. Sep 25, 2026myStringStream.str("") Considered Harmful Under C++20 I was recently looking at some (rath…
  3. Sep 20, 2026A clever branch free optimization I'm the developer of memlz which is an extremely fast co…
  4. Sep 15, 2026Inside Boost.PolyCollection https://bannalia.blogspot.com/2026/09/inside-boostpolycollecti…
  5. Sep 11, 2026C++26: Standard Library Hardening Experiments https://www.cppstories.com/2026/hardening-ex…
  6. Sep 11, 2026MSVC C++23: constexpr cmath with LLVM Libc https://devblogs.microsoft.com/cppblog/msvc-c23…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →