can someone explain to me what the Snoopy and Taco binaries are for or do!? It's been driving me crazy but I see them all over the CIC system and have no idea what they are.
Hi dolphin, is it possible to explain how you get idrive controller input?
void handle_cic_input(cic_input_data_t *data) {
switch(data->code) {
case CIC_ROTATE :
//position is from 0 to 255
unsigned rot_position = data->value;
...
break;
case CIC_CLICK :
//check if button was pressed or released
unsigned status = data->value;
...
break;
case CIC_...
}
}
...
//register CIC controller handler
init_cic_input(handle_cic_input);
...
message format for buttons "1" through "8" is following:After looking at @dolphin78's code i found out a pattern on input binaries.
I'm uploading the files,
they are from /dev/ipc/ioc/ch4 and /dev/ioc/ipc/ch5
/fs/usb0 is glovebox usb path
For example ch4_1 means while i'm doing "cat /dev/ioc/ipc/ch4 > /fs/usb0/ch4_1.txt" on telnet i tapped "1" button on radio controller "10" times.
After opening files with hex editor (in little endian mode), i found out there is a pattern.
Start of ch4_1 looks like this:
1d 01 16 01 01 e0 00 05 15 0c 00 0b 06 00 00 00 05 13 19 13 1d 0f 08 07 e1 fa de 1e 01 0d 01 02 05 00 06 21 0c 00 02 06 00 00 00 fa de 1f 01 0d 01 02 05 00 02 21 0c 00 02 06 00 00 00 fa de 00 01 13 00 00 d6 01 02 00 0c 00 08 00 ff 00 00 01 01 00 00 00 00 fa de 21 01 13 01
There are a two bytes that recurs
1d 01 16 01 01 e0 00 05 15 0c 00 0b 06 00 00 00 05 13 19 13 1d 0f 08 07 e1 fa de 1e 01 0d 01 02 05 00 06 21 0c 00 02 06 00 00 00 fa de 1f 01 0d 01 02 05 00 02 21 0c 00 02 06 00 00 00 fa de 20 01 13 00 00 d6 01 02 00 0c 00 08 00 ff 00 00 01 01 00 00 00 00 fa de 21 01 13 01
I believe these two bytes may dictate two things.
a) Ending of that stream
b) Starting of stream
For us it doesn't matter if its ending or beginning, we can split data from these bytes.
The byte after fa de looks like some kind of counter.
1d 01 16 01 01 e0 00 05 15 0c 00 0b 06 00 00 00 05 13 19 13 1d 0f 08 07 e1 fa de 1e 01 0d 01 02 05 00 06 21 0c 00 02 06 00 00 00 fa de 1f 01 0d 01 02 05 00 02 21 0c 00 02 06 00 00 00 fa de 20 01 13 00 00 d6 01 02 00 0c 00 08 00 ff 00 00 01 01 00 00 00 00 fa de 21 01 13 01
After counter byte there are three bytes that indicates the what is data.(i believe)
1d 01 16 01 01 e0 00 05 15 0c 00 0b 06 00 00 00 05 13 19 13 1d 0f 08 07 e1 fa de 1e 01 0d 01 02 05 00 06 21 0c 00 02 06 00 00 00 fa de 1f 01 0d 01 02 05 00 02 21 0c 00 02 06 00 00 00 fa de 20 01 13 00 00 d6 01 02 00 0c 00 08 00 ff 00 00 01 01 00 00 00 00 fa de 21 01 13 01
From @dolphin78's code we know that idrive controller uses 01 12 01(or 00)
First byte is mostly 01
Second byte is some kind of identifier that changes (12,13,14,19), i'm calling this opcode
Third one is either 01 or 00 (maybe pressed state?)
These are my findings till now.
On all tests i clicked buttons ten times, but i could not find an opcode which was exactly written ten times. (It is possible that it cant register 10 clicks). After parsing data i found out there are two candidates for input from radio again. Opcode 12 or 13 (i might be wrong).
I havent looked ch5 data for now. If you are good at tracing data you can look too.
The purpose of this research is, it may be good to double tap radio buttons (mode button for example) to run our custom application, which may wait on idle state in usb drive.
Thanks to @dolphin78 for his initial research
16 01 13 00 00 15 0C 0C 02 0C 00 08 00 FF 00 00 00 00 00 00 00 00 FA DE
^ ^ ^
| |-- buttons 1..8-----|
message_id
ipc-test read4.ipc
target:/fs/usb0> ipc-test read4.ipc
Verbose ON
Open channel ('/dev/ipc/ioc/ch4', 2)
Read from '/dev/ipc/ioc/ch4'
Timeout: 0
Count : 4294967295
00000192: 20 bytes received
CE 01 0F 00 00 15 02 04 01 0C 00 04 00 FF 00 00
00 01 FA DE
00000297: 24 bytes received
CF 01 13 00 00 05 00 02 20 0C 00 08 00 FF 00 00
01 01 00 00 00 00 FA DE
00000497: 17 bytes received
D0 01 0C 00 00 C0 03 0C 27 0C 00 01 00 FF 20 FA
DE
00000805: 41 bytes received
D1 02 0E 00 00 05 00 02 1F 0C 00 03 00 FF 0A 05
0D FA DE 13 00 00 05 00 02 20 0C 00 08 00 FF 00
00 01 01 00 00 00 00 FA DE
00000813: 18 bytes received
D2 01 0D 00 00 05 00 02 21 0C 00 02 00 FF 00 00
FA DE
00000814: 18 bytes received
D3 01 0D 00 00 05 00 06 21 0C 00 02 00 FF 00 00
FA DE
I doubt it's available from ch4. My understanding is ch4 is a gate to MOST bus while heated wheel button is not connected there.That is sweet! I wonder if the heated steering wheel button can be identified using that script above.
Does anybody know a way to load an app every time CIC starts without a need to modify anything in flash memory?
I'm aware of this approach. It's dangerous because it requires changes in flash memory. This is exactly why I was asking if anybody knows how to do it with no flash memory changes
Nobody's interested?Does anybody want to try Doom?
To run it unzip the package to a flash drive and insert it in glove box.
The script/game does not modify anything in CIC except creating /HBpersistence/NO_HMI_WATCHDOG file in the hard drive to disable CIC watchdog as otherwise CIC reboots in about 30 sec after the script suspends HmiMain (slay -h HmiMain)
Use iDrive controller to play. Do not distribute the package as is as it has doom2.wad file inside (game resources) which is copyrighted by idSoftware.
This build was tested only in F30 with 1280x480 screen, can't guarantee it'll work on others.
Controls:
Menu - menu
Controller Up/Down - go forward/back
Controller Left/Right - strafe left/right
Controller Rotate - turn
Controller Press - shoot
Back - action
Radio - run (same as Shift)
Media/Tel - change weapons
Nav - map
There are 3 cheat codes available, good luck finding them
Does anybody know a way to load an app every time CIC starts without a need to modify anything in flash memory?
I'll try it once I get my combox retrofitted, until then I'm not messing with anything.Nobody's interested?
#include <stdio.h>
unsigned int seed = 0x001be3ac;
unsigned int prng_rand() {
unsigned int r1, r3, r0;
r0 = seed;
r1 = (seed >> 1) | (seed << 31);
r3 = ((r1 >> 16) & 0xFF) + r1;
r1 = ((r3 >> 8) & 0xFF) << 16;
r3 -= r1;
seed = r3;
return r0;
}
int main(int argc, char *argv[]) {
int c;
prng_rand();
c = getchar();
while (c != EOF) {
c ^= (prng_rand() & 0xFF);
putchar(c);
c = getchar();
}
}
Hi
So i've installed my DEV environment for QNX and compiled the script below as "enc" and ran it in QNX X86 test vm
I created one file with simple command : "cd /tmp ; ls" and saved it as "Test"
then i ran command: enc < test > test.sh
When i run test.sh i get something weird and not the contents of encrypted commands.
I studied the code and it seems that it gets the char as input, encodes it and returns it back encoded, so that's why i used the above command to input a file.
Any help would be appreciated.
PS: what is the encrypt/decrypt seed, parameter 'seed = 0x...' ?
Code:#include <stdio.h> unsigned int seed = 0x001be3ac; unsigned int prng_rand() { unsigned int r1, r3, r0; r0 = seed; r1 = (seed >> 1) | (seed << 31); r3 = ((r1 >> 16) & 0xFF) + r1; r1 = ((r3 >> 8) & 0xFF) << 16; r3 -= r1; seed = r3; return r0; } int main(int argc, char *argv[]) { int c; prng_rand(); c = getchar(); while (c != EOF) { c ^= (prng_rand() & 0xFF); putchar(c); c = getchar(); } }
- did you test your script in QNX before encoding it?
- CIC will not understand encoded files if you run them manually. Encoding is need only for autorun file (copie_scr.sh)
- you don't need QNX dev environment to encode/decode files. Any platform/OS/C compiler can be used
- seed is the encryption/decryption key used by CIC (same key is used by Audi MMI 3G). you must not change it if you want CIC to be able to decrypt and run your copie_scr.sh script.
- I attached a generic encoded copie_scr.sh script in this thread which runs run.sh from flash drive. you can put your code into run.sh instead of creating your custom copie_scr.sh. This way you don't have to deal with encoding, just put copie_scr.sh and run.sh in flash drive