Dear, Derek Selander:
I’m tree_fly. I’m reading the book recently, “Advanced Apple Debugging & Reverse Engineering”.
This book is really great. I read carefully, and then practice.
When I read chapter 20, about the function " evaluate condition ", it always goes wrong.
Here is the code:
expression = 'expression -lobjc -O -- id obj = ((id){}); ((BOOL){})'.format(getRegisterString(target), condition)
I test:
bar fullName.getter -c '[[[NSString alloc] initWithBytes:obj length:28 encoding:0x94000100] containsString:@"Ray Wenderlich"]'
and, use print to debug,
expression = 'expression -lobjc -O -- id obj = ((id){}); ((BOOL){})'.format(getRegisterString(target), condition) print('id obj = ((id){});((BOOL){}'.format(getRegisterString(target), condition))
result:
Attention to the single quotation mark:
(BOOL)'[[[NSString alloc] initWithBytes:obj...]'
I don’t know why the single quotation marks are here.
Then, I modify the code:
strip_condition = condition.strip("'") expression = 'expression -lobjc -O -- id obj = ((id){}); ((BOOL){})'.format(getRegisterString(target), strip_condition)
Now, all is OK.
I don’t know whether or not this question is a separate case, I hope the bug I submit you can focus on.