Quest for HEX Strings



Hi,

maybe somebody can give me a hint how to solve this Problem. I want to
write a script that can recover files from malformed Mails. The
background: A colleague has an Virus scanner on his incomming Notes
Mail
Server. Sometimes when a mail contains attachment and was send from a
Exchange client the Virus scanner glue the Message and the attachement
together.

To recover the containing file you can just use a simple HEX Editor.
Lets say we are looking for a DOC File as attachment. The Header of a
DOC is "D0 CF 11". So I look for this Value in the File and then I
delete everything above. Than I save the rest as DOC and tada the DOC
can be opend.

Now I want to create a script wre I can automate this task. So first I
will place all the Header to an Array and than I want to grep for them
in a file that I read into a variable. My only Problem, I have no clue
how to read a file in hex to a variable and than to grep the variable
with the array fields.

Afterwards I would like to cut off the parts that I need of course :-)

If I get that far I wil try to place that somewhere on a website.

You think I am crazy? :-D Maybe you have a hint for me where or on
what
I should take a look.

aTdHvAaNnKcSe

Bye
n0m

.



Relevant Pages

  • Re: Execution Plan Hinting
    ... someone a hint at what is going wrong. ... I couldn't recreate your problem running this script from Query Analyzer. ... PRIMARY KEY constraint 'PK_FIELD_VALUES'. ...
    (comp.databases.ms-sqlserver)
  • Re: More into /etc/rc.d/jail
    ... > creating temorary files like that is bad, use mktemp). ... Again, thanks for the hint. ... I cribbed the use directly off some other script... ...
    (freebsd-current)
  • Re: Deploying Terminal Services after the operating system
    ... this was a very good hint. ... >> of IIs by script. ... > I've used a sysocmgr answer file with great success; ...
    (microsoft.public.windows.terminal_services)
  • [SUMMARY] Changing password via script
    ... Thanks to everyone who gave a hint about ... How can I change via script or similar the password for ... Other suggested to play with awk, ...
    (SunManagers)