电脑驾考宝典怎么样激活(BMW 原创经典实战宝典系列课程(20)——BMW 脚本激活器实战法宝)
今日头条请关注BMW新能源
BMW脚本激活器实战法宝
将USB格式化为fat32
将文件从MEGA链接复制到USB根文件夹(copie_scr.sh)
将USB插入主机
如果成功,它将进行脚本激活并重新启动主机。
此外,由于在copyie_scr.sh中打包了一个二进制文件而不是脚本,因此我将完全公开
在这里附上源代码,即使它很简单。
PHP代码
#include
#include
#include
#include
#include
#include
#include
#include
#include"CIC_HU.h"
constchar*_target="/EFS_RO/startl6sss.sh";
constchar*_backup="/EFS_RO/startl6sss.sav";
constchar*_script="/EFS_RO/SWT_enable.sh";
int_remount(){
returnmount(NULL,"/mnt/EFS_RO",_MOUNT_REMOUNT,NULL,NULL,NULL);
}
void_reboot(){
sysmgr_reboot();
}
void_deploy_enabler(){
remove(_script);
FILE*f2=fopen(_script,"ab+");
fwrite(_enabler,sizeof(char),sizeof(_enabler),f2);
fclose(f2);
chmod(_script,S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
};
int_modify_startup(){
FILE*f0;
FILE*f1;
inti=0;
intctr=0;
rename(_target,_backup);
f0=fopen(_backup,"r");
f1=fopen(_target,"ab+");
if(f0!=NULL){
while((i=fgetc(f0))!=EOF){
if(ctr==11){
fprintf(f1,"%s&\n",_script);
}else{
fputc(i,f1);
}
ctr++;
}
fclose(f0);
fclose(f1);
chmod(_target,S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
return0;
}
return-1;
};
bool_fileexists(constchar*_filename){
if(FILE*file=fopen(_filename,"r")){
fclose(file);
returntrue;
}else{
returnfalse;
}
}
intmain(intargc,char*argv[]){
std::cout<< "CIC_HU - Script aktivator" << std::endl;
if(_fileexists(_backup)){
std::cout<< "Backup fajl postoji." << std::endl;
return1;
}
if(_remount()==-1){
std::cout<< "Remount problem" << std::endl;
return1;
}
if(_modify_startup()!=0){
std::cout<< "problem pri izvrsavanju" << std::endl;
return1;
}
_deploy_enabler();
std::cout<< "Zavrseno" << std::endl;
_reboot();
return0;
}
和实际的脚本
代码:
#!/bin/ksh
set-Aetc1718191A1B
whiletrue;do
forcodein${etc[@]}
do
swt="/mnt/HBpersistence/00"$code"0001.swt"
if[!-e$swt];then
touch$swt
fi
done
sleep5;
done
BMW实战法宝持续更新......