How to read PL / SQL code in Oracle Forms.FMT file?

Oracle Forms10g provides a tool for converting Oracle Forms modules from a binary format (.FMB) that Oracle Forms Builder works with to a text format (.FMT).

For example, if you create a module called mymodule.fmb with Oracle Forms Builder, then call

frmcmp module=mymodule.fmb script=yes batch=yes logon=no 

From the command line, Oracle Forms Convert will create the mymodule.fmt file from the mymodule.fmb file. This text file must be human readable, with the exception of the PL / SQL trigger code and program units that are encoded.

For example, this is a fragment of a .FMT file with a fragment of encoded PL / SQL code

 DEFINE F50P BEGIN PP = 10 PI = 3 PN = 464 PL = 1138 PV = (BLONG) <<" 00000049 00800000 00440000 00000000 00000031 0000000d 00000002 a0011519 00002420 0000045e 001f0000 00165030 5f32335f 4f43545f 32303038 31365f33 375f3039 00000006 42454749 4e0a0000 0042676f 5f626c6f 636b2820 27504149 53455327 20293b0a 69662066 6f726d5f 73756363 65737320 7468656e 0a096578 65637574 655f7175 6572793b 0a656e64 2069663b 00000005 0a454e44 3b000000 1d574845 4e2d4e45 572d464f 524d2d49 4e535441 4e434520 28466f72 6d290000 

Have you ever tried to decode such files to be able to extract PL / SQL form code?

It would be very useful to be able to search for a string in the PL / SQL code of a large number of .FMT files, instead of using Oracle Forms Builder to manually open each of the corresponding .FMB files and search for a string in each of them.

Thanks!

+4
source share
4 answers

Along with the API, note that if you are working at the beginning of this process, you will probably be better off generating an XML version than the FMT version. FMT is an older format supported for backward compatibility, and tools like the recently announced Forms -> Oracle APEX will need XML. It is also easier to read.

In "Forms 10g release 1" (9.0.4), the XML converter is a separate command-line program. forms2xml. I think that is still true for 10.1

In addition, XML is easier to read and interpret.

+5
source

Bytes are only hexadecimal character values. for example: taking the 4th line and entering it in the following python code:

 [chr(x) for x in [0x53,0x45,0x53,0x27 ,0x20,0x29,0x3b,0x0a ,0x69,0x66,0x20,0x66 ,0x6f,0x72,0x6d,0x5f ,0x73,0x75,0x63,0x63 ,0x65,0x73,0x73,0x20 ,0x74,0x68,0x65,0x6e ,0x0a,0x09,0x65,0x78]] 

gives the following result:

 ['S', 'E', 'S', "'", ' ', ')', ';', '\n', 'i', 'f', ' ', 'f', 'o', 'r', 'm', '_', 's', 'u', 'c', 'c', 'e', 's', 's', ' ', 't', 'h', 'e', 'n', '\n', '\t', 'e', 'x'] 

which is a recognizable form of pl / sql. Thus, it seems that it would not be too much work to create a script that would take the FMT file directory and create the corresponding text files that could be searched.
Enjoy!

+1
source

Oracle Forms 9i and later have a programming API that allows you to do exactly what you are describing. To do this, you will need to look at your form documentation, but this may be faster than trying to extract binary strings.

If you are willing to pay for an existing tool, use the following:

http://www.orcl-toolbox.com/

Their forms APIs and FormsTools allow you to do extractions, distinctions, changes and updates in your forms.

+1
source

According to this page, the author has a perl script to convert hex back to ascii text (he says to send him an email and he will send it)

0
source

All Articles