Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Decoding Hexadecimal

Reply
 
Old 01-08-2009   #1 (permalink)
dphizler


 
 

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
Old 01-08-2009   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: Decoding Hexadecimal


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

> 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
Old 01-09-2009   #3 (permalink)
dphizler


 
 

Re: Decoding Hexadecimal

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

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

> > Hello,
>
Quote:

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

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

> > 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:
>
Quote:

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

> > 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.
>
Quote:

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

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

> > application:
> > "21485A4C0700000000F8FFF17EBFAF98"
>
Quote:

> > 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
>
Quote:

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

> > 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
Reply

Thread Tools


Similar Threads
Thread Forum
Yenc decoding Vista mail
Re: Vista decoding of DVD???? Vista General
JE TOUS MES MAILS DES MAILS EN HEXADECIMAL, PHOTO EN BINAIRE ET BALISE HTML??? Vista mail
decoding Vista music pictures video
Dreamscene & error decoding Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46