00:28:19 -!- Lord_of_Life_ has joined. 00:29:41 what's this 00:31:02 -!- Lord_of_Life has quit (Ping timeout: 268 seconds). 00:31:06 -!- Lord_of_Life_ has changed nick to Lord_of_Life. 00:34:12 I assume the gist of the joke was that score. 00:35:07 There's a web submission form at https://zem.fi/bfjoust/ although you don't get to use your nickname, all programs submitted from there are "web.*". 00:35:36 ah it's a bfjoust result 00:36:51 -!- b_jonas has quit (Quit: leaving). 00:55:08 -!- Sgeo__ has quit (Read error: Connection reset by peer). 00:56:14 -!- Sgeo has joined. 01:28:55 -!- oerjan has joined. 01:44:08 [[Talk:String rewriting paradigm]] M https://esolangs.org/w/index.php?diff=60535&oldid=60533 * Salpynx * (-2) Undo revision 60533 by [[Special:Contributions/Salpynx|Salpynx]] ([[User talk:Salpynx|talk]]) actually it's more interesting in the original form, and prob not a bug 01:48:25 `` cp src/hello*.c tmp; cd tmp; gcc -o hello hello.c; gcc -o hello2 hello2.c 01:48:27 No output. 01:48:36 `ls tmp 01:48:37 UnicodeData.txt \ a \ b \ a.c \ a.out \ hello \ hello.c \ hello2 \ hello2.c \ paste \ perm10 \ rakudo-star-2018.06 \ spline \ spout \ spout.raw 01:48:48 `tmp/hello 01:48:48 Hello, world! 01:48:51 `tmp/hello2 01:48:51 No output. 01:49:09 `cat tmp/hello2.c 01:49:09 const char main[] = "AXAYAZA[A\\ATX-pppp-0```- ///P^VTXH10XP4>40PZ414>P_\x0f\x05XATASARAQAP\xc3Hello, world!\n"; 01:50:10 That always makes me think of AT commands for some reason. 01:50:17 I think it's the "ATX-pppp-0" part. 01:50:55 hello2.c seems to have bitrotted. i was trying to test them because of a question in PPCG chat. 01:52:29 Back in the olden (or at least moderately moldy) days, you could use "ping -p 2b2b2b415448300d0a" to disconnect people from IRC. 01:53:04 `file tmp/hello2 01:53:05 tmp/hello2: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=a83df14d01723d512f38d7545549f6275133454f, not stripped 01:53:23 `tmp/hello2 01:53:23 No output. 01:53:48 `url tmp/hello2.c 01:53:49 https://hack.esolangs.org/tmp/hello2.c 01:54:46 `cat tmp/hello2.c 01:54:46 const char main[] = "AXAYAZA[A\\ATX-pppp-0```- ///P^VTXH10XP4>40PZ414>P_\x0f\x05XATASARAQAP\xc3Hello, world!\n"; 01:55:06 write(1, 0xd7ef86c0, 14) = -1 EFAULT 01:55:12 I wonder what's happened to it. 01:56:15 Maybe it could even be collateral damage from some security feature. On my home system, it just plain segfaults except with "-fuse-ld=gold". (With that, it has the same behavior of not crashing but just not printing anything.) 01:56:44 hm 01:57:09 the originals were put in the bot back in 2013 by Jafet 01:57:30 i don't remember if e made them or copied them from elsewhere 01:57:51 The disassembled code looks kinda odd, but printable x86 always does. 01:58:16 it's not entirely prinable 01:58:22 *+t 01:58:50 Oh, you're right. I wonder why it's that long then. 01:59:43 `` cd tmp; gcc -O2 -o hello2 hello2.c 01:59:44 No output. 01:59:53 `tmp/hello2 01:59:53 No output. 02:00:12 oh well duh 02:00:24 it's not like gcc understands what's happening 02:01:17 I'm not sure how it's getting that address for write. I was expecting the usual position-independent tricks (or on x86-64 it's just a lea with rip-relative addressing, which isn't a really a trick) but it just does a bunch of pushing, popping and math. 02:03:51 `cat tmp/hello.c 02:03:51 const short main[] = {18517,58761,49201,49801,49407,51081,3816,0,18432,27749,28524,8236,28535,27762,8548,24074,3762,1295,15536,-207,1295}; 02:04:13 they're not accidentally the same? 02:05:40 No, they look entirely different. 02:06:18 That's rather simpler, and uses the classic position-independent trick (call+pop). 02:06:47 It's still a little bit more complicated than necessary (since it also exits via syscall), but less so than hello2. 02:07:10 ic 02:11:07 Well, there's only 32-bit displacement for RIP-relative addressing, so you'd get a few 0s in there, ... but it's not like that's an issue for a short[]. 02:14:45 oh maybe that's why it's not a string constant 02:15:03 -!- arseniiv has quit (Ping timeout: 245 seconds). 02:19:43 -!- olsner has quit (Ping timeout: 246 seconds). 02:20:53 You can put zero bytes in a string literal. 02:21:00 I mean, even in the middle, not just the end. 02:21:08 `` echo 'const char main[] = "1\xc0\xff\xc0""1\xff\xff\xc7H\x8d""5\x07\0\0\0""1\xd2\xb2\x0e\x0f\x05\xc3""Hello, world!\n";' | gcc -x c - -o /tmp/hello3 && /tmp/hello3 02:21:09 Hello, world! 02:21:17 That's exceedingly ugly, though. 02:26:23 in freefall, one of those toys looks a little familiar. 02:26:59 fancy 02:34:15 I guess if you do the numbers approach from hello.c, and the sort of straightforward code you'd write under normal circumstances, it's not too bad. 02:34:19 `` echo 'const long main[] = {5244310924189237688, 1061160662199711117, 7298297622647799808, 8245940422806826092, 169960556};' | gcc -x c - -o /tmp/hello3 && /tmp/hello3 02:34:20 Hello, world! 02:37:34 Another reason why the hello2.c code might've rotten: it starts with a lot of pops, it might be making some assumptions about the initial state of the stack. 02:38:06 In fact, that might be how it's arriving at the address of the string to write, and maybe ASLR or something has changed. 02:41:49 Also the nonprintable parts (\x0f\x05 and \xc3) of hello2 are the "syscall" and "ret" instructions, which are pretty hard to work around when you don't have any read-write-execute memory. So I guess it's trying to be maximally printable under those constraints. 02:54:05 mhm 03:11:28 -!- oerjan has quit (Quit: Nite). 03:52:34 -!- olsner has joined. 04:17:50 -!- Yevano_ has joined. 04:20:52 -!- Yevano has quit (Ping timeout: 245 seconds). 04:23:08 -!- moei has joined. 04:23:28 -!- Yevano_ has changed nick to Yevano. 04:27:09 -!- danieljabailey has joined. 04:46:17 -!- danieljabailey has quit (Ping timeout: 245 seconds). 05:31:26 -!- FreeFull has quit. 05:43:29 -!- adu has joined. 06:05:25 -!- Yevano has quit (Ping timeout: 255 seconds). 06:53:14 -!- TheWild has joined. 07:08:39 -!- adu has quit (Read error: Connection reset by peer). 08:14:58 -!- Lord_of_Life has quit (Ping timeout: 246 seconds). 08:18:52 -!- Lord_of_Life has joined. 08:32:21 -!- adu has joined. 09:07:50 I think I may be losing track of what's going on in GG 09:29:29 -!- adu has quit (Quit: adu). 10:07:59 -!- AnotherTest has joined. 10:13:05 -!- nfd9001 has quit (Ping timeout: 268 seconds). 10:59:50 do we have PHP equivalent of JSFuck? 11:01:18 -!- nfd9001 has joined. 11:01:24 i don't think it will be that easy 11:01:27 https://bolknote.ru/all/4065/ 11:01:35 the autocasts of php are much less wild 11:10:16 thanks rain1 11:13:22 -!- joast has quit (Ping timeout: 245 seconds). 12:30:02 -!- Lord_of_Life has quit (Ping timeout: 245 seconds). 12:31:44 -!- Lord_of_Life has joined. 12:54:29 -!- Lord_of_Life has quit (Ping timeout: 246 seconds). 12:56:47 -!- Lord_of_Life has joined. 13:17:35 -!- heroux has quit (Read error: Connection reset by peer). 13:18:15 -!- heroux has joined. 13:22:09 -!- arseniiv has joined. 14:00:52 -!- wob_jonas has joined. 14:01:04 fizzie: sure, but those start with "+++AT", and that hello world thing doesn't have that 14:01:59 have you tried compiling that to x86_32 by the way? IIRC the original HackEso used that. 14:09:14 Yes, didn't work at least out of the box -- it uses "syscall", which IIRC is only available as a Linux system call convention on x86-64. The ones available on x86-32 are the int 0x80 and sysenter paths. 14:15:55 fizzie: do you mean the syscall instruction, or the syscall libc macro/function? 14:16:33 and yes, the syscall instruction is only available on x86_64 14:17:53 ah I see. it has \x0f\x05 in it, which is the syscall instruction, and you suppose that gets ran 14:18:04 in that case, have you tried to compile it x86_64? 14:20:20 ah I see 14:37:24 -!- wob_jonas has quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client). 14:38:22 -!- Sgeo has quit (Ping timeout: 245 seconds). 14:59:55 -!- TheWild has quit (Quit: TheWild). 15:05:21 -!- tromp has quit (Remote host closed the connection). 15:14:02 -!- tromp has joined. 15:23:21 -!- wob_jonas has joined. 15:23:59 You know how there are some programs and websites where if you participate, you can upload a small avatar image associated with your user account, and then the website displays it in multiple small sizes, right? 15:26:31 The problem is that since multiple sizes are involved, such as 32x32 and 24x24 and 16x16 in the case of StackExchange, or 30x30 circular and 24x24 circular in the case of another example, it's hard to make an image that looks good when resized to each of those sizes (plus sometimes a large size). 15:27:14 It would be nice if you could just upload separate images for each resolution, but obviously websites don't want to just allow it, because people could then upload deliberately very different images to confuse others. 15:27:29 I don't think there's a good solution for this. 15:28:10 When more trust is involved, such as for windows icons, you are allowed to use different images at different resolutions. 15:49:44 -!- wob_jonas has quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client). 15:56:43 [[Special:Log/newusers]] create * Sygmei2 * New user account 16:02:12 [[Esolang:Introduce yourself]] https://esolangs.org/w/index.php?diff=60536&oldid=60531 * Sygmei2 * (+75) /* Introductions */ 16:02:17 [[Kitanai]] https://esolangs.org/w/index.php?diff=60537&oldid=50294 * Sygmei2 * (+586) /* Full language Syntax : */ 16:07:24 [[Kitanai]] https://esolangs.org/w/index.php?diff=60538&oldid=60537 * Sygmei2 * (+654) /* Standard Library */ 16:21:04 [[Kitanai]] https://esolangs.org/w/index.php?diff=60539&oldid=60538 * Sygmei2 * (-24) /* Examples */ 16:25:33 -!- bobby has quit (Ping timeout: 246 seconds). 16:27:10 -!- bobby has joined. 16:34:41 -!- bobby has quit (Remote host closed the connection). 16:36:55 -!- bobby has joined. 16:43:58 -!- bobby has quit (Remote host closed the connection). 16:44:37 -!- bobby has joined. 16:49:12 -!- danieljabailey has joined. 16:51:52 -!- Bob- has joined. 16:52:19 -!- bobby has quit (Ping timeout: 252 seconds). 16:57:13 -!- bobby has joined. 16:57:18 -!- Bob- has quit (Ping timeout: 252 seconds). 17:11:57 -!- LKoen has joined. 17:13:00 @tell wob_jonas Maybe it could make sense to allow different images, but require some sort of (well-defined and tooled) visual similarity score to be good enough. Although I'm sure some of those might have pathological cases that could still look similar to the machine but different to humans. 17:13:01 Consider it noted. 17:17:46 -!- joast has joined. 17:30:47 -!- LKoen has quit (Remote host closed the connection). 17:36:36 -!- b_jonas has joined. 17:39:49 fizzie: it's tricky, yes. one problem is that for the small images, you often want to show a crop of the larger image (still scaled down), or a stylized version, and it's hard to make a similarity function that allows good crops but doesn't allow bad crops 17:41:05 it's hard even if the uploader is allowed to give some hints to it apart from the image data 17:41:40 I think it's hard even for humans 17:41:42 oh well 17:42:03 I mean, it's *supposed* to be easy for humans 17:42:11 because the end goal is that it can't confuse humans 17:42:12 but still 17:42:56 mind you, even without different resolutions of avatars, there are already some attacks people can try, with similar or identical avatar images and/or similar or identical nicks 17:43:35 or users can upload pornographic avatars, but that gets tricky at low resolutions 17:54:32 -!- danieljabailey has quit (Ping timeout: 250 seconds). 18:31:54 -!- ^[ has quit (Ping timeout: 252 seconds). 18:31:54 -!- lynn has quit (Ping timeout: 252 seconds). 18:33:41 -!- lynn has joined. 18:35:05 -!- ^[ has joined. 18:41:58 `` echo 'const char main[] = "%0000%HELOPPPPPPT]5Hell1E XP5o wo1E$XP5rld!1E(XP4@4J1E,4@4GPZ$AP_^^^^T^\x0f\x05XX\xc3";' | gcc -x c - -o /tmp/hello4 && /tmp/hello4 18:41:59 Hello world! 18:42:20 There, that should be a lot more portable and not really that much longer. 18:42:40 (It's portable because it encodes the payload text inside immediate operands.) 18:44:20 It'd be a lot simpler on x86-32, because you can just PUSH imm32 without leaving any gaps. On x86-64, that still decrements the stack pointer by 8. 18:46:11 oh hey 18:47:07 fizzie: but on x86_64, you get RIP-relative addressing. or do you want to use only printable characters? 18:47:28 It's under the same constraints as the one we were failing to make to work, "only printable except for syscall and ret". 18:47:38 yeah, with those exceptions that you explained earlier 18:48:45 I made one with RIP-relative addressing earlier, it's the one encoded as long[]. 18:49:23 * kmc seeks and offers hugs 18:50:00 fizzie: oh right. in that one, why don't you write the numbers as hexadecimal literals? or use long long, or both? 18:50:37 They were already 64-bit, it was assuming I32LP64. 18:51:26 ah 18:51:30 sorry, that makes sense 18:51:36 um, hexadecimal then 18:51:47 also, isn't the stack executable if you compile for linux like this? I'll have to test that 18:51:55 maybe it isn't on x86_64 or something 18:53:01 Hexadecimal constants might've saved a little space. Just thought it'd nicely obfuscate the "Hello, world!" string to do decimal. Also, with the "0x" prefixes probably not a big difference. 18:53:38 Actually, on my system, neither the stack *nor* the place where read-only data goes were executable. 18:54:32 Back when I was last playing, string literals and static const char variables were indeed executable, because linkers tended to merge .rodata and .text sections into a single read-and-execute-but-not-write ELF segment. 18:54:48 `rm a.out 18:54:49 No output. 18:55:09 But at least on my Debian testing + default GCC flags to use classic GNU as, it's no longer the case: .rodata goes in a separate read-only ELF segment, distinct from the read-and-execute .text. 18:55:32 So when testing this at home, I have to use "-fuse-ld=gold", which still makes them executable. 18:56:02 (gold provides a flag to control this, so "-fuse-ld=gold -Wl,--rosegment" makes them non-executable again.) 18:56:04 fizzie: ok. I'm going to test on HackEso anyway 18:57:00 I think "no mappings that are both writable and executable by default" has been a standard practice for quite a while now. 18:57:49 There is (or at least was) a flag you can set on the binary to make stack executable again, though, via something like "-z execstack" at link time. 19:03:15 fizzie: yes, but for a while it wasn't enforced, because x86 didn't use to have a way to mark pages non-executable (only segments), and then libraries wanted to be compatible with programs that assumed that any readable page is also executable 19:03:24 but that's on x86_32, not on x86_64 19:04:08 but you are right, the stack isn't executable 19:05:26 then you are right in what you said 19:05:43 you could of course get a writable and executable memory area, but you would need to do a system call for that 19:05:54 now I don't know if there's any other system call interface on x86_64 linux than this 19:07:20 On most x86-64 kernels (those who support 32-bit binaries at all), you can actually call (even from 64-bit code) through the int 0x80 interface. 19:07:48 But it truncates pointers to 32 bits. 19:08:21 And 0x80 isn't printable either. :) 19:09:01 (Or 0xcd, for "int".) 19:10:20 Of course you have the full C runtime library available, you could just go and look up the address of write(2) and call that. 19:11:10 fizzie: can you call them with the sysenter instruction? that one is older than x86_64 19:11:47 I would assume so, but the opcode for that is "0F 34", which is only half-printable. 19:12:06 full C runtime library => sure, you can just int main(){printf("hello, world");}, or at least refer to a function address in the initializer of a long main[] = { ... }; 19:12:41 fizzie: my guess is no, in that I think syscall was introduced at the same time as x86_64, so there's no reason not to use it as the main syscall interface for x86_64 architecture 19:13:10 Not the main syscall interface, no, I was just assuming it'd support both sysenter and int 0x80 for the 32-bit compatibility layer. 19:13:14 Haven't looked that up though. 19:13:39 or you could refer to the address of main in the initializer, to be able to load the address of the literal 19:13:54 fizzie: the 32-bit compatibility layer is for 32-bit code 19:14:00 oh 19:14:02 wait 19:14:05 Yes, but as mentioned, you can call it from 64-bit code as well. 19:14:42 does int 0x80 and sysenter actually call to the same kernel routine from 64-bit or 32-bit code, so it would be extra work to check which one is calling? 19:14:46 that would make sense 19:15:12 I just sort of assumed that the calls from 32-bit code would naturally land to a different place than the ones from the 64-bit code, but that's stupid 19:15:17 that's not really how x86 works 19:15:27 so that's why there's a syscall instruction! 19:17:21 -!- LKoen has joined. 19:17:50 hmm no, it isn't 19:17:56 -!- Essadon has joined. 19:17:59 they're genuinely different 19:18:12 -!- Essadon has quit (Max SendQ exceeded). 19:18:14 and besides, they could just dispatch by using different syscall numbers 19:18:39 although there's a slight penalty for that, because the lowest syscall numbers are already used 19:20:06 In any case, I'm guessing you should be able to call write(/printf/puts) from a fully printable 'const char main[] = "...";'-form program, you'd just have to do the symbol lookup manually. Although that's kind of an odd problem statement in the first place, it's more strict than just "the main function body must be made out of printable bytes". 19:20:15 -!- TheWild has joined. 19:20:24 b_jonas: they must be different entry points, because the state is different 19:20:35 e.g. after int 0x80, there is already a kernel stack and such 19:20:56 after syscall the userspace registers are still in place, except for ip and sp 19:21:00 which are loaded from MSRs 19:21:12 kmc: int vs sysenter vs syscall are different entry points, sure 19:21:26 oh, I see what you mean now 19:21:37 kmc: what I assumed as that int 0x80 called from 32-bit code vs called from 64-bit code were different entry points 19:21:43 but it wouldn't work that way 19:21:48 There are some Linux demoscene intros that do hash-based symbol lookups to avoid having to include all those long X/OpenGL function names. 19:21:53 it would be extra work for the kernel to distinguish between those 19:22:03 fizzie: hehehe 19:22:04 fizzie: seems reasonable 19:22:19 They're all very envious regarding Windows and its ordinal-based imports. 19:22:56 fizzie: that makse sense, though I'd assume they also just compress the whole executable 19:25:17 I'm sure some do that as well. Although I think most of the innovation happens on the Windows side. There are pretty sophisticated executable packers that do a lot of nontrivial transformations on the code to make it more compressible. 19:25:33 as for that, how does an x86_64 program call into an x86_32 code sequence in linux? what does it have to ask the kernel? I think the cpu knows the difference from the attributes of the code segment descriptor 19:26:22 fizzie: sure, but it's hard to put such packers in a smaller demoscene. I was thinking just ordinary compressors, still useful for something not too small, and pre-installed on a linux machine 19:27:13 is there maybe a segment descriptor with a fixed number that it has to jump to? 19:27:28 Farbrausch have released their old kkrunchy tool designed for 64k intros -- http://www.farbrausch.de/~fg/kkrunchy/ -- and I think http://www.crinkler.net/ is the state-of-the-art for 1k/4k intros. 19:27:47 and how do you ask gcc to do that too? 19:28:08 fizzie: oh, 1k and 4k are different. I was thinking more of 64k or 16k intros, sorry 19:28:20 mostly because you mentioned linux 19:28:30 Right. 19:29:04 plus there are some of these browser-based intros 19:31:40 here's a tiny animation thing for linux I made. it's not trivial to run it on modern linuxen. => https://www.perlmonks.com/?node_id=793690 19:32:18 I don't know how mixed 32-bit/64-bit code works on Linux. It might not even be a really full-fledged feature. 19:32:23 Also I'm not sure what the rationale is for the int 0x80 entry point being available for 64-bit code in a 64-bit process. If mixed code was supported, that'd be one good reason. Or it could just be that it was easier to have it than not have it. 19:33:06 -!- LKoen has quit (Remote host closed the connection). 19:35:08 * b_jonas looks at http://refspecs.linuxbase.org/ 19:35:25 fizzie: I think it's because it would be extra work for the kernel to forbid that interface 19:35:57 the kernel doesn't want to change the interrupt table just because it switches between processes, and doesn't want to check whether to allow the interface at each syscall entry 19:36:50 eek this doc is ugly 19:41:00 at least that doc says that system calls are done using the syscall instruction, and tells how the arguments are passed 19:42:00 (syscall number and return value or -errno in RAX; arguments in RDI, RSI, RDX, R10, R8, R9; scratch registers are RCX and R11) 19:42:44 it doesn't seem to mention how to call 32-bit functions 19:43:45 liiiiiiiiiiinux 19:44:56 I mean, this is totally an esoteric only application 19:45:03 I certainly don't want to call 32-bit code from a real program 19:48:43 I'll be happy when x86_32 will finally be gone except very early to boot the cpu to 64-bit mode in the boot loader 19:49:05 and perhaps in the kernel for the same reason 20:16:09 I don’t think you can mix 32 and 64 like that 20:28:32 [[Special:Log/newusers]] create * Watashiwaanata * New user account 20:29:46 you have to go into 48 bit mode, obviously :P 20:36:57 -!- tromp has quit (Remote host closed the connection). 20:37:10 -!- FreeFull has joined. 20:40:54 [[Esolang:Introduce yourself]] https://esolangs.org/w/index.php?diff=60540&oldid=60536 * Watashiwaanata * (+150) /* Introductions */ 20:51:10 [[User:Watashiwaanata]] N https://esolangs.org/w/index.php?oldid=60541 * Watashiwaanata * (+187) Created page with "

