Pages: 1 2 3 [4] 5 6
Author Topic: LC/NLS ASM help  (Read 33255 times)
BlackT
Hero Member
*****

Karma: +79/-40
Offline Offline

Posts: 1425



« Reply #45 on: July 06, 2021, 03:24:52 AM »

Thank you all I am going to dig more around, and try to figure out more. 
I didn't install any plug in to IDA, would that be any of help for this beginner level?
Logged
Praga
Full Member
***

Karma: +4/-3
Offline Offline

Posts: 62


« Reply #46 on: July 21, 2021, 05:23:43 AM »

Thank you all I am going to dig more around, and try to figure out more. 
I didn't install any plug in to IDA, would that be any of help for this beginner level?

The Boschme7 plugin is helpful
Logged
BlackT
Hero Member
*****

Karma: +79/-40
Offline Offline

Posts: 1425



« Reply #47 on: July 23, 2021, 12:44:58 AM »

This one?

Also, how hard is to make function that turn on MIL?
Can someone give me some push to do it on this file? From where to start?

From Me7logger I see B-mil is at
B_mil           , {}                                , 0x00FD22,  2,  0x0001, {}

Now first how to find it in flash where it set MIL on/off so I can make there jump to my function?
Logged
BlackT
Hero Member
*****

Karma: +79/-40
Offline Offline

Posts: 1425



« Reply #48 on: July 26, 2021, 03:23:50 AM »

I think i found something
-Could be this function to set MIL on/off?
-If it is, how to find in flash when ECU call this routine?
-Next step will be to bypass it, and make my own function for MIL?

Logged
_nameless
Hero Member
*****

Karma: +342/-466
Offline Offline

Posts: 2802



« Reply #49 on: July 26, 2021, 06:25:18 AM »

example of your file patched with ignition retard, knock and lambda disabled during routine and hard cut rev lim all in one patched file Wink
« Last Edit: July 26, 2021, 10:45:41 AM by Marty » Logged

Giving your mom a tuneup
BlackT
Hero Member
*****

Karma: +79/-40
Offline Offline

Posts: 1425



« Reply #50 on: July 26, 2021, 10:02:17 AM »

Thank you very much. You gave me a lot of homework.

I am just curios, Is this file generated by some script, beacuse I have one tune from US tuner and functions are similar.
Logged
Blazius
Hero Member
*****

Karma: +89/-40
Offline Offline

Posts: 1282



« Reply #51 on: July 26, 2021, 12:15:29 PM »

I think i found something
-Could be this function to set MIL on/off?
-If it is, how to find in flash when ECU call this routine?
-Next step will be to bypass it, and make my own function for MIL?



Why is your file all messed up, seg015? and such, that is not a proper defined and disassembled file. Use a combination of prj's scripts, .ecu file load script / a2l and andy's plugin to produce decent idb.
Logged
BlackT
Hero Member
*****

Karma: +79/-40
Offline Offline

Posts: 1425



« Reply #52 on: July 27, 2021, 03:31:06 AM »

Why is your file all messed up, seg015? and such, that is not a proper defined and disassembled file. Use a combination of prj's scripts, .ecu file load script / a2l and andy's plugin to produce decent idb.
I don't know I just loaded bin in IDa, set procesor to C167 and that it is.

About script and plugins, I still didn't find way how to load them, install, use or whatsoever.  I have IDA 5.5 maybe that is a problem?
Logged
fknbrkn
Hero Member
*****

Karma: +186/-24
Offline Offline

Posts: 1455


mk4 1.8T AUM


« Reply #53 on: July 27, 2021, 06:09:25 AM »

Iirc there is a reverse logic ie bclr b_mil turns on mil and bset turns off
Logged
Blazius
Hero Member
*****

Karma: +89/-40
Offline Offline

Posts: 1282



« Reply #54 on: July 27, 2021, 06:18:06 AM »

I don't know I just loaded bin in IDa, set procesor to C167 and that it is.

About script and plugins, I still didn't find way how to load them, install, use or whatsoever.  I have IDA 5.5 maybe that is a problem?

Aight. Here is how I do it.

