pretend as if ur a hacker https://git.ari.lt/ari/hacker
Find a file
Ari Archer 45cf4168ea
readme : add a note abt arr.c not reading null bytes
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2023-05-10 01:51:43 +03:00
media init 2023-05-10 00:52:50 +03:00
scripts make build script only find files 2023-05-10 01:01:06 +03:00
src main : fix unused param 2023-05-10 01:08:16 +03:00
.clang-format init 2023-05-10 00:52:50 +03:00
.editorconfig init 2023-05-10 00:52:50 +03:00
.gitignore make git ignore changes on code.txt 2023-05-10 01:02:36 +03:00
code.txt init 2023-05-10 00:52:50 +03:00
LICENSE init 2023-05-10 00:52:50 +03:00
README.md readme : add a note abt arr.c not reading null bytes 2023-05-10 01:51:43 +03:00

hacker

pretend as if ur a hacker

screenshot

sources

  • arr.c -- converts files to c arrays
  • main.c -- main file

arr

arr is a utility that converts files into c arrays, its only used for build time most likely, dont install it, its useless for this besides build time, it takes files as input, for the build script the output will be cached to code.txt, although ur free to just use it inline lol, i include the code.txt cache from my system if u want it to just work, but for uniqueness and more diverse output id suggest to just use ur own

keep in mind, the arr utility ignores null bytes no matter what, this is intentional, null byte would indicate that its binary data or smt and i dont want that, so its stopping before it reads all of it, if u want to use arr.c modify it to use the sz instead of a while value is truthy

compilation

run ./scripts/build.sh or :

cc -o arr src/arr.c -Ofast -s  -std=c89
cc -o hacker -DCODE="$(./arr $(find /usr/include/ -type f -name '*.c*' -or -name '*.h*' | head -n 500))" src/main.c -Ofast -s -std=c89
#                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u can play around with this

build script config

env vars :

  • CC -- c compiler ( default : cc )
  • CFLAGS -- c compiler flags ( default : -Ofast -s -std=c89 )
  • SRC -- folder to look for code ( default : /usr/include )
  • SRCC -- how many files to find in SRC ( default : 500 )

hacker configuration

macro definitions ( -DMACRO ( e.g. -DSCAN_COUNT=1 ) :

  • CODE -- c array, should be an array of characters or integers of ASCII values ( see arr.c ) ( default : {0} )
  • SCAN_COUNT -- how many characters of code should one keystroke equal to ( default : 6 )
  • CODE_CLR -- ansi colour your code is ( default : \033[32m ( green ) )

usage

launch the program, type anything and to exit just press CTRL + C