You are not logged in.
This is fun! Here is a chance to showoff your skills. Of course you can choose whatever language you want.
Just another Perl hacker, or JAPH, typically refers to a Perl program which prints "Just another Perl hacker," (the comma is canonical but is occasionally omitted). Short JAPH programs are often used as signatures in online forums, or as T-shirt designs. The phrase or acronym is also occasionally used (without code) for a signature.
JAPH programs are classically done using extremely obfuscated methods, in the spirit of the Obfuscated C Contest. More recently, as the phenomenon has become so well known, the phrase is sometimes used in ordinary examples (without obfuscation). Even more recently the P of JAPH can also stand for Perl 6, Parrot or Pugs.
Starting easy...
Perl:
$c='python';$_=`printf hack`;$_=~s;ck;;;;$c=~s%^(?!\x68)(.)(?2)(?1)(.)(?1)(?2)(?<!.{4}h)$%$2%;print j.substr($_,1),p,$c.','
Let's go obfuscating!
Offline
Not exactly a one-liner. I guess it could be (minus the directives), but I liked this format better...
[corey@sariss ~]$ cat asm.s
.text
.globl _start
_start:
.word 0x19ba,0x0000,0xb900,0x0098,0x0040,0x01bb,0x0000,0xb800
.word 0x0004,0x0000,0x80cd,0xdb31,0x01b8,0x0000,0xcd00,0xc380
.word 0x754a,0x7473,0x6120,0x6f6e,0x6874,0x7265,0x4120,0x4d53
.word 0x6820,0x6361,0x656b,0x2c72,0x000a
[corey@sariss ~]$ as -o asm.o asm.s
[corey@sariss ~]$ ld asm.o
[corey@sariss ~]$ ./a.out
Just another ASM hacker,
[corey@sariss ~]$
I also could probably have gotten a little more clever with it, but that just sounded like too much work.
Last edited by cmtptr (2010-02-28 00:11:40)
Offline
It's an interesting code, cmtptr, since it seems to expose a bug in strace.
Stracing it shows:
stat(NULL, Just another ASM hacker,
NULL) = 25
write(0, NULL, 25 <unfinished ... exit status 0>
The string "Just another ASM hacker,\n" is 4A 75 73 74 20 61 6E 6F 74 68 65 72 20 41 53 4D 20 68 61 63 6B 65 72 2C 0A
which takes the last to lines of words.
If we disassemble the first two lines (gdb ./a.out, disas /r _start):
0x0000000000400078 <_start+0>: ba 19 00 00 00 mov $0x19,%edx
0x000000000040007d <_start+5>: b9 98 00 40 00 mov $0x400098,%ecx
0x0000000000400082 <_start+10>: bb 01 00 00 00 mov $0x1,%ebx
0x0000000000400087 <_start+15>: b8 04 00 00 00 mov $0x4,%eax
0x000000000040008c <_start+20>: cd 80 int $0x80
0x000000000040008e <_start+22>: 31 db xor %ebx,%ebx
0x0000000000400090 <_start+24>: b8 01 00 00 00 mov $0x1,%eax
0x0000000000400095 <_start+29>: cd 80 int $0x80
0x0000000000400097 <_start+31>: c3 retq
0x0000000000400098 <begin of the text>
That's a syscall 4 (__NR_write), with parameters 1 (write to stdout), 0x400098 (address if the text) and 25 (text length).
Finally it calls syscall 1 with parameter 0, ie. _exit(0).
That's using linux32 syscalls (<asm/unistd_32.h>), but with 64 bits syscalls (<asm/unistd_64.h>) syscall 4 is stat and syscall 1 is write. Which matches what strace tried to output.
$ file a.out
a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
So the kernel manages to correctly run it even though it uses 32 bit syscalls (because it isn't using a x86-64 interface?) but strace doesn't notice it and shows the 64 bit functions.
Offline
Python:
print("Just another Python hacker,")
TOOWTDI
Offline
ruby
puts 'Just another Ruby Hacker'
Got to love them interpreted launguages, with there short code snippets.
Check me out on twitter!!! twitter.com/The_Ringmaster
Offline
Ada:
With Ada.Text_IO;
Use Ada.Text_IO;
the procedure hello is
Put_Line ('I'm a Ada hacker/user')
end;
Shell Scripter | C/C++/Python/Java Coder | ZSH
Offline
Wow, way to completely miss the point guys...
It's an interesting code, cmtptr, since it seems to expose a bug in strace.
Stracing it shows:
stat(NULL, Just another ASM hacker, NULL) = 25 write(0, NULL, 25 <unfinished ... exit status 0>
The string "Just another ASM hacker,\n" is 4A 75 73 74 20 61 6E 6F 74 68 65 72 20 41 53 4D 20 68 61 63 6B 65 72 2C 0A
which takes the last to lines of words.If we disassemble the first two lines (gdb ./a.out, disas /r _start):
0x0000000000400078 <_start+0>: ba 19 00 00 00 mov $0x19,%edx 0x000000000040007d <_start+5>: b9 98 00 40 00 mov $0x400098,%ecx 0x0000000000400082 <_start+10>: bb 01 00 00 00 mov $0x1,%ebx 0x0000000000400087 <_start+15>: b8 04 00 00 00 mov $0x4,%eax 0x000000000040008c <_start+20>: cd 80 int $0x80 0x000000000040008e <_start+22>: 31 db xor %ebx,%ebx 0x0000000000400090 <_start+24>: b8 01 00 00 00 mov $0x1,%eax 0x0000000000400095 <_start+29>: cd 80 int $0x80 0x0000000000400097 <_start+31>: c3 retq 0x0000000000400098 <begin of the text>
That's a syscall 4 (__NR_write), with parameters 1 (write to stdout), 0x400098 (address if the text) and 25 (text length).
Finally it calls syscall 1 with parameter 0, ie. _exit(0).That's using linux32 syscalls (<asm/unistd_32.h>), but with 64 bits syscalls (<asm/unistd_64.h>) syscall 4 is stat and syscall 1 is write. Which matches what strace tried to output.
$ file a.out
a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not strippedSo the kernel manages to correctly run it even though it uses 32 bit syscalls (because it isn't using a x86-64 interface?) but strace doesn't notice it and shows the 64 bit functions.
It took me a few reads and some experimenting/investigating before I understood what you were getting at, since I'm admittedly new to the 64-bit world.
The code I wrote works because I'm invoking interrupt 0x80, while the 64-bit syscalls you (and strace) wanted to see are invoked using the "syscall" instruction (I suppose this is what you meant when you said it isn't using the x86-64 interface?). I suppose my code should have been...
[corey@sariss ~]$ cat asm.s
.text
.globl _start
_start:
.word 0xc748,0x19c2,0x0000,0x4800,0xc6c7,0x00a3,0x0040,0xc748
.word 0x01c7,0x0000,0x4800,0xc0c7,0x0001,0x0000,0x050f,0x3148
.word 0x48ff,0xc0c7,0x003c,0x0000,0x050f,0x4ac3,0x7375,0x2074
.word 0x6e61,0x746f,0x6568,0x2072,0x5341,0x204d,0x6168,0x6b63
.word 0x7265,0x0a2c
[corey@sariss ~]$ as -o asm.o asm.s && ld asm.o
[corey@sariss ~]$ ./a.out
Just another ASM hacker,
[corey@sariss ~]$ strace ./a.out
execve("./a.out", ["./a.out"], [/* 46 vars */]) = 0
write(1, "Just another ASM hacker,\n", 25Just another ASM hacker,
) = 25
_exit(0) = ?
[corey@sariss ~]$
Thanks for pointing that out. You caused me to learn something!
And you're right, that does appear to be a bug in strace!
Last edited by cmtptr (2010-03-08 01:05:29)
Offline
echo Just another bash lover
Offline
>025* v
>"gnufeB"v"
">"na t"v".
e >:#,_@ .
^"Jus"<".
"^"other"<"
^"lunatic"<
I need a sorted list of all random numbers, so that I can retrieve a suitable one later with a binary search instead of having to iterate through the generation process every time.
Offline
Ruby:
$><<%{SnVzdCBhbm90aGVyIHJ1YnkgaGFja2VyLA==}.unpack('m')[0]
Offline
** Gah. Never mind.
Last edited by Peasantoid (2010-03-08 22:39:03)
Offline
Scheme
(display "Just another Scheme hacker.")
currentproblem: none.
Offline
set ___ "hack%";proc ::: {_} {upvar $_ __;set __ [regsub Tcl [regsub -all \\\\\\\\ $__ Tcl] Just]};set ::_ "\\\\_\$____\\_\\\\_\$___,";::: ::_;set ____ "anoth%";eval set ::_ $::_;set ::__ "puts_\"[split [regsub -all % $::_ er] _]\"";eval [regsub _ $::__ \ ]
Offline
Brainfuck:
++++++++++[>+++>+++++++<<-]>>++++.<<+++++++[>>++++++<<-]>>+.--.+.<++.<++++[>>----<<-]>>---.<<++++[>>+++<<-]>>+.+.+++++.
------------.---.<<++++[>>+++<<-]>>+.<.<++++[>>----<<-]>>.<<++++[>>++++<<-]>>.<<++++[>>----<<-]>>-.++++++++.+++++.--------.
<<+++++[>>+++<<-]>>.<<++++++[>>---<<-]>>.++++++++.<.>---.-------.++.++++++++.------.<<++++[>>+++<<-]>>+.
Offline
>025* v >"gnufeB"v" ">"na t"v". e >:#,_@ . ^"Jus"<". "^"other"<" ^"lunatic"<
Brainfuck:
++++++++++[>+++>+++++++<<-]>>++++.<<+++++++[>>++++++<<-]>>+.--.+.<++.<++++[>>----<<-]>>---.<<++++[>>+++<<-]>>+.+.+++++. ------------.---.<<++++[>>+++<<-]>>+.<.<++++[>>----<<-]>>.<<++++[>>++++<<-]>>.<<++++[>>----<<-]>>-.++++++++.+++++.--------. <<+++++[>>+++<<-]>>.<<++++++[>>---<<-]>>.++++++++.<.>---.-------.++.++++++++.------.<<++++[>>+++<<-]>>+.
Showoffs! Esoteric languages should be disqualified.
Offline
HLA:
Program JustAnother;
#include( "stdlib.hhf" );
begin JustAnother;
stdout.put("Just Another HLA Hacker.", nl );
end JustAnother;
Offline
Is it just me, or are a lot of people missing the point?
Let's go obfuscating!
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
for post in
\Index\General/ Programming/ Forum/\;do
LD_PRELOAD=/usr/lib/automerge.so.1 /usr/bin/post_reply --quotepost "Wanna use bash, huh???";
done
( waiting for the debugging replies lol)
Last edited by flamelab (2010-04-11 23:34:43)
Offline
Python:
print reduce(lambda l,x:l+chr(int(''.join(x)[1:])+int(x[0]*2)),zip('2'*27,*str((17630002262754493<<128)+(7497280228225801499<<64)+9082866329653831730).split(str(51>>3))),'')
Offline
wget bbs.archlinux.org/viewtopic.php?pid=742278 -qO-|sed -n "/<t/s/.*\(J.*\) &.*; \(.*r\).*/\1 data aquisition and formatting \2./;T;p;b"
...one of the more ineffective ways to do it?
Last edited by tlvb (2010-04-12 17:50:46)
I need a sorted list of all random numbers, so that I can retrieve a suitable one later with a binary search instead of having to iterate through the generation process every time.
Offline
Another in python,
class _:__getattr__=lambda *_:''.join(map(lambda _:''.join(_),zip(_[1],'utaohrpto_akr')))
_=_().js_nte_yhnhce;print(_.replace('_','hello world'[5]))
Offline
C:
main(){int j,u[22]={0};while(!u[12]){while(u[j=rand()%22]++);putchar("atCorhnhteua\nsk eJcr "[j]);}}
Offline
ruby:
[926381, 23200231779, 1299022, 1045307475].collect {|a| a.to_s(36)}.join(" ")
Each number in the array is converted to strings after 36-base. They are then joined together to a string, with spaces as seperators.
(please forgive me for my english )
Last edited by jhvid (2010-04-15 18:18:23)
GCS d- s-:+ a12 C++++ U++++ L+++ P--- E--- W+++ N+ o K- w--- O? M-- V? PS PE
Y- PGP? t? 5? X? R tv b+++ DI+ D- G++ e++ h! !r !y
Please ignore me... I'm pretty weird...
Offline
This is quite addictive. Here's another in python,
def _rehtona_tsuj (): '''rekcah nohtyp''' ;pass
_=_rehtona_tsuj;map(lambda x: __import__ ('sy'
's') .stdout. write(eval("_.%s[::- 1]"%x)),('_'
'_name__.replace("_"," ")-__doc__'.split('-')))
Offline