1. Download the pack of scripts and stuff I included, since you already have Andy's plugin install I didnt include that.
2. Check what CPU you have if you dont know, just use the included CPU rom which is the most generic one.
3. Open loadbin_idaq autoit script , ofcourse you need autoit installed. Then start IDA, this script is for the idaq with the new qt stuff, instead of idag.exe which is an older version I am not sure which one is 5.5.

Click on Go, "work on your own", click load rom in the script -> select the cpu bin. It will automatically set the processor, set the segments such as IRAM and RAM.  After click load flash , which will be your binary file that you wanna disassemble.

4.Go to file-> Run script -> select import.ecu file script. Ofcourse you should generate an ECU file for your binary if you dont have an a2l , if you do you can load the a2l instead using a different script from prj's helper scripts. Find your .ecu file, it should load, then click on OK to load them. I like to save and restart at this point.

5. Open IDA, start up the project which you just created, then go to Edit-Plugins-BoschME7 plugin , Andy's plugin which you should have installed properly. Select all boxes except the 2 at the top, so it does not mess up your project. Let it do its thing ofcourse. Save again.

6.Open loadbin autoit script again, then start IDA, open your project. Go to File->Run script, select processrom.py, then at the bottom in the console type processrom(0x80000, 0x8FFFFF) this process the flash again.

7.Navigate to 0x80000 and click Start cleanup in the autoit script which will remove any unreferenced code which might have been created accidentaly etc.

This should produce a pretty decent and cohesive dissassembly project. I dont know if anyone got a better method feel free to share  Wink Hope I didnt make any mistakes in writing this as I gotta go work right now, so will recheck in a few hours. Good luck.

« Last Edit: July 27, 2021, 09:44:58 AM by Blazius » Logged
BlackT
Hero Member
*****

Karma: +79/-40
Offline Offline

Posts: 1425



« Reply #55 on: July 27, 2021, 01:41:21 PM »

Thank you very much Smiley what IDA version do you use?
Script doesn't work with 5.5, I instaled 6.8 but I can only load ROM, nothing hapen when I click load flash
Logged
Blazius
Hero Member
*****

Karma: +89/-40
Offline Offline

Posts: 1282



« Reply #56 on: July 27, 2021, 01:59:09 PM »

Thank you very much Smiley what IDA version do you use?
Script doesn't work with 5.5, I instaled 6.8 but I can only load ROM, nothing hapen when I click load flash

6.1 32 bit ofcourse.
Logged
BlackT
Hero Member
*****

Karma: +79/-40
Offline Offline

Posts: 1425



« Reply #57 on: June 08, 2022, 03:05:32 PM »

Iirc there is a reverse logic ie bclr b_mil turns on mil and bset turns off

I can confirm, bset B_mil  turn MIL ON
bclr B_mil turn MIL OFF
Logged
BlackT
Hero Member
*****

Karma: +79/-40
Offline Offline

Posts: 1425



« Reply #58 on: June 10, 2022, 03:08:09 AM »

You could use any (with some restrictions on byte adressing see c167 docs)
Be careful to avoid using registers which stores some data from main code flow i.e.

Mov r4, #22h // r4  22h for now
Calls 8Bh, #your_subroutine // where you used r4 to store zeros
...
Movb tsrldyn, rl4 // stock code expecting 22h here but youve replaced r4 with zeros and get a blown coils


Your_subroutine:
Movb rl4, zeros
Rets
Soo the most secure metod is to copy this registers to some unused memory, and after my function to reverse tham back

Let say
1. My custom function start
2. Copy r4 to 81400, copy r5 to 8140A...
3. I use that r4 and r5 in my function so I can play with them
4. Before end of my function
5. Copy 81400 to r4, copy 8140A to r5
6. Return to main code


This will take a little more work but will make sure It safe
Logged
fknbrkn
Hero Member
*****

Karma: +186/-24
Offline Offline

Posts: 1455


mk4 1.8T AUM


« Reply #59 on: June 10, 2022, 09:30:45 AM »

What is the 81400 ?
Just use any others which written next to your CALLS

I.e

Mov r4, mem
Calls <your routine>
Mov mem, r4 // r4 consist some data which was written before your routine and inspected after so you cannot use it here
Mov r6, mem // r6 written here so it wont consist any useful data, use it

Another way is to use system stack
Logged
Pages: 1 2 3 [4] 5 6
  Print  
 
Jump to:  

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