XOR Operator - How?

G

Guest

I have a keylog file that I captured and it is encrypted by the virus. It
requires a XOR operation of each byte. I would like to see what the contents
of the file is so I know if I lost anything.

I looked in Excel and there is no XOR operation or function.

An example of the file is hex code:

03 34 3e 3b .....

I'm told that if I XOR it with the key, I can get to the data. I found the
key... Can I do this in Exel?

Thanks!
 
T

Tom Ogilvy

Demo'd from the Immediate window:

? &HEF& xor 2^3
231
? &HEF&
239

Looks like an XOR operator to me.
 
G

Guest

Odd - it is not in the Excel 2003 function or operator list... I'll try it.

So it is A1 B1
3 =(a1 xor 0xE)

Returns an error. Function format is not correct...

HREF seems to be a large number checker... How can it use that for a very
large file? I want import it into Excel, each column containg 1 byte. In
sheet 2, do a XOR 0xE on the associated cell in Sheet 1.

I don't think this is possilbe.
 
T

Tom Ogilvy

What I showed you is VBA.

Usually, processing a textfile as you describe would be done with VBA.

If the file has had all the bits altered, then I doubt it would come into
Excel with each bit in a single cell just by opening it.

In any event, you could create your own worksheet function

Public Function MYXOR(rng As Range)
If rng.Count > 1 Then
MYXOR = CVErr(xlErrRef)
Exit Function
ElseIf Not IsNumeric(rng) Then
MYXOR = CVErr(xlErrValue)
Else
MYXOR = Int(rng.Value) Xor &HE&
End If
End Function

Change &HE& to your key value

Put this in a general module of your workbook.

Usage
=MYXOR(A1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top