View Full Version : The color of flag register in Ollydbg
MathewMickle
November 21st, 2009, 03:39
I always have a trouble to remember jcc instructions(eg. JNLE,JNG) looking up which flag register, so I want to if there is an ollydbg plug-in,which has the following feature,
when the current instruction is a conditonal jump,
e.g. jz instruction
zero flag register(the letter 'z' in ollydbg) will be showed a special color to be distinguished from other flag registers .
Do someone know about this ? thx
naides
November 21st, 2009, 07:03
I know you WANT that plug-in, and sounds like a realy cool idea. . .
Why don't we MAKE it?
Think about how much you will learn. . . for starters, the flags affected by a jump will be forever engraved in your brain, plus you will help other people having similar problems!
MathewMickle
November 22nd, 2009, 01:24
What you said sounds like a zen.

Sure,why not make it by ourselves?
I have download some examples from http://www.ollydbg.de/, but I still am not sure how to change the letter's color in Ollydbg's register pane.
I never write a plug-in for ollydbg, but I REALLY would like to have a try.
Could you give me some suggestions or info? thanks
Kayaker
November 22nd, 2009, 03:48
Good on ya. for wanting to do it yourself. Just a very quick few comments then to steer you hopefully in the right direction. It's been quite a long time since I wrote an Olly plugin, so this is only from reviewing the documentation at the moment.
Text syntax (highlighting, color, etc.) is defined in Painttable(), or more precisely the DRAWFUNC callback. This is a normal WM_PAINT construct and is how you would define your Flag modifications.
As for the rest, you *might* be able to subclass the CPU Registers window (t_reg*) and modify the flags display (note things like DRAW_MASK, RS_EFL, etc. defines in plugin.h).
It might actually be easier, or at least more flexible, to create your own custom window and output a new set of Flags on each conditional jump. You could then use this custom window as a template for more involved plugins.
Pretty sketchy notes this time of night, but this should give you a rough idea for now.
Kayaker
Powered by vBulletin® Version 4.2.2 Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.