Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Hidden Source Code

Former Member
0 Likes
2,562

Hi guys,

Someone has used the *@#@@[SAP] string to hide the source code in one of our programs.

Any ideas how to undo this?

PeteA

17 REPLIES 17
Read only

Former Member
0 Likes
1,595

Hi check this theread.

here there is another way to hide .

if you used the *@#@@[SAP] then you will not get the code

back.

regards

vijay

Read only

Former Member
0 Likes
1,595

Hi Pete,

I have absolutely no Idea.

I thought Hiding was itself not possible and you are asking about undoing it??..:D...

I have a small doubt here, How do you know if "*@#@@[SAP] " has been used to hide your code or not, when you can't see it??..:D

I will wait with you for the answer..:)

Regards,

Ravi

Read only

Former Member
0 Likes
1,595

Hi Pete,

You can use this program to unhide your code.

*****

PROGRAM ZHIDE NO STANDARD PAGE HEADING.

  • This program hides any ABAP's source code and protects it with a

  • password in this source code. So the first candidate to be hidden

  • should be ZHIDE itself.

  • After hiding, you can still run the abap (the load version is intact)

  • but it cannot be displayed, edited, traced, transported or generated.

  • If the ABAP is not hidden, the program hides it, if it is hidden, it

  • unhides it.

  • To execute this program, change the user name and password in this

  • source code first.

SELECTION-SCREEN BEGIN OF BLOCK BLOCK.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(8) PWD.

SELECTION-SCREEN POSITION 35.

PARAMETERS: PASSWORD(8) MODIF ID AAA.

SELECTION-SCREEN END OF LINE.

PARAMETERS: PROGRAM(8).

SELECTION-SCREEN END OF BLOCK BLOCK.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'AAA'.

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

INITIALIZATION.

PWD = 'PASSWORD'.

START-OF-SELECTION.

TABLES: TRDIR.

  • User name and passsword check

IF SY-UNAME <> 'SAP' OR PASSWORD <> 'PASSWORD'.

WRITE: / 'Wrong password'.

EXIT.

ENDIF.

  • SAP owned?

IF NOT PROGRAM CP 'Z' AND NOT PROGRAM CP 'Y'.

WRITE: / 'Do not hide original SAP programs!'.

EXIT.

ENDIF.

  • Exists?

SELECT SINGLE * FROM TRDIR WHERE NAME = PROGRAM.

IF SY-SUBRC <> 0.

WRITE: / 'Program does not exists!'.

EXIT.

ENDIF.

  • Does it have a current generated version?

DATA: F1 TYPE D, F3 TYPE D.

DATA: F2 TYPE T, F4 TYPE T.

EXEC SQL.

SELECT UDAT, UTIME, SDAT, STIME INTO :F1, :F2, :F3, :F4 FROM D010LINF

WHERE PROG = :PROGRAM

ENDEXEC.

IF F1 < F3 OR ( F1 = F3 AND F2 < F4 ).

WRITE: / 'The program has no recent generated version!'.

EXIT.

ENDIF.

  • Compose a new program name

DATA: NEW_NAME(8), I TYPE I, J TYPE I.

NEW_NAME = PROGRAM.

DO 8 TIMES.

I = SY-INDEX - 1.

NEW_NAME+I(1) = '_'.

  • Search for acceptable program name variations

J = 0.

SELECT * FROM TRDIR WHERE NAME LIKE NEW_NAME.

J = J + 1.

ENDSELECT.

IF J = 1.

EXIT.

ENDIF.

NEW_NAME = PROGRAM.

ENDDO.

  • Cannot generate appropriate program name

IF J > 1.

WRITE: / 'Cannot generate appropriate program name'.

EXIT.

ENDIF.

  • Check if it is already in d010s (already hidden)

DATA: F5(8).

EXEC SQL.

SELECT PROG INTO :F5 FROM D010S WHERE PROG = :NEW_NAME

ENDEXEC.

IF F5 IS INITIAL.

  • There is no such hidden program, hide it

EXEC SQL.

UPDATE D010S SET PROG = :NEW_NAME WHERE PROG = :PROGRAM

