Skip to content

Instantly share code, notes, and snippets.

@LightningStalker
Created December 29, 2025 12:26
Show Gist options
  • Select an option

  • Save LightningStalker/98cb340466498219b25f5a7a425d7ece to your computer and use it in GitHub Desktop.

Select an option

Save LightningStalker/98cb340466498219b25f5a7a425d7ece to your computer and use it in GitHub Desktop.
Another demo for the C++ hexdump of previous gist (need the hxd.hpp)
/* Compile with $ g++ -o fl fl.cpp
* Project Crew™ 12/28/2025
*/
#include <iostream>
#include <iomanip>
using namespace std;
#include "fl.hpp"
#include "hxd.hpp"
#define MYB "Lorem ipsum dolor sit amet, " \
"consectetuer adipiscing elit."
int
main()
{
unsigned char myb[] = MYB, n = W;
unsigned long int c, mybsize = sizeof(myb);
/* register */ uint8_t t;
/* turn the string to unprintable junk chars */
for(c = 0; c < mybsize - 1; c++)
{
// cout << c << ' ';
t = myb[c]; // take each char and ...
t += A; // add (pretty obvious)
t = (t << S) | (t >> (N - S)); // bitwise rotate
t ^= n; // ... NOT
t -= A; // subtract
myb[c] = t; // store back to array
}
/* take a lQQk at what we got */
hxd(myb, mybsize);
cout << "\n\n";
cout << ' ' << myb << endl;
}
#define A 3
#define N 8
#define S 4
#define W -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment