Skip to content

Instantly share code, notes, and snippets.

@pedro-javierf
Created January 2, 2020 23:55
Show Gist options
  • Save pedro-javierf/05bdac934b4ec8fee9e4fbaf49069d01 to your computer and use it in GitHub Desktop.
Save pedro-javierf/05bdac934b4ec8fee9e4fbaf49069d01 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <nds.h>
/*
Based On: https://wiki.newae.com/V3:Tutorial_A3_VCC_Glitch_Attacks
Careful, glitches in the h loop won't be noticed
*/
int main(void){
consoleDemoInit();
iprintf("Glitch Me!\n\n");
int i,j,h,k;
unsigned long int cnt;
k = 0;
while(1){
cnt = 0;
for(h=0; h<900000; h++){ //glitches in h won't be noticed
for(i=0; i<900000; i++){
for(j=0; j<900000; j++){
cnt++;
}
}
}
iprintf("%ld %d %d %d\n", cnt, i, j,k++);//glitches in h won't be noticed
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment