Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

A challengy present for /prog/

Name: Anonymous 2009-04-28 4:20

Dear /prog/, today I'm giving you this nice dump for your .rodata segment!

http://pastebin.com/m23c95d92

Beyond the quite horrifying, although harmless content (hint: it's only a jpg, windows users won't be infected by anything), I'd like to challenge you: try to retrieve the content in the most optimized way.

Good luck! :-)

Name: Anonymous 2009-04-28 5:14

NO EXCEPTIONS!

Name: Anonymous 2009-04-28 5:32

>>1
Sorry if this is obvious, but you just want us to serialize those bytes to disk? Not worth my time, IMO.

Name: Anonymous 2009-04-28 5:43

>>3
Actually this is the aim... Obviously it's not worth, but the point is: are you smart enough to make it in a very optimized way?

If you are clever enough, you can do it with only two shell commands without write a single line of code

Name: Anonymous 2009-04-28 5:45

>>4
I'm guessing some esoteric grepping to isolate the bytes, then redirect that to output...
I would do this but I have a homework assignment due in a couple of days and I need to work on that :(

Name: Anonymous 2009-04-28 5:59

>>5
OP speaking: not so distant from truth.

Name: Anonymous 2009-04-28 6:43

perl -ne'print chr for eval'

HURR OPTIMZZED

Name: Anonymous 2009-04-28 7:11

Just use a text editor to type in the ascii character represented by each byte in the array.

That only requires only one shell command to load the editor, and you still don't have to write a single line of code.

Name: Anonymous 2009-04-28 7:19

>>8
Congratulations, faggot. What about the keyboard's key for "\0"?

Name: Anonymous 2009-04-28 7:42

>>9
unlike your toy editor, vi lets me enter any character i want.

Name: Anonymous 2009-04-28 7:44

>>10
But I actually use vi! Can you even insert strange characters? How do I?

Name: Anonymous 2009-04-28 8:24

The most optimized solution:


1. Paste it on a file, let'say "faggot.c"
2. $ gcc -c faggot.c
3. $ objcopy -Obinary faggot.o lulz.jpg
4. ???
5. PROFIT

Name: Anonymous 2009-04-28 8:32

>>12
bullshit
>>7

Name: Anonymous 2009-04-28 8:40

>>7
>>13
OP respects this anon like only a nerd can do.

Name: Anonymous 2009-04-28 9:40

gawk --non-decimal-data '/,/ {n = split($0,X,",");for(i = 1; i < n; i++) printf("%c",X[i])}'

Name: Anonymous 2009-04-28 16:22


newlisp -e "(write-file {poo.jpg} (join (map (fn (x) (char (int x))) (find-all {0x[\da-f]{2}} (read-file {http://pastebin.com/pastebin.php?dl=m23c95d92})))))"

Name: Anonymous 2009-04-28 21:09

>>13,14
`progget 1240906847 7`
Shorter than >>7.

Name: Anonymous 2009-04-28 22:52

>>11
ctrl-V.
specifically ctrl-V ctrl-space for \0.
it works in nvi and vim 3 (before vim became non-free), but \0 doesn't seem to work in real vi.
the vi man page says:
A ^@ cannot be part of the file due to the editor implementation (7.5f).
(http://ex-vi.sourceforge.net/vi.html#2)

and "An Introduction to Display Editing with Vi" says:
The implementation of the editor does not allow the NULL (ˆ@) character to appear in files.
(http://ex-vi.sourceforge.net/viin/paper-notes.html#7-3)

Name: Anonymous 2009-04-29 4:46

>>18
Thanks a lot.
I'm asking myself if using vim is worthy... this nvi may be the answer. What do you suggest?

Name: Anonymous 2009-04-29 5:27

>>18
before vim became non-free
What.

Name: Anonymous 2009-04-29 6:35

>>19
nvi is more vi-compatible than vim 3, but vim 3 is more free (public domain vs. 3-clause bsd)... i'd recommend using the real vi and only resorting to either of those if you have to work with files with null characters in them.

>>20
vim 3 was public domain. later versions are licensed under one of those non-free copywrong licenses.

Name: Anonymous 2009-04-29 6:37

I'M EX/VI
SON OF A BITCH VIM
VIM IS PIG
DO YOU WANT FORCED UPSTREAM CODE SUBMISSION ?
DO YOU WANT PROPRIETARY RELICENSING ?
VIM IS PIG DISGUSTING
BRAM MOLENAAR IS A MURDERER
FUCKING UGANDA

Name: Anonymous 2009-04-29 8:39

>>7
HURR
Back to the imageboards, please.

Name: Anonymous 2009-04-29 9:37

>>23
back to 7chan, please.

Name: Anonymous 2009-04-29 9:39

>>21
"Public domain" is not a license. Nothing is actually in the public domain until its copyright term has expired. Was Vim 3 under an actual legally binding public license like the WTFPL, or did it just say "public domain?"

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List