Advertisement
j0h

YoDawgIHeardULikeBash.sh

j0h
Apr 29th, 2023 (edited)
896
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.24 KB | None | 0 0
  1. #!/bin/bash
  2. #Still assuming Linux users have gcc
  3.  
  4. #Yo dawg I heard you like bash!
  5. echo -e "
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <unistd.h>
  9. #include <string.h>
  10. char *Cipher2Text(char *startup){
  11.    int i = 0;
  12.    int shift=3;
  13.    char* plainText = (char*) malloc(strlen(startup) + 1);
  14.    while (startup[i] != '\0'){
  15.        if (startup[i] >= 'a' && startup[i] <= 'z')
  16.            plainText[i] = 'a' + ((startup[i] - 'a' - shift + 26) % 26);
  17.        else if (startup[i] >= 'A' && startup[i] <= 'Z')
  18.            plainText[i] = 'A' + ((startup[i] - 'A' - shift + 26) % 26);
  19.        else
  20.            plainText[i] = startup[i];
  21.        i++;
  22.    }
  23. plainText[i] = '\0';
  24. return plainText;
  25. }
  26. int main(){
  27.     char init[] = {\"Surmhfw Dgrqlv: Zulwlqj grsh frgh vlqfh \"};
  28.     char *startup=Cipher2Text( init);
  29.     usleep(10000);
  30.     int size = sizeof(init);   
  31.     for (int a = 0; a < size; a++){
  32.         setvbuf(stdout, NULL, _IONBF, 0);
  33.         printf(\"%c\", startup[a]);
  34.         usleep(50000);
  35. }
  36. //So we put a bash code in your C code
  37. system(\"stat \$HOME | awk 'FNR == 8 {print}' | awk '{print \$2}'\");
  38. //so you can have a bash while you C bash
  39. return 0;
  40. }" > cyphr.c
  41. gcc -g -Wall cyphr.c -o cyphr
  42. ./cyphr
  43. sleep 3
  44. pkill cyphr
  45. rm cyphr cyphr.c
  46.  
  47.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement