Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The Hexeditor project
#1
The Hexeditor project.

This update represents the final editing of the hex editor.

Program name:
  Hex Editor for DOS & Windows Public Domain BASIC Source Code 2023.

Author name:
  Written by Erik Jon Oredson at eoredson@gmail.com

Program purpose:
  This utility allows fast editing of bytes in a file. Two windows allow for
  editing and scrolling through hex values and ascii values.

 Hexxit85.zip for VBdos
 Hexed8rS.zip for QB64


[Image: hexedit3.png]



[Image: hexedit.png]


[Image: hexedit2.png]


Attached Files
.zip   HEXED8RS.ZIP (Size: 363.77 KB / Downloads: 11)
.zip   HEXXIT85.ZIP (Size: 406.31 KB / Downloads: 9)
Reply
#2
I get a C++ error while compiling:

In file included from qbx.cpp:2185:
..\\temp\\main.txt: In function 'void SUB_MENU(qbs*, qbs*, qbs*, qbs*, qbs*)':
..\\temp\\main.txt:38620:102: error: cast from 'HANDLE' {aka 'void*'} to 'int' loses precision [-fpermissive]
*__UOFFSET_HFIND=(  int32  )CreateFile((char*)(_SUB_MENU_STRING_G)->chr, 384 ,NULL,NULL, 1 ,NULL,NULL);
                                                                                                      ^
compilation terminated due to -Wfatal-errors.
Reply
#3
I also am receiving this error. You should be declaring your external functions with "Declare CustomType Library" when they use data types such as offset. Line 359 is the start of your declare block for some of your functions. You need to change "Declare Library" to "Declare CustomType Library". Even then, I'm not entirely a fan of your declarations as a whole but the program will build after this simple change.
Tread on those who tread on you

Reply
#4
ouff
i never figured what was a real purpose of hex-editors
i am too stupid for hex numbers
Reply
#5
I have tested Hexedit in QB64 PE under Win10 and have not encountered any library errors.

Maybe your Linux Wine is not parsing them correctly.

I also edited Declare Library To Declare CustomType Library without errors.

Maybe replace CreateFile with CreateFileA

Erik.
Reply
#6
(08-30-2022, 02:11 AM)eoredson Wrote: I have tested Hexedit in QB64 PE under Win10 and have not encountered any library errors.

Maybe your Linux Wine is not parsing them correctly.

I also edited Declare Library To Declare CustomType Library without errors.

Maybe replace CreateFile with CreateFileA

Erik.

I wasn't using Linux Wine and I don't think BDS107 was either. I was using Windows 11 with QB64pe. The errors we were receiving were not within the IDE but during compile time. But, as a rule, you should use "Declare CustomType Library" when one of your arguments or your function return is of type OFFSET. You can also just declare the DLL that contains the "CreateFileA" function.
Tread on those who tread on you

Reply
#7
Hi,

The most recent QB64 version of HexEditor now adds:
Code: (Select All)
 v8.0a r9.0a updates 12/30/2022:
  Increases maxfiles to 15.
  Adds Alt-A to Alt-F for ViewFile.

 v8.0a rA.0a updates 02/10/2023:
  Adds trap for Keypad-5 and Control-Keypad-5 keys.
  Adds Ctrl-F1 to Ctrl-F10 to all File Menu Box Alt- keys.
  Adds call to screen saver to Ctrl-F11/Ctrl-F12 in File Menu Box.

v8.0a rB.0a updates 03/20/2023:
  Edits file menu box help screen.

v8.0a rC.0a updates 03/28/2023:
  Adds hexedit.bmp to titlebar.

v8.0a rD.0a updates 04/16/2023:
  Replaces file menu box with dialog box.
  Adds ErrorBox and MessageBox.
  Adds ansi splash screen.
  Now stores and restores windows coordinates.

v8.0a rE.0a updates 04/20/2023:
  Adds BreakBox for Ctrl-Break trap.
  Updates dialogx.inc for correct title.
  Includes more old hexeditor in oldsrc.zip
  Fixes problem with CreateFile function call.

