Pages: 1 [2]
Author Topic: Damos address corrector (Python script)  (Read 2688 times)
Bitshifter
Jr. Member
**

Karma: +1/-3
Offline Offline

Posts: 44


« Reply #15 on: April 06, 2019, 01:34:36 AM »

copy/paste what you tried to do at the command line.

That was not the Problem. The Problem are missing "" Wink

@ Polo35580

Great tool. Tested with 3 versions (MED9) and all looks fine, save a lot of time.

Thank you for engineering, release and update. I vote: hero member  Smiley
Logged
IamwhoIam
Hero Member
*****

Karma: +24/-36
Offline Offline

Posts: 696


« Reply #16 on: April 06, 2019, 04:56:35 AM »

If only it worked as decently with continental as it does with Bosch stuff... there's definitely LOADS of room for improvement there, just searching for byte strings isn't enough to make it a proper "corrector"... I've tested it on 2 similar Bosch MED17 files, in one of them LAMFA doesn't exist anymore, in the original one it exists. Guess what? the corrector found LAMFA in my file that doesn't have it Cheesy
Logged

I have no logs because I have a boost gauge (makes things easier)
Gilgamesh
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


« Reply #17 on: June 02, 2019, 04:10:56 AM »


Feel free to test it and report if it fit your needs.   Cheesy


Hello Polo! Very good idea and solution. Thanks a lot for your work!
I've test it and it's working good, but sometimes there is strange errors:

Quote

Address 0x04A170 not corrected in 16384 search !!! No matching pattern !!!
Correcting address 0x04A172
Address 0x04A172 not corrected in 16384 search !!! No matching pattern !!!
Correcting address 0x04A174
Bestmatch for address: 0x04A174, searchaddress: 0x04B7D2, offset: 165E, matchbefore: 0, matchafter: 20
Address 0x04A174 not corrected in 16384 search !!! Keeped Best match: 0x04B7D2 - Offset 165E matchbefore: 0 matchafter: 20 !!!
Correcting address 0x04A176
Bestmatch for address: 0x04A176, searchaddress: 0x04B7D4, offset: 165E, matchbefore: 4, matchafter: 16
Address 0x04A176 not corrected in 16384 search !!! Keeped Best match: 0x04B7D4 - Offset 165E matchbefore: 4 matchafter: 16 !!!
Correcting address 0x04A178
Bestmatch for address: 0x04A178, searchaddress: 0x04B7D6, offset: 165E, matchbefore: 8, matchafter: 12
Address 0x04A178 not corrected in 16384 search !!! Keeped Best match: 0x04B7D6 - Offset 165E matchbefore: 8 matchafter: 12 !!!
Correcting address 0x04A17A
Bestmatch for address: 0x04A17A, searchaddress: 0x04B7D8, offset: 165E, matchbefore: 12, matchafter: 8
Address 0x04A17A not corrected in 16384 search !!! Keeped Best match: 0x04B7D8 - Offset 165E matchbefore: 12 matchafter: 8 !!!
Correcting address 0x04A17C
Address 0x04A17C not corrected in 16384 search !!! No matching pattern !!!
Correcting address 0x04A180
Bestmatch for address: 0x04A180, searchaddress: 0x04B7DC, offset: 165C, matchbefore: 2, matchafter: 16
Bestmatch for address: 0x04A180, searchaddress: 0x04A224, offset: A4, matchbefore: 4, matchafter: 8
Bestmatch for address: 0x04A180, searchaddress: 0x049D34, offset: -44C, matchbefore: 2, matchafter: 8
Address 0x04A180 not corrected in 16384 search !!! Rejected Best match: 0x04B7DC - Offset 165C matchbefore: 2 matchafter: 16 !!!
Correcting address 0x04A184
Bestmatch for address: 0x04A184, searchaddress: 0x04B7E0, offset: 165C, matchbefore: 10, matchafter: 8

Address corrected from 0x04A170 to 0x04B7CE - 36% - 105420/286002 - offset 165E 
Address corrected from 0x04A171 to 0x04B7CF - 36% - 105421/286002 - offset 165E     
Address corrected from 0x04A172 to 0x04B7D0 - 36% - 105422/286002 - offset 165E     
Address corrected from 0x04A173 to 0x04B7D1 - 36% - 105423/286002 - offset 165E     
Address corrected from 0x04A174 to 0x04B7D2 - 36% - 105424/286002 - offset 165E     
Address corrected from 0x04A175 to 0x04B7D3 - 36% - 105425/286002 - offset 165E     
Address corrected from 0x04A176 to 0x04B7D4 - 36% - 105426/286002 - offset 165E     
Address corrected from 0x04A177 to 0x04B7D5 - 36% - 105427/286002 - offset 165E     
Address corrected from 0x04A178 to 0x04B7D6 - 36% - 105428/286002 - offset 165E     
Address corrected from 0x04A179 to 0x04B7D7 - 36% - 105429/286002 - offset 165E     
Address corrected from 0x04A17A to 0x04B7D8 - 36% - 105430/286002 - offset 165E     
Address corrected from 0x04A17B to 0x04B7D7 - 36% - 105431/286002 - offset 165C     
Address corrected from 0x04A17C to 0x04B7D8 - 36% - 105432/286002 - offset 165C     
Address corrected from 0x04A17D to 0x04B7D9 - 36% - 105433/286002 - offset 165C     
Address corrected from 0x04A17E to 0x04B7DA - 36% - 105434/286002 - offset 165C
Address corrected from 0x04A17F to 0x04B7DB - 36% - 105435/286002 - offset 165C     
Address corrected from 0x04A180 to 0x04B7DC - 36% - 105436/286002 - offset 165C     
Address corrected from 0x04A181 to 0x04B7DD - 36% - 105437/286002 - offset 165C     

Logged

Passat 1.4tsi Ecofuel Petrol/CNG 150hp Med17.1
Polo35580
Newbie
*

Karma: +5/-0
Offline Offline

Posts: 12


« Reply #18 on: July 15, 2019, 02:59:13 AM »

If only it worked as decently with continental as it does with Bosch stuff... there's definitely LOADS of room for improvement there, just searching for byte strings isn't enough to make it a proper "corrector"... I've tested it on 2 similar Bosch MED17 files, in one of them LAMFA doesn't exist anymore, in the original one it exists. Guess what? the corrector found LAMFA in my file that doesn't have it Cheesy
Hello
I can take a look to Simos support if you provide me some hex + damos couples  Smiley

Yes there is lot of things to improve as reorder the whole code with class and functions or rewrote the address linearization part which cause your LAMFA and Gilgamesh issues or add MEASUREMENT correction support ...
It's a hard work for each improvement and I don't have enough time for now...
Feel free to give help on any part

Best regards

Polo
« Last Edit: July 15, 2019, 06:26:19 AM by Polo35580 » Logged
nabsabs
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 2


« Reply #19 on: October 16, 2019, 02:40:47 AM »

Hello
I am trying this for the first time on an MED9.1 file
I am getting the following errors and it is not being executed

c:\Users\nabih\Desktop\Test>python correct-damos-address.py DamosFile.A2L OriginalDump NewDump
  File "correct-damos-address.py", line 734
    print (('Address 0x%06X skipped because of unreconizable pattern - %d%% - %d/%d              ' % (damosaddress, (100/len(damosaddresslist)*damosaddresscount), damosaddressco
unt, len(damosaddresslist))), end="\r")

                                 ^
SyntaxError: invalid syntax


Image attached below



Can anyone help
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.028 seconds with 18 queries. (Pretty URLs adds 0s, 0q)