Software
Delphi and Lazarus
Trekking and Events
Blog and Forum
Čeština English
Main menu
Delphi and Lazarus
Useful Links

interesting webs & galleries of my friends:

F-Web

Máša&Pája Gallery

Delphi and Lazarus:

Embarcadero/ CodeGear

Lazarus project

Torry's Delphi pages

JEDI Code Library

 

KHexEditor

Once, I just needed an integrated hexadecimal editor for one project. As I didn't find any suitable component either with Google, I decided to write my own component. This should be very easy at the beginning but grew in quite a huge project later. This component should be well tuned already because I spent much time writing it.

KHexEditor features
Written as TCustomControl descendant
Enhanced editing capabilities for binary code
Many rendering styles
(Virtually) unlimited Undo/Redo
Keycode mapping
Fast functions for searching and replacing a binary code snippet
Printing and previewing of printed page
OS themes supported
Hexadecimal editor demo (quite simple)

Necessary packages

From version 1.4 none. Up to version 1.3 JEDI Code Library (JCL) - Version 1.100+ - download here.

Compiled executable demo

Download the executable demo directly without compiling in Delphi - it is absolutely virus and spyware free: HexEditorDemo.zip

KHexEditor downloads

Note: there are only stable packages here. For latest changes and hotfixes please download KControls.

