Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

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

Error compiling obfuscated code in Oracle 10g

From: Rich <rfried_at_visto.com>
Date: 23 Feb 2005 17:31:40 -0800
Message-ID: <1109208700.940819.128210@z14g2000cwz.googlegroups.com>


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 compiled.

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 DBA... 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)

Example below.

Thanks!
-Rich

Source:
create or replace procedure rnf
as

    my_int integer;
begin

    null;
end rnf;
/

10g-wrapped file:
create or replace procedure rnf wrapped
a000000
b2
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
7
3e 71
/Rd7B/4UXvvbkXlRn5mUKvkOvyQwg5nnm7+fMr2ywFznm8eGwHSLCabhmoUwrp0vRMqfMr+y wovAwDL+0h3ZzgKSzlTHvpK+qYm6gqamBmTLFQ==

/

8i-wrapped file:
create or replace procedure rnf wrapped
0
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
1
7
8106000
1
4
0
3
2 :e:
1RNF:
1MY_INT:
1INTEGER:
0

0
0
15
2
0 1d 9a b4 55 6a a3 a0
1c 81 b0 4f b7 a4 a0 b1
11 68 4f 17 b5
15
2
0 3 4 15 16 1a 32 22
26 2e 21 39 3b 3d 41 45
47 53 57 59 62
15
2
0 1 b 0 :2 1 5 :3 c :2 5
:2 1 5 :6 1

15
2
0 :2 1 0 :2 1 :5 3 5 :2 4 6
:6 1

64
4
:2 0 1e 0 1
:a 0 11 1 :5 0

3 :2 0 11 2
4 :2 0 3 :2 0
:2 3 :3 0 7 :7 0

a 8 0 f
2 :7 0 c 5
10 :3 0 10 1
:3 0 7 10 f

c d :6 0 11
:2 0 2 4 10

13 :2 0 1 11
14 :8 0
9
4
:3 0 1 6 1

b 1 9
1
4
0
13
0
1
14
1
2
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0
2 0 1
6 1 0
0

/ Received on Wed Feb 23 2005 - 19:31:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US