PDA

View Full Version : extra copy plugin problems and one feature request


blabberer
January 13th, 2004, 00:58
i today dld that extra copy plugin to try it out coz i needrd to rip some code

even though it has been written that copy to clipboard (alt+shift+f11) bug has been fixed i still find that it copies one or two lines properly but if i select a block to copy it crashes

and it can paste in one instance of olly only

i mean i had a dummy exe running and i wanted to copy the asm to it from anothere instance of olly running the original exe but i couldnt do it
all i could do waste paste code (yes it corrects the relative address )in some place in the same exe

so i had to resort to binary copy and paste and edit those e8 calls and all those relative address hope regon you could implement this

focht
January 14th, 2004, 00:07
Greetings,

>i still find that it copies one or two lines properly but if i select a block to copy it crashes

Didnt encounter it yet. Would be nice if you post some code block sample (do binary copy whatever) that crashes the plugin for sure.

>and it can paste in one instance of olly only

This is by design. The plugin checks its internal data strutures, a table of (modified bookmark structure) and enables/adds menu items on demand.
How would the other plugin instance know of the data? There are process boundaries.
Unless the plugin implements some sort of shared memory data block or other kind of IPC communication, it can't know of the "private" process data.

The other way would be to register a custom clipboard format and only rely on on this data (without having private table data) when doing copy/paste operations with clipboard api.

Regards,

A. Focht

blabberer
January 14th, 2004, 02:38
hey focht i dunno if i could code some thing that may reproduce the behaviour

but i tried copying it today too after your reply and it failed again so please see the screen shots at here
http://www.geocities.com/anonyscrollmouse/index.htm
("http://www.geocities.com/anonyscrollmouse/index.htm
")

the idea is good it labels the jump locations and it jumps there
if this could be pasted to some file then it will be as good as idas asm output file option

hope it may help

focht
January 14th, 2004, 13:06
Hi again,

well i now encountered some anomalies too but couldnt reproduce the behaviour.
I took a glance at the plugin source code and i think it contains some crash potential

<pre>
void copyToClipboard(void *item)
...
for(ii=0;ii<NumberL;ii++){

....
if(findLabel(pb->index)==0)
n+=7;//Length of label

n+2; //2 spacesbefore command
}
</pre>

"n+2" has no effect at all. use "operator+=" -> n+=2;

<pre>
void copyToClipboard(void *item):
....

if ( !OpenClipboard(NULL) )
{
....
}
if( !EmptyClipboard(NULL) )
{

}
</pre>

Good way to trash the local stack.
WIN32 API function prototype is: "BOOL EmptyClipboard( VOID)";
With the call "!EmptyClipboard( NULL)" you are corrupting your local stack.
"NULL" gets pushed as param but gets not cleaned by callee (win32 api is stdcall) because the function has NO PARAMS.

<pre>
if ( SetClipboardData( CF_TEXT, clipbuffer ) == NULL )
{
MessageBox(hwmain,"Unable to set Clipboard data", "ExtraCopy plugin",MB_OK|MB_ICONINFORMATION);
CloseClipboard(hwmain);
return;
}
CloseClipboard(NULL);
</pre>

Same applies as EmptyClipboard().
Will trash stack.
Please lookup WIN32 API prototypes at least on MSDN website!
NULL != VOID

<pre>
extc int _export cdecl ODBG_Pluginshortcut(int origin,int ctrl,int alt,int shift,int key,void *item)
{
....
if(alt!=0 && ctrl==0)
{
.....
}
else
return 0; // Shortcut not recognized
};
</pre>

Notice the problem? Not all paths return a value

Thats all i found at that time..
The Author should fix these bugs.

Regards,

A.Focht

blabberer
January 15th, 2004, 01:42
well i now encountered some anomalies too but couldnt reproduce the behaviour
yep that is another problem it crashes arbitarily

so all we can do now is wait till regon comes here and reads these posts and starts to do some thing about it
hey TBD have you got his address so that we can mail him

TBD
January 15th, 2004, 03:38
oh me anon: it is available in the readme.txt
... also you can do the changes and release a new version based on regon work

Regon
January 15th, 2004, 14:20
Most of mystakes and bugs is now removed but is not time for finish it...
I'll have time next month at last, so be patient.
I'll release new version with more features.

>"n+2" has no effect at all
silly bug

About parameter void I know, but I maked it because It couldn't compile without parameter. Why? I don't know.
Nevertheless after time I solve this too, if I remmember well

Thanks for all reported bugs!


By the way no body send to me bugs up to this day.
This was my first work in C because nobody was able to do something this for the others.

I'm sorry for my english

Regon
February 26th, 2004, 19:02
Try this version:
ExtraCopy1.2beta.zip ("http://www.regon.wz.cz/ExtraCopy1.2beta.zip")

Repaired some bugs
added:
Copy from the clipboard
- is tested for MASM syntax, nubers are expected in hex format: 20=20h=0x20
Options
Delete labels/comments