Why do C Programmers Always Obfuscate Their Code?
Вставка
- Опубліковано 25 тра 2024
- Streamed Live on Twitch: / tsoding
Enable Subtitles for Twitch Chat
References:
- a1k0n.net - Have a donut. - www.a1k0n.net/2006/09/15/obfu...
- binji - POKEGB: a gameboy emulator that only plays Pokémon blue - binji.github.io/posts/pokegb/
- Nothings - stb_c-lexer.h - github.com/nothings/stb/blob/...
- Tsoding Daily - Ridiculously Easy 3D in C (Color Quantization) - Color Quantization Stream: • Ridiculously Easy 3D i...
- Tsoding - conway.c - github.com/tsoding/conway
Support:
- BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9
- Pay for my VPS: zap-hosting.com/en/shop/donat... - Наука та технологія
3:04 "I'm going to compile this [...] to confirm that it, in fact, works."
*It doesn't work*
I felt that on a personal level
Have you seen the IOCCC (International Obfuscated C Code Contest). They do a bunch of stuff like this and format their code in really wonky ways!
I prefer the Underhanded C Contest, sadly it hasn't been held for years. It's about writing a program that looks fine, but has a deliberate exploitable vulnerability.
The fluid one is craaazy
Actually useful what the hell for it to stop being held if it teaches security vulnerabilities maybe it's a DevOp.
@@vytah That's just professional development.
@@vytah you might want to look into ctf challenge creation
1:06:10 John Convey's mouth just turned into gol's glider
lol that looked like that jesus restoration failure meme.
This video inspired me to write a C lexer that formats itself into frames of bad apple video ascii art.
Dude it is so cool
the only actually interesting programming channel posted again, we eating good
0:54 Hello Mr. Zoidberg
If you change "[%dA""\033[%dD" to "[%dA\033[%dD" (remove the "" in the middle) it would fit in the cube perfectly
As a representative of the Free Pascal Discord, we would actually really be grateful for your help, we've started work on a modern Pascal website so it would be great for us to have some help :p
I find the idea of putting the chat into the subtitles interesting, although it just confused me when I didn't quite understand something you said, so I enabled subtitles to get a clue and then got something that had nothing to do with what you said XD
I love that you can make c look like a dynamically typed language by simply only using one type and having that type be int
Anybody saying this is a great video must be a time traveler
It was actually streamed yesterday on Twitch. So quite a few people already watched it.
I just walked out of the shed
that's a banger i'm saving it for later
thanks zozin, enjoyed this video
Can your python do that?
I dont fkin think so
yes (using semi colons)
it can with semicolons
❤da python can do this😅
Yep, check out Evan Zhou
I adore your focus on C i am an Assembler Developer and you are so valuable!
"Marketing is comercial propaganda"
In portuguese at leat (probably other Latin languages as well), the words for "ad" and "propaganda" are the same (just "propaganda")
Anunçio
Sabe mt jovem
@@tSaturnquase
In the final code you have the second to last line overflowing on the right block by two characters and the string right in there is unecessarily split. So you could merge those two strings back together (just remove the two quotes in the middle) and that line would perfectly fit the block.
The moment I saw you're using Emacs I knew it would be a worthwhile video.
I really appreciate the video! Earlier you referenced that Gameboy and Pokemon Blue wasnt that familiar because different places exist in the world.
Thats fine... but you could bridge the gap by teaching people what the equivalent for you would be... instead of just leaving people to feel shamed for misunderstanding something
That was super cool. Thank you!
Lost it at the reference in the title. Great content creator work, third owner of zozzing
front and back can be declared with octal notation: f[010][020];b[010][020]; Then the other vars can be named f010, f020, b010, and b020.
"This is valid C," he says about constructs that have been invalid since C99
Too bad compilers have to support c89 and sometimes even older for compatibility
@@MatthisDayer They do, but modern GCC does not default to C89 mode and technically should not have accepted this
@@calebharper9567 GCC does default to a GCC compliance mode rather than standard. If you want, say, C99 compliance, you need to pass -std=c99 to GCC. The default is something gnuxx depending on GCC's version, but not strict standard compliance. Something to be aware of.
@@joseoncrack I'm aware. Just saying that if it was trying to be standards compliant, it shouldn't accept this without an explicit C89 argument. I would also argue that it shouldn't accept this in the default mode regardless, but that's another matter.
He compiled C code and it ran fine, seems pretty valid 😂
i wonder if you could get the conway picture to work if you messed with the brightness/contrast sliders
this is peak youtube programming content
Subtitles for Twitch Chat is quite a neat feature!
the font you use really matches the sound of your keyboard
maybe the reason it made convay look like he doesn't have hair, is because the app turned transparent background black, similar color to convay's hair
What's your discord link? Is it open for joining? Edit: Nvm. Found it on your twitch channel
Personally, I think a flying head is funnier than to include the shoulders. Something I was thinking about was you could embed ANSI escapes into the code, and use backspace commands to erase the opening comment characters and then move forward and overwrite the end characters, then set the color, repeat ad nauseam and then just cat'ing the file to the terminal would yield a colored image. Then you could just focus on formatting with 8 colors and embedding the escapes.
If Debian restricts you in that way, why not come to the dark side and use Slackware.
1:06:33 I think I met this guy at my local Vietnamese restaurant.
Maybe it would be better to find difference-between-colors values and draw tokens in their places or blanks instead. That way you preserve the lines of the face, which is more important than colors.
"DevOps should learn psyops" - my brother in Christ, how do you think we came to be
Potato Conway was the best, lol.
(Can help but to feel he is laughing somewhere.)
What's the tool being used to zoom to the cursor? (for example as in 1:31)
Nice video btw!!
it't called "boomer", you can check at his repo
the closed captions are just comments lol
i saw you promote your channel during sleep paralysis, that's what brought me here
On my first job I rewrote the whole legacy code of the project from C++ to Pascal.
Would've been interesting to remove the background using seam carving
Maybe quantize to 3 shades and then use the lighter chats like punctuation between fully filled and space
IIRC there was a kind of contest about the weirdest thing of writing code.
Looking to see how to put the donut in my motd when I log in to the terminal...
No entiendo nada pero me encantan tus videos 😅
La programación es muy interesante. Si desea aprender los conceptos básicos, vea el curso CS50 2023 de Harvard en freeCodeCamp. Qué buen profesor y si necesitas traducción, la descripción del video tiene escritos que puedes leer a un ritmo más lento.
Se un poco de programación y diría que soy junior, pero aún el idioma inglés no logro entenderlo 😁
Watched 10 min will watch rest in the morning good night
I learned Pascal before C but after 8-bit asm
I've heard, this is almost the best path. We have in Russia some guy, his name is Stolyarov, who wrote the book Introduction to (programmer) profession (3 volumes!) and he teaches programing in this order: Pascal, Assembler, C, then goes to Unix, paradigms, OOP. He says, Pascal is an excellent language for teaching and starting also because it cleanly introduces to some fundamental concepts. Also it unlike C clearly separates functions (those return values) and routines (which have side effects) and so sharpen mind for those important aspects. This is one of the reasons to learn Pascal before C.
@@RoadToFuture007 Yes, Pascal was a very good learning tool. Later Wirth languages were even better yet a bit more "modern" for that purpose, like Modula-2 and Oberon.
Beginning your learning journey with C is a mistake. But so is beginning with Python, which teaches you almost nothing fundamental about programming.
@@joseoncrack so which of those would you reccomend as starting languages: older Pascal or like you said more modern Wirth languages? Or something else?
@@RoadToFuture007 These are safe bets IMO. The thing with Oberon is that there are various dialects of it, and not many available compilers at all, although you can try OBNC which should build on most platforms. But it's a relatively small project. A more "robust" choice would probably be either Pascal (and the freepascal compiler is pretty good), or Modula-2, which is now supported as an official front-end by GCC! But even if you go the Pascal route, you don't need to settle for an "old " language, as freepascal does support Object Pascal/Delphi and of course there is Delphi itself which is still sold and still used in more commercial projects than you may think. These are versions of Pascal that support OOP and a lot of modern additions to the original Pascal, while keeping its spirit.
@@RoadToFuture007 as someone who uses Free Pascal, you've got everything from low level stuff to advanced OOP, we've evolved quite a bit :)
Out of principle I'd recommend Modula-2 or Oberon, but sadly no one uses those and you'll be isolated, so try Pascal, you won't regret it
What do you say about it, Python?
Братан, хорош, давай, вперёд! Контент в кайф, можно ещё? Вообще красавчик! Можно вот этого вот почаще?
soo classno! ❤️ it
You also could move the indexes of arrays before the arrays variables in loops. I'm not sure what combinations of that is legal for two dimensional arrays but a[b]==[b]a==b[a]==[a]b😅
now imagine it doing glider in its own code blocks instead of '#'!
Ruby also has a nice mod opperator
Because they can.
1:34:10 "It kinda worked but not really. Yeah, it actually, it didn't really work at all"
Thank you...
Can't wait for this to get fed to chat gpt
Yo man, I don't know if you've got specific people doing your subtitles but they are effing them up
Subtitles don't at all represent what you are saying in the video
It's the twitch chat from the livestream
@@A2music i thought so! I just didn't know, that's super sick! Thnx
subtitles broke ):
it's twitch chat
i have a question, what is porn folder?
Thank you for the small rage about AI revolution yet the tools being incapable of doing the basic things we ask for. AI has a danger of making humanity very very dumb. Let's hope we can counteract
it's self obfuscating
Only 40mins through but if there's not enough tokens you should unroll all of the loops 😂
not sure calling that code and donut obfuscated is quite right tho. It doesn't necessarily try to deliberately hide what it is actually doing. Sure names are mangled, but the logic is right there, plain and simple. I know - not a real language - but code like this is basically how you write fast(er) .js, tho in .js land no one cares about speed, so that's only used to reduce file size that goes with react.
what? the reason why code looks like this in js is because people use a build tool to minify the source code so there’s less data to send to the user. your variable names are turned to bytecode at runtime and have no impact on the speed of ur application after it has been parsed by the engine. it’s purposely written to be messy and unreadable (it’s code in the shape of a donut) and the author says so himself ”This was my first attempt at obfuscated C”
no one actually writes code like this because your coworkers actually want to be able to read it
@@scrung yes, except for the fact that reducing code to logical operations is faster in many cases, writing "helper" functions in this fashion opens the possibility of inlining them later without making resulting file huge, math is way faster this way etc (n | 0 instead of Math.floor(n) for example, not only faster by itself, but also no function call overhead).
Because they don't want anyone to learn from them
1:06:10 legit looks like something from analog horror
36:05 how about promoting your own language tailored for daily recreational programming?
I would love to see pascal streams.. 36:20 would be nice
My code is automatically obfuscated
Can someone explain how did he remove includes and his code worked fine?
Old C allows implicit declarations
@@Xotchkass why only old C? As I know in modern standards you can declare any function by yourself without using include. This based on fact that include directive just extends your code with all necessary declarations before even compiler will work.
@@Xotchkass does that mean he include stdio at the end or doesn’t need to include at all?
@@alymikky97you can't include in the end, but you can choose to not include it at all, if printf is all you need, you can give the function declaration yourself,as the include headers don't actually contain the function, they just contain the function signature which is called a function declaration.
You can simply do int printf(char *,...); Anywhere outside any functions before using the first printf statement . Compiler would probably warn you. But code would worl fine.
@@alymikky97GCC links with libc by default. It warns him for not knowing what printf is at compile time. But after linking with libc, where its "implementation"(compiled library code) lies, the program can run as usual. You can use -nostdlib flag to see the things the standard c library functions you were granted before(i.e. you will see the regular code fail).
Pascal OS stream confirmed????
Do OSs like it's Apple in the 80s
Maybe someone can give me a heads-up: I am developing computational software for ~10 years now. But I acknowledge that software development is spread much wider than my niche field of expertise. However, I often see the trend of people in information technology to get excited about completely useless stuff. And I wonder why that is. What is the mind-set? I have a hard time making sense of so many things because my questioning is always "what can I use it for? What can it compute? What questions can it answer that I couldnt answer before? What can it do better? What is the effort vs benefit ratio?" What questions drive those informatics enthusiasts (as I'd call them in lack for better words) instead?
You can't see the value in just writing code for art? Some people truly love reading code and seeing code composed and work in interesting ways. We should never lose the curiosity to always discover more in our hobbies because it can lead to something great.
It's fun.
Brother why is your CPU running at 100c 😭
To keep myself warm
it's cold in russia
Whaaaaat, Russia never caught the Poke mania!?
Kadyrov, the president of Chechen Republic once said, his spetsnaz caught all the Pokemons, so, no, no more Pokes in Russia!
The title of this feels like a click-bait lie.
Does he do leetcode streams?
you’re definitely going to be featured in a future stream now :p
@@ManavKaushal it's already a meme? What I miss..
D... do they?!.... but I've never!.... 😑😑😑
Answer: so they can keep their jobs and become unfirable
Hey men you seem very smart with C why not make a C full 38 hour course
Perl programmers be like: That looks completely normal to me.
Obfuscating? You mean strange formatting... Visual Studio Code would wreck all the formatting as soon as it's pasted or a newline is entered. Obfuscation is when you try to hide function pointers until runtime, including name mangling and other methods.
Average c programmer behaviour 0:52
C programmers I know eschew obfuscation. We use Perl or Python when we intend to obfuscate.
0:54
No, not the age of AI for search engines, it's the age of corporate greed, the founders of google have moved on to other things, even Gatsie isn't hanging around much. Why corporate greed though? Well if youu search and find what you want, how many adds have you possibly looked at? But, if it takes you a long time to find what you want, potentially never finding it, you just keep runing searches. Kind of brilliant if you're a corporate idiot who only cares about the next year or 2. I think it's time to write an opensource search engine.
37:30 Propaganda used to be just a synonym for advertisement.
56.1GB P*rn folder... i think it's too smol...
Hello, Sailor 😒😒😒😒
Hello from India
namaskaram
Hello from USA
Next time just grep your /home/streamer/Programming/tsoding/ and you will find it faster
Gop
52:19 Debian ? the same ones crying because of the name of Gimp ?
I do agree their code is пакетик!!!
pathetic
1:06:13 😂
Эх, а на русском никто не пишет :(
Какой родной милый акцент... 😉
They don't. Saved you 2 hours
what obfuscate even means
make something hard to understand
sdaoisifsoadsadosahud
make difficult to read by trying to hide/obscure parts of it
It means to hide in a way that doesn't hide it completely.
super abbreaviate everything to make things unreadable and make you look smarter
Братик, я недавно смотрю твой канал, скажи пожалуйста, почему ты вещаешь на английском? Это такая форма протеста?
Больше аудитория и все, не надо политоту везде приписывать
@@plushrei5926 спасибо за ответ)) я без злости спросил)
He's been making videos for many years
Прежде всего это красиво....
@@Fusjgaprocnzmfjspejx че это вдруг?)
51:31 I hate Debian, stupid dictators telling you what you can or can't do.
I always have problems when I want to install 2 versions of the same library, can't have that, it "wastes" space, so you get rekt wil "DLL hell" because of it.
I'm purging that crap from all my servers. I now use Fedora.
Also, they're woke (the debian ones, the fedora I don't know, they're probably boomers so theyre no woke, that's less bad).
Why do you care if they're "woke" (I am not sure how they're woke...?)? This is a nothing burger, bring something better
@@stefanalecu9532 I don't care, I just find it funny.
Every corporation uses Woke as a deflecting shield against any accountability for their actions, and lack of honesty.
Its so clear now that they're going that, meanwhile the old contributors left the ship, everything is becoming shit, water is entering, the ship is sinking.
I'm just seeing correlations based on observation, I don't care, I just find it amusing that when big corporations start sinking they become woke.
I'm not saying its cause and effect either.
I really don't care, I don't use Debian anymore.
@@stefanalecu9532 We should all care since it's a sign that someone is mentally ill.
printf("%c", ".#"[front[x][y]];
feels kinda enlightening
printf("%c", *(*(*(front + x) + y) + ".#"));
That’s a torus 🥹