Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   Locate procedure in olly (https://forum.exetools.com/showthread.php?t=13698)

yogi_saw 08-04-2011 22:47

Locate procedure in olly
 
Hi all
i have been reversing an app after succesful unpacking it but now the problem is from the menu of that app if i click show toolbar it doesnt show. just nothing happens. I want to know how to find the procedure that is called when i click show toolbar and also the reason behind non working of it. Is there something destroyed in unpacking or something else

congviet 08-05-2011 23:19

You can find import function name EnableMenuItem, Menu item is enable or disable, The api function always call to EnableMenuItem function. From this api function, you can find out a begin of procedure.

copyleft 08-06-2011 09:56

maybe you have missed some api during unpacking,...
is IAT completely recovered ? or just used cut Thunk for some API !!?

yogi_saw 08-06-2011 13:39

thanks guys
@congviet there is no such call to the enablemenuitem api app is mfc application which makes many call to mfc42 and i cant find usage of it in win32.hlp file an example call is...
MFC42.#823_operator new
it seems c app but new to me
@copyleft no there were no invalid thunks which i cut iat was restored succerfuly

Kerlingen 08-07-2011 14:54

Did you dump the program at OEP? Many high level programming language programs don't work correctly any more if some variables are already initialized.

copyleft was not thinking of invalid APIs but of missing APIs. Sometimes the automated unpacking tools guess a wrong start or end address for the IAT so that some functions are never imported. However, this would most likely result in a app crash and not in a missing menu bar.

yogi_saw 08-07-2011 16:38

Yes it was unpacked with automated unpacker but i think it it is referencing to unexiting code in same exe. Do windows give any err if code referenced not exist

copyleft 08-07-2011 21:01

Why not unpacking manually,...
missing code means not unpacked code section correctly.
As Kerlingen noted you might also encounter wrong OEP address or might misplaced IAT with generic unpackers.

yogi_saw 08-07-2011 22:31

The target was too hard to unpack manually btw there is no doubt tat unpacking was succesful. Everything is working as expected other than this two functions. And as everything is working as expected there is no chance of wrong oep. It could be possible after dumping the section size may have not included required address....
Btw is there any way to know the address which get called when i click show toolbar if i found tat it wll be easy to include code in right section

yogi_saw 08-07-2011 22:54

Btw is there any way to know the address which get called when i click show toolbar if i found tat it wll be easy to include code in right section

Kerlingen 08-08-2011 01:10

The default window/dialog proc is called. You just need to follow the control's ID from there.

yogi_saw 08-08-2011 02:09

As i know the id gets pushed on stack for dialogbox. And same applies to menu but what do i need to see in case of submenu item
any hint on api or any docs to read is welcomed
thanks all

Kerlingen 08-08-2011 15:49

It doesn't matter if the ID comes from a menu or a sub-menu, as long as it all belongs to the same window.
Quote:

Originally Posted by Kerlingen (Post 74387)
The default window/dialog proc is called. You just need to follow the control's ID from there.


SLV 10-20-2011 20:37

It may be a DeleteMenu.

xpoy 10-23-2011 01:27

maybe you load MFC's lib in OD at first, by debug->select import library, you can get it from VC's path.

and for location msgproc, may you can found the addr that user32 call the callback, and filter the msg code at there, when the msg code that intereeting you show up, just follow it into program memory

jonwil 10-26-2011 12:30

If its importing MFC42.dll, it probably wont be making calls to windows API directly.
You should be looking for calls to CMenu::* (which will be calling into MFC)


All times are GMT +8. The time now is 15:03.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX