You are not logged in.

#26 2010-04-16 03:30:33

cmtptr
Member
Registered: 2008-09-01
Posts: 135

Re: Just Another <insert language here> Hacker,

tavianator wrote:

C:

main(){int j,u[22]={0};while(!u[12]){while(u[j=rand()%22]++);putchar("atCorhnhteua\nsk eJcr  "[j]);}}

I liked this one a lot!  Can I ask how you came up with it?
Unfortunately it was missing a comma on the end, so I fixed it.  I hope you don't mind:

main(){int j,u[23]={0};while(!u[19]){while(u[j=rand()%23]++);putchar("uatChks rteJ r hon,\neca"[j]);}}

Offline

#27 2010-04-16 03:47:53

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 859
Website

Re: Just Another <insert language here> Hacker,

Oh right, thanks!  I dunno how I came up with it; the typical C hack involves something usually, but not technically, portable (this should work on any system using glibc).  And this was more interesting than printf("Just another C Hacker,\n").

Offline

#28 2010-04-16 04:02:14

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: Just Another <insert language here> Hacker,

tlvb wrote:
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?

Nice one dear sir...

Offline

#29 2010-04-16 04:40:19

smakked
Member
From: Gold Coast , Australia
Registered: 2008-08-14
Posts: 420

Re: Just Another <insert language here> Hacker,

Nice thread guys, .....NFI whats going on tho lol


Certified Android Junkie
Arch 64

Offline

#30 2010-05-13 19:51:10

hidefromkgb
Member
Registered: 2009-08-03
Posts: 146

Re: Just Another <insert language here> Hacker,

Just another attempt to write JAPH in assembly.
Definitely not a one-liner.
Works only on x86_64.
Non-optimized (the very code costed me more time than expected, so let it simply work).
PS. Base address 0x004000B0 is vital for the word "Just" to render properly, keep this in mind when linking!

[SECTION .text];

  MOV ECX, $;
  CALL @woot;
  INT 80h;
  XOR EBX, EBX;
  MOV EAX, 1;
  INT 80h;

@woot:
  SHL EAX, 3;
  PUSH RBP;
  MOV RBP, RSP;
  PUSH RCX;

  LEA RDX, [@buff-@main - 28];
  LEA RSI, [@main + 17];
  MOV RAX, @buff;
  LEA RDI, [RAX + 17];
  MOV RCX, 18;
  MOV ESP, 0C2AEEBA4h;

@main:
  ADD AL, 18;
  MOV [RAX], ESP;
  XOR AL,  01110011b;
  TEST EAX, 9AEB4CF3h;
  ADC EDX, ESI;
  TEST AL, 01101000b;
  JE @skip;
    XCHG EDX, EAX;
    STD;
    REPNE MOVSB;

    SHR BYTE [RAX+32], 1;
    MOV AX, [@main+22];
    MOV [@buff+22], AX;
    MOV AX, 7773h;
    SUB AX, [@main];
    MOV [@buff], AX;
    MOV RSI, [RBP-8];
  @skip:
  XOR BYTE [@buff+6], "l";
  CLD;
  MOV EAX, 3;
  MOV EDX, EAX;

  LODSQ;
  BSWAP RAX;
  XOR RAX, [RDI+1];
  BSWAP RAX;
  MOV [RDI+1], RAX;
  LODSQ;
  BSWAP RAX;
  XOR RAX, [RDI+9];
  BSWAP RAX;
  MOV [RDI+9], RAX;
  LODSQ;
  BSWAP RAX;
  XOR RAX, [RDI+17];
  BSWAP RAX;

  MOV [RDI+17], RAX;
  MOV EAX, 4;
  SHL EDX, 3;
  LEA RCX, [RDI+1];
  MOV RSP, RBP;
  POP RBP;
  RET;

[SECTION .bss];
  @buff RESQ 3;

Last edited by hidefromkgb (2010-05-13 19:54:29)

Offline

Board footer

Powered by FluxBB