CarTechnoloGY
BMW CIC USB SCRIPT ACTIVATOR - Printable Version

+- CarTechnoloGY (https://cartechnology.co.uk)
+-- Forum: Discussions All about Software and Hardware (https://cartechnology.co.uk/forumdisplay.php?fid=310)
+--- Forum: Automotive Help & Discussions / Software and Hardware (https://cartechnology.co.uk/forumdisplay.php?fid=40)
+---- Forum: BMW - Mini - Rolls Royce (https://cartechnology.co.uk/forumdisplay.php?fid=61)
+---- Thread: BMW CIC USB SCRIPT ACTIVATOR (/showthread.php?tid=23231)

Pages: 1 2 3 4 5 6 7 8 9 10


BMW CIC USB SCRIPT ACTIVATOR - intel123 - 04-04-2017

So like title says, this is script activator for BMW CIC

format usb to fat32
copy file from MEGA link to USB root folder (copie_scr.sh)
insert USB into CIC

it will make script activation and reboot the CIC if successful.

Also, since in copie_scr.sh is packed a binary not a script, just for full disclosure i will attach source code here even it is simple one.

PHP Code:
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <sys/sysmgr.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "CIC_HU.h"

const char_target "/EFS_RO/startl6sss.sh";
const 
char_backup "/EFS_RO/startl6sss.sav";
const 
char_script "/EFS_RO/SWT_enable.sh";

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(_scriptS_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(_targetS_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 argcchar *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



RE: BMW CIC USB SCRIPT ACTIVATOR - fumantwo - 04-04-2017

Have just check it and works like a charm smile

Followed the steps related above, and ... once that the screen goes to red, when wake up from restart, navigation is working smile


RE: BMW CIC USB SCRIPT ACTIVATOR - sacaman - 05-04-2017

Hi

please can you explain how do you convert it to a bin file

and thanks for your share

sacaman


RE: BMW CIC USB SCRIPT ACTIVATOR - muskatas - 05-04-2017

(05-04-2017, 00:02 AM)sacaman Wrote:  Hi

please can you explain how do you convert it to a bin file

and thanks for your share

sacaman

Read thread again. You have nothing to convert.


RE: BMW CIC USB SCRIPT ACTIVATOR - rafi-88 - 05-04-2017

(05-04-2017, 00:02 AM)sacaman Wrote:  Hi

please can you explain how do you convert it to a bin file

and thanks for your share

sacaman

SHC: http://www.thegeekstuff.com/2012/05/encrypt-bash-shell-script/


RE: BMW CIC USB SCRIPT ACTIVATOR - intel123 - 05-04-2017

Making copie_scr.sh into readable format (bin format) by CIC is already published and documented: it uses simple xor, important thing when you are making copie_scr.sh on windows is that your source file (actual shell script) should be UNIX STYLE End of Line and ANSI encoding not UTF as encoders will mostly fail then since the difference in char size. Easiest way for end-users to check this is notepad++ at it has everything integrated into menu (EDIT->EOL CONVERSION and Encoding: ANSI). And only way i chosen to write a program for script activation is that QNX on CIC is missing many GNU tools in its bin directory so i was unable to script actual process and had to made native bin for it.


RE: BMW CIC USB SCRIPT ACTIVATOR - mjuhl2003 - 05-04-2017

And this goes for both Exx and Fxx CIC systems?


RE: BMW CIC USB SCRIPT ACTIVATOR - intel123 - 05-04-2017

(05-04-2017, 13:36 PM)mjuhl2003 Wrote:  And this goes for both Exx and Fxx CIC systems?

Yes.


RE: BMW CIC USB SCRIPT ACTIVATOR - buzzy - 06-04-2017

Will it also suit Mini Cooper Mask-2 (with) Move map?


RE: BMW CIC USB SCRIPT ACTIVATOR - ATC - 06-04-2017

Hi to all.

Can someone tell me how maps would be loaded if this script is used to activate navigation and maps?

The loading of the maps would be the same way as before installing the script or must be done in a different way.

Thank you and greetings.
ATC