ENDEXEC.

ELSE.

  • There is already a hidden program there, unhide it

EXEC SQL.

<b> UPDATE D010S SET PROG = :PROGRAM WHERE PROG = :NEW_NAME</b> ENDEXEC.

ENDIF.

*****

Regards,

Raj

Read only

FredericGirod
Active Contributor
0 Likes
1,595

Hi Pete,

I had read, there was a looong time, to back from this code, you have to release the request order.

When you release the request order, that will create a file, in this file you will find all the source code.

Rgd

Frédéric

PS: maybe in the Abap version table you could find too.

Read only

Former Member
0 Likes
1,595

Hi Check the Link which i mentioned in the above post.

there you can unhide the code . but Hiding is done in different way.

regards

vijay

Read only

Former Member
0 Likes
1,595

Sorry guys - didn't give the background info.

We've got a program which runs OK, but you cannt see the code in either SE38, SA38 or even in debug mode. Also tries function module SCWB_GET_ABAP_CODE_OF_OBJECT - zilch...

I got this infomation second-hand

Apparently if you put *@#@@[SAP] in the first line of your code, then it is hidden. It can be used by developers to protect their work e.g. an implementation partner develops a new transaction and ships it to a customer. The customer can run the transaction, but cannot see the code. Thus the work is protected.

Read only

0 Likes
1,595

Pete, do you try to look inside the file of the request order ?

Read only

0 Likes
1,595

Create a new program and try:


READ REPORT prog INTO itab.

I don't know if it will work, but it's easy and maybe worth a try.

Rob

Read only

0 Likes
1,595

Silly question number 2....

How do I do this?

Read only

0 Likes
1,595

Ask your favorite administrator

Maybe you could see it with the AL11 transaction. (I can't check, I have not a valid SAP system right now).

Fred

Read only

0 Likes
1,595

I just wanted to experiment, so I went ahead and added this line *@#@@[SAP] as my first line in the report program. When I try to activate it, it is giving me an syntax error saying that I don't have a REPORT/PROGRAM statement, whereas it is there on the second line.

Then if I say 'Activate anyway', it is adding an additional '' in front of my first line <b>automatically</b>. Ok, then I remove the additional '' it added, and this time I just save it, not activate it. I go out and come back in, I see that the * is back again.

Can someone explain how anyone could have achieved this hiding the code? I am in 46C.

Srinivas

Read only

0 Likes
1,595

Hi Srinivas - in the thread mentioned above, it says that this doesn't work in release 4.6C and above.

Rob

Read only

0 Likes
1,595

I am facing the same problem. One contractor had hid the code somehow. I tried everything but have not been able to unhide so far.

(1) I tried to open the transport data file but it was so encryptic that it was not possible to find anything out of it.

(2) I tried to read ABAP source using read textpool statement but this statement fails.

(3) I tried to send transport to WAS 6.20 system but it was hidden there too.

(4) I found that if you just delete the first character of transport data file, you can at least open the program in ABAP editor but everything is just blank.

So if somebody finds the answer, I will be very glad to know about it.

Read only

0 Likes
1,595

C'mon guys,

"Open Source" is the buzzword now.. forget about hiding the code...

Have fun

Suresh

Read only

0 Likes
1,595

> Hi Srinivas - in the thread mentioned above, it says

> that this doesn't work in release 4.6C and above.

>

> Rob

Thanks Rob,

My mistake (Duh!!), I should have read it closely. So SAP fixed a hole by adding an additional check for these characters in the first line and made it part of the editor syntax check.

Read only

0 Likes
1,595

> C'mon guys,

>

> "Open Source" is the buzzword now.. forget about

> hiding the code...

>

> Have fun

>

> Suresh

But Suresh, the problem on this post is that someone already used this feature and they want to undo it.

In order to build a good firewall software, you need to be a good hacker first. I guess that is the problem now.

Anyone looked for OSS notes?

Srinivas

Read only

Former Member
0 Likes
1,595

one thing you could try is used the VERSION MANAGEMENT in SE38 and see if the abaper kind enough and leave a tail there, however, it may not the final version, but at least you could have something to reference.