Skip to content

Commit

Permalink
Unlock bootloader huawei
Browse files Browse the repository at this point in the history
Script
  • Loading branch information
JoeArchV authored Jan 7, 2025
1 parent b55eadd commit f5d967a
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions huawei.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>

#define LEN 37

unsigned long long base_start = 1000000000000000;

void resumer(){
printf("\n\nLast used code was: %lld", base_start);
FILE * fp = fopen("lastcode","w");
fprintf(fp,"%llu",base_start);
fclose(fp);
exit(1);
}

int main( int argc, char **argv) {
if ( argc > 1 ) {
char *base = argv[1];
base_start = atoll( base );
} else {
FILE * fp;
if(fp= fopen("lastcode","w")) {
fscanf(fp,"%llu",&base_start);
fclose(fp);
}
}
signal(SIGINT, resumer);
signal(SIGTERM, resumer);
char fou[LEN] = "fastboot oem unlock ";
char TOTAL[LEN];

while (sprintf( TOTAL, "%s%llu", fou, base_start++) && system( TOTAL ));

printf("Your unlock code is: %llu", base_start);

return 1;
}

0 comments on commit f5d967a

Please sign in to comment.