Hey KetilO, first let me say.. you are a GOD.

Now to business:
A few weeks ago i built a plugin for a debugger called OllyDbg (you may know it). The plugin is called NonaWrite. A couple of days ago i set about the task of adding syntax hilighting using the RAEdit control. But i have problems when trying to Open / Save from the control.

i've debugged the control, and it seems to get a C0000005 (ACCESS VIOLATION) on an address.

I've found this line of code in the RAEdit source code (in the Paint.asm module):

mov ebx,hWrdMem
mov edx,
  TestWord1:
.if edx
mov eax,.WORDINFO.color        ;  <<<BAD LINE
shr eax,28
cmp eax,nGroup

Is there any reason why it would crash because of this line.. or is there somthing i need to add to stop this happening.

I've tryed to change the code so it always returns 0 in ecx, but this stops syntax hilighting.

Please clue me up.

Thanks Bud

-Nonameo-
Posted on 2005-05-28 15:47:45 by Nonameo
Hi Nonameo

It seem like the list of words is corrupted.
Hard to tell what can cause this. Maybe your addin saves data where it should not.

KetilO
Posted on 2005-05-29 14:36:43 by KetilO
i had to do my list of words line by line...

bluewords              db "MOV BLAH SOMTHING ELSE"
                            db "NEXT LINE",0

becuase they wouldnt fit on one line..

i used the code from the SimEd example in the FileIO.asm module for my saving.

Also, the control seems to act differently in a dll for example:

In an exe, you cant use the mousewheel if there is only 1 line. In my dll, it lets you, and then it crashes
In an exe, you can use REM_SETMODE to change to block mode, but in my dll, it doesnt change
In an exe, i can save from the control and open to it without any crashes, in my dll i cant.

I am using these command lines...

4,O,$B\RC.EXE /v,1
3,O,$B\ML.EXE /c /coff /Cp /nologo /I"$I",2
7,O,$B\LINK.EXE /SUBSYSTEM:WINDOWS /RELEASE /DLL /DEF:$6 /LIBPATH:"$L" /OUT:"$7",3,4

rsrc.obj,O,$B\CVTRES.EXE,rsrc.res
*.obj,O,$B\ML.EXE /c /coff /Cp /nologo /I"$I",*.asm

Any help would be appreciated

Thanks again

-Nonameo-
Posted on 2005-05-29 17:01:26 by Nonameo
It seem there is something seriously wrong.
To be able to help I need to see your sources.

KetilO
Posted on 2005-05-30 05:15:32 by KetilO
Sure, i'll zip them up for you. I'm not posting a link on here. Do you use msn ? Maybe PM me with your msn name ?

mine is Mighele@gmail.com

Feel free to add me, I'd like to help :)

Thanks

-Nonameo-
Posted on 2005-05-30 08:08:06 by Nonameo
Ok problem fixed..

a couple more are still present tho :S

I can still scroll past the last line, and this causes a crash
Some of my text isnt hilighting such as "pushad" and "leave"

Is there a way to set the hilight on these words ?

Thanks

-Nonameo-
Posted on 2005-06-02 14:08:38 by Nonameo
For the hiliting "pushad"
In your code
bluewords db "ADC ADD AND CALL CBW CLC CLD CLI CMC CMP CMPS CMPSB CMPSW CWD DAS DEC"
db "DIV DAA ESC HLT IDIV IMUL IN INC INT INTO IRET JA JAE JB JBE JC JCXZ JE"

There must be a space at the end of each line or the word becomes DECDIV
bluewords db "ADC ADD AND CALL CBW CLC CLD CLI CMC CMP CMPS CMPSB CMPSW CWD DAS DEC "
db "DIV DAA ESC HLT IDIV IMUL IN INC INT INTO IRET JA JAE JB JBE JC JCXZ JE "

Also a modeless dialog should be terminated with DestroyWindow, not EndDialog.

There is also something odd with data definitions

.data?
CSOLineCount dd ?
CSOTextFromLine dw 0300

You can't have initialisized data in section .data?. Move it to .data

It is still unstable, don't know why.

KetilO
Posted on 2005-06-02 16:07:46 by KetilO
Thanks man, i should have seen that one :P

I've changed it back to a modal dialog and it is a lot more stable, i guess it doesnt like modeless ones.

just to give you the shout out.. still having problems getting block mode to work, even with a modal dialog

-Nonameo-
Posted on 2005-06-03 16:55:27 by Nonameo
Hi

Block mode can only be set if you have a monospaced font like Courier New.

KetilO
Posted on 2005-06-07 03:25:49 by KetilO