c icon indicating copy to clipboard operation
c copied to clipboard

help in C language ..

Open r00t-3xp10it opened this issue 6 years ago • 2 comments

hello man can you help me in C ? i now how to extract ANCII chars and concaternate them.. what i need to know its how can i execute that ancii string after concaternation ..

example: 1º i what to extract the string whoami from ancii chart 2º concaternate the chars to build whoami command 3º and execute the string concaternated ..

this code does allmost everything.. it extracts the chars, concaternate them ... but it only prints the string .. but i dont what to print ..i want to execute ..

#include <stdio.h>
#include <string.h>

  int main(void)
    {
      /* variable declarations */
      char a = 119;  /* ancii character w */
      char b = 104;  /* ancii character h */
      char c = 111;  /* ancii character o */
      char d = 97;   /* ancii character a */
      char e = 109;  /* ancii character m */
      char f = 105;  /* ancii character i */
 
      /* concaternate and transform decimal values to ancii chars using putchar */
      //char command = putchar('a');putchar('b');putchar('c');putchar('d');putchar('e');putchar('f');

      /* execute command using system() */
      int system(char command);
        system(command);
    }

r00t-3xp10it avatar May 30 '18 01:05 r00t-3xp10it

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

int main(void)
{
    /* variable declarations */
    char a = 119; /* ancii character w */
    char b = 104; /* ancii character h */
    char c = 111; /* ancii character o */
    char d = 97;  /* ancii character a */
    char e = 109; /* ancii character m */
    char f = 105; /* ancii character i */

    /* concaternate and transform decimal values to ancii chars using putchar */
    char command[] = {a,b,c,d,e,f};

    /* execute command using system() */
    system(command);
}

ryanmjacobs avatar Jul 21 '18 22:07 ryanmjacobs

Thanks man ...

r00t-3xp10it avatar Aug 07 '18 08:08 r00t-3xp10it