PDA

View Full Version : Labelmaster feature request


sigi
01-16-2005, 06:42 AM
two things that would be nice:

first: if labels from files could automatically be limited to length that ollydbg can take (256?). labels larger cause a crash. (undecorated names tend to be very long).

second: being able to supply a different base adress (since dlls are sometimes relocated).

labelmaster is a really nice plugin, very usefull...

focht
01-16-2005, 11:47 AM
Hi,

well for the case of "automatic limitation" the plugin author is not to be blamed because it's a shortcoming/inconsistency of ollydbg plugin interface iteself.

The plugin uses:

int Quickinsertname(ulong addr,int type,char *name);

(though same applies to Insertname())

which takes a "char*" as 3rd param.
There is no "max length" argument nor even a size limit mentioned in plugin docs.
Though one could "guess" the limitation by looking at other plugin functions which use "TEXTLEN" for char buffers.

For the "crash" case its not really ollydbg's fault but a plugin bug.
The stack gets overwritten due to large input line.

offending code (shortened)

<-- snip -->
....

while(ReadLine(fd,buf,bufsize) > 0) {
sscanf(buf, "%x %[\x20-\x7e]", &addr, label);

<-- snip -->

While the readline() call succeeds (bufsize limits the line reading) the sscanf() call will overwrite the stack due to insufficient "label" buffer.

Simple calculation:

char buf[550];
int bufsize = 550;
char label[512];

There is a "size" gap between line buffer and label buffer.
If you assume text file lines like "

sigi
01-31-2005, 04:32 PM
now that's accurate information, thank's a lot...