This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
// number of characters into charset | |
#define CHARACTERS 62 | |
// charset | |
static const char charset[] = | |
"abcdefghijklmnopqrstuvwxyz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Coded by ScratchyCode | |
// Compile in gcc with option -lm | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
int even(unsigned long long int num); | |
int prime(unsigned long long int num, unsigned long long int vect[], unsigned long long int index); | |
int main(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Coded by ScratchyCode | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
long long int var=0; | |
void sighandler1(int); | |
int main(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Coded by ScratchyCode | |
// Compile in gcc with option -lm | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
double factorial(long long int N); | |
int main(void){ | |
long long int N; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Coded by ScratchyCode | |
// Compile in gcc with option -lm | |
#include <math.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define SUBSAMPLES 10 | |
int control(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Coded by ScratchyCode | |
// Compile in gcc with option -lm | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
// maximum size for file name | |
#define LEN 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From the academic paper "Spectre Attacks: Exploiting Speculative Execution" | |
/* | |
We're putting text "The Magic Words are Squeamish Ossifrage." in memory and then we're trying to read it using exploit. | |
If system is vulnerable, you'll see same text in output, readed from memory. | |
In this code, if the compiled instructions in victim_function() were executed in strict program order, the function would only read from array1[0..15] since array1 size = 16. | |
However, when executed speculatively, out-of-bounds reads are possible. | |
The read memory byte() function makes several training calls to victim_function() to make the branch predictor expect valid values for x, then calls with an out-of-bounds x. | |
The conditional branch mispredicts, and the ensuing speculative execution reads a secret byte using the out-of-bounds x. | |
The speculative code then reads from array2[array1[x] * 512], leaking the value of array1[x] into the cache state. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Coded by ScratchyCode | |
// Compile with -lm | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <time.h> | |
// radiant degree | |
#define BROWNIAN_THETA (2*M_PI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Coded by ScratchyCode | |
// Compile with -lm | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#define BITS 64 | |
int main(void){ | |
long long int n, i=0, j=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Coded by ScratchyCode | |
/* | |
This program approximates the value of Pi with a rapid decimal expansion thanks to a summation, | |
that converges to the pi value very quickly, called Bailey-Borwein-Plouffe, discovered in 1995. | |
*/ | |
#include <stdio.h> | |
#include <math.h> | |
long double BBPpigreco(long long int i); |
OlderNewer