Return to site

A few lines code, Just for fun.

Magic Number

Show the code first.

#include <stdio.h>
#include <stdlib.h>
//Magic number 65 (A)
typedef unsigned long u64;

typedef void enc_cfg_t;
typedef int enc_cfg2_t;
typedef __int128_t dcf_t;

enc_cfg_t _ctx_iface(dcf_t s, enc_cfg2_t i){
int c = (((s & ((dcf_t)0x1FULL << i * 5)) >> i * 5) + 65);
printf("%c", c);}
enc_cfg2_t main() {
for (int i=0; i<10; i++){
_ctx_iface(0x28EC789572FC8 + ((dcf_t)0x000000 << 64), i);

Now it's explanation.

It's pretty simple. As we can see, there's a magic number (65).Yes, right, that's A on ASCII. All the thing is just add numers to offset, for outputting string.

0x79481E6BBCC01223 + ((dcf_t)0x1222DC << 64)

More detail, the offset is caculated by 0x1FULL. Every time obtain 5 digits from the above number from lower order. The 5 digit binary would be the offset.

Learned from Silicon Valley HBO Season 3 Episode 1.

All Posts

Almost done…

We just sent you an email. Please click the link in the email to confirm your subscription!