Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Xor decode from pcap file

by AnomalousMonk (Abbot)
on Jun 18, 2011 at 18:34 UTC ( #910348=note: print w/ replies, xml ) Need Help??


in reply to Xor decode from pcap file

Maybe something like this:

>perl -wMstrict -le "my $binary = pack 'H*', '03762cefa7ffe5'; printf '%02x ', $_ for unpack 'C*', $binary; print ''; ;; my ($p, $q) = unpack 'xCC', $binary; my $pairs = (length($binary) - 3) / 2; my $k = pack 'C*', 0, 0, 0, ($p, $q) x $pairs; printf '%02x ', $_ for unpack 'C*', $k; print ''; ;; my $decode = $binary ^ $k; printf '%02x ', $_ for unpack 'C*', $decode; " 03 76 2c ef a7 ff e5 00 00 00 76 2c 76 2c 03 76 2c 99 8b 89 c9


Comment on Re: Xor decode from pcap file
Download Code
Re^2: Xor decode from pcap file
by mabossert (Beadle) on Jun 18, 2011 at 18:55 UTC
    Sweet! That seems to have done the trick...Thank you so much. I have a huge headache from banging my head on the wall trying to figure out how to accomplish this. Now all I have to do is figure out what the heck the decoded data means...Thanks again!!!!
      Would you mind posting the completed code?
        my apologies...I didn't notice the request to post the completed code. Unfortunately, I moved to a new job and no longer have access to the code...sorry.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://910348]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-12-25 05:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls