Page 1 of 1
Minimal Codes for learning HexEditor
Posted: Mon Nov 14, 2022 8:31 pm
by bembulak
Hi all,
I do have an apprentice here at work (for networking, serveradministration …) and would like to teach him some other stuff besides infrastructure as well. Like, investigating stuff, poking around in code, use WireShark etc. pp.
Today I thought it would be good, if he had some idea how a HexEditor works and so I wondered if it was difficult to build some Binaries with PB that we could investigate with a HexEditor and eventually change some of the values.
Do you have any ideas on that? I'm not that big of a programmer myself, so I'm asking you for help/hints. Thank you!
Re: Minimal Codes for learning HexEditor
Posted: Mon Nov 14, 2022 9:04 pm
by Olli
Hi ! And welcome to you !
very interesting subject you share ! Maybe start with :
- the
Random() function to simulate a file reading and report the file reading system to a next time.
- the
Hex() function to convert a numeric value to a digits string.
- the
RSet() function to format the strings by filling the missing zeros
- the
TextGadget() function to display all the values in a virtual grid.
- and nest two
For... Next loops to draw the virtual grid.
What do you think about this start ?
Re: Minimal Codes for learning HexEditor
Posted: Mon Nov 14, 2022 9:53 pm
by AZJIO
Re: Minimal Codes for learning HexEditor
Posted: Mon Nov 14, 2022 10:02 pm
by infratec
I think he want a file/exe where he can change some bytes with a HEX-Editor.
You can write a program where the text is stored in a datasection.
Then you can modfy the text in the exe file with a Hex-Editor and run it again.
Code: Select all
If OpenWindow(0, 0, 0, 400, 300, "PureBasic Window", #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget)
EditorGadget(0, 10, 10, 380, 280)
SetGadgetText(0, PeekS(?Text))
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_CloseWindow ; If the user has pressed on the close button
Quit = 1
EndIf
Until Quit = 1
EndIf
DataSection
Text:
Data.s "Hello World" + #LF$ + #LF$ + "Change me with an Hex-Editor, but not my size" + #LF$ + "But it's unicode!"
EndDataSection
Re: Minimal Codes for learning HexEditor
Posted: Mon Nov 14, 2022 10:18 pm
by AZJIO
For a network administrator learning HexEditor?
Code: Select all
MessageRequester("", "Hello World")

Re: Minimal Codes for learning HexEditor
Posted: Mon Nov 14, 2022 10:31 pm
by infratec
Re: Minimal Codes for learning HexEditor
Posted: Tue Nov 15, 2022 8:43 am
by bembulak
infratec wrote: Mon Nov 14, 2022 10:02 pm
I think he want a file/exe where he can change some bytes with a HEX-Editor.
Exactly. This is what I had in mind.
For a network administrator learning HexEditor?
Not only network admin. Sysadmin in general is the starting point for this sort of education and it covers multiple topics. Once the apprentice knows where his interests are, he then can do specialization. E.g. Infrastructure Architecture, Security & Pentesting etc. pp.
In general I see the benefit of „climbing other mountains“ / thinking outside the box and having a basic knowledge of these things.
Anyways, the Datasection seems to be a good idea and I‘ll have a look at it.
Thank you all for the contributions!
Re: Minimal Codes for learning HexEditor
Posted: Tue Nov 15, 2022 9:52 am
by Bitblazer
If you want (him) to get a general knowledge about native (non NET) windows binaries aka
PE files, i would suggest something like
PE Explorer and from there, investigate the individual sections with a
hex editor.
Once he finished the PE knowledge,
knowing everything about DLL's could be next.
Re: Minimal Codes for learning HexEditor
Posted: Tue Nov 15, 2022 11:20 am
by Olli
bembulak wrote: Tue Nov 15, 2022 8:43 amThank you all for the contributions!
That is all right !
I blended << learning HexEditor >> and << learning hex editor >> !
Plus the term of a << apprentice >> relation and, I was casting myself in the steps of an hex editor building !
