PDA

View Full Version : Auto_Root_Offset_Finding



<M457>
23-05-2003, 12:51 PM
HI guys,

I'm writing a little software to edit menustructure. But I don't know how to make a routine than can find root offset in a flashfile.:confused:
can anyone help me?

bye

<M457>
26-05-2003, 12:45 PM
nobody can help me? :confused: :confused:

jeep
28-05-2003, 01:02 PM
The way I do this is to cheat a little... I haven't seen a "proper" way of doing it....yet!

It works with all the 3310 versions I've thrown at it (I haven't tried other models), you might need to adapt the idea a bit.

The last entry in the root menu always seems to be Net Monitor, so I search for that. As I'm coding as I speak, I'll copy/paste the magic lines (it's Delphi, but I'm sure you'll be able to make sense of it)

// 00 00 00 3e 04 00 00 24 - end of netmonitor menu
Offset:=Find (#$00+#$00+#$00+#$3e+#$04+#$00+#$00+#$24)+$08;


My current project (MeNok) shows EVERYTHING that I can identify in a full flash file - it's rather sexy already :-)

Yeah, it does the same as many other programs, but I wanted one program that does everything... you can even select text from the TEXT chunk (any language) and it'll find the relevant menu structure automagically (most of the time!) :D

Currently it uses fixed offsets for a number of things (game graphics, sound effects) rather than searching for the offsets... so it's limited to 3310 V5.57 at the mo... I'll probably post a beta soon if anyone's interested.


George

Kontact
01-06-2003, 04:44 AM
Originally posted by <M457>
HI guys,

I'm writing a little software to edit menustructure. But I don't know how to make a routine than can find root offset in a flashfile.:confused:
can anyone help me?

bye

hi,

try to d/l the source code of al. (nfader and ppmmaker). i think there is a routine there for locating root offset. if u study it well. u can use that style to locate any root offset.

regards,

g3gg0
04-06-2003, 12:33 AM
my method:



locator loc_root =
{
"root_offset",
"\x00\x00\x05\xDC\x00\x00\x05\xDD\x00\x00\xFF\xFF\x00\x00\x05\xDF",
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
16,
1
};

void *asm_get_root_offset ( void *base, unsigned int length )
{
void *ptr = NULL;
void *offset = NULL;

ptr = asm_find_function ( base, length, loc_root, 0 );
if ( !ptr )
return NULL;

ptr = (void*) ((unsigned int) ptr + 28 );

get_dword ( (void*)((unsigned int) base + (unsigned int) ptr), &offset );

offset = (void*) ((unsigned int)offset - (unsigned int) MCU_START );

return offset;

}

<M457>
04-06-2003, 06:43 AM
tnx to all!!!

:)

Crux
22-06-2003, 03:44 PM
@jeep

hi
where can i get your software? (MeNok)

jeep
22-06-2003, 09:55 PM
@Crux

I'm in the middle of a re-write at the moment (code started to get very messy) and the soundcard has died, so beta release has been unavoidably delayed. Give me a few weeks to sort things out and I'll post here


George