Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

argv is bloat

Name: Anonymous 2011-11-26 21:11

this_is_fasta.c :


#include <stdio.h>
#include <stdlib.h>

void _start() {
  puts("I pity the fools that lag program start and ending by calling and returning from main");
  exit(0);
}



noTIMEfor@LOVE$ gcc -c this_is_fasta.c
noTIMEfor@LOVE$ ld -I/lib/ld-linux.so.2 -lc this_is_fasta.o -o this_is_fasta
noTIMEfor@LOVE$ this_is_fasta
I pity the fools that lag program start and ending by calling and returning from main
noTIMEfor@LOVE$

Name: Anonymous 2011-11-26 21:23

ZOMG OPTIMIZATION!!!

Name: stdlib.h is bloat 2011-11-26 21:37


#include <stdio.h>

void _start() {
  puts("I pity the fools that lag program start and ending by calling and returning from main");
  asm("mov $1,%eax");
  asm("mov $0,%ebx");
  asm("int $0x80");
}

Name: Anonymous 2011-11-26 21:51

So why aren't you just using assembly?

Name: puts is bloat 2011-11-26 22:03


char* str = "I pity the fools that lag program string printing by calling puts\n";
void _start() {
  asm("mov $86,%edx"); // string length
  asm("mov str,%ecx"); // string pointer
  asm("mov $1,%ebx"); // stdout file descriptor
  asm("mov $4,%eax"); // sys_write system call
  asm("int $0x80");

  asm("mov $1,%eax"); // sys_exit system call
  asm("mov $0,%ebx"); // exit status zero
  asm("int $0x80");
}

Name: Anonymous 2011-11-26 22:10

>>5
section    .data
s:    db    "I pity the fools that bloat strings by null terminating them", 0xa
l:    equ    $ - s

section    .text
    global    _start
_start:
    mov    eax, 4
    mov    ebx, 1
    mov    ecx, s
    mov    edx, l
    int    0x80

    mov    eax, 1
    mov    ebx, 0
    int    0x80

Name: Anonymous 2011-11-26 22:19

>>6

alas, I have been foiled once more!

Name: Anonymous 2011-11-26 22:23

>>1
You talk about bloat but here you are linking with motherfucking GLIBC.

Name: Anonymous 2011-11-26 23:44

gotta say, i love when people on /prog/ reduce code snippets down to asm

Name: Anonymous 2011-11-26 23:52

>>6
Thanks, GNU syntax really fucking sucks.

Name: Anonymous 2011-11-27 0:26

>>10

It's AT&T syntax, toggaf.

Don't change these.
Name: Email:
Entire Thread Thread List