Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does some know perl script to convert Binary file (EXE) to decimal values(with option to set custom delimiters), and then just write output in html page? I searched, but did find anything. All binary to decimal / hex converters are online scripts for converting between different representations of numbers, whereas I need utility that take binary EXE file as unput and convert it into decimal format, allows save it in text file.

Replies are listed 'Best First'.
Re: Binary file (exe) to decimal converter
by BrowserUk (Patriarch) on May 20, 2010 at 12:21 UTC
    perl -nE"say join',',map{ qq[c($_)] } unpack 'C*', $_" ..\dumpbin.exe c(77),c(90),c(144),c(0),c(3),c(0),c(0),c(0),c(4),c(0),c(0),c(0),c(255) +,c(255) c(36),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(204),c(80),c(224),c(67),c(1 +36),c(4 c(0),c(0),c(0),c(6),c(0),c(0),c(0),c(0),c(0),c(0),c(176),c(19),c(0),c( +0),c(0), ),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0 +),c(0),c( c(0),c(0),c(0),c(4),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0), +c(0),c(0 (0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c +(0),c(0) (0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c(0),c +(0),c(0), c(0),c(0),c(126),c(24),c(0),c(0),c(146),c(24),c(0),c(0),c(162),c(24),c +(0),c( c(0),c(0),c(0),c(108),c(105),c(110),c(107),c(46),c(101),c(120),c(101), +c(0),c c(0),c(108),c(105),c(110),c(107),c(0),c(0),c(0),c(0),c(46),c(101),c(12 +0),c(1 ,,,

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      You know you need a binmode STDIN; or you'll get surprises later, right?

Re: Binary file (exe) to decimal converter
by Anonymous Monk on May 20, 2010 at 10:43 UTC
    Does some know perl script to convert Binary file (EXE) to decimal values(with option to set custom delimiters), and then just write output in html page?

    Its called hexdump/od/....

      I mean PERL script that I can run on any virtual web host. Not on my Windows machine. Any help??

        It's not hard to write that using CGI. A search for "hexdump" returns the following nodes:

        This site is not a script writing service. We will help you with your programming questions. You are supposed to write your own programs.

        A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Binary file (exe) to decimal converter
by ww (Archbishop) on May 20, 2010 at 12:52 UTC
    Just because someone needs to ask (IMO),

        why would you want to do that?

      homework, obviously :)