The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ecube on February 01, 2010, 05:06:06 AM

Title: simple hex byte search
Post by: ecube on February 01, 2010, 05:06:06 AM
i'm just trying to find simple hex bytes in a file but having trouble

hbytes dd 04e1224b3h

how can I get BinSearch to use the above correctly? i've tried dwtoa,hex2bin and

hbytes db 04eh,12h,2h,4bh,3h

tried it like that too, with no luck. i'm sure the bytes are in the file, and i've searched the forum and found similar but nothing solid.

Title: Re: simple hex byte search
Post by: Ghandi on February 01, 2010, 06:04:53 AM

  hbytes dd 04e1224b3h
  hbytes db 04eh,12h,2h,4bh,3h


I'm no expert, but wouldnt you be looking for:

  hbytes dd 04e1224b3h
  hbytes db 0B3h 24h, 12h, 4Eh


When i assemble the following i get:
Quote
.data
dd 0FFFFFFFFh
dd 12345678h
dd 0FFFFFFFFh

FF FF FF FF 78 56 34 12 FF FF FF FF

It's stored Little-Endian, so the byte positions are inverted.

http://support.microsoft.com/kb/102025

HR,
Ghandi
Title: Re: simple hex byte search
Post by: ecube on February 01, 2010, 06:10:07 AM
ugh, is that big and little indian stuff? and is there easy way to convert over the dword that is in the switch form?
Title: Re: simple hex byte search
Post by: donkey on February 01, 2010, 06:18:27 AM
Quote from: E^cube on February 01, 2010, 06:10:07 AM
ugh, is that big and little indian stuff? and is there easy way to convert over the dword that is in the switch form?

What do you mean switch form ? The byte order of a dword can be reversed with BSWAP.
Title: Re: simple hex byte search
Post by: ecube on February 01, 2010, 06:32:07 AM
ok got it, thanks for your guys help  :bg i'm gonna use this to try and patch couple simple bugs in my commerical apps without forcing the user to redownload everything again.