v8.0a rF.0a updates 04/28/2023:
  Removes some code from Sub ReadConfig and Sub WriteConfig.
  Stores config filename node in Sub GetConfigFilename$
  Adds Alt-F11 to test dialog box.
  Adds Alt-F12 to test file menu box.
  Forces config filename to current path.

v8.0a rG.0a updates 05/18/2023:
  Fixes \\ in directory display in Sub Menu3.

v8.0a rH.0a updates 05/20/2023:
  Fixes print display for Alt-F11 and Alt-F12
  Adds Filemenubox setting to hexedit.cfg
  Adds Errorbox2 to select file menu box/dialog box at start.

v8.0a rI.0a updates 05/23/2023:
  Adds more up/down scancodes to some message boxes.
  Updates oldsrc.zip with newer Hexxit81 features.
  Adds <escape> to exit system in call to ErrorBox2 in startup.

v8.0a rJ.0a updates 06/01/2023:
  Fixes netpath in Call Menu during startup box.
  Calls Delete.Process in exit from startup box and breakbox.

v8.0a rK.0a updates 06/10/2023:
  Fixes error when started from netpath.

v8.0a rL.0a updates 06/15/2023:
  Fixes error when writing config to cd-rom drive.
  Adds [FLOPPY] to DriveType in Function DriveExists.

v8.0a rM.0a updates 08/15/2023:
  Fixes MaxFiles in some UDTs.

v8.0a rN.0a updates 08/20/2023:
  Adds _ControlChr Off to top of main.
  Removes some assigned screen save variables.

v8.0a rO.0a updates 08/25/2023:
   Adds MouseButton2 to Sub Menu.
   Adds Control-F12 to edit hexedit.cfg

v8.0a rP.0a updates 11/10/2023:
   Now forces user to admin status.
   Adds Left-DoubleClick mouse to Sub Menu.
   Fixes search string during replace in ScrnEdit.

v8.0a rQ.0a updates 01/01/2024:
   Hexxit oldsrc v8.2a upgrade notes:
     Adds Insert filename in FileMenuBox in File box in Hexedit5.bas.
   Hexxit oldsrc v8.3a upgrade notes:
     Adds shell to treedel in delete dir in file box.

v8.0a rR.0a updates 01/10/2024:
  Replaces LoadIcon with Icon2BMP.
   Hexxit oldsrc v8.4a upgrade notes:
     Repairs SortFilesX in Filebox.
     Adds Ctrl-Fx to Alt-Fx in FileBox.
     Increments MaxFiles to 15.
     Fixes problem in Dir$ in LoadMultipleFiles.
     Solves cursor color upon exit to dos.

v8.0a rS.0a updates 02/20/2024:
  Hexxit v8.5a upgrade notes:
  Fixes call to Dir$
   Fixes Windows.Detected default.
Thanks.

[Image: hexedit4.png]

Hexed8rS.zip for QB64
Hexxit85.zip for VBdos


Attached Files
.zip   HEXED8RS.ZIP (Size: 363.77 KB / Downloads: 9)
.zip   HEXXIT85.ZIP (Size: 406.31 KB / Downloads: 7)
Reply
#8
@aurel this program could come in handy although it's not an everyday tool.

An example program used to be offered in the Wiki which patched one of the files QB64 used for compilation, so that it didn't dump "stdout" and "stderr" special files. This was needed especially for QB64-created executable programs that had to be run from CD-ROM or DVD-ROM. But this was a long time ago, like until v0.92 of QB64.

Another example was a patch needed to a binary configuration file for a music plug-in so it stopped misbehaving when it received a setting from the modulation wheel of the musical keyboard. Without that patch, the plug-in was intolerable in my favorite music-creation program.

There is a program in fact offered for Linux which does this type of thing, and is recommended used when more than a few bytes are needed modified inside a binary file. It gets complicated with "diff" files:

https://en.wikipedia.org/wiki/Patch_%28Unix%29

https://www.man7.org/linux/man-pages/man1/patch.1.html
Reply
#9
I recall they were handy for .COM files back in 80's.

Code: (Select All)
s$ = "I recall they were handy for .COM files back in 80's." + Chr$(13) + Chr$(10)

