NefMoto

Technical => Reverse Engineering => Topic started by: terminator on February 07, 2013, 02:30:08 PM



Title: How identify Prokanal bits?
Post by: terminator on February 07, 2013, 02:30:08 PM
I know the way to identify Prokanal bits is dissasembling, but I've just started to learn it.  So maybe there is an easier way to identify it?

And if 2 different files have the same OS, will CDKAT, CDHSH etc have the same offsets too?

Thanx


Title: Re: How identify Prokanal bits?
Post by: masterj on February 09, 2013, 01:17:48 AM
I know the way to identify Prokanal bits is dissasembling, but I've just started to learn it.  So maybe there is an easier way to identify it?

And if 2 different files have the same OS, will CDKAT, CDHSH etc have the same offsets too?

Thanx

For most files Prokonal bits will be somewhere in 18xxx zone. You can try to compare your file to similar.


Title: Re: How identify Prokanal bits?
Post by: elRey on February 09, 2013, 01:35:57 PM
I have seen where the order of the bits are different from version to version. it becomes a guessing game/ trial and error to find the CW you're looking for.

Is there anyway to identify them in disassembly? Or similar to the DTC table / error class lookup mentioned else on this forum?


Title: Re: How identify Prokanal bits?
Post by: masterj on February 09, 2013, 01:41:25 PM
I have seen where the order of the bits are different from version to version. it becomes a guessing game/ trial and error to find the CW you're looking for.

Is there anyway to identify them in disassembly? Or similar to the DTC table / error class lookup mentioned else on this forum?

I have created definition files for ASM map finder... Look for topic on this forum somewhere :)


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 11:22:48 AM
These are 1x1 8bit Codewords that are not referenced directly in ASM code. So, I highly doubt the ASM map finder can reliably identify these.


Title: Re: How identify Prokanal bits?
Post by: phila_dot on February 10, 2013, 12:12:02 PM
These are 1x1 8bit Codewords that are not referenced directly in ASM code. So, I highly doubt the ASM map finder can reliably identify these.

Yes they are.

The Prokon bits are referenced directly. Relevent bits are checked and then condition bits (i.e. B_cdlash) are set or cleared which are then referenced in the routines that they influence.


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 02:53:06 PM
Please show me an example of b_cdtes being set in an ASM code. (copy/paste)


Title: Re: How identify Prokanal bits?
Post by: phila_dot on February 10, 2013, 03:32:10 PM
Code:
extp     #206h, #1       
movbz  r4, CDTES      
and      r4, #1          
jmpr    cc_Z, loc_800472
mov     r4, #2000h      
or        prokonal_w, r4  
jmpr    cc_UC, loc_80047A
mov     r4, #0DFFFh    
and      prokonal_w, r4

B_cdtes is bit 13 in the word variable labeled prokonal_w above.


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 04:38:25 PM
Looks like they changed how those are set in the NA AWP files. There's nothing like that in the 032HS/032LP files.

At the beginning of DTEV I see this:
Code:
mov     [-r0], r9
mov     [-r0], r8
mov     [-r0], r7
mov     [-r0], r6
sub     r0, #14h
mov     [r0], word_3839FE
mov     r4, word_380BEA
and     r4, #2000h
jmpr    cc_NZ, loc_8A6F7A

and     r4, #2000h looks familiar. Could word_380BEA hold b_cdtes? A Jump to xref to operand... does NOT show any writes to it though.


Title: Re: How identify Prokanal bits?
Post by: phila_dot on February 10, 2013, 05:17:14 PM
Ands and ors right?


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 05:24:55 PM
word_380BEA is looking more like your prokonal_w. However, there's no and/or word_380BEA in the disassembly.


Title: Re: How identify Prokanal bits?
Post by: phila_dot on February 10, 2013, 05:32:49 PM
Screenshot of xref window?


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 05:33:38 PM
one minute


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 05:35:01 PM
xref window for word_380BEA


Title: Re: How identify Prokanal bits?
Post by: phila_dot on February 10, 2013, 06:00:00 PM
Jump to 0x800000 and check that the code is disassembled properly.

That should be the start of PROKONAL.


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 06:17:00 PM
x800000


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 06:52:21 PM
also filled in function names for xref a little while waiting. Thank you for your help.



Title: Re: How identify Prokanal bits?
Post by: phila_dot on February 10, 2013, 06:57:51 PM
What file is this?


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 07:01:00 PM
the famous Audi TT 180 that started it all - 8N0906018BD


Title: Re: How identify Prokanal bits?
Post by: phila_dot on February 10, 2013, 07:18:01 PM
Can you post it?

Nef searched turned up no exact matches.


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 07:23:15 PM
I a little surprised anyone on here wouldn't have it since it was the first fully mapped file in winols available. (<- complement to be as knowledgable as you are without this cheatsheet)


Title: Re: How identify Prokanal bits?
Post by: phila_dot on February 10, 2013, 07:26:15 PM
Found it in the OLS file.

0x821F70


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 07:33:01 PM
Yes, but how do you find it in an unmapped file similar to this one?


Title: Re: How identify Prokanal bits?
Post by: phila_dot on February 10, 2013, 07:35:01 PM
That's the reference.


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 07:35:55 PM
i.e in this one. What I'm saying is in these type of files, I don;t think the b_cdxxx are set in a way that they are easy to find. You can't just match positions. They are in a different order. I want a concrete way to said this is the bit via disassembly.

Thanks,
Rey


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 07:44:40 PM
That's the reference.

a reference to what? word_380BEA? or CDTES => 181B2 ?


Code:
C2  F4  B2  01

or

Code:
F3  F8 37 88


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 07:56:51 PM
So do I get IDA to format this into readable instructions?


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 08:00:35 PM
nevermind. Code

Perfect, Thanks phila_dot.

Code:
extp    #206h, #1
movbz   r4, CDTES_byte_8181B2
and     r4, #1
jmpr    cc_Z, loc_821F82
mov     r4, #2000h
or      prokonal_w_word_380BEA, r4
jmpr    cc_UC, loc_821F8A


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 08:03:41 PM
So all that to say I' was wrong. Thanks masterj.


Title: Re: How identify Prokanal bits?
Post by: phila_dot on February 10, 2013, 08:20:45 PM
DQ file

CDTES 0x8181B5

B_cdtes set at 0x821FDE


Title: Re: How identify Prokanal bits?
Post by: elRey on February 10, 2013, 09:06:57 PM
Yep. Found that with your info above.