# Don't output the file

This rar file, when decompressed, gives a 65024-byte exe file. Requiring you to output the contents of that file would be absolutely no fun.

But you aren't required to do that. Actually, you're to do something opposite: Output a binary of the same length (65024 bytes), such that no byte equals the byte at same position in the source exe file.

This is code-golf, shortest code wins.

• The binary is the rar file itself, not the extracted contents, right? Jan 26, 2022 at 13:16
• What makes this challenge interesting? A compressed file will look almost purely random, so there doesn't seem to be a strategy to avoid byte values Jan 26, 2022 at 13:23
• Any reason why you have a rar with exe? Why not just the raw 65,024 bytes? Jan 26, 2022 at 14:13
• @l4m2 Responding to my request for clarification with a quote from the question which I can read in front of me doesn't help. I can already read that, and it wasn't clear enough to answer my query. I think I have worked out what you meant by looking at the file sizes of the rar and the exe (the extracted exe is 65024 bytes, but the rar is 64848), but I'm still not sure. Can you please explicitly clarify the question? Jan 26, 2022 at 14:39
• I'd also like to point out that VirusTotal flags the exe as possible malware. I think this is just a false positive because the file is so compressed that it looks like encryption, which is potentially suspicious for an exe, but I still don't suggest running it. Jan 26, 2022 at 14:43

# BQN, 81 bytesSBCS

•Out 65024↑1042/"#?ZY>Rg*778c0?74h3g)G?mm5963!1[!1OC+VUb)7]#Z-%&N/D^sUrJaVwc}%! "


Try it online! This is written for CBQN, I removed the •Out  to run it online.

If you split the binary into chunks of 1042, in each chunk at least one printable different from " is missing. Search program:

pa ← @-˜'"'⊸≠⊸/' '+↕95
b ← @-˜•FBytes "fr08v101.exe"
m ← ⊑⌽1000+/{⊑∧´¬∧˝pa∊⌜<˘↑‿𝕩⥊b}¨ 1000+↕1000
•Show m
•Show @+⊑⟜pa¨ ⊑∘/˘⍉¬pa∊⌜<˘↑‿m⥊b


# Pyth, 55 51 bytes

<3s*L1586"iýy±å7Ë±â7a£Õ§³mh79B!OÈ­wc7wÝ%'÷î3awo÷c­#


Try it online!

         "iýy±å7Ë±â7a£Õ§³mh79B!OÈ­wc7wÝ%'÷î3awo÷c­#    41-character string literal
*L1586                                            repeat each character 1586 times
s                                                  concatenate
<3                                                   remove the last 3 characters
output with a trailing newline


(Use the PYTHONIOENCODING=latin1 environment variable for correct binary output.)

• I feel like the requirement of the environment variable should cost bytes. Jan 27, 2022 at 19:08
• @Makonede The environment variable is not required; it just changes the output format to bytes for more convenient verification. The output without it is still correct, just in a different format (65024 UTF-8 characters), exactly like l4m2’s own JavaScript answer and similarly to the answers that return an array of 65024 integers. Jan 27, 2022 at 19:43

# Charcoal, 339 bytes

