Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 01-06-2010, 23:23
winndy winndy is offline
VIP
 
Join Date: Sep 2005
Posts: 236
Rept. Given: 104
Rept. Rcvd 26 Times in 12 Posts
Thanks Given: 27
Thanks Rcvd at 16 Times in 13 Posts
winndy Reputation: 26
I think I figured it out.

idaapi.i

change
Code:
%array_class(uchar, uchar_array);
to
Code:
%array_class(unsigned char, uchar_array);
recompile idapython,then call it in python like this:

Code:
func = idaapi.get_func(idaapi.get_screen_ea())

patternlen = 3
pattern = idaapi.uchar_array(patternlen)
pattern[0] = 0x18;
pattern[1] = 0x00;
pattern[2] = 0x89;

print pattern

mask = idaapi.uchar_array(patternlen)
mask[0] = 0xFF
mask[1] = 0xFF
mask[2] = 0xFF

print mask

ea = idaapi.bin_search(func.startEA,func.endEA,pattern,mask,patternlen,idaapi.BIN_SEARCH_FORWARD,idaapi.BIN_SEARCH_NOCASE)

print '%08lx'%(ea)
Reply With Quote
 


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
Advanced IdaPython to change details UI cannot change chants General Discussion 1 07-31-2019 15:46
the big call >> mov eax,01 ret crkelbery General Discussion 3 03-21-2009 06:40
Fixing an EXE to not call a DLL? Barry General Discussion 11 06-03-2004 00:37


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


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