brtrue.s points to an invalid address after inserting #112

Closed
opened 2012-09-30 09:59:01 -05:00 by andrasfuchs · 1 comment
andrasfuchs commented 2012-09-30 09:59:01 -05:00 (Migrated from github.com)

If there is a while loop in the code which is extended by Cecil, the brtrue.s instruction of the loop will point to an address which is not an instruction in the code.

For more details I uploaded to screenshots from the .NET Reflector to illustrate the problem.

My original code (before the insert) is here:
http://www.naplampa.hu/MonoCecil_OffsetBug_Original.png

My patched code (after the insert) is here:
http://www.naplampa.hu/MonoCecil_OffsetBug_Patched.png

If there is a while loop in the code which is extended by Cecil, the brtrue.s instruction of the loop will point to an address which is not an instruction in the code. For more details I uploaded to screenshots from the .NET Reflector to illustrate the problem. My original code (before the insert) is here: http://www.naplampa.hu/MonoCecil_OffsetBug_Original.png My patched code (after the insert) is here: http://www.naplampa.hu/MonoCecil_OffsetBug_Patched.png
jbevain commented 2012-09-30 10:29:01 -05:00 (Migrated from github.com)
Cecil itself won't check the validity of your code. See https://github.com/jbevain/cecil/issues/44 or http://stackoverflow.com/questions/7267480/does-mono-cecil-take-care-of-branches-etc-location
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-jbevain/cecil#112
No description provided.