Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Daishim

Determining a hex string from a text string.

This topic is 5471 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m almost positive that this has been asked before but I don''t have the links to the posts and more and more often now when I try to search for something in the forums, it just errors out with... An error occurred on the server when processing the URL. Please contact the system administrator. Ok, I''m working on a program that will scan through text for a hex string that is not always the same but is always the same length. Anyone know how I could determine if a hex string lies within a normal text string? Thanks.

I know only that which I know, but I do not know what I know.

Share this post


Link to post
Share on other sites
Advertisement
Assuming you're using standard notation, could you just parse the string for 0x then read the next 8 (or whatever) characters?

If there is no such identifier I see no way to pick it out, since something like FACEHAT could either be a word or hex.

[edited by - wild_pointer on November 27, 2003 7:00:32 PM]

Share this post


Link to post
Share on other sites
check out www.codeproject.com for a tokenizer, which is what should be used here.

quote:
Original post by wild_pointer
Assuming you''re using standard notation, could you just parse the string for 0x then read the next 8 (or whatever) characters?

If there is no such identifier I see no way to pick it out, since something like FACEHAT could either be a word or hex.

[edited by - wild_pointer on November 27, 2003 7:00:32 PM]


well, if the person used a tokenizer, s/he could just search for the numerical #''s (0 - 9) & the alphabetical letters (A - F), and if something isn''t right (like, there''s the "T" in "FACEHAT"), output an error, notice, or something.

my poetry

my programs

Share this post


Link to post
Share on other sites
I didn''t think of the ''0x'', so I went to check... it doesn''t have a preceding 0x. But I think I can figure it out, the server probably sends some preceding byte code before the hex string, I think I''ll have to see if I can figure out that code.



I know only that which I know, but I do not know what I know.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Sorry for the lame reply, but I love weird "special values".

My favorites:

0xdeadbeef
0xdeadf00d
0xbadcaca

The Microsoft ones work well too however without as much color:

0xcccccccc
0xdddddddd

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!