4

Got some wrapped packages in a database, normally doing a

SELECT text
FROM   ALL_SOURCE
WHERE  NAME = 'CatPackage'
and owner = 'Catology'
order by line

gives you a big blob of text like this:

A+OWYFjWmLZCgN+19SRY/cDDZfIldbKxuOFZDIxL/b+rs7N1fuM0FRRVMeMVGzRHns7H7Tzg
TW7bJG2NV3pMezBbIovs3RbKJcsr87qj1qPZ+GNTKldCbypJu2JHU7T+I81FvoYG/EAoQSt6
rI9/bKIvXgfNmazpAzUlYJ8UsSYsLOf+71nfNxq6PjhHPDDtn4IyGpHaRY7sG0OYnXXI+DxG
rZRY8tMd3+J/bZ/uh90CEO9I8UNFAre9Op2yoxxP2z1ySBuSFIrvgI2jzY719IQMZfVCJuRw
bDHlkXyey61SOS1wLSHKt9VDZdGgYdJxsPNKVVjel8DYZW38oLSispTIuQNa+8LZzxApyyaD
BWq5GPHHjUA2zEb3HXSegbPXw6BAbmtXRhTjO0f5rSqTRr71nKqiH/D3oT8sHWR66YStnYzj
LLDrb0DkMwGD8CivjRxK4OSkeCNBCYBwww+tAXLddYwf7Cm+ppf0w6EMckRp5uLAYx7ykp34
0YZO7EO2XpgcW9xmf4ZBuMhtZq+7ZRRmawNaWtGoRHAY3wK/aoYbWeYPpmiyE6mh/W8driAg
efscbAx3mDYCQfIaaUU4cbj71UbFr6H7OTgUAjXDFnqUpTVN08+OcC8iCQRVpZSgPlPPz5V0
vV/Q4XQVgOELHAjAI/W+uWORHin3L/vPZWCyXRt1tM4BX1110SKxVgRs8kuVKAbME+vOE=

ending in =

then using an online tool to unwrap works.

However I have one package which returns the data like this:

"package CatPackage wrapped
0
abcd
abcd
abcd
abcd
abcd
.
.
.
55 6a a0 8d 8f :2 a0 6b :2 a0
f b0 3d 8f :2 a0 b0 3d 8f
55 6a a0 8d 8f :2 a0 6b :2 a0
f b0 3d 8f :2 a0 b0 3d 8f
55 6a a0 8d 8f :2 a0 6b :2 a0
0 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0
0 0 0 0
f b0 3d 8f :2 a0 b0 3d 8f

It has weird hexidecimal numbers all the way to the end, and it does not end in = and it is not possible to unwrap it. It doesn't look like an encoded string at all.

Is there any explanation for this bizarre behaviour?

I should add that I have tested some methods in the package and they work ok, so it is not corrupt.

NibblyPig
  • 51,118
  • 72
  • 200
  • 356
  • That's what a wrapped package looks like. I guess the tool didn't unwrap it. – David Aldridge Oct 20 '16 at 09:42
  • I'm not sure it does look like that. – NibblyPig Oct 20 '16 at 09:47
  • maybe the procedure was wrapped under a different wrapper algorithm (Oracle do change these, precisely to prevent people from unwrapping them; after all, someone went to the trouble to wrap the code in the first place to prevent it from being read and copied!) and your tool doesn't know about that particular algorithm? – Boneist Oct 20 '16 at 09:49
  • I see, that is a possibility. I'll investigate if there is an older unwrapper. Perhaps this code is very old – NibblyPig Oct 20 '16 at 09:52
  • @NibblyPig I am having the same issue. Did have any luck unwrapping the sql file? – not_a_comp_scientist Feb 26 '21 at 23:48

1 Answers1

0

Unwrapping PL/SQL for up until Oracle 10g is explained here.

Martin Schapendonk
  • 12,893
  • 3
  • 19
  • 24