Jump to content
Sign in to follow this  
Attila Kovacs

EditorStructuralHighlight + AV Read of address 00000044

Recommended Posts

I've got tired restarting the IDE because of the recurring AV when I was adding a new unit/form etc.. to the current project.

Looks like it was fixed in 10.3 https://quality.embarcadero.com/browse/RSP-15471 I don't know, because I'm still on 10.1 U2, and there will be never an official patch for that.

 

The problem is crystal clear:

2203A97A E861C7E6FF       call $21ea70e0      ; FindTopEditView
2203A97F 8B4044               mov eax,[eax+$44]   
 

not checking against "nil" in EAX.

(Why this returning nil after an amount of time is a different question and it's not something we could ever fix in the binaries)

 

the fix is almost as easy as spotting the problem, detouring the call, and do some check:

 

procedure PatchStructuralHighlighterCode;
asm
  call FindTopEditView
  TEST EAX, EAX
  JNE @ok
  call PErrorProc // debug logging
  jmp ReturnNil
@ok:
  jmp Return
end;

 

Now, @FindTopEditView, @ReturnNil and @Return are version specific values, obviously, I have the addresses only for my IDE version.

As I don't feel the urge for maintaining and supporting fixes for Delphi but I would share the details if anybody is interested.

 

 

 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×