Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.server -> Re: Error compiling obfuscated code in Oracle 10g

Re: Error compiling obfuscated code in Oracle 10g

From: Frank van Bortel <>
Date: Thu, 24 Feb 2005 09:39:42 +0100
Message-ID: <cvk3ob$hib$>

Anurag Varma wrote:

> "Rich" <> wrote in message

>>My company is trying to ofbcfuscate our database code using Oracle's
>>wrap utility.
>>Seems pretty straightforward. For each pl/sql file, you call wrap
>>iname=file.sql oname=file.plb. I even wrote a nifty batch file that
>>takes in a directory name and wrapes each file.
>>Everything worked using the 8i version of wrap. Got some nice
>>gobbledy-gook, saw the dreaded string literals, but everything
>>But, 8i's no longer supported, and the rest of our system is 10g. So,
>>we installed the 10g client. After much handwringing, we got it to
>>work. For whatever reason, it's not installed as part of the main
>>client tools. Rather, following Oracle's advice, we installed the
>>custom client with everything, then copied in two files: wrap.exe and
>>ORAPLC10.DLL. This did the trick, and we got nice gobbledy-gook files.
>> Or so we thought.
>>Problem is, the 10g-wrapped files won't compile. I've tried numerous
>>times, and with various syntax. I've tried converting the source using
>>dos2unix, or removing crlf, etc.
>>I opened the .plb files, and noticed something fishy - the 10g-wrapped
>>files look like there are no spaces. Just one long 73-char fixed-width
>>column. Looking at the hex, there are no spaces, cr's, lf's, or any
>>other "break". Depending on the source, I've gotten PLS-00114:
>>identifier '(...)' too long, PLS-00103: Encountered the symbol "+",
>>etc. So, I think the files are wrapped incorrectly. If I had to
>>guess, I'd say that the "workaround" install of wrap was only partially
>>successful, though the instructions came from Oracle, according to our
>>On the other hand, the 8i-wrapped files have some, albeit weird,
>>format. They compile just fine.
>>Help? We were supposed to go to production with this in a few days.
>>(I made the mistake of testing with the 8i client, and assumed that the
>>10g files would work fine. QA informed me otherwise)
> -snip-
> The problem is most probably with your pl/sql code. Maybe its having problems
> compiling in a 10g database.
> The wrap utility has changed from 8i/9i to 10g. In fact most of oracle code is
> wrapped. So if there was a general problem with the wrap utility, I'd expect that to
> affect the oracle wrapped code quite significantly.
> Try for example viewing the .plb files in $ORACLE_HOME/rdbms/admin ...
> What you think is incorrect/abnormal wrapping seems to be normal.
> So unless you wish to show us a sample code which is failing in your case ..
> you might want to open a Tar.
> BTW: The example code in your mail works fine (wrapped) in my 10g database.
> Anurag

I doubt that, because I've had similar experiences with different patch levels of 9i Rel2.
Some code performs aOK unwrapped, and simply does not when wrapped. Worse: some wrapped code *does* compile, but generates runtime errors, where the unwrapped code does not.

To the OP: the format has changed, formats you describe are OK, as Anurag already has proven.
Don't try to wrap package headers, just bodies, and do so *before* testing.

Frank van Bortel
Received on Thu Feb 24 2005 - 02:39:42 CST

Original text of this message