Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-04-2011, 22:47
yogi_saw yogi_saw is offline
Family
 
Join Date: Jul 2010
Posts: 173
Rept. Given: 57
Rept. Rcvd 52 Times in 32 Posts
Thanks Given: 3
Thanks Rcvd at 13 Times in 13 Posts
yogi_saw Reputation: 52
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
Reply With Quote
  #2  
Old 08-05-2011, 23:19
congviet congviet is offline
Family
 
Join Date: Jun 2010
Location: Vi
Posts: 154
Rept. Given: 30
Rept. Rcvd 76 Times in 42 Posts
Thanks Given: 60
Thanks Rcvd at 61 Times in 33 Posts
congviet Reputation: 76
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.
Reply With Quote
  #3  
Old 08-06-2011, 09:56
copyleft copyleft is offline
VIP
 
Join Date: Apr 2010
Posts: 174
Rept. Given: 181
Rept. Rcvd 43 Times in 39 Posts
Thanks Given: 156
Thanks Rcvd at 60 Times in 36 Posts
copyleft Reputation: 43
maybe you have missed some api during unpacking,...
is IAT completely recovered ? or just used cut Thunk for some API !!?
Reply With Quote
  #4  
Old 08-06-2011, 13:39
yogi_saw yogi_saw is offline
Family
 
Join Date: Jul 2010
Posts: 173
Rept. Given: 57
Rept. Rcvd 52 Times in 32 Posts
Thanks Given: 3
Thanks Rcvd at 13 Times in 13 Posts
yogi_saw Reputation: 52
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
Reply With Quote
  #5  
Old 08-07-2011, 14:54
Kerlingen Kerlingen is offline
VIP
 
Join Date: Feb 2011
Posts: 338
Rept. Given: 0
Rept. Rcvd 278 Times in 100 Posts
Thanks Given: 0
Thanks Rcvd at 358 Times in 110 Posts
Kerlingen Reputation: 200-299 Kerlingen Reputation: 200-299 Kerlingen Reputation: 200-299
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.
Reply With Quote
  #6  
Old 08-07-2011, 16:38
yogi_saw yogi_saw is offline
Family
 
Join Date: Jul 2010
Posts: 173
Rept. Given: 57
Rept. Rcvd 52 Times in 32 Posts
Thanks Given: 3
Thanks Rcvd at 13 Times in 13 Posts
yogi_saw Reputation: 52
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
Reply With Quote
  #7  
Old 08-07-2011, 21:01
copyleft copyleft is offline
VIP
 
Join Date: Apr 2010
Posts: 174
Rept. Given: 181
Rept. Rcvd 43 Times in 39 Posts
Thanks Given: 156
Thanks Rcvd at 60 Times in 36 Posts
copyleft Reputation: 43
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.
Reply With Quote
  #8  
Old 08-07-2011, 22:31
yogi_saw yogi_saw is offline
Family
 
Join Date: Jul 2010
Posts: 173
Rept. Given: 57
Rept. Rcvd 52 Times in 32 Posts
Thanks Given: 3
Thanks Rcvd at 13 Times in 13 Posts
yogi_saw Reputation: 52
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

Last edited by yogi_saw; 08-07-2011 at 22:42.
Reply With Quote
  #9  
Old 08-07-2011, 22:54
yogi_saw yogi_saw is offline
Family
 
Join Date: Jul 2010
Posts: 173
Rept. Given: 57
Rept. Rcvd 52 Times in 32 Posts
Thanks Given: 3
Thanks Rcvd at 13 Times in 13 Posts
yogi_saw Reputation: 52
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
Reply With Quote
  #10  
Old 08-08-2011, 01:10
Kerlingen Kerlingen is offline
VIP
 
Join Date: Feb 2011
Posts: 338
Rept. Given: 0
Rept. Rcvd 278 Times in 100 Posts
Thanks Given: 0
Thanks Rcvd at 358 Times in 110 Posts
Kerlingen Reputation: 200-299 Kerlingen Reputation: 200-299 Kerlingen Reputation: 200-299
The default window/dialog proc is called. You just need to follow the control's ID from there.
Reply With Quote
  #11  
Old 08-08-2011, 02:09
yogi_saw yogi_saw is offline
Family
 
Join Date: Jul 2010
Posts: 173
Rept. Given: 57
Rept. Rcvd 52 Times in 32 Posts
Thanks Given: 3
Thanks Rcvd at 13 Times in 13 Posts
yogi_saw Reputation: 52
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
Reply With Quote
  #12  
Old 08-08-2011, 15:49
Kerlingen Kerlingen is offline
VIP
 
Join Date: Feb 2011
Posts: 338
Rept. Given: 0
Rept. Rcvd 278 Times in 100 Posts
Thanks Given: 0
Thanks Rcvd at 358 Times in 110 Posts
Kerlingen Reputation: 200-299 Kerlingen Reputation: 200-299 Kerlingen Reputation: 200-299
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 View Post
The default window/dialog proc is called. You just need to follow the control's ID from there.
Reply With Quote
  #13  
Old 10-20-2011, 20:37
SLV SLV is offline
Friend
 
Join Date: May 2005
Posts: 62
Rept. Given: 3
Rept. Rcvd 4 Times in 3 Posts
Thanks Given: 5
Thanks Rcvd at 2 Times in 2 Posts
SLV Reputation: 4
It may be a DeleteMenu.
Reply With Quote
  #14  
Old 10-23-2011, 01:27
xpoy
 
Posts: n/a
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
Reply With Quote
  #15  
Old 10-26-2011, 12:30
jonwil jonwil is offline
VIP
 
Join Date: Feb 2004
Posts: 399
Rept. Given: 2
Rept. Rcvd 21 Times in 9 Posts
Thanks Given: 2
Thanks Rcvd at 67 Times in 35 Posts
jonwil Reputation: 21
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)
Reply With Quote
Reply

Tags
menu, procedure, resource


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to log all procedure calls? morgot General Discussion 2 10-01-2024 03:30
Olly & .NET peleon General Discussion 8 06-21-2007 09:13
Ollydebug plugin crashes.. how do i locate problem? redbull General Discussion 3 11-24-2005 15:42
Olly BPM apex General Discussion 1 02-25-2005 15:02


All times are GMT +8. The time now is 06:19.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )