fork(1) download
  1. #!/usr/bin/perl
  2.  
  3. use warnings;
  4. use strict;
  5.  
  6. undef $/;
  7. my $input = <>;
  8.  
  9. $input = unpack("H*", $input);
  10. my @integers;
  11.  
  12. while (length($input) > 8) {
  13. my $str = substr($input, 0, 8);
  14. $str =~ s/(.{2})(.{2})(.{2})(.{2})/$4$3$2$1/;
  15. push(@integers, ("0x".$str));
  16. $input = substr($input, 8);
  17. }
  18.  
  19. my $buf = "";
  20. while (length($input) > 0) {
  21. $buf .= substr($input, -2);
  22. $input = substr($input, 0, -2);
  23. }
  24.  
  25. push(@integers, sprintf("0x%08x", hex($buf)));
  26. my $stck_deep = ($#integers + 1) * 4;
  27.  
  28. print <<EOS
  29. .section .text.startup,"ax",\@progbits
  30. .globl main
  31. .type main, \@function
  32. main:
  33. pushl %ebp
  34. movl %esp, %ebp
  35.  
  36. subl \$$stck_deep, %esp
  37.  
  38. movl \$$integers[0], (%esp)
  39. EOS
  40. ;
  41.  
  42. for my $i (1 .. $#integers) {
  43. printf("\tmovl \$%s, %d(%%esp)\n", $integers[$i], $i * 4);
  44. }
  45.  
  46. print <<EOS
  47. movl \$0x0, $stck_deep(%esp)
  48.  
  49. pushl %esp
  50. call printf
  51. popl %eax
  52.  
  53. addl \$$stck_deep, %esp
  54.  
  55.  
  56. xorl %eax, %eax
  57. leave
  58. ret
  59.  
  60. EOS
  61. ;
  62.  
Success #stdin #stdout 0s 4728KB
stdin
So Like A Rose
Garbage

Baby thinks he's dying
Lost inside his bedroom
Mommy won't stop crying
And daddy's always working

There's no going back
There's no going back
There's no going back
On this one

Baby wakes up with the sun
While everyone is sleeping
He thinks he's going crazy
But this could be the big one

There's no going back
There's no going back
There's no going back

Sleeping with ghosts
It's such a warming experience
The stars are out tonight
Only they can hear you breathing

You're so like a rose
You're so like a rose
You're so like a rose
I wish you could stay here


http://w...content-available-to-author-only...e.com/watch?v=HJGtqLnJvc4
stdout
        .section        .text.startup,"ax",@progbits
        .globl  main
        .type   main, @function
main:
        pushl   %ebp
        movl    %esp, %ebp

	subl $632, %esp

	movl $0x4c206f53, (%esp)
	movl $0x20656b69, 4(%esp)
	movl $0x6f522041, 8(%esp)
	movl $0x470a6573, 12(%esp)
	movl $0x61627261, 16(%esp)
	movl $0x0a0a6567, 20(%esp)
	movl $0x79626142, 24(%esp)
	movl $0x69687420, 28(%esp)
	movl $0x20736b6e, 32(%esp)
	movl $0x73276568, 36(%esp)
	movl $0x69796420, 40(%esp)
	movl $0x4c0a676e, 44(%esp)
	movl $0x2074736f, 48(%esp)
	movl $0x69736e69, 52(%esp)
	movl $0x68206564, 56(%esp)
	movl $0x62207369, 60(%esp)
	movl $0x6f726465, 64(%esp)
	movl $0x4d0a6d6f, 68(%esp)
	movl $0x796d6d6f, 72(%esp)
	movl $0x6e6f7720, 76(%esp)
	movl $0x73207427, 80(%esp)
	movl $0x20706f74, 84(%esp)
	movl $0x69797263, 88(%esp)
	movl $0x410a676e, 92(%esp)
	movl $0x6420646e, 96(%esp)
	movl $0x79646461, 100(%esp)
	movl $0x61207327, 104(%esp)
	movl $0x7961776c, 108(%esp)
	movl $0x6f772073, 112(%esp)
	movl $0x6e696b72, 116(%esp)
	movl $0x540a0a67, 120(%esp)
	movl $0x65726568, 124(%esp)
	movl $0x6e207327, 128(%esp)
	movl $0x6f67206f, 132(%esp)
	movl $0x20676e69, 136(%esp)
	movl $0x6b636162, 140(%esp)
	movl $0x6568540a, 144(%esp)
	movl $0x73276572, 148(%esp)
	movl $0x206f6e20, 152(%esp)
	movl $0x6e696f67, 156(%esp)
	movl $0x61622067, 160(%esp)
	movl $0x540a6b63, 164(%esp)
	movl $0x65726568, 168(%esp)
	movl $0x6e207327, 172(%esp)
	movl $0x6f67206f, 176(%esp)
	movl $0x20676e69, 180(%esp)
	movl $0x6b636162, 184(%esp)
	movl $0x206e4f0a, 188(%esp)
	movl $0x73696874, 192(%esp)
	movl $0x656e6f20, 196(%esp)
	movl $0x61420a0a, 200(%esp)
	movl $0x77207962, 204(%esp)
	movl $0x73656b61, 208(%esp)
	movl $0x20707520, 212(%esp)
	movl $0x68746977, 216(%esp)
	movl $0x65687420, 220(%esp)
	movl $0x6e757320, 224(%esp)
	movl $0x6968570a, 228(%esp)
	movl $0x6520656c, 232(%esp)
	movl $0x79726576, 236(%esp)
	movl $0x20656e6f, 240(%esp)
	movl $0x73207369, 244(%esp)
	movl $0x7065656c, 248(%esp)
	movl $0x0a676e69, 252(%esp)
	movl $0x74206548, 256(%esp)
	movl $0x6b6e6968, 260(%esp)
	movl $0x65682073, 264(%esp)
	movl $0x67207327, 268(%esp)
	movl $0x676e696f, 272(%esp)
	movl $0x61726320, 276(%esp)
	movl $0x420a797a, 280(%esp)
	movl $0x74207475, 284(%esp)
	movl $0x20736968, 288(%esp)
	movl $0x6c756f63, 292(%esp)
	movl $0x65622064, 296(%esp)
	movl $0x65687420, 300(%esp)
	movl $0x67696220, 304(%esp)
	movl $0x656e6f20, 308(%esp)
	movl $0x68540a0a, 312(%esp)
	movl $0x27657265, 316(%esp)
	movl $0x6f6e2073, 320(%esp)
	movl $0x696f6720, 324(%esp)
	movl $0x6220676e, 328(%esp)
	movl $0x0a6b6361, 332(%esp)
	movl $0x72656854, 336(%esp)
	movl $0x20732765, 340(%esp)
	movl $0x67206f6e, 344(%esp)
	movl $0x676e696f, 348(%esp)
	movl $0x63616220, 352(%esp)
	movl $0x68540a6b, 356(%esp)
	movl $0x27657265, 360(%esp)
	movl $0x6f6e2073, 364(%esp)
	movl $0x696f6720, 368(%esp)
	movl $0x6220676e, 372(%esp)
	movl $0x0a6b6361, 376(%esp)
	movl $0x656c530a, 380(%esp)
	movl $0x6e697065, 384(%esp)
	movl $0x69772067, 388(%esp)
	movl $0x67206874, 392(%esp)
	movl $0x74736f68, 396(%esp)
	movl $0x74490a73, 400(%esp)
	movl $0x73207327, 404(%esp)
	movl $0x20686375, 408(%esp)
	movl $0x61772061, 412(%esp)
	movl $0x6e696d72, 416(%esp)
	movl $0x78652067, 420(%esp)
	movl $0x69726570, 424(%esp)
	movl $0x65636e65, 428(%esp)
	movl $0x6568540a, 432(%esp)
	movl $0x61747320, 436(%esp)
	movl $0x61207372, 440(%esp)
	movl $0x6f206572, 444(%esp)
	movl $0x74207475, 448(%esp)
	movl $0x67696e6f, 452(%esp)
	movl $0x4f0a7468, 456(%esp)
	movl $0x20796c6e, 460(%esp)
	movl $0x79656874, 464(%esp)
	movl $0x6e616320, 468(%esp)
	movl $0x61656820, 472(%esp)
	movl $0x6f792072, 476(%esp)
	movl $0x72622075, 480(%esp)
	movl $0x68746165, 484(%esp)
	movl $0x0a676e69, 488(%esp)
	movl $0x756f590a, 492(%esp)
	movl $0x20657227, 496(%esp)
	movl $0x6c206f73, 500(%esp)
	movl $0x20656b69, 504(%esp)
	movl $0x6f722061, 508(%esp)
	movl $0x590a6573, 512(%esp)
	movl $0x7227756f, 516(%esp)
	movl $0x6f732065, 520(%esp)
	movl $0x6b696c20, 524(%esp)
	movl $0x20612065, 528(%esp)
	movl $0x65736f72, 532(%esp)
	movl $0x756f590a, 536(%esp)
	movl $0x20657227, 540(%esp)
	movl $0x6c206f73, 544(%esp)
	movl $0x20656b69, 548(%esp)
	movl $0x6f722061, 552(%esp)
	movl $0x490a6573, 556(%esp)
	movl $0x73697720, 560(%esp)
	movl $0x6f792068, 564(%esp)
	movl $0x6f632075, 568(%esp)
	movl $0x20646c75, 572(%esp)
	movl $0x79617473, 576(%esp)
	movl $0x72656820, 580(%esp)
	movl $0x0a0a0a65, 584(%esp)
	movl $0x70747468, 588(%esp)
	movl $0x772f2f3a, 592(%esp)
	movl $0x792e7777, 596(%esp)
	movl $0x7574756f, 600(%esp)
	movl $0x632e6562, 604(%esp)
	movl $0x772f6d6f, 608(%esp)
	movl $0x68637461, 612(%esp)
	movl $0x483d763f, 616(%esp)
	movl $0x7174474a, 620(%esp)
	movl $0x764a6e4c, 624(%esp)
	movl $0x00003463, 628(%esp)
	movl $0x0, 632(%esp)
	
	pushl %esp
	call printf
	popl %eax

	addl $632, %esp


	xorl %eax, %eax
	leave
	ret