ＵＴＩ⪪”}⊞➙×Ｔμ[j…｜U◨{Ｕ⁸→º4Ｄ›⮌⪫ιaＹh⎇E"6ºρ⌊mＭＯk…÷›ＧF⭆B↨⬤U↙⊕✳…Ｈd¶5‖Ｏ$¬÷Ｇ≕6ＴχSυ⟧⌈◨~a3j'▷↘3⊖À⁷0r]e⎇⁻≔s＆g>▶r↔⊗⁰ηχκη↔S1hLΦ⍘⦄⪪⊕«⪪⊙M»nＰＯgbＯ\XＫÀ›'◨‽⬤κ➙›\p；▶⸿⁴P÷χ>Ie…Ｅσ/Ｎ⟲Ｂ÷«～υ⟧χ9✂‽G⁶⦄⁷τＨ¿Þ₂⊘ΦＷ4rO＆v×σIB⍘↔_﹪ηA⸿/?⊙/Ｊ¡lβ“K▷¬✂6τＢ﹪G▶﹪⁺%zÀτ(&7\g⁷Ｃ↙¤⦄ïＧ↖0⪫ςj]nＱ#Ｗ¶ＪeM)⬤χ9c←@⁷S5w⌊#Ｕ；Ｎ⌕·NＳＮ1?Σ@s↖$Ｔ(⁵xd«Fαh▶º⌊0l⮌d⮌oＨ"=d=▷À⁰j¤q⊙⦃Oε↥∧ψ�¬&≧↷cy/⊞⁴GE»¦≔✳κ¦'⁶↘S⎚ü]₂Ｑ”¶


Try it online! Link is to verbose version of code. Explanation: Charcoal is very good at printing lots of - signs. The compressed strings represents all the runs of non---signs in the file. Each run of -s is separated by a newline, thus ensuring that no character of the output matches a character in the file.

ＵＴ


Turn off Charcoal's default rectangular output, since we don't want space padding.

Ｉ⪪...¶


Split the compressed string 1041\n97...104\n2031 on newlines (they are the golfiest separators), and cast the numbers to integer, which causes Charcoal to output them as that number of - signs.

A "port" of @ovs's answer is only 90 bytes:

⭆“"jＶXＷ⬤tＯ#^S0➙↷⊟Li§Ｋ″1·β℅±d74%;{ESＭ»ΠⅈρξDςΦcＳEenÞ⁻.⁷¡ê；q¬⟧l﹪Π0№Σ″≔Ｘ⁼·⁶d´Z»～⪪Ｖ⎚+⪪ÀkＯ”×ι⁵¹²


Try it online! Link is to verbose version of code. Explanation: Simply repeats each character in the compressed string 512 times (I used this instead of @ovs' 1042 because it's a factor of 65024 and larger factors end up covering all of printable ASCII). Conveniently all the characters needed are in Charcoal's "symbols" area which allows the string to be compressed from 127 to 84 bytes. (It's not possible to do this with all letters (either upper or lower case) or all digits.)

# JavaScript (ES10), 131 bytes

Returns an array of bytes.

_=>[..."hx53ptn9mgv1xij4xcw506nhi1cxi7w116o3kntsesafc5xwy4w15u6bo7ulphwt"].flatMap(v=>Array(1016).fill(n-=parseInt(v,36)-17),n=187)


Try it online!

### How?

This encodes 64 bytes $$\b_0\$$ to $$\b_{63}\$$ that are repeated 1016 times each and do not appear in the corresponding chunk of the original file:

187,171,183,197,189,177,171,179,174,175,161,177,161,160,158,171,
155,160,145,157,174,185,179,179,178,194,199,183,182,192,177,193,
209,220,213,227,224,218,206,195,198,187,194,196,201,213,197,182,
165,178,163,179,191,178,189,195,188,198,185,181,173,173,158,146


The values were chosen in such a way that $$\|b_k-b_{k-1}|<18\$$ for each $$\k>0\$$, which allows to store the delta values in base 36.

# JavaScript (Node.js), 74 bytes SBCS

_=>"­[-!^7q7hŒƒŽÏ³á»±™{3Ž³îg}GÅc¬ïn·×O~v#¹›½+:[¦w".repeat(1414).slice(20)


Try it online!

I'm not sure if this happen for random enough file, or why you use aaaabbbbccccdddd rather than abcdabcdabcdabcd even for languages with better support for the latter solution

• I haven't tried the abcdabcd... pattern for my answer, but it only has a longer lookup string because I limited myself to printable ascii. If I'd use the full byte range, I could use a length 41 string, which is shorter than the one used here. I guess in Javascript repeating each character is a lot longer, so your approach is probably better.
– ovs
Jan 27, 2022 at 16:14
• @ovs Using printable ascii, the minimum loop length is 76
– l4m2
Jan 27, 2022 at 17:28

# 05AB1E, 26070 69 bytes

-1 thanks to Kevin Cruijssen.

•Ý=£ë—ÛāR5Bf·½"¨ß¡˜v₆BÌÝΩ\∞?ΓтJ&тƒFćO#'œ|Ć‹RÞ¼Á,нìçD|•Ƶ?вŽ4´δи˜Ž3ć(£


Try it online! Outputs as a list of byte values. Alternative link for text output.

# Explanation

Similarly to other answers here, this answer uses equal-sized chunks (except the last chunk), each consisting of the same byte throughout the entire chunk (but different bytes throughout the entire output). To get an optimal score, maximizing the chunk size is important – or rather, minimizing the number of chunks.

To do this, I iterated through chunk sizes, starting from $$\1{,}000\$$ and going up. With each iteration, I checked if every byte value was present at least once in at least one chunk.

This happened at $$\1{,}200\$$ bytes per chunk. This meant that each chunk but the last can be up to $$\1{,}199\$$ bytes, with the last chunk being $$\278\$$ bytes. This means there are $$\54\$$ full chunks plus the small chunk at the end, making a total of $$\55\$$ chunks.

Let's verify this: $$\54×1{,}199+278=65{,}024\$$.

Finally, for each chunk, we find the smallest byte that doesn't exist there and repeat it for the length of that chunk, and we're done!

• εŽ4´и} to Ž4´δи for -1. Jan 27, 2022 at 9:03

PHP (276 chars)

for($d=[-17,-532,-95,-515,-79,463,95,-392,-27,148,$i=-1,808,53,61,15,-665,-5,419,-29,211,46,399,95,569,11,-2,101,-588,11,418,-43,-70,-48,-1887,105,918,-63,-1655,-97,-317,-104,-116,-74,513,53,885,-97,605,150,593,20,-295];++$i<52;)echo str_repeat(chr(150-$d[$i]),2500-$d[++$i]);  Try it Online (using an URL shortener to store the .exe file) If GMP is available it's 206 chars long : for($d=str_split(($i=0).gmp_init('1FmB6eDs41MlblmT1hchbcMok3RFjcIJ7OHt8hphdLMPDPgigsPrqHXfc3QEFotYuvL9zfZ3y7ZYkD7nnoSCgAzgJhHEVnl9R6mB5cshIudtpnunsccV',62),4);$i<52;)echo str_repeat(chr($d[$i++]),$d[$i++]);


How is generated this sequence of str_repeat ?

Just by the output of strcspn.

<?php
$data = file_get_contents('raw_file');$file_length = strlen($data);$ptr = 0;
while ($ptr <$file_length) {
$max_dist =$max_ord = 0;
for ($i = 0;$i < 256; ++$i) {$char = chr($i);$dist = strcspn($data,$char, $ptr); if ($dist > $max_dist) {$max_dist = $dist;$max_ord = $i; } }$ptr += $max_dist; echo ".str_repeat(chr($max_ord), \$max_dist)";
}