[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
      Chat Bot: QM|T_JinX has joined the room.