From 53d99a141ab5ec7212cbb67a833df50d959beb79 Mon Sep 17 00:00:00 2001 From: "ero.carrera@gmail.com" Date: Mon, 12 Apr 2010 17:12:23 +0000 Subject: [PATCH] - Fixed a really subtle bug in some of the uses of _IDC_SetAttr(). In a couple of locations the call is made as part of the condition of an IF. But _IDC_SetAttr() will always return None ( "return setattr(obj, attrmap[attroffs][1], value)" ), leading to the value being properly set in the instance but never updated in the IDB. Which led to mysterious behavior because of "vanishing" attributes --- python/idc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/idc.py b/python/idc.py index c9f87e5..2496391 100644 --- a/python/idc.py +++ b/python/idc.py @@ -3892,7 +3892,8 @@ def SetFunctionAttr(ea, attr, value): """ func = idaapi.get_func(ea) - if func and _IDC_SetAttr(func, _FUNCATTRMAP, attr, value): + if func: + _IDC_SetAttr(func, _FUNCATTRMAP, attr, value) return idaapi.update_func(func) @@ -5231,7 +5232,8 @@ def SetFchunkAttr(ea, attr, value): """ if attr in [ FUNCATTR_START, FUNCATTR_END, FUNCATTR_OWNER ]: chunk = idaapi.get_fchunk(ea) - if chunk and _IDC_SetAttr(chunk, _FUNCATTRMAP, attr, value): + if chunk: + _IDC_SetAttr(chunk, _FUNCATTRMAP, attr, value) return idaapi.update_func(chunk)