[C] Example program [ASM]

  • Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

ZionHD

Leader
Retired Staff
Nov 8, 2014
184
215
53
You can run this with gcc compiler. This is an example for all teams on this site. What this program does is just display text "Example C!". This program uses C, ASM, and Hexadecimals. I'm not going to explain how this works, if you really want to know go study some C and ASM. The purpose of showing you this code is to try to get all of you to learn some C and ASM. Also I was bored af since there was no interesting anime xd.

main.c:
Code:
#include <sys/mman.h>
#include <string.h>

int main ()
{
char code[] = {
0x48, 0xc7, 0xc7, 0x01, 0x00, 0x00,
0x00, 0xe8, 0x0b, 0x00, 0x00, 0x00,
0x45, 0x78, 0x61, 0x6D, 0x70, 0x6C,
0x65, 0x20, 0x43, 0x21, 0x0a, 0x5e,
0x48, 0xc7, 0xc2, 0x0b, 0x00, 0x00,
0x00, 0xb8, 0x01, 0x00, 0x00, 0x00,
0x0f, 0x05, 0xbf, 0x0b, 0x00, 0x00,
0x00, 0xb8, 0x3c, 0x00, 0x00, 0x00,
0x0f, 0x05
};

void *buf;

buf = mmap (0,sizeof(code),PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_ANON,-1,0);
memcpy (buf, code, sizeof(code));

((void (*) (void))buf)();
}

To compile the code run, modify if needed:
gcc main.c -o main

Results:
Example C!
 
  • Like
Reactions: Chris
inb4 you teach people how to code keyloggers :troll:
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • @ LoveModz:
    Been a very long time.
  • @ QM|T_JinX:
    sup
  • Chat Bot:
    go88club4comm is our newest member. Welcome!
  • Chat Bot:
    QM|T_JinX has joined the room.
  • @ lurch6661:
    zap zap
  • @ QM|T_JinX:
    zap
  • @ lurch6661:
    hey bro hows it going
  • @ QM|T_JinX:
    im good you
  • @ lurch6661:
    good bro just waking up
  • @ QM|T_JinX:
    haha cool
  • @ lurch6661:
    listening to old school lol
  • @ QM|T_JinX:
    nice
  • @ lurch6661:
    old school is best
  • @ QM|T_JinX:
    it is
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    heaven99 is our newest member. Welcome!
  • Chat Bot:
    Glenda is our newest member. Welcome!
  • Chat Bot:
    zandergum015 is our newest member. Welcome!
  • Chat Bot:
    RobertoNoc95 is our newest member. Welcome!
  • @ ⇜HUDSON⇝:
    not been on in years, sad seeing it like this man, was the place to be back in the day, fun times. :weed:hope all old members if they see this are good:peace: now who’s got a console
    +1
  • @ ⇜HUDSON⇝:
    Now who’s got a console ID for me :problemo:
    +1
  • Chat Bot:
    QM|T_JinX has joined the room.
  • @ QM|T_JinX:
    ⇜HUDSON⇝ said:
    Now who’s got a console ID for me :problemo:
    haha
      @ QM|T_JinX: Now who’s got a console ID for me :problemo:haha