groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] need help resolving groff error


From: Ralph Corderoy
Subject: Re: [Groff] need help resolving groff error
Date: Thu, 10 Oct 2013 13:13:43 +0100

Hi charlie,

> Is this something I could contract for a reasonable fee? (a.k.a "not
> looking for a freebie")

Hard fiat currency!?  Now you're talking.  :-)  Well, maybe not.  See if
this works out for you.

I've took grops.exe from
http://sourceforge.net/projects/ezwinports/files/groff-1.21-w32-bin.zip/download
mentioned in
http://lists.gnu.org/archive/html/groff/2013-10/msg00001.html but you
could try starting with your existing one to save installing something
new.  Its SHA1 digest is 4e8639f4f7b67a9aff785053132d97b71615b784.

It has no symbols but I tracked down gen_tempname() and found

    ba 80 01 00 00    mov $0x180, %edx   # S_IRUSR | S_IWUSR
    b8 02 05 00 00    mov $0x502, %eax   # O_RDWR 2 | O_CREAT 100 | O_EXCL 400

The comments are mine.  O_BINARY on Windows seems to be 0x8000 (thanks,
Debian Code Search) so we need that second instruction to be

    b8 02 85 00 00    mov $0x8502, %eax   # O_RDWR | O_CREAT | O_EXCL | O_BINARY

I checked that byte sequence only occurred once in the exe by printing
the zero-based offset of every occurrence.

    $ perl -0777 -ne 'while (/\xb8\x02\x05\x00\x00/g) {print pos() - 5, "\n"}' 
grops.exe
    111706
    $

Then I got perl to substitute it, backing up the original.

    $ perl -i.bak -0777 -pe 's/(\xb8\x02)\x05(\x00\x00)/$1\x85$2/' grops.exe
    $

And listed all bytes that differ in octal with their 1-based offset.

    $ cmp -l grops.exe.bak grops.exe
    111709   5 205
    $

Giving a new SHA1 of

    $ sha1sum grops.exe
    b30cc09eb0f7cd24104a6ca207849ceb54233b40  grops.exe

Which you can find for a week or two at

    $ curl -sS http://inputplus.co.uk/ralph/grops.exe | sha1sum
    b30cc09eb0f7cd24104a6ca207849ceb54233b40  -

So, either try that grops.exe along with the rest of the above
groff-1.21-w32-bin.zip, or follow along at home with your existing one
to see if it modifies in the same way.  Look out for the permissions on
the downloaded grops.exe or your own created one;  it will possibly be a
plain file and need fixing.

Cheers, Ralph.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]