참고로 여기에 게시합니다. JSL의 암호화된 클래스는 안전하지 않습니다.함수는 이에 취약하지 않으므로 클래스가 아닌 함수만 사용하는 것이 좋습니다.
문제는 JMP 클래스는 내성적이지만 컴파일된 함수는 그렇지 않다는 사실에 있습니다.비밀로 하고 싶은 메서드가 포함된 다음 클래스를 생각해 보세요.
Define Class(
"complex",
real = 0;
imag = 0;
_init_ = Method( {a, b},
real = a;
imag = b;
);
secret method = Method( {secret input 1, secret input 2 = "foo"},
{Default Local},
my secret password = "password123";
my secret connection database = "database=UML_4x7z;source=axml1131;pwd=my_great_password";
Eval( Eval Expr(
my ultra secret program = Run Program(
Executable( "secret_exe.exe" ),
Options( Expr( "-o " || my secret connection database ) )
)
) );
);
Add = Method( {y},
New Object( complex( real + y:real, imag + y:imag ) )
);
Sub = Method( {y},
New Object( complex( real - y:real, imag - y:imag ) )
);
Mul = Method( {y},
New Object( complex( real * y:real - imag * y:imag, imag * y:real + real * y:imag ) )
);
Div = Method( {y},
t = New Object( complex( 0, 0 ) );
mag2 = y:Magsq();
t:real = real * y:real + imag * y:imag;
t:imag = imag * y:real + real * y:imag;
t:real = t:real / mag2;
t:imag = t:imag / mag2;
t;
);
Magsq = Method( {},
real * real + imag * imag
);
Mag = Method( {},
Sqrt( real * real + imag * imag )
);
_to string_ = Method( {},
Char( real ) || " + " || Char( imag ) || "i"
);
_show_ = _to string_;
);이 스크립트를 가져와 암호화하는 경우(편집->스크립트 암호화... 사용) 이상적으로는 이를 배포할 수 있는 최종 사용자가 내부 코드를 쉽게 볼 수 없어야 합니다.그러나 이는 사실이 아니다.실제로 해체하고 재구성하는 것은 엄청나게 쉽습니다.
다음은 암호화된 메서드(이것이 문제입니다)를 분해한 후 편의를 위해 재구성할 수 있는 몇 가지 함수입니다.
clref = New Object( complex( 1, 2 ) );
introspect = Function( {obj},
{Default Local},
i = 1;
obj part = Arg( obj, 1 );
ret = Eval List( {Head Name( obj part )} );
While( !Is Empty( Arg( obj part, i ) ),
moil = Eval List({Arg( obj part, i)} );
ret[N Items( ret ) + 1] = If( N Arg( Arg( moil, 1 ) ) > 0, Recurse( moil ), Head Name( Arg( moil, 1 ) ) );
i++
);
ret
);
Clear Log();
deconstructed = introspect( Eval List( {Name Expr( clref:secret method )} ) );
Show( deconstructed );
reconstruct = Function( {input},
{Default Local},
init = Parse( input[1] || "()" );
If( Is List( input ) & N Items( input ) > 1,
For( i = 2, i <= N Items( input ), i++,
If( Is List( input[i] ),
Insert Into( init, Try( ( s = Recurse( input[i] ); s )[1], Char( s ) ) )
,
Insert Into( init, Parse( input[i] ) )
)
);
);
Eval List( {Name Expr( init ) } );
);
Show( reconstruct( v ) );여기에는 두 가지 주의 사항이 있습니다. 문자열과 이름을 쉽게 구별할 수 없으며(그러나 인간은 아마도 구별할 수 있음) 다음과 같은 구성의 중심 인수에 대한 가시성이 없습니다. 클래스:방법( arg1, arg2 ):returned_class_method( arg ); , 여기서 첫 번째 메서드는 추가로 메서드를 호출하는 클래스를 반환합니다.이러한 제한에도 불구하고 비밀번호/민감한 정보에 대한 구현 세부 정보를 매우 빠르게 찾을 수 있습니다.
다시 한 번 말씀드리지만, 보안 목적으로 스크립트/여러 스크립트를 암호화하는 경우 클래스에 의존하지 않는 것이 좋습니다.
알아 둘만 한.이 내용을 다음 주소로 보내는 것이 좋습니다. support@jmp.com 아직 하지 않았다면 마찬가지입니다.