Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 03-22-2006, 04:33
nino nino is offline
Friend
 
Join Date: Jan 2002
Posts: 58
Rept. Given: 0
Rept. Rcvd 2 Times in 1 Post
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
nino Reputation: 2
IDA SetName

I'm trying to run some old IDC scripts on an IDA 4.7.0.830 installation but some of them fail with a Runtime error: Attempt to call undefined function. I traced the problem to the SetName IDC call. I remember this function was available before. Does anybody know what happened to the SetName function and how to use the same functionality in this version of IDA?
Reply With Quote
  #2  
Old 03-22-2006, 09:19
TQN TQN is offline
VIP
 
Join Date: Apr 2003
Location: Vietnam
Posts: 343
Rept. Given: 142
Rept. Rcvd 20 Times in 12 Posts
Thanks Given: 169
Thanks Rcvd at 130 Times in 43 Posts
TQN Reputation: 20
You can replace the SetName with MakeNameEx function:
MakeNameEx:
// Rename an address
// ea - linear address
// name - new name of address. If name == "", then delete old name
// flags - combination of SN_... constants
// returns: 1-ok, 0-failure

MakeNameEx(long ea,string name,long flags);

#define SN_CHECK 0x01 // Fail if the name contains invalid characters
// If this bit is clear, all invalid chars
// (those !is_ident_char()) will be replaced
// by SubstChar (usually '_')
// List of valid characters is defined in ida.cfg
#define SN_NOCHECK 0x00 // Replace invalid chars with SubstChar
#define SN_PUBLIC 0x02 // if set, make name public
#define SN_NON_PUBLIC 0x04 // if set, make name non-public
#define SN_WEAK 0x08 // if set, make name weak
#define SN_NON_WEAK 0x10 // if set, make name non-weak
#define SN_AUTO 0x20 // if set, make name autogenerated
#define SN_NON_AUTO 0x40 // if set, make name non-autogenerated
#define SN_NOLIST 0x80 // if set, exclude name from the list
// if not set, then include the name into
// the list (however, if other bits are set,
// the name might be immediately excluded
// from the list)
#define SN_NOWARN 0x100 // don't display a warning if failed
#define SN_LOCAL 0x200 // create local name. a function should exist.
// local names can't be public or weak.
// also they are not included into the list of names
// they can't have dummy prefixes
Regards,
TQN
Reply With Quote
  #3  
Old 03-23-2006, 03:32
nino nino is offline
Friend
 
Join Date: Jan 2002
Posts: 58
Rept. Given: 0
Rept. Rcvd 2 Times in 1 Post
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
nino Reputation: 2
Yeah it worked Thanks
Reply With Quote
Reply

Thread Tools
Display Modes

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



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


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