What is the Smallest Possible .EXE?

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 1 тис.

  • @shortcat
    @shortcat 4 місяці тому +2229

    "I’m not sure typing simulator would become a best seller on Steam."
    You'd be surprised what's taking over Steam tops these days...

    • @cerulity32k
      @cerulity32k 4 місяці тому +187

      banana

    • @pepsiman9093
      @pepsiman9093 4 місяці тому +84

      banana

    • @blarghblargh
      @blarghblargh 4 місяці тому +49

      terracotta

    • @mjdevlog
      @mjdevlog 4 місяці тому +39

      banana click simulator?

    • @pepsiman9093
      @pepsiman9093 4 місяці тому

      @@mjdevlog yeah, it basically just exists to make money off the item trading system on steam

  • @qwerty11111122
    @qwerty11111122 4 місяці тому +858

    17:46 bad video for security. Now the number of executables is finite and we can brute force through all of the 2^2^34 executables to find all of the penetration vectors.

    • @lunabell-2
      @lunabell-2 4 місяці тому +86

      only for windows. unix/linux-based systems are still safe (but for how long?)

    • @v84l42
      @v84l42 4 місяці тому +4

      huh?

    • @samuelthecamel
      @samuelthecamel 4 місяці тому +203

      Good idea. I'm sure this calculation will complete before the heat death of the universe

    • @SG_01
      @SG_01 4 місяці тому +94

      While you're at it, you can figure out all the valid versions of Doom are in there ^^

    • @yigawaffle
      @yigawaffle 4 місяці тому +8

      @@samuelthecamel Well, it probably would. As technological advancements are constantly happening, once we have, per say, consumer-grade quantum computers, we just write the program, sit back, and enjoy.

  • @JJFX-
    @JJFX- 4 місяці тому +457

    Fun fact: That "MZ" required at the beginning of the header stands for Mark Zbikowski, who is credited with creating the .exe file format at Microsoft.

    • @RvnKnight
      @RvnKnight 2 місяці тому +19

      Yep, but sadly most IT/Is people never learn it unless they have the right class and right instructors.

    • @JJFX-
      @JJFX- 2 місяці тому +17

      @@RvnKnight Well I've taken no such official classes. Just an obsessive need to learn the 'why' as much as the 'how' and whatever experience comes from having to find my own way through this never-ending cave.

    • @RvnKnight
      @RvnKnight 2 місяці тому +2

      @@JJFX- Hence 'most*, not 'all'.

    • @delphicdescant
      @delphicdescant 2 місяці тому +19

      @@RvnKnight I don't think it's that sad that people aren't aware of the MZ standing for Mike Wazowski. It's pretty much the most useless trivia imaginable.

    • @RvnKnight
      @RvnKnight 2 місяці тому +5

      @@delphicdescant That's your opinion and you are entitled to it.

  • @araghon007
    @araghon007 4 місяці тому +959

    When I started watching, I somehow only expected the usual "overlapping the DOS and PE headers" and hello world message box, didn't expect you to enter the

    • @TheSulross
      @TheSulross 4 місяці тому +34

      Clearly the video failed hugely on its stated objective to create smallest possible .EXE. Have to give a grade of F for that reason.

    • @128Gigabytes
      @128Gigabytes 4 місяці тому +57

      @@TheSulross thats stupid, he found out how small it could be and then went on to, after answering the question, making something else related to the same topic, which again happened after answering the main question

    • @RoganGunn
      @RoganGunn 4 місяці тому +12

      @@128Gigabytes Sarcasm detection failure detected 👀😁

    • @sonicSnap
      @sonicSnap 3 місяці тому +7

      @@RoganGunn it very clearly isn't sarcasm based on context clues

    • @timmygilbert4102
      @timmygilbert4102 3 місяці тому +9

      F is the highest grade in the hexadecimal scale ⚖️ 😂

  • @darkarchon
    @darkarchon 4 місяці тому +2537

    Just to be pedantic, the first file isn't actually 0 bytes. But its contents are!

    • @HeyImSolace
      @HeyImSolace 4 місяці тому +181

      But the file is nothing but its contents. Unless you're considering the directory entry of the file system part of the file, in which case you would also need to consider the filename and all the files metadata part of it. To my knowledge it isn't though. Directory structure is kept completely separate from file contents

    • @mars5train601
      @mars5train601 4 місяці тому +327

      ​@@HeyImSolaceFiles on your computer are stored with overhead. Some tools will tell you your file has a size of x bytes, and a size on disk of y bytes.
      This difference will exist even if the contents are 0bytes, since usually the system reserves a section of disk for it.
      This difference is op's 'being pedantic'

    • @albi2k88
      @albi2k88 4 місяці тому +21

      O Archon się tu zjawił.

    • @HeyImSolace
      @HeyImSolace 4 місяці тому +56

      @@mars5train601 I know that this overhead exists, but this overhead is not part of the file. This is like saying a Google search result is part of a Website. It takes up space, but it's not part of the website itself, it merely shows some data of it (Title and a little preview) and points to where it is (its web address).

    • @qwerty11111122
      @qwerty11111122 4 місяці тому +14

      ​@HeyImSolace nah, thats the difference in memory vs storage.
      The file's metadata in the inode table has a minimum size. In windows ntfs (from googling), the equivalent looks to be the mft record, which clocks in at 1kb or 2 512B ssd sectors.

  • @technikschaf1574
    @technikschaf1574 4 місяці тому +156

    The smallest piano having 555 Bytes, "like" THE one IC used for making simple sounds, the one and only NE555... That's just awesome and it cant be a coincidence

    • @lizardswithhats
      @lizardswithhats 4 місяці тому +11

      I thought the same thing lmao

    • @ping_th
      @ping_th 4 місяці тому +1

      I don’t understand your technical, so you mean like make a file that run beep/ small sound?

    • @technikschaf1574
      @technikschaf1574 3 місяці тому +15

      @@ping_th the NE555 is a small IC (integrated Circuit) / Chip used in electronic devices for timing/clock signal (and more) purposes. This chip (and its clones) are probably the most used IC for such stuff. It is so easy to use and cheap and widely used it became synonymous for this kind of usecase. Since any note you can play is nothing more than a sine wave with a specific frequency and the NE555 can easily produce such frequency you can use this chip to build a small piano (ignoring it not producing sine waves but square waves you then have to filter)

    • @HappyBeezerStudios
      @HappyBeezerStudios 2 місяці тому +2

      If he manages to shrink that by another 45 bytes, it'll fit into a boot sector and will clearly kick pac-man and doom from the most popular choices.

    • @anty.
      @anty. 12 днів тому

      @@technikschaf1574 do modern computers still have this circuit, and if so, is it still possible to use it to make sounds/music that come straight from the computer?

  • @KadeDev
    @KadeDev Місяць тому +17

    "Works twice as well as expected" is probably the best line i've ever heard. Great video!

  • @SomethingCatchy2_
    @SomethingCatchy2_ 4 місяці тому +344

    I was exspecting this to just be a deep dive in to how small an exe can be, then he just made a game, this is amazing

  • @thomquiri9860
    @thomquiri9860 4 місяці тому +389

    1:15 nice integer overflow lmao

    • @HasanGaming482
      @HasanGaming482 4 місяці тому

      idiots who dont know freaking a bit of coding arent allowed

  • @DavesGarage
    @DavesGarage 4 місяці тому +159

    Great video! I never considered what the *largest* would be! Now I know :-)

    • @InkboxSoftware
      @InkboxSoftware  4 місяці тому +41

      Thanks for giving it a watch, it means a lot coming from you.

    • @kipchickensout
      @kipchickensout 4 місяці тому +7

      I was confused when I saw the video in my feed, thinking it would be basically the same as your video, but I love how this one explains everything visually! Kudos to you both

    • @ognjenjakovljevic494
      @ognjenjakovljevic494 24 дні тому

      ​@@InkboxSoftware for a guy who scammed non educated ppl by selling fake cleaning software LOL

  • @powerpc6037
    @powerpc6037 4 місяці тому +67

    I remember having an exe file on my Amiga which was only 56 bytes in size: "reboot". This in fact rebooted the Amiga computer when you executed it.

    • @stalker32041
      @stalker32041 4 місяці тому +4

      I don't checked size of linux "reboot" program...

    • @neoney
      @neoney 3 місяці тому

      ​@@stalker32041its a symlink to systemctl if on systemd

    • @RWBHere
      @RWBHere 3 місяці тому +2

      @@stalker32041 Fifteen characters, 'shutdown -r now' is enough to do that, as root, from the Command Line.

    • @chriku
      @chriku Місяць тому

      ​@@stalker32041i am not sure if it even has one, as i saw one being a symlink to systemd, which checks its filename on start and if it was started via the reboot link recommends the main systemd to reboot.

    • @cmposting
      @cmposting День тому +1

      @@RWBHere that is a command which executes the program known as "shutdown" with the arguements "-r now" and has nothing to do with the size of the shutdown program, which includes reboot functionality

  • @MangoPango1973
    @MangoPango1973 4 місяці тому +24

    Nearly 40 years ago, my first Computer was an Amstrad / Schneider CPC 464. I bought a monthly magazine which featured type in programs, back then called listings and there was always the 1kb program section, containing fantastic tools and full games with sound, colour graphics and joystick controls. I remember several Space Invaders clones, Shoot'em Ups, Racing and Puzzle games and an absolutely awesome Fractal generator, everything less than 1kb in Locomotive Basic and less than one page in the magazine.

    • @HappyBeezerStudios
      @HappyBeezerStudios 2 місяці тому +1

      Back in the day before magazines had download codes. Or DVDs. Or CDs. Or floppies.
      No, they printed the code directly and you had to type it in manually.

  • @AlexTrusk91
    @AlexTrusk91 4 місяці тому +294

    I once talked to the kernel directly.
    Now I got a lifetime supply of chicken wings.

    • @timmygilbert4102
      @timmygilbert4102 3 місяці тому +7

      Something is not right because it should have given you pop corn 🌽🍿😮

    • @wbat5816
      @wbat5816 2 місяці тому

      Why is your PFP Person... sideways...?

    • @juliehelloworld
      @juliehelloworld 2 місяці тому +1

      🏃‍♀️‍➡️🏃‍♀️‍➡️🏃‍♀️‍➡️➡️➡️➡️

    • @wbat5816
      @wbat5816 2 місяці тому

      @@juliehelloworld Gotta RunRunRunRunRunRRRRRRRRRRRRRR
      𓊖 Emojitranslator.exe has stopped unexpectedly.

    • @Saver310
      @Saver310 Місяць тому +1

      c

  • @KvapuJanjalia
    @KvapuJanjalia 4 місяці тому +63

    If I remember correctly, if you disable ASLR, you can simply jump to Win32 API function addresses. This will eliminate some strings in IMPORTS section of a PE file.
    I haven't tried it myself.

  • @filker0
    @filker0 4 місяці тому +36

    Fun video.
    ANSI (usually spoken as "ahn-see") control sequence originated with the Digital Equipment Corporation VT100. The SGR (Set Graphic Rendition) sequence was extended in "ANSI.SYS" on DOS to allow setting foreground and background colors. The glyphs the video shows beyond the ASCII characters are the VT100 graphics set, so the same program game would work using a serial port connected to a VT100+ terminal emulator that supported the color extension.
    The flickering could be reduced by only redrawing the bottom row except as the meteors shift down. Using save cursor and restore cursor sequences could improve keeping the little house's position from flickering. This will take more code code, of course.

    • @JJFX-
      @JJFX- 4 місяці тому +1

      Yeah and similar usage of ANSI is also great for anyone who enjoys torturing themselves making unnecessarily complicated batch files. Using it to clear lines and restore cursor positions instead of simply clearing it is much more pleasant and opens up some cool possibilities that wouldn't be possible (or practical) otherwise.

    • @rosiefay7283
      @rosiefay7283 4 місяці тому +2

      *usually pronounced an-see

    • @HappyBeezerStudios
      @HappyBeezerStudios 2 місяці тому

      @@JJFX- as someone who has made unnecessarily complicated batch files, I appreciate all methods that make it less complicated, because that allows me to add more stuff.

    • @JJFX-
      @JJFX- 2 місяці тому

      @@HappyBeezerStudios It can simplify things but can become a headache to decipher later unless you mask repeated commands as vars. Aside from totally necessary colors and animations I mostly find it useful for advanced menu navigation, the ability to display information underneath an input line, temporarily replacing an invalid input with text, etc...

  • @OlegDorbitt
    @OlegDorbitt 4 місяці тому +28

    14:04 big thumbs up for CISC, without it we wouldn't have such gems as "AAA" and "PUNPCKHQDQ"

    • @marcsh_dev
      @marcsh_dev 20 днів тому +1

      And the lovely EIEIO

  • @ArthurKhazbs
    @ArthurKhazbs 4 місяці тому +41

    "What is the largest possible EXE?" (Proceeds to develop an Electron application.)

  • @EscapedShadows
    @EscapedShadows 4 місяці тому +97

    11:58 „And that works twice as well as I expected“ Best line every

  • @pielover267
    @pielover267 4 місяці тому +98

    5:17 wait a sec, wait a sec, does every windows executable really contain ASCII art of a shrub by default? I'm tempted to assume that was a joke so you would have something to rhyme, but honestly I'm hoping that it's true because that would be a hilarious and genuinely beautiful absurdity.

    • @Levi_OP
      @Levi_OP 4 місяці тому +29

      Just a joke :-)

    • @avantesma1
      @avantesma1 4 місяці тому +14

      This would be a software equivalent of those dudes etching Milhouse in the corners of their microchips.

    • @zpa89
      @zpa89 28 днів тому +2

      ​​@@avantesma1 one of the code bases my teams work with has a big old dragon ASCII. It isn't super uncommon. Though that is just made with comments so not technically the same

    • @avantesma1
      @avantesma1 28 днів тому +2

      @@zpa89 If those etched Milhouses weren't functional parts of the chips, I'd say it's indeed, technically the same.
      Comments are the non-functional part of code, right? 🙂

  • @Felice_Enellen
    @Felice_Enellen 4 місяці тому +17

    One thing about compressors like crinkler is that you'll always have the potential hazard of the output executable being detected as possible malware. Most AV is leery of anything that looks like it's compressed, since it's a common way to hide telling features of the executable.

    • @RainDownpours
      @RainDownpours 4 місяці тому +8

      Ah, that's why windows defender detects it as a trojan.

    • @mkstffwthstff
      @mkstffwthstff 4 місяці тому

      ​​@@RainDownpours I got that too

  • @shallex5744
    @shallex5744 4 місяці тому +66

    10:56 those aren't actually ASCII characters (except for the @)
    ASCII is only a 7-bit encoding, and thus only contains 127 characters. anything beyond that into the 8-bit realm is a vendor-specific extension beyond ASCII

    • @sttate
      @sttate 4 місяці тому +1

      Where's the 128th value?

    • @shallex5744
      @shallex5744 4 місяці тому +11

      @@sttate the 128th value is the number 127. the 1st value is the number 0

    • @mjouwbuis
      @mjouwbuis 4 місяці тому

      @@shallex5744 not only the value (not number) 0, but also the NULL byte. Sometimes used as a string terminator so not exactly a character, but if you think of the other control characters as a character, it can be argued that NULL is also one, which makes a total of 128 characters. Also, back in the day the remaining 128 values used to be known as high-ASCII which were more or less vendor or machine specific. Later they became code pages which were more or less standardised.

    • @marsovac
      @marsovac 4 місяці тому +2

      If you actually look at the image that you complain about, you first notice there are 16 rows with 8 columns, which excluding the NULL character makes for 127 characters. Then you notice that columns have 3 bits and rows 4 bits. Which is exactly 7 bits. And then you notice that those are precisely the ASCII characters.

    • @shallex5744
      @shallex5744 4 місяці тому +6

      @@marsovac i wasn't focused on the image, i was referring to him suggesting that the house and the horseshoe-looking thing were ASCII characters

  • @verebellus
    @verebellus Місяць тому +8

    2:47 was a BRILLIANT sponsor cut?

    • @InkboxSoftware
      @InkboxSoftware  Місяць тому +13

      After a certain time I can cut them out for a better viewing experience

    • @Chris_winthers
      @Chris_winthers 27 днів тому +5

      ​@@InkboxSoftwareUnbelievably based

    • @Thespikedballofdoom
      @Thespikedballofdoom 22 дні тому +2

      @@InkboxSoftware so swag

    • @Kalaphant
      @Kalaphant 5 днів тому +1

      Lol I thought it was a sponsorblock skip, but then was confused why I didn't see the popup asking if I wanted to unskip lol

  • @andrew_ray
    @andrew_ray 4 місяці тому +18

    With the parameters now all in place, we can build Jorge Luis Borges' library of Babel, but for exe files. Since there's a limit to the number of bytes that can go in an exe and a finite number of values each byte can have, we can imagine a filesystem the contains every possible exe file. But it couldn't be a Windows filesystem.

    • @InkboxSoftware
      @InkboxSoftware  4 місяці тому +11

      Here you go: github.com/InkboxSoftware/DatabaseOfDamascus

  • @mrjson3039
    @mrjson3039 4 місяці тому +102

    Dude... Dealing with microsoft's documentation practoces, that's the challenge I saw. Amazing work of art

    • @JJFX-
      @JJFX- 4 місяці тому +5

      Most useful usage of chatgpt for me when coding is simply to have it return documentation info...... and then hope it doesn't decide to just make something up which ends up wasting more time than simply digging into it myself :/

    • @spht9ng
      @spht9ng 3 місяці тому +1

      @@JJFX-just tell it DO NOT HALLUCINATE . That’s what Apple does on their prompts

    • @JJFX-
      @JJFX- 3 місяці тому

      @@spht9ng lol "DON'T F'IN LIE TO ME!"

  • @thewelder3538
    @thewelder3538 4 місяці тому +14

    Just as a comment here, you don't want to do things like cmp al, 0. The reason is simple. You're comparing an immediate value and that value has to be stored in the instruction. Since you're only interested in the flags, you should test al, al whereby the assembly doesn't need to store the immediate value and it will set the flags for you to branch against.

    • @InkboxSoftware
      @InkboxSoftware  4 місяці тому +9

      Thanks, I had forgot about TEST, looks like I can shave off a few more bytes

    • @thewelder3538
      @thewelder3538 4 місяці тому +8

      @@InkboxSoftware Well when you've done as much assembly as I have and enter 4k/64k demo competitions at Revision and other parties, every byte does indeed matter!
      Good video though.

  • @Dr-Zed
    @Dr-Zed 4 місяці тому +75

    Demoscene members being chads as always. Crinkler is one of my favorite tools, so cursed yet so elegant.

    • @stgigamovement
      @stgigamovement 4 місяці тому +10

      Another demoscene-friendly language is JS. In my experience, it's quite versatile. Stuff like fitting a game that was 30,000 bytes into 3,081 bytes. People have also made 140-character JS programs back in the olden days of X/Twitter when there was a hard 140 character limit.

    • @blarghblargh
      @blarghblargh 4 місяці тому +7

      @@stgigamovement sounds more like code golf.
      does the demoscene want or care about JS?

    • @stgigamovement
      @stgigamovement 4 місяці тому +1

      @@blarghblargh there's a section on Demozoo and Pouet for Javascript demoscene works, which I've used.

    • @eter9nitysslut131
      @eter9nitysslut131 4 місяці тому

      @@stgigamovement i mean you need the runtime to go with it lol so not really demosccene

    • @Roomsaver
      @Roomsaver 4 місяці тому +4

      @@stgigamovementThat’s code golf, you still need an interpreter for JS

  • @RochesterX
    @RochesterX 4 місяці тому +10

    2:55 - Who knew Plato was a Linux fan?

  • @leafdebrief
    @leafdebrief Місяць тому +7

    2:53 Subliminal ad placement

  • @WilburHawthorne
    @WilburHawthorne 2 місяці тому +4

    Do not be embarrassed by your mistakes. Nothing can teach us better than our understanding of them. This is one of the best ways of self-education.

  • @RobinLeGaming
    @RobinLeGaming 4 місяці тому +7

    EXE doesn't actually indicate a PE file.
    It may contain an early MS-DOS MZ, an MS-DOS 4.0 New Executable or a modern Portable Executable.

    • @larkuser
      @larkuser 2 місяці тому

      and also the LE and LX from Windows VxD services and Microsoft OS/2 2.0

  • @blarghblargh
    @blarghblargh 4 місяці тому +176

    Back in the day, we called it "Anne See" (like "antsy" with a silent "t"). not "Ay En Ess Eye"

    • @yourcomputerhasdied
      @yourcomputerhasdied 4 місяці тому +73

      it's the superior way to pronounce it. less syllables and easier to say. I've heard some people say ASCII one letter at a time, one of the worst experiences of my life

    • @blarghblargh
      @blarghblargh 4 місяці тому +16

      @@yourcomputerhasdied you poor soul. Stay strong!

    • @voxvolhynia5400
      @voxvolhynia5400 4 місяці тому +8

      @@yourcomputerhasdied Laugh out loud, what a waste of time.

    • @rhysbaker2595
      @rhysbaker2595 4 місяці тому +2

      In fairness, he might have never heard anyone say it 🤷🏻‍♂️

    • @mewity
      @mewity 4 місяці тому

      I pronounce it "ayensi"

  • @PaulPassarelli
    @PaulPassarelli 4 місяці тому +9

    Back in the days of DOS, we (Crescent Software) sold a library for BASIC (called PDQ) which would allow for the quick compilation & linking of EXEs less then 512 Bytes. Why 'so big' (LOL)? Because that was the size of *ONE* sector on a *FLOPPY DISK*. Anything less was moot.
    It could also create TSR (Terminate & Stay Resident) programs, which were available with a keystroke or interrupt. And we could shove them up into Extended, or of you remember it, "Expanded" memory.
    Since this was in the days prior to math coprocessors, I wrote the 8087 emulator for the product.
    Thanks for the nostalgic trip down memory lane.

    • @lasskinn474
      @lasskinn474 4 місяці тому +2

      did it compile basic into a more native program instead of the more usual of adding the basic intepreter and the bas itself into an exe?
      I remember trying to coax borland c/c++ 3.1 into compiling as small executable as possible (I think I was like 11 back then). i think i got a 'flame' effect down to 8kb or so, which was still huge for what it was(just couple of loops really and calling bios to change the video mode and make the pallette).

    • @PaulPassarelli
      @PaulPassarelli 4 місяці тому +2

      @@lasskinn474 LOL! Yeah, these were genuine EXE files. The BASIC compilers BC 6 & BC 7 Professional were actually pretty good compilers for the time. BASIC code was lexed into 8086, 80286, or 80386 instructions. It even had math coprocessor options. statements like Print, Play, Open, Locate, REDIM, Strings, etc., generated calls into the runtime libraries just like C functions.
      We re-wrote the runtimes from *SCRATCH* in hand tuned assembly language (MASM). Because our libraries were so granular, the linker was able to bring in just the bare bones set of library routines that the programmer actually invoked. Nothing was just along for the ride.
      Since it was a library we were able to add extra functionality, such as the TSR capabilities, interrupt handlers, function pointers, pretty much anything a C coder could do, we put that power in the hands of the BASIC programmer.
      Then came Visual Basic for Windows. But that's a story for another day.

    • @lasskinn474
      @lasskinn474 4 місяці тому +2

      @@PaulPassarelli that's pretty cool, would've been cool to get hold of back in the day.

  • @IamNerfDart
    @IamNerfDart 4 місяці тому +11

    Someone mention MattKC his QR code game could get an upgrade

  • @godwin972
    @godwin972 3 місяці тому +3

    for anyone wondering, the character at 4:06 is "嗯", which (according to Wiktionary) is a Chinese character that can mean doubt, curiosity, surprise, agreement, "pledge", or just onomatopoeia for groaning.

    • @HappyBeezerStudios
      @HappyBeezerStudios 2 місяці тому +2

      So in general the reaction of the programmer after the program starts and displays the message.
      All of that.

  • @diegoreckholder945
    @diegoreckholder945 4 місяці тому +5

    it's been about 10 years since I last wrote any code, and about 12 years since I worked with processor instructions. This video made me remember that I loved this before my professors at college made me hate this with my soul 😅

  • @KLegyyn
    @KLegyyn 4 місяці тому +22

    You brought me back in time to my computer science days, making games on console applications.
    .
    Those were the simplest of days.
    .
    Thank God I still have them.
    .
    .

  • @numbr6
    @numbr6 4 місяці тому +3

    Over they years, Windows developers give zero consideration of the size of their programs. I'm glad to see someone demonstrating it is possible to write functionally interesting programs in the

  • @nordern1
    @nordern1 4 місяці тому +3

    Maybe an interesting honorable mention: "fr-016c: fuenf (in your face)" by the demo group Farbrausch. It's a COM file that just produces an endless stream of garbage in the terminal, but because sometimes includes ascii bell symbols, it's technically an application with visuals and audio in 5 bytes.
    (It also crashes the terminal window)

  • @MsHojat
    @MsHojat 4 місяці тому +3

    I know that 4k is comparatively huge to these tiny minimal-size exes, but I've seen some pretty cool demoscene exes that are only 4kb.

  • @JustinWang
    @JustinWang 4 місяці тому +3

    1:26 the background music is the “if there is no CCP, there is no new China” wow very patriotic

  • @etaoinwu
    @etaoinwu 4 місяці тому +16

    that 嗯 got me laughing so hard in the binary selection part

  • @doslogo
    @doslogo 2 місяці тому +3

    My game is 53 KB, runs even before/without Windows directly when the PC turn on power, and funny enough, it has the MZ header! I am quite happy with that 😇

    • @MissNorington
      @MissNorington 2 місяці тому +1

      I looked at it, great video, the MZ header is used by the bootsector, very clever!

    • @larkuser
      @larkuser 2 місяці тому +2

      thats quite extreme compression you got. blew my mind!

  • @sundhaug92
    @sundhaug92 4 місяці тому +8

    I mean, you can make a smaller executable for Windows by taking advantage of the NTVDM and making a COM-file

    • @klh.
      @klh. 4 місяці тому

      Yeah, you can get it down to one byte, a single RET instruction.

    • @shinyhappyrem8728
      @shinyhappyrem8728 Місяць тому

      Wouldn't that be a 16-bit x86 file? Which wouldn't run on 64-bit Windows versions...

    • @sundhaug92
      @sundhaug92 Місяць тому

      @@shinyhappyrem8728 Sure, but 32-bit Windows is still supported for about a year more

  • @bradl7439
    @bradl7439 4 місяці тому +2

    In practical terms, the smallest .exe file you can have is the cluster size the FAT uses on the storage device you're using. Assuming you saved your work that is.

  • @paumb64
    @paumb64 4 місяці тому +20

    11:59 I laughed more than i should have on this part lol. Amazing video

  • @andreyrumming6842
    @andreyrumming6842 4 місяці тому +2

    The 2GB limit for RAM with 32 bit systems was a massive headache until I realised using GCC I was compiling for 32 bit OS's, when my OS was 64 bit. Changed that, and solved

  • @cigmorfil4101
    @cigmorfil4101 4 місяці тому +4

    There used to be a full chess game for the Sinclair ZX81 (Timex 1000) which fitted in the 1k (1024 bytes) of static RAM which came with the system, from which some was used for the screen....

  • @km077
    @km077 4 місяці тому +1

    *fun fact:* Registers: EDI, ESP, EBI and EFL could be used to power a RNG with some multiplications and/or additions. Some of them change to a pretty unique value only at start-up and then increment as the program is running, but others could be used to get multiple equally dispersed pseudo-random numbers.

  • @nikotheoneshot
    @nikotheoneshot 4 місяці тому +5

    watching videos like these gives me such a desire to c r e a t e something in assembly
    but, yknow, then I remember, oh yea, I hate coding in assembly

  • @beautifulsmall
    @beautifulsmall 4 місяці тому +1

    I dived into bitmaps years ago and found unseen riches, unused digits at the ends of non 32bit arrays. nice work . we all need to keep kicking the tyres.

  • @MonroeChapman
    @MonroeChapman 2 місяці тому +3

    He who conquers others is strong; He who conquers himself is mighty.

  • @suspense_comix3237
    @suspense_comix3237 4 місяці тому +2

    17:41 This is close to 1.99 Gigabytes for those who don't know.

  • @SojournerDidimus
    @SojournerDidimus 4 місяці тому +2

    I once made an executable a mere 20 bytes in size.
    It ran in DOS, was a .com, not a .exe. It's use was to set text resolution to 120x50 characters (if I remember correctly).

  • @suspense_comix3237
    @suspense_comix3237 4 місяці тому +3

    15:09 I braced myself for a Rickroll, but was glad that that wasn't the case.

  • @moontoadz
    @moontoadz 4 місяці тому +64

    ANSI you can just say "an-see"

  • @Bunny99s
    @Bunny99s 4 місяці тому +2

    Writing small programs under an OS is fun. Try writing a bootable game :) People managed to pack whole simulations or games into the bootsector of a floppy. A sector has 512 bytes but the last 2 bytes are required or the BIOS won't recognise it as bootable (55AA in hex). Though the bootsector (depending on the medium) also contains some volume information. That only leaves a little bit left for the program. People have written bootsector games or simulations and still have the disk to work properly under DOS or windows. Also there are no sys calls to any OS function since we ARE the OS if we boot from this medium. All we have are the BIOS interrupts and direct memory access. The BIOS only loads the first sector (boot sector) of the medium which usually just contains code to load the actual OS boot loader from other sectors.

    • @lasskinn474
      @lasskinn474 4 місяці тому

      back in the day booter games on dos machines were not that common but there were a bunch of them. if you had only 1 floppy drive you didn't need to swap from dos, you didn't need to worry if the customers config.sys was weird etc and could have more confidence in whatever tricks you used to make it harder to copy the floppy.
      i think that there were those titles is one reason for why booting from floppy was default for so long on pc's so you couldn't leave a floppy in the drive.

    • @jbird4478
      @jbird4478 Місяць тому

      Yeah but the BIOS _is_ an operating system. A very primitive one, but an operating system nonetheless. And a BIOS interrupt call is only two bytes. There's a plethora of them; printing text to the screen, loading things from the disk, setting timers, etc. When you programmed on DOS you made use of some them as well. Because DOS ran in real mode, it could share the interrupt table with the BIOS, so some interrupts where DOS system calls, while others were handled by the BIOS.

  • @HedgehogGolf
    @HedgehogGolf 4 місяці тому +4

    0:26 sneaking in your mailing list is a genius move lol

  • @leviackerman5866
    @leviackerman5866 4 місяці тому +1

    Markus Persson, in a

  • @aspectreishauntingeurope
    @aspectreishauntingeurope 4 місяці тому +21

    11:00 none of those characters are a part of ASCII... 😄

    • @timseguine2
      @timseguine2 4 місяці тому +5

      If memory serves, isn't this CP437?

    • @EvelynIsDeprecated
      @EvelynIsDeprecated 4 місяці тому +3

      ​@@timseguine2To my knolwedge with ANSI art, yes

    • @COArSe_D1RTxxx
      @COArSe_D1RTxxx 4 місяці тому

      The "@" sign isn't part of ASCII-7?

    • @goomygaming980
      @goomygaming980 4 місяці тому +3

      @ is ASCII at least

  • @DaleBartlett-x5n
    @DaleBartlett-x5n 2 місяці тому +1

    Experience can only be gained by doing not by thinking or dreaming.

  • @Saru-Dono
    @Saru-Dono 4 місяці тому +52

    We really need Dave on this one

    • @graealex
      @graealex 4 місяці тому +5

      Yes, let's bring in the tone-deaf boomer millionaire. He'll solve our problems.

    • @Saru-Dono
      @Saru-Dono 4 місяці тому +12

      @@graealex Well, he kinda knows Windows, so he may be a good fit to explain Windows executables

    • @skycaptain95
      @skycaptain95 4 місяці тому

      This is not some esoteric boomer multimillionaire knowledge ​@@Saru-Dono

    • @graealex
      @graealex 4 місяці тому

      @@Saru-Dono He knows task manager. There are far more competent people still around in regards to WINAPI.

    • @cerulity32k
      @cerulity32k 4 місяці тому

      ​​@@graealexhe developed windows... he made fucking task manager and zip... *_he probably knows a lot about executable files._*

  • @MasterGeekMX
    @MasterGeekMX 4 місяці тому +2

    I once saw a question on reddit asking why you can't make the same executable file for Linux and Windows.
    The answer: see the first half of this video and then one about the ELF format to understand it.

  • @aarocka11
    @aarocka11 4 місяці тому +4

    Cool. Next time do a boot sector program so that way you don’t need the pesky bloat of an OS to execute.

  • @Daniel15au
    @Daniel15au 4 місяці тому +2

    8:14 you just offended a whole generation of people that played DOS games on Windows 9x lol

  • @marijalt9
    @marijalt9 23 дні тому +3

    4:22 ASCII art of a shrub??

  • @TedSeeber
    @TedSeeber 4 місяці тому +1

    My first hackathon, in 1994, was to write a smallest possible replacement for taskman.exe

  • @omgboy4939
    @omgboy4939 4 місяці тому +18

    what is the smallest possible elf64?

    • @aspectreishauntingeurope
      @aspectreishauntingeurope 4 місяці тому +5

      (btw the result turns out to be 45 bytes)

    • @aspectreishauntingeurope
      @aspectreishauntingeurope 4 місяці тому +6

      it seems youtube deleted my reply so let's try it again...
      even though it's about elf32, I'd highly recommend the famous essay "A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linux"

    • @cirkulx
      @cirkulx 4 місяці тому

      i think using a header someone i know made and assembling asm -> elf64 it was 40 or smth

    • @asdfghyter
      @asdfghyter 4 місяці тому

      @@aspectreishauntingeurope that's way smaller than I expected!

  • @Harvey-b2j
    @Harvey-b2j 2 місяці тому +2

    Sometimes by losing a battle you find a new way to win the war.

  • @gLitCheRR44
    @gLitCheRR44 23 дні тому +3

    Wow, it took until 2016 for windows to support ANSI escape sequences? Yikes!

  • @IanZainea1990
    @IanZainea1990 4 місяці тому +1

    15:59 theoretically (based on size alone) it could run on the Apollo guidance computer. Congrats!

  • @code123ns
    @code123ns 4 місяці тому +16

    In DOS, the smallest EXE that will do something is 2 bytes. If an EXE contains "@e" it will reboot the computer when run.

    • @Drysart
      @Drysart 4 місяці тому +16

      That sounds more like a COM file. EXE files *must* start with "MZ" to be valid; and then also contain a header (very similar to the one used by EXE files for Windows).
      COM files, on the other hand, were literally just something DOS loaded into a page of memory and then jumped to the first byte of. The smallest valid COM file is 1 byte, the encoding of the "RET" instruction (hex code C3). That would just immediately terminate and return control to DOS.

    • @pdr.
      @pdr. 4 місяці тому +3

      Last time I used DOS/Windows (c. late 1994), you could rename a .COM file to .EXE (and vice versa) with no effect on how it would run.

    • @rashidisw
      @rashidisw 4 місяці тому +3

      @@pdr. Back then they do checks for header within the file content instead of fully reliant on file extension.

    • @code123ns
      @code123ns 4 місяці тому +1

      @@Drysart i know.. but I didn't say it was valid :D I discovered this as a kid who didn't have any compilers, but desperatly wanted to make my own exe. So, as all kids do, I just renamed a BAT to EXE to see what would happen 🤔 the first line was... .@echo off 😀 and the result was that it would restart when I run it. I progressively deleted stuff until I was left with just @e and it would still do the same.

    • @maxmuster7003
      @maxmuster7003 4 місяці тому

      A DOS executable com file with a nop instructions = 1 byte file size.😂

  • @TheMcSebi
    @TheMcSebi 4 місяці тому +2

    Not sure if you already know about this, but you might be interested in Cosmopolitan libc, a project to compile c code to a polyglot binary running natively on Linux + Mac + Windows + FreeBSD + OpenBSD + NetBSD and even in BIOS

  • @araghon007
    @araghon007 4 місяці тому +9

    Just a heads up, the link in description for the diagram at 1:00 is not the original source, nor does it link to the original source. The author is 'corkami' (look up 'corkami pe101')

    • @araghon007
      @araghon007 4 місяці тому +3

      I've been working on my own compiler, and diagrams from that person have been a huge help

    • @InkboxSoftware
      @InkboxSoftware  4 місяці тому +4

      Thank you for bringing that up, I've corrected it to reflect the original author. It it a great chart.

  • @kylebowles9820
    @kylebowles9820 27 днів тому

    16:37 lol i thought you were just going to say the results; animating the binary search was super funny

  • @MonochromeWench
    @MonochromeWench 4 місяці тому +4

    linking an extra dll just for a rng is costing a lot of space. Ok not really a lot but you can do better. It would be smaller to implement a LFSR rng using a seed value from whatever source you can get that you're already have access to. A Console handle is probably good enough to use as a seed for a LFSR. The Handle values are likely going to be unique every time you run the exe though not guaranteed, the chances you'd get repeated Handle values are extremely unlikely. Or you can just go straight to using a cpu random instruction but you lose compatibility with old cpus.

  • @chantag9517
    @chantag9517 Місяць тому

    Goodbye Rich Header, Goodbye DOS Stub,
    Goodbye Debug Table and the ASCII Art of a Shrub.
    i see what you were doing there :)

  • @UndercoverDog
    @UndercoverDog 4 місяці тому +5

    0:40 +1000 soical credit for the music

    • @loquenderovalencia2003
      @loquenderovalencia2003 3 місяці тому

      I thought no one else noticed

    • @xxxtrib
      @xxxtrib 2 місяці тому

      goof

    • @H1O_AN
      @H1O_AN Місяць тому

      no it’s -9999999999 social credit. it’s Taiwan’s music

  • @ElectricalInsanity
    @ElectricalInsanity 4 місяці тому +2

    I never expected to see a video game that you can print on a single sheet of paper.

  • @ImpossibleEvan
    @ImpossibleEvan 4 місяці тому +33

    5:15 the what now?

    • @voxvolhynia5400
      @voxvolhynia5400 4 місяці тому +17

      Essential code, the ASCII Art Of A Shrub (TM) stabilizes the program, protects against any form of cyberattack, and automatically generates cryptocurrency. It's the sequel to Sun Tzu's The Art Of War, even being more practical on the field of battle.

  • @veroxid
    @veroxid 3 місяці тому

    The fact you put your closing parentheses on its own line to create a ); is almost too perfect, lol.

  • @OzzFan1000
    @OzzFan1000 4 місяці тому +18

    That comment about every Windows executable having the same DOS header isn't true. You could specify an actual MS-DOS application as the header and create a dual-mode application. The same .EXE when run under DOS would run only the DOS "header" portion, while when run from Windows would skip over the DOS header and execute the Windows code.
    Many applications used to do this back in the day - and I've even created a few myself!

    • @InkboxSoftware
      @InkboxSoftware  4 місяці тому +10

      That's true, and that's why it has an MS-DOS header in the first place. It's just nowadays your standard compiler will fill in the string "This program cannot be run in DOS mode" automatically.

    • @rashidisw
      @rashidisw 4 місяці тому +7

      Older compiler uses slightly different string "This program requires Microsoft Windows".

    • @throwaway6478
      @throwaway6478 4 місяці тому +2

      @@rashidisw And certain versions of Delphi had a DOS stub that printed "This program must be run under Win32."

  • @ArmandWells
    @ArmandWells 2 місяці тому +1

    Go to your bosom: Knock there, and ask your heart what it doth know.

  • @minirop
    @minirop 4 місяці тому +4

    would you save some space if you used RDRAND or RDSEED instead for the RNG?

  • @cobrce6093
    @cobrce6093 4 місяці тому +1

    Back in windows xp era I remember having a program that has no sections, only a header that also contains some code that restarts windows, IIRC its size was 97 bytes

  • @hc4633
    @hc4633 4 місяці тому +5

    nice mix of humor and knowledge, good stuff

  • @saultube44
    @saultube44 3 місяці тому

    Fun fact: I learned this from a Pascal 6 Book a friend read to me, at leas on MS-DOS it was 1 byte, the ╣B9h or Char 185, in a .exe file, which is the x86 Instruction RetF: Return Far, full qualified address: SEG:OFFSET is used to return to the Operating System.
    Great concise analysis, thank you

  • @danmakufan
    @danmakufan 4 місяці тому +3

    0:29 is that a CCP song lol

    • @Nonethousand9090
      @Nonethousand9090 4 місяці тому

      Yes. It's called "without the communist party, there will be no new china" or something like that

  • @artofnoise5013
    @artofnoise5013 4 місяці тому +1

    Just discovered your channel. At first wasn't sure if I was watching clickbait. Then at 1:00 - 1:15 I knew you were the real deal!

  • @G-u-z-i-o
    @G-u-z-i-o 4 місяці тому +5

    5:17 Okay, but WHY? WHYYYY in the world would Windows put a shrub there? What purpose does this serve?

    • @blarghblargh
      @blarghblargh 4 місяці тому +9

      what man, you ain't shrubbin? it's the new craze!

  • @minhkhoi1009
    @minhkhoi1009 16 днів тому

    My (my, my, my) grandpa fought in World War II
    He was such a noble dude
    I can't even finish school
    Missed my mom, and left too soon
    His dad was a fireman
    Who fought fires so violent
    I think I bored my therapist
    While playing him my piano
    that's so insane
    (Oh, my God) that's such a shame
    Next to them, my shit don't feel so grand
    But I can't help myself from feeling bad
    I kinda feel like two things can be sad (one, two, three, four)
    The world's smallest piano
    Really needs an audience
    So if I do not find somebody soon (that's right, that's right)
    I'll blow up into smithereens
    And spew my tiny symphony
    Just let me play my piano for you, you, you, you
    My grandpa fought in World War II
    And he was such a noble dude
    Man, I feel like such a fool
    I got so much left to prove
    All my friends have vaping friends
    They're so good at making friends
    I'm so scared of caving in
    Is that entertaining yet?
    that's so insane
    (Oh, my God) that's such a shame
    Next to them, my shit don't feel so grand
    But I can't help myself from feeling bad
    I kinda feel like two things can be sad (one, two, three, four)
    The world's smallest piano
    Really needs an audience
    So if I do not find somebody soon (that's right, that's right)
    I'll blow up into smithereens
    And spew my tiny symphony
    Just let me play my piano for you, you, you, you
    Somewhere in the universe
    Somewhere someone's got it worse
    Wish that made it easier
    Wish I didn't feel the hurt
    The world's smallest piano
    Really needs an audience
    So if I do not find somebody soon
    I'll blow up into smithereens
    And spew my tiny symphony
    All up and down a city street
    While tryna put my mind at ease
    Like finishing this melody
    This feels like a necessity
    So this could be the death of me
    Or maybe just a better me
    Now, come in with the violins
    And take a shot of Hennessy
    I know I'm not there mentally
    But you could be the remedy
    So let me play my piano for you

  • @win7best
    @win7best 4 місяці тому +13

    You could fit the entirety of Minecraft into a exe lol

    • @thewhitefalcon8539
      @thewhitefalcon8539 4 місяці тому +2

      yes? most games can be fit in an exe. in fact that's how games work. they are exes.

    • @win7best
      @win7best 4 місяці тому +1

      @@thewhitefalcon8539 you dont get my point...

    • @saidtejeda2012
      @saidtejeda2012 4 місяці тому

      @@thewhitefalcon8539 He refers to all the DLLs, libraries, files, external to the Minecraft JAR or EXE file depending on the game edition (Java or Bedrock)

    • @gavinrolls1054
      @gavinrolls1054 4 місяці тому

      ​@@thewhitefalcon8539he means the entire game, not just the "executable" portion. (using quotation marks since it's java which is a VM and not a real executable)

    • @stalker32041
      @stalker32041 4 місяці тому

      Yes, but saves

  • @gigabytemon
    @gigabytemon 4 місяці тому

    15:15 "Granted it's not a good piano, but it is the smallest."
    Only a poor musician blames his instruments.

  • @Mr.Pixie.
    @Mr.Pixie. 3 місяці тому +12

    But can it run Doom?

  • @notstupid5322
    @notstupid5322 3 місяці тому +1

    Congratulations on making the world's most basic bullet hell game, be sure to watch out for ZUN knocking on your door at 3 AM. Lock the door.

  • @IHaveTheCIBCSmart
    @IHaveTheCIBCSmart 4 місяці тому +47

    Bro why do i hear chinese propaganda music in the background

    • @NWIN-zg3hq
      @NWIN-zg3hq 4 місяці тому

      No that's "Without the Capitalist Party there would be no new America".

    • @Jkingwalagamer
      @Jkingwalagamer 4 місяці тому +6

      薳火嚳心中友是

    • @leroyjenkinsreturns
      @leroyjenkinsreturns 4 місяці тому +3

      Don't think about it

    • @FranciTheGamer
      @FranciTheGamer 3 місяці тому

      cause programmers are based

    • @Quardanter
      @Quardanter 3 місяці тому +1

      Mao zeonlong propoganda

  • @nikoladd
    @nikoladd 4 місяці тому

    The smallest windows .exe, that does something meaningful, that I've seen, was a demo project in macro assembler and was just under 900 bytes. It created a window/form with some inputs and buttons and then executed a command when clicked. Basic demo, but still impressive.

  • @Matthew_Lawless
    @Matthew_Lawless 3 місяці тому +3

    ...do you have a homemade smartwatch?

  • @BoyCcns
    @BoyCcns 4 місяці тому +1

    In my minimal work with exe compression in the demoscene I verified that if the PE header offset at 0x3C points to a value smaller than 0x40 then the microsoft signing tool will not recognize the image as an executable, which may be an indication towards future limitations. The space between 0x02 and 0x3C can still be used freely though... We use it to put a small vanity ASCII art header in there for our 64k intros ;)

  • @lpyibm5333
    @lpyibm5333 4 місяці тому +3

    正津津有味看视频的时候突然蹦出来一个汉字,给我整恍惚了

    • @lpyibm5333
      @lpyibm5333 4 місяці тому +1

      看起来老哥你是真喜欢简中,关注了,加油!

  • @ethanporcaro
    @ethanporcaro Місяць тому

    The simplest game only takes up a few characters:
    You lost the game