FileVersionNumber of
downloads
Available tools:Changes
khexeditor_1.5.zip1.5592Delphi 6+, Lazarus 0.9.29(SVN#21827)+, C++Builder 2007+Update for RAD Studio XE
khexeditor_1.4.zip1.4563Delphi 6+, Lazarus 0.9.29(SVN#21827)+Update for Delphi 2010 and Lazarus and other changes due to first release of KControls
KHexEditor13.zip1.3414Delphi 6 till 2009Update for Delphi 2009
KHexEditor121.zip1.211267Delphi 6 till 2007Initial release

Screenshots (click the images to enlarge)

 
Simple demo of the componentBlock selection (row selection only)
 
Print preview component demo
 

Home | Software | Delphi and Lazarus | Trekking, travelling | Sport | Others | Blog

Search in comments: 
inserted: 2012-02-06 11:53:02   Reply...
From: adw2ru
Missing 2 functions: 1. Limit editing block size - edit only block with specific size. 2. Custom from and to char mapping when displaying and entering characters.
inserted: 2011-10-06 03:14:36   Reply...
From: dados
Hi, Are you going to make XE2 version? Do you have release date in mind?
inserted: 2011-08-18 19:38:59   Reply...
From: ac
Is there any example how to add and copy bytes from khexeditor array ? Is possible direct array access ?
inserted: 2011-03-25 08:27:44   Reply...
From: david
Hi! After repeatedly adding small chunks of data (1k..4k) for a while to the editor i suddenly get the error message Runerror (203) obviously an out of memory as this happens in the method TKCustomHexEditor.InsertString, to be more precise at the line ReallocMem(FBuffer, FSize); FSize is of the order of a few MB, any ideas how to solve this bug? By the way: it is rather odd how the display of the Editor changes when adding additional data, it is not possible to read or change any data...
inserted: 2011-02-08 08:00:03   Reply...
From: Stanley
Also, please add event, which triggered when cursor changes position. OnKeyUp and OnMouseUp doesn't work well when I press and holf on key/mouse button.
inserted: 2011-02-01 06:28:17   Reply...
From: Stanley
In Delphi XE when I enter into hex editor "1450323F593F432750" and try to find hexadecimal sequence "50" or char "P", method ExecuteCommand(ecSearch, @SearchData) can find only first occerence, but can't find second. This bug presents in sample application ..\demos\khexeditor too.
inserted: 2011-02-01 18:55:01   Reply...
From: tk
In KHexEditor.pas find I := Min(I, FSize - N); and replace to I := Min(I, FSize - N + 1);. Corrected for next patch.
inserted: 2011-02-01 18:56:45   Reply...
From: tk
And similar with M := Min(M, FSize - N);
inserted: 2011-01-26 11:13:04   Reply...
From: Stanley
1. Method SetCharMapping does nothing: code SetLength(MyCharMapping, 256); for c := Low(c) to High(c) do if c<#20 then MyCharMapping[Ord(c)]:='.' else MyCharMapping[Ord(c)]:=c; KHexEditor1.SetCharMapping(MyCharMapping); has no effect. 2. KHexEditor 1.5 doesn't support input of russian chars (and, probably, any other chars with codes >127) in TKCustomHexEditor.KeyPress. I use this fix: insted of eaText: I := Ord(Key); I wrote {$IFDEF UNICODE} eaText: begin I:=0; WideCharToMultiByte(DefaultSystemCodePage, 0, @Key, 1, @I, 1, nil, nil); end; {$ELSE} eaText: I := Ord(Key); {$ENDIF} 3. Please add methods "Copy", "Paste", "Undo" etc. Using "ExecuteCommand(...)" is more complicated and needs "uses KEditCommon". 4. In sample "HexEditor": when I remove suffix "0x" from component property, save project, close and open again, suffix "0x" appears again. 5. Is it possible to change separators' width programmatically? And how can I place any data into editor not via Clear/Append?
inserted: 2011-02-01 19:12:36   Reply...
From: tk
1. Corrected for next patch. 2. Patch applied. 3. Will be added when I have time. 4. Doesn't happen in my compilation. Did you find the reason? 5. No. Use Data property.
inserted: 2011-02-03 04:53:54   Reply...
From: Stanley
Doesn't happen in my compilation. Did you find the reason? In Delphi XE when AddressPrefix='', Delphi doesn't save this value into .dfm file. When I open project again, AddressPrefix has default value '0x', not ''.
inserted: 2010-12-23 20:55:30   Reply...
From: Rus
Hi! How can I put a limit on the size of the input data? How to programmatically enable overwrite of characters?
inserted: 2010-12-23 22:59:01   Reply...
From: tk
You always can type new characters and increase the buffer, there is no limit for that. You can enable overwrite mode by calling KHexEditor1.ExecuteCommand(ecOverwriteMode);
inserted: 2010-12-20 20:16:38   Reply...
From: user
не поддерживает русский язык =(
inserted: 2011-01-25 10:53:52   Reply...
From: Ivan
He tells that the code does not support russian/cyrillic texts.
inserted: 2010-11-22 00:10:48   Reply...
From: david
How can i add data from a simple array to the hex editor? There are only methods to load from stream or file...
inserted: 2010-11-22 00:27:13   Reply...
From: tk
Use Data or Lines property.
inserted: 2010-11-25 01:17:00   Reply...
From: david
Could you elaborate on that? It is not obvious to me how to append single bytes or whole arrays to the Data record...
inserted: 2010-11-25 13:06:09   Reply...
From: tk
Please download latest version again. I added the Append methods to append data (Ansistring or TDataSize record) to THexEditor buffer.
inserted: 2010-09-16 14:11:15   Reply...
From: thecult
I need to use with Codegear XE (cbuilder 2010) but it does not work. Do you know something about? thanks!
inserted: 2010-11-08 14:40:11   Reply...
From: tk
It should work by now.
inserted: 2010-08-29 01:25:59   Reply...
From: tech@digi-tk.net
Is it possible to get around the memory size, there are times I need to open 2gb files or larger?
inserted: 2010-11-08 14:42:49   Reply...
From: tk
No. You have to split it to smaller segments manually. Or we all have to wait until the 64 bit compiler comes... I don't want to segment the buffer.
inserted: 2010-03-22 13:39:34   Reply...
From: YU7XW
Hello! Have u solved problem with C++ personality? Thanks!
My account
Top downloads
Recently modified

KControls Development Suite

by: tk

2010-11-08

KHexEditor

by: tk

2010-11-08

KGrid

by: tk

2010-11-08

KIcon

by: tk

2009-11-24

KGrid 1.3 released.

by: tk

2009-08-10

Recently inserted

KComponents as open source

by: tk

2011-04-16

Problem with comments and logins

by: tk

2010-01-29

KControls released

by: tk

2009-10-15

Working hard on KGrid update...

by: tk

2009-06-22

EMWD

by: tk

2007-12-03

No translation available

by: tk

2007-10-30