Skip to content

Instantly share code, notes, and snippets.

Avatar

Al-buharie harieamjari

View GitHub Profile
@harieamjari
harieamjari / sha-ttered.py
Created May 4, 2019
A python script that tries to crack hash
View sha-ttered.py
import hashlib
import string
import sys
hash_name = 'd5787cd36cdf96b5ff9edcfb2461e092a9cbe6e0e15474464346950a5c6b5616'
# random_list = ['a', 'b', 'c', 'd']
random_list = list(string.ascii_lowercase)
length = len(random_list)
lens = 0
print("\nSHA-256")
@harieamjari
harieamjari / write_bmp.c
Last active Jun 10, 2020
A simple bmp writer in C using the standard library. This renders a 24-bit image of color red, green, and blue, from bottom to top, respectively.
View write_bmp.c
/*
DO WHAT THE FUCK YOU WANT TO BUT IT'S NOT MY FAULT PUBLIC LICENSE
Version 1, October 2013
Copyright (c) 2020 Al-buharie Amjari <healer.harie@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified copies
of this license document, and changing it is allowed as long as the name
is changed.
@harieamjari
harieamjari / dft_wav.c
Last active Jun 15, 2020
Fourier transform a wav file.
View dft_wav.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <fftw3.h>
typedef struct __attribute__((__packed__)) {
char ChunkID[4];
uint32_t ChunkSize;
@harieamjari
harieamjari / string_vibrate.c
Last active Aug 13, 2020
To model a vibrating string using gnuplot and then ffmpeg.
View string_vibrate.c
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#define TIME_OF_VIDEO (uint32_t) 10
#define LENGTH_OF_STRING (uint32_t) 3
#define SAMPLE_PER_LENGTH (uint32_t) 50
#define FPS (uint32_t) 30
#define FREQUENCY (uint32_t) 1
View plot_wav_file.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <fftw3.h>
#define FPS 24
#define VID_TIME 10
View little_encryption.c
#include <stdio.h>
int
main(){
char tobe_encrypted[8];
printf("enter pin: ");
scanf("%s", tobe_encrypted);
char tmp;
char processed9[8];
for (int i = 0; i < 8; i++){
View randtowav.c
#include <stdio.h>
#include <stdint.h>
char wav_data[] = {
'R', 'I', 'F', 'F',
0, 0, 0, 0,
'W', 'A', 'V', 'E',
'f', 'm', 't', ' ',
16, 0, 0, 0, /*subchunk1size*/
1, 0, /*audio format*/
1, 0, /*num channels*/
@harieamjari
harieamjari / Makefile
Last active Jul 25, 2020
example plugin
View Makefile
all : main libfunc.so
.PHONY : all
main : main.c
$(CC) -rdynamic $^ -o $@
libfunc.so : func.c
$(CC) -shared -fPIC $^ -o $@
.PHONY : clean
@harieamjari
harieamjari / comwav.c
Last active Jul 30, 2020
combine wav files
View comwav.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char wav_struct[] = {
'R', 'I', 'F', 'F',
0, 0, 0, 0, /* chunksize */
'W', 'A', 'V', 'E',
'f', 'm', 't', ' ', /* subchunk1id */
16, 0, 0, 0, /* subchunk1size */
View ssort.c
#include <stdio.h>
int main(){
int arr[] = {6, 2, 5, 1, 20, 12, 8, 3, 400, 13, 13, 32};
int lenarr = 12;
int a = 0;
int b = 1;
int look;