Closed nirizr closed 8 years ago
whoa, yes, this is much much better! i really appreciate that you reported this issue. should be a fairly quick fix, resulting in lots of deleted lines. good!
looks like getblob
is not exported via IDAPython. might have to do some ctypes
magic to invoke these routines.
Python>getblob
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'getblob' is not defined
Python>idc.getblob
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getblob'
Python>idaapi.getblob
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getblob'
Python>idautils.getblob
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getblob'
idasdk ctypes reference: http://www.hexblog.com/?p=695
getblob
and setblob
are not module level methods. I'm might not have been clear enough.
Those are methods of the netnode
object and should be used similarly to how hashstr
and hashset
are used (respectively).
(facepalm) yes, of course. thanks!
happens to the best of us, glad I could help!
looking into implementation....
get/setblob
accepts only a supval (integer) as a key. so if going to support string keys, will need to keep a mapping from string-key to int-key.
need an int-key blobstore and a string-key blobstore. since we don't want string-keys colliding with int-keys when we implement a map from string-key to int-key. propose:
INT_KEYS_TAG = 'M'
STR_KEYS_TAG = 'N'
STR_TO_INT_MAP_TAG = 'O'
Result's looking good! :)
getblob and setblob are implemented and supported API functions to store data above 4k bytes.
It is advised in IDA's SDK to use those APIs instead of implementing other solutions here:
Using those APIs will benefit this repository tremendously, removing a lot of complicated edge cases and logic.