今日头条请关注宝马的新能源

宝马主机USB脚本激活实战法宝

将USB格式化为fat32

将文件从mega link复制到USB根文件夹)

将USB连接到主机

如果成功,请激活脚本并重新启动主机。

此外,由于在 co 中打包了一个二进制文件而不是脚本,因此我将完全公开在这里附上源代码,即使它很简单。

PHP代码

#include <cstdlib>

#include <iostream>

#include <;

#include <;

#include <sys / ;

#include <sy;

#include <sy;

#include <sy;

#include "CIC_HU.h"

const char* _target = "/EFS_RO;;

const char* _backup = "/EFS_RO;;

const char* _script = "/EFS_RO;;

int _remount() {

return mount(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;

int i = 0;

int ctr = 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);

return 0;

}

return -1;

};

bool _fileexists (const char * _filename) {

if (FILE *file = fopen(_filename, "r")) {

fclose(file);

return true;

} else {

return false;

}

}

int main(int argc, char *argv[]) {

std::cout << "CIC_HU-Script aktivator" << std::endl;

if(_fileexists(_backup)) {

std::cout << "Backup fajl postoji." << std::endl;

return 1;

}

if (_remount() == -1) {

std::cout << "Remount problem" << std::endl;

return 1;

}

if (_modify_startup() != 0) {

std::cout << "problem pri izvrsavanju" << std::endl;

return 1;

}

_deploy_enabler();

std::cout << "Zavrseno" << std::endl;

_reboot();

return 0;

}

and the actual script

Code:

#!/bin/ksh

set -A etc 17 18 19 1A 1B

while true; do

for code in ${etc[@]}

do

swt="/mnt/HBpersistence/00"$code"0001.swt"

if [! -e $swt ]; then

touch $swt

fi

done

sleep 5;

done

BMW 实战法宝 持续更新……

相关推荐