Windows Vista Forums

Decoding Hexadecimal
  1. #1


    dphizler Guest

    Decoding Hexadecimal

    Hello,

    I connect myself to an SQL Server database to retrieve content about
    file attachments using VBScript within ASP.

    The datatype type in the table is an "image", which can contain the
    content of any type of file.

    I use a "response.binarywrite" to display the content of different
    types of files. Depending on the type of file, I use one of the follow
    content type code:

    - Response.ContentType = "text/html"
    - Response.ContentType = "application/vnd.ms-excel"
    - Response.ContentType = "application/msword"

    The web application I am modifying comes with a main application. Both
    services use the same database to retrieve and write data. You can
    create an attachment record in the database using both the application
    and the web application. The problem is that depending on whether you
    save the file through the application or through the web application,
    the content of the file is encoded slightly different. I have no idea
    what happens in terms of encoding because all that code is in a dll.

    So basically a example of a file with the content "testing" saves the
    following data in the database:

    web application:
    "74657374696E67"

    application:
    "21485A4C0700000000F8FFF17EBFAF98"

    The result is clearly different. And you can see that the first one is
    easier to decode than the second one by going to the following
    website:
    http://www.string-functions.com/hex-string.aspx



    If anyone has any idea what to do from there, I would really
    appreciate it.

    Thank you.

      My System SpecsSystem Spec

  2. #2


    Richard Mueller [MVP] Guest

    Re: Decoding Hexadecimal


    <dphizler@xxxxxx> wrote in message
    news:12b14030-e727-4ed2-ba9b-c98e1509c524@xxxxxx

    > Hello,
    >
    > I connect myself to an SQL Server database to retrieve content about
    > file attachments using VBScript within ASP.
    >
    > The datatype type in the table is an "image", which can contain the
    > content of any type of file.
    >
    > I use a "response.binarywrite" to display the content of different
    > types of files. Depending on the type of file, I use one of the follow
    > content type code:
    >
    > - Response.ContentType = "text/html"
    > - Response.ContentType = "application/vnd.ms-excel"
    > - Response.ContentType = "application/msword"
    >
    > The web application I am modifying comes with a main application. Both
    > services use the same database to retrieve and write data. You can
    > create an attachment record in the database using both the application
    > and the web application. The problem is that depending on whether you
    > save the file through the application or through the web application,
    > the content of the file is encoded slightly different. I have no idea
    > what happens in terms of encoding because all that code is in a dll.
    >
    > So basically a example of a file with the content "testing" saves the
    > following data in the database:
    >
    > web application:
    > "74657374696E67"
    >
    > application:
    > "21485A4C0700000000F8FFF17EBFAF98"
    >
    > The result is clearly different. And you can see that the first one is
    > easier to decode than the second one by going to the following
    > website:
    > http://www.string-functions.com/hex-string.aspx
    >
    > If anyone has any idea what to do from there, I would really
    > appreciate it.
    >
    > Thank you.
    The first string is just the 7 characters converted to 7 hex bytes. The
    second string is 16 bytes (128 bits). Makes me think it could be a hash
    (although it doesn't look like a good one). If it is a hash, it should not
    be reversible (except by brute force guessing, hashing candidate strings
    until you get a match). If the second string is reversible, maybe the last 7
    bytes are significant and the string has been padded to 16 bytes. If so, the
    last 7 bytes have been obfuscated in some way.

    --
    Richard Mueller
    MVP Directory Services
    Hilltop Lab - http://www.rlmueller.net
    --



      My System SpecsSystem Spec

  3. #3


    dphizler Guest

    Re: Decoding Hexadecimal

    On Jan 8, 6:49*pm, "Richard Mueller [MVP]" <rlmueller-
    nos...@xxxxxx> wrote:

    > <dphiz...@xxxxxx> wrote in message
    >
    > news:12b14030-e727-4ed2-ba9b-c98e1509c524@xxxxxx
    >
    >
    >
    >
    >

    > > Hello,
    >

    > > I connect myself to an SQL Server database to retrieve content about
    > > file attachments using VBScript within ASP.
    >

    > > The datatype type in the table is an "image", which can contain the
    > > content of any type of file.
    >

    > > I use a "response.binarywrite" to display the content of different
    > > types of files. Depending on the type of file, I use one of the follow
    > > content type code:
    >

    > > - Response.ContentType = "text/html"
    > > - Response.ContentType = "application/vnd.ms-excel"
    > > - Response.ContentType = "application/msword"
    >

    > > The web application I am modifying comes with a main application. Both
    > > services use the same database to retrieve and write data. You can
    > > create an attachment record in the database using both the application
    > > and the web application. The problem is that depending on whether you
    > > save the file through the application or through the web application,
    > > the content of the file is encoded slightly different. I have no idea
    > > what happens in terms of encoding because all that code is in a dll.
    >

    > > So basically a example of a file with the content "testing" saves the
    > > following data in the database:
    >

    > > web application:
    > > "74657374696E67"
    >

    > > application:
    > > "21485A4C0700000000F8FFF17EBFAF98"
    >

    > > The result is clearly different. And you can see that the first one is
    > > easier to decode than the second one by going to the following
    > > website:
    > >http://www.string-functions.com/hex-string.aspx
    >

    > > If anyone has any idea what to do from there, I would really
    > > appreciate it.
    >

    > > Thank you.
    >
    > The first string is just the 7 characters converted to 7 hex bytes. The
    > second string is 16 bytes (128 bits). Makes me think it could be a hash
    > (although it doesn't look like a good one). If it is a hash, it should not
    > be reversible (except by brute force guessing, hashing candidate strings
    > until you get a match). If the second string is reversible, maybe the last 7
    > bytes are significant and the string has been padded to 16 bytes. If so, the
    > last 7 bytes have been obfuscated in some way.
    >
    > --
    > Richard Mueller
    > MVP Directory Services
    > Hilltop Lab -http://www.rlmueller.net
    > --- Hide quoted text -
    >
    > - Show quoted text -
    Thanks for the input.

    Though I knew there was some kind of extra encoding done on the second
    string. Since both the web application and the main application can
    easily retrieve the content of both files, I would assume that it`s
    not a very complicated process to retrieve the actual content of the
    files.

    Another file is test3.txt:

    web application:
    6173646661736A64666B6F6173646A69666F7061697364666A6F70

    application:
    21485A4C1B000000F6FFFE1F2C5C4FB61E17DFF7180AC1FADCBFFE5CBBBE09DAB174

    And this file contains "asdfasjdfkoasdjifopaisdfjop"

    There are certain similarities between the two application files, both
    of them start with the same 8 characters: "21485A4C"

    Those 8 characters have probably nothing to do with the file's
    content. I thought maybe it had something to do with the file's
    extension "txt"

    Any help is appreciated,

    Thanks,
    Phil

      My System SpecsSystem Spec

Decoding Hexadecimal problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Yenc decoding sheidt Vista mail 1 28 Apr 2008
Re: Vista decoding of DVD???? oldman@old.net Vista General 2 03 Aug 2007
JE TOUS MES MAILS DES MAILS EN HEXADECIMAL, PHOTO EN BINAIRE ET BALISE HTML??? eric S. Vista mail 1 27 Jun 2007
decoding Patti Vista music pictures video 0 01 Apr 2007
Dreamscene & error decoding Dan E Vista General 10 18 Feb 2007