Up next: a C compiler that compiles to printf statements :-P
There is somewhere a compiler that outputs to all sorts of crazy languages including awk, sed, printf, etc.. but I can't find it right now. Hopefully someone knows what I'm talking about. I feel like it did LLVM IR to a bunch of languages or something like that.. but my memory is faulty.
Best of show – abuse of libc
41–50 of 84 posts
Re: Best of show – abuse of libc
#42Earlier quoted context omitted.
Theres a great example of what you can do with this, submitted and discussed on HN here: https://news.ycombinator.com/item?id=25690319
> Format specifiers can take extra “arguments”. - "%hhn": store the number of bytes written mod 256 to the char pointer ... Oh boy. I'll put that down for my "thing I don't think I wanted to know" of the day.
Re: Best of show – abuse of libc
#43Earlier quoted context omitted.
> Format specifiers can take extra “arguments”. - "%hhn": store the number of bytes written mod 256 to the char pointer ... Oh boy. I'll put that down for my "thing I don't think I wanted to know" of the day.
There is some innocent beauty in the twistedness of printf - especially with GNU extensions.
Re: Best of show – abuse of libc
#44Re: Best of show – abuse of libc
#45General thread here: https://news.ycombinator.com/item?id=25651942
Personally I find it amusing that the 0-signal comment "Thanks for all dang" is upvoted while the opposite 0-signal comment "Thanks for nothing dang" is downvoted. I mean, I think dang is chill, but neither of these really contributes to the discussion any more than the other, so shouldn't they have the same score? Upvotes really are a popularity contest these days.
Re: Best of show – abuse of libc
#46Earlier quoted context omitted.
GNU's printf specifier language is Turing complete, I believe.
Presumably it needs a loop around it, so it's not Turing-complete by itself?
Re: Best of show – abuse of libc
#47Re: Best of show – abuse of libc
#48Earlier quoted context omitted.
There is some innocent beauty in the twistedness of printf - especially with GNU extensions.
So I can port doom to gnu printf?
[0] Mentioned (but not directly linked) by TFA:
https://www.usenix.org/conference/usenixsecurity15/technical...
Re: Best of show – abuse of libc
#49Re: Best of show – abuse of libc
#50Earlier quoted context omitted.
> Format specifiers can take extra “arguments”. - "%hhn": store the number of bytes written mod 256 to the char pointer ... Oh boy. I'll put that down for my "thing I don't think I wanted to know" of the day.
There is some innocent beauty in the twistedness of printf - especially with GNU extensions.