News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

simple hex byte search

Started by ecube, February 01, 2010, 05:06:06 AM

Previous topic - Next topic

ecube

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.


Ghandi

#1

  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

ecube

ugh, is that big and little indian stuff? and is there easy way to convert over the dword that is in the switch form?

donkey

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.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ecube

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.