Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 06-08-2006, 10:29 PM   #1
In Runtime
 
hextcomm's Avatar
 
Join Date: Aug 2005
Posts: 237
Send a message via ICQ to hextcomm Send a message via AIM to hextcomm Send a message via MSN to hextcomm
Default Hexadecimal...

Salutations,

could someone please show me how to make a hex editor in either Visual Basic..or Delphi, or C++?

but with code that isn't over complexified, i might not be able to understand it

or direct me to a tutorial?

I am writing a program with an engine that requires hex editing capabilities.

Thank You.
__________________

__________________
Nicholas.

http://www.kompulsa.com

http://www.kompulsa.com/kae/

http://www.kompulsa.com/it/
hextcomm is offline   Reply With Quote
Old 06-09-2006, 12:26 PM   #2
Baseband Member
 
Griz803's Avatar
 
Join Date: Jun 2004
Posts: 89
Default Re: Hexadecimal...

Well, that isn't too difficult. I've included below the psuedocode procedure to follow.

Code:
get file specification
open file for read/write
read values into memory
display buffer portion to screen
edit buffer
refresh display
write buffer to file
close file
While this is a very simple program, it does use memory to keep from thrashing the hard drive as much and so that edits can be committed AFTER verification rather than by default. You will need to simply use an integer or real variable to store the values and display them in hex. You will need to take a character value as an array to store input for translation to the numeric value. This is needed since you have to input letters and numbers for true hex entry. Remember to dynamically size and resize the buffer used as you edit. I hope this will help you out.
__________________

__________________
/*What does not kill us, makes us drink far too much caffeine*/
Griz803 is offline   Reply With Quote
Old 06-09-2006, 12:32 PM   #3
In Runtime
 
hextcomm's Avatar
 
Join Date: Aug 2005
Posts: 237
Send a message via ICQ to hextcomm Send a message via AIM to hextcomm Send a message via MSN to hextcomm
Default Re: Hexadecimal...

Thank You

But what I meant was I need to learn how to write the algorithm that willl convert the binary to hex and then process it.
__________________
Nicholas.

http://www.kompulsa.com

http://www.kompulsa.com/kae/

http://www.kompulsa.com/it/
hextcomm is offline   Reply With Quote
Old 06-10-2006, 01:02 PM   #4
Baseband Member
 
Griz803's Avatar
 
Join Date: Jun 2004
Posts: 89
Default Re: Hexadecimal...

No you actually don't if you are using C or C++ to write it. Both have facilities to display integers as binary, decimal and/or hexadecimal built in. Check out the docs online for the printf function in C or the "extraction operator" in C++. Both have format specifiers to do it for you, and since it is only a matter of displaying it in a mode for a human to mesh with, then you don't have to worry about it as much. Input can be done more easily in C than in C++ (since I don't recall a format specifier for the "insertion operator"), simply use scanf (Carefully or it will eat your program!) and the correct specifier to accept the input as a hexidecimal value. Always remember, computers only know about binary and what to do with the values to convert them for display, they don't "see" any difference between decimal and hexadecimal and octal and binary at all in reality. I hope this will help you get started. Write some code and then repost it if you get stuck, I'll be glad to help if I can.
__________________
/*What does not kill us, makes us drink far too much caffeine*/
Griz803 is offline   Reply With Quote
Old 06-10-2006, 03:31 PM   #5
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: Hexadecimal...

How about this, (i've not tested it), but print a var able as a long hex number, (%lx), and then print the same as a char (%c).

unsigned char var;
scanf ("%c", &var);
printf ("Hex %lx, char %c", var, var);

using scanf is great, but it's also a great way to introduce bugs, but since i imagine that you're writting this program for yourself, then that's not going to matter so much.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 06-11-2006, 03:13 PM   #6
In Runtime
 
hextcomm's Avatar
 
Join Date: Aug 2005
Posts: 237
Send a message via ICQ to hextcomm Send a message via AIM to hextcomm Send a message via MSN to hextcomm
Default Re: Hexadecimal...

Thank You

But i kind of stopped C++ because it got hard and the tutorials weren't helping

so i'm in Delphi now.

i'm very sorry for wasting your time
__________________
Nicholas.

http://www.kompulsa.com

http://www.kompulsa.com/kae/

http://www.kompulsa.com/it/
hextcomm is offline   Reply With Quote
Old 06-12-2006, 12:16 PM   #7
Baseband Member
 
Griz803's Avatar
 
Join Date: Jun 2004
Posts: 89
Default Re: Hexadecimal...

It's not a waste of time. And I'm sorry, but you said C++ in your post. I can't specifically help you out in Delphi, but the same things hold true for the algorithm of the thing. 16 decimal is 16, whether I write it as 10000 binary or 10 hexadecimal. And the machine and most languages have a facility to accept diferent input notations and display results as different notation formats. Perhaps I've misunderstood what it is that you are wanting to do. Have patients with me please and don't give up, it has been a LONG, *LOONG* time since I studied Pascal or used Delphi. Post details specifically of what it needs to do and I'll try again. Walking away from a problem with programming just leaves one result, a problem.
__________________
/*What does not kill us, makes us drink far too much caffeine*/
Griz803 is offline   Reply With Quote
Old 06-12-2006, 04:28 PM   #8
In Runtime
 
hextcomm's Avatar
 
Join Date: Aug 2005
Posts: 237
Send a message via ICQ to hextcomm Send a message via AIM to hextcomm Send a message via MSN to hextcomm
Default Re: Hexadecimal...

oh, thanks

The program is to edit system files and change other settings as well, for example: tcpip.sys, and change the 10 concurrent connection limitation in Windows XP.

I also want to change the XP bootscreen, but that requires Hex also, and some other things as well.

Which is why I need for the program to be able to modify the hex codes in these files.

When released, the program will be available at: http://hex.hackershome.net
It is Tecravox.

The next program is an IM client also being written in Delphi, but i'll have to edit, accept and interpret hex codes, it will connect to AIM, MSN, ICQ, Yahoo!, Jabber.

The program (Tecravox) is a System Manipulator that enables the user to change various system settings safely and in a user-friendly fashion, it will also explain how these things work and attempt to guide the users on a path to better understand their computer and operating system environment.
__________________
Nicholas.

http://www.kompulsa.com

http://www.kompulsa.com/kae/

http://www.kompulsa.com/it/
hextcomm is offline   Reply With Quote
Old 06-12-2006, 04:46 PM   #9
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: Hexadecimal...

tcpip.sys is 1029 lines of compiled code... to change that 10 connection limit you're going to need a little more than a hex editor.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 06-12-2006, 06:23 PM   #10
In Runtime
 
hextcomm's Avatar
 
Join Date: Aug 2005
Posts: 237
Send a message via ICQ to hextcomm Send a message via AIM to hextcomm Send a message via MSN to hextcomm
Default Re: Hexadecimal...

oh
__________________

__________________
Nicholas.

http://www.kompulsa.com

http://www.kompulsa.com/kae/

http://www.kompulsa.com/it/
hextcomm is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:13 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0