While count < Len(s$)
    count = count + 1
    If Asc(s$, count) < 32 Then t$ = t$ + "." Else t$ = t$ + Mid$(s$, count, 1)
    Print Right$("    " + Str$(Asc(s$, count)), 4);
    If count Mod 8 = 0 And count > 0 Then Print " | "; t$: t$ = ""
Wend
If t$ <> "" Then Print Tab(33); " | "; t$

Oh maybe I am thinking of byte editors.
b = b + ...
Reply
#10
Hi, the newest version of Hexedit now contains:

Code: (Select All)
 v8.0a rD.0a updates 04/16/2023:
  Replaces file menu box with dialog box.
  Adds ErrorBox and MessageBox.
  Adds ansi splash screen.
  Now stores and restores windows coordinates.

v8.0a rE.0a updates 04/20/2023:
  Adds BreakBox for Ctrl-Break trap.
  Updates dialogx.inc for correct title.
  Includes more old hexeditor in oldsrc.zip
  Fixes problem with CreateFile function call.

v8.0a rF.0a updates 04/28/2023:
  Removes some code from Sub ReadConfig and Sub WriteConfig.
  Stores config filename node in Sub GetConfigFilename$
  Adds Alt-F11 to test dialog box.
  Adds Alt-F12 to test file menu box.
  Forces config filename to current path.

v8.0a rG.0a updates 05/18/2023:
  Fixes \\ in directory display in Sub Menu3.

v8.0a rH.0a updates 05/20/2023:
  Fixes print display for Alt-F11 and Alt-F12
  Adds Filemenubox setting to hexedit.cfg
  Adds Errorbox2 to select file menu box/dialog box at start.

v8.0a rI.0a updates 05/23/2023:
  Adds more up/down scancodes to some message boxes.
  Updates oldsrc.zip with newer Hexxit81 features.
  Adds <escape> to exit system in call to ErrorBox2 in startup.

v8.0a rJ.0a updates 06/01/2023:
  Fixes netpath in Call Menu during startup box.
  Calls Delete.Process in exit from startup box and breakbox.

v8.0a rK.0a updates 06/10/2023:
  Fixes problem with hexedit started in netpath.

v8.0a rL.0a updates 06/15/2023:
  Fixes error when writing config to cd-rom drive.
  Adds [FLOPPY] to DriveType in Function DriveExists.

v8.0a rM.0a updates 08/15/2023:
  Fixes MaxFiles in some UDTs.

v8.0a rN.0a updates 08/20/2023:
  Adds _ControlChr Off to top of main.
  Removes some assigned screen save variables.

v8.0a rO.0a updates 08/25/2023:
  Adds MouseButton2 to Sub Menu.
  Adds Control-F12 to edit hexedit.cfg

v8.0a rP.0a updates 11/10/2023:
  Now forces user to admin status.
  Adds Left-DoubleClick mouse to Sub Menu.
  Fixes search string during replace in ScrnEdit.

v8.0a rQ.0a updates 01/01/2024:
   Hexxit oldsrc v8.2a upgrade notes:
     Adds Insert filename in FileMenuBox in File box in Hexedit5.bas.
   Hexxit oldsrc v8.3a upgrade notes:
     Adds shell to treedel in delete dir in file box.

v8.0a rR.0a updates 01/10/2024:
  Replaces LoadIcon with Icon2BMP.
   Hexxit oldsrc v8.4a upgrade notes:
     Repairs SortFilesX in Filebox.
     Adds Ctrl-Fx to Alt-Fx in FileBox.
     Increments MaxFiles to 15.
     Fixes problem in Dir$ in LoadMultipleFiles.
     Solves cursor color upon exit to dos.

v8.0a rS.0a updates 02/20/2024:
  Hexxit v8.5a upgrade notes:
   Fixes call to Dir$
   Fixes Windows.Detected default.

[Image: hexedit4.png]


[Image: hexedit2.png]



[Image: hexedit1.png]


the file is attached here:

Hexed8rS.zip for QB64
Hexxit85.zip for VBdos


Attached Files
.zip   HEXED8RS.ZIP (Size: 363.77 KB / Downloads: 11)
.zip   HEXXIT85.ZIP (Size: 406.31 KB / Downloads: 8)
Reply




Users browsing this thread: 1 Guest(s)