Watashi wa anata<..." 20:57:43 [[User:Watashiwaanata]] https://esolangs.org/w/index.php?diff=60542&oldid=60541 * Watashiwaanata * (-8) 21:53:36 -!- TheWild has quit (Quit: TheWild). 21:55:47 -!- danieljabailey has joined. 22:05:39 -!- Yevano has joined. 22:07:28 -!- b_jonas has quit (Quit: leaving). 22:10:24 Lol I made this tool print an error message of "Oren is a moron" when constraints are violated, apparently they are in fact violated 22:10:50 -!- arseniiv has quit (Ping timeout: 258 seconds). 22:11:16 just not violated on my dev machine 22:13:48 this thing prints out so many error messages that mine have to be avant garde to get user attention 22:14:01 -!- tromp has joined. 22:14:49 -!- moei has quit (Quit: Leaving...). 22:18:41 haha 22:38:26 -!- AnotherTest has quit (Ping timeout: 258 seconds). 22:50:13 -!- LKoen has joined. 22:55:48 -!- LKoen has quit (Remote host closed the connection). 22:58:34 -!- LKoen has joined. 23:00:38 -!- LKoen has quit (Remote host closed the connection). 23:01:07 -!- LKoen has joined. 23:03:12 -!- LKoen has quit (Remote host closed the connection). 23:03:27 -!- LKoen has joined. 23:13:46 -!- LKoen has quit (Remote host closed the connection). 23:33:00 -!- Sgeo has joined. 23:48:56 -!- tromp has quit (Remote host closed the connection).