OS/2 tricks: how to add BLDLEVEL signatures to the executables

BLDLEVEL command displays a version string in a file. This information is useful to distinguish the version of the executables and DLLs which have the same names.

There are twothree(2020/08/24) ways in order to add BLDLEVEL signatures to the executables

1. 'DESCRIPTION' statement of .DEF file

DESCRIPTION statement of .DEF is used to descript a usage of a module. And the string of the field is stored into the executables. Therefore, if you write BLDLEVEL signatures here, BLDLEVEL command can read the signatures.

Syntax is like:
DESCRIPTION 'BLDLEVEL signatures'
You can use double-quotes(") instead of single-quotes(').

For build with gcc, do like this:
gcc filename.c filename.def

2. RCDATA statement of .RC file

BLDLEVEL scans the executable partially not DESCRIPTION field. So if writing BLDLEVEL signature to the executable, BLDLEVEL may find it.

RCDATA of .RC which puts custom datum as-is. This is the command that we are finding.

Syntax is like:
RCDATA resource-ID {"BLDLEVEL signatures"}
Resource-ID should be unique in all resource files.

If you have already a resource file, put RCDATA statement into the file. Or use RCINCLUDE to include a separate RC file.

Syntax is like:
RCINCLUDE filename
If filename has blanks, then you should use double-quotes(").

To embed a description string with gcc, do like this:
gcc filename.c
rc filename.rc filename.exe


/// ----- 2020/08/24
3. Appending version sting
 
BLDLEVEL scans the end of the executable. Therefore, if you write a version string into the end of the executable, then BLDLEVEL may find it.

Appending is so easy. First is to use 'copy' command like this:

copy /b executable_file+string_fie

By this, the version string is appended to the end of the executable.

Second is to use just echo command like this:

echo string >> executable_file
 
/// ----- 

4. makedesc.cmd


makedesc.cmd is a utility printing BLDLEVEL signatures to stdout. It was modified from one of Project Odin. For example,

makedesc.cmd -D"Hello, world!" -HOS2BOX -M1 -NOS2FACTORY -V1.0
will prints:
@#OS2FACTORY:1.0#@##1## 15 Jan 2018 17:48:47     OS2BOX::::1::@@Hello, world!
If you embed that string into the executable with .DEF or .RC, then bldlevel displays:
Build Level Display Facility Version 6.10.480 Oct  6 2000
(C) Copyright IBM Corporation 1993-2000
Signature:       @#OS2FACTORY:1.0#@##1## 15 Jan 2018 17:54:53     OS2BOX::::1::@@Hello, world!
Vendor:          OS2FACTORY
Revision:        1.00
Date/Time:       15 Jan 2018 17:54:53
Build Machine:   OS2BOX
File Version:    1.0.1
Description:     Hello, world!
For detailed explanation of options, see the syntax usage of makedesc.cmd.

5. Conclusion

With BLDLEVEL signatures, you can provide more detailed version information to users. Especially, this is very useful for DLLs which has a length limitation for a name. Because  it's general that DLLs with the same name may have different versions on OS/2.

Therefore it would be better to provides BLDLEVEL signatures.

6. References

댓글

이 블로그의 인기 게시물

토렌트: < 왕좌의 게임 > 시즌 1 ~ 시즌 8 완결편 마그넷

토렌트: NGC < 코스모스 > 우리말 더빙 전편(1편~13편) 마그넷

토렌트: < 스타워즈 > Ep.1 ~ Ep.6 마그넷