I wrote a perl script to decode a file and it keeps giving me a weird out put. I have zipped my script and the encoded file. Can any one make any since or tell me what I am doing wrong?

Dani AI

Generated

confirmed the decoded text matched what was expected; the thread is effectively resolved. The notes below collect concise, repeatable checks that save time when Perl decoding produces "weird" output and make results easier to verify.

  • Turn on strict and warnings so mistakes are caught early.
  • Prevent automatic character/line translations by using binary/raw I/O (see binmode). (binmode)
  • Inspect raw bytes before and after transformation. unpack('H*', $data) or ord/chr are the fastest ways to see numeric values and confirm byte-level changes. (unpack)
  • Work with a small sample first, record the exact transformation steps, then apply to the full file. Keep originals and use checksums to confirm no accidental corruption.

Quick hex-dump example (read raw and print hex):

open my $fh, '<:raw', $file or die $!;
local $/;
my $data = <$fh>;
print unpack('H*', $data), "\n";
close $fh;

's posted line is a useful verification point when comparing expected plaintext to output. As a final caution: when solving public challenges, avoid posting full solutions if the event rules prohibit it.

Never mind I was seeing what I was suppose to see. It was using a Ascii shift encryption. I needed the windows location for the solution to my online challenge at Mod-X.

<SmartDrv<=<C:\\WINDOWS\\system32\\Setup\\SmartDrv.exe<

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.