ZaiRoN
January 13th, 2006, 11:23
Hi.
Playing a little with IDa Python I was trying to create a new segment using the function SegCreate. From Ida help you can read the syntax of the function:
The definition of the function taken from idc.py is almost the same:
so I tried to use:
Unfortunatly I received an error... So, looking at the definition of the function -inside ida.py- I noticed something strange:
Look at the third parameter: para
This is an error, 'para' is never defined/used/referred before. The right parameter should be 'base'; I tried to change the parameters but I got a warning message, this time from ida:
"Create a segment (00620000-00000001): end address is lower than start address."
Seems like there is something wrong with the order of the parameters. The right sequence is base-startea-endea.
I mailed the author but I didn't receive a reply so I decided to write it here. Is there someone that had the same problem?
Regards,
ZaiRoN
Playing a little with IDa Python I was trying to create a new segment using the function SegCreate. From Ida help you can read the syntax of the function:
Code:
success SegCreate(long startea,long endea,long base,long use32,long align,long comb);
where:
// startea - linear address of the start of the segment
// endea - linear address of the end of the segment
// this address will not belong to the segment
// 'endea' should be higher than 'startea'
// base - base paragraph or selector of the segment.
// a paragraph is 16byte memory chunk.
// If a selector value is specified, the selector should be
// already defined.
// use32 - 0: 16bit segment, 1: 32bit segment, 2: 64bit segment
// align - segment alignment. see below for alignment values
// comb - segment combination. see below for combination values.
// returns: 0-failed, 1-ok
The definition of the function taken from idc.py is almost the same:
Code:
def SegCreate(startea, endea, base, use32, align, comb)
Code:
SegCreate(0x610000, 0x620000, 0x1, 0x1, 0x2, 0x2)
Code:
def SegCreate(startea, endea, base, use32, align, comb):
...
success = idaapi.add_segm(startea, endea, para, "Segment", "CODE"
...
This is an error, 'para' is never defined/used/referred before. The right parameter should be 'base'; I tried to change the parameters but I got a warning message, this time from ida:
"Create a segment (00620000-00000001): end address is lower than start address."
Seems like there is something wrong with the order of the parameters. The right sequence is base-startea-endea.
I mailed the author but I didn't receive a reply so I decided to write it here. Is there someone that had the same problem?
Regards,
ZaiRoN