Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

ibm midrange - IBM i: Binary diff between two *PGM objects

Operating system: IBM i (AS/400)

I want to check two ILE *PGM (or *SRVPGM) objects if their executable code is the same. The included source change date can not be used because the timestamp can be changed but the code is the same. This is the case when the source code will be downloaded from a git respository and therefore the source change date can be changed.

Example: You have a library A with all compiled program objects. Then you will download the complete source code from git to the AS/400 and compile it to another library B. Now you want to check which program objects did really change between library A and library B. Only the changed program objects should be saved and transferred to the target system.

The objects which will be compared are all compiled on the same system and the same target release.

I didn't found an API to compare the binary code. Can I use MI to get this information?

Has anyone had the same problem?

Best regards, Matthias

question from:https://stackoverflow.com/questions/65842230/ibm-i-binary-diff-between-two-pgm-objects

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If the *PGM happened to have been compiled with DBGVIEW(*LIST) or DBGVIEW(*ALL)

You should be able to use the debug API's to extract the compile listing from the objects.

Otherwise, the Dump Object command could be used to generate a spool file of the objects contents. You could then compare the spool files. Obviously, they wont be a perfect match, library name &creation date will be difference for instance. I also suspect that there would be differences in the compiled objects if they were compiled on different levels of the OS (version or even PTFs).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...