Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

ASSEMBLER-L - (Verlorenen) Source-Code eines C-Programms wiederherstellen

Subject:

Re: Recovering a lost C-source program

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU>

Date:

2002.08.26 16:15:01


Hello,

I also believe that this is not an easy task. How big is the load module ?
First you would have to identify the original compiler generated section of the
module; normally it is followed by many IBM-supplied subroutines with names
like IBMxxxxx and CEExxxxx, which are not of big interest. You also should be
able to see the calls of some ANSI library function, only if they are not
inlined, of course.

You should be able to identify the original function names, they are included
in normal text before the entry points of the functions.

You should be aware, that the compiler normally does not put things together,
that depend from each other. For example, you could see coding like this:

L   15,=V(fopen)
...
<many other operations>
...
BALR 14,15

so it's not easy to follow the register contents.

Stack is always adressed with register 13 (if not bigger than 4096, per
function). You could replace references to the stack (for example, D13A,
that is, Register 13 and offset 13A) with variable names that make sense
to you. Static variables are normally adressed with register 4, 5, 6 or 7;
you should be able to see it in the prolog of each function. Parameters to
functions are adresses via register 1 in the normal MVS way.

As someone already stated, you should perhaps look at the assembly listing of
other C programs to get an idea of the "look and feel" of special C operations
like function calls etc.

Good luck

Bernd



Am Mon, 26 Aug 2002 schrieben Sie:
> Hi all,
>
> I have to update a program, originally written in C, without having the
> source.
> Disassembly of the load module is the solution but how do I start, what
> tools are recommended...?
> What I've already noticed is the different load module structure between a C
> compiled program and
> an assembler compiled program.
>
> Regards,
> L.

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie