|
发表于 2020-10-11 16:00:55
|
显示全部楼层
我把要加密的代码替换成生成出来的set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR]
2 a4 o( }4 H/ D3 U+ G' jset this_post_dir "[file dirname [info script]]"
6 I( R( {* W5 {/ E* C+ x! cset encrypted_post_file "[file rootname [info script]]ab_crypt.txt"( r c6 x: F" J% A) i
if { ![file exists $encrypted_post_file] } {
2 f+ O y& [0 v b# K! Y set __msg "ERROR in[info script] :"$encrypted_post_file" is not found."1 P+ Y6 A2 d) e. Q, d
MOM_abort $__msg* I8 ^7 Y% p2 Z+ J: N$ |" A) F$ G
}. `2 r3 Q8 U, L- y9 }6 {
" n9 \* I8 |& u+ k' g3 c/ K
########################################################################% W5 T' M* [- C) I8 c8 r: l
set x64 0 ; set path "" ;7 }* B* f" o7 K9 O
set root_dir [MOM_ask_env_var UGII_ROOT_DIR] ;4 H- ?/ |' Y. o; w: I% X
set os_64 ${root_dir}ugtcl.dll
' x$ O5 L# h& o' |& J2 b% C if { [file exists $os_64] } {
! ~7 {% C; u# A) l; r set sz [ file size $os_64 ] ; set sz [ expr double($sz) ]- N5 _, b, E5 j; i, b: s7 i* w
if {$sz>600000.} { set x64 1 ; } else { set x64 0 ; }
0 u& u: v: y9 M: T% ^) D } else { set x64 1 ; }' f" t& a. B, A% Y4 U+ S
if {$x64} { set encload_dll ${path}encload_x64.dll ; } else { set encload_dll ${path}encload_x32.dll ; }
2 ?7 g! r; m$ K+ }1 s if { ![file exists ${cam_post_dir}$encload_dll] } {' R @# ^: W8 s2 y- n( P
set __msg "ERROR in[info script] :Shared library "Encload" is not found in ${cam_post_dir}."
& {% x- x, b3 V: P$ X0 R MOM_abort $__msg
7 v2 E1 |) E- o% N7 ]7 E9 P2 M) H0 M }" n; k. @) |8 x& ]
6 q) e0 g }; O# F; Y; Y9 }" K########################################################################/ c, l Z( W2 T# T; L( s
catch {' u7 x2 M. e- Q1 ?% o( _
MOM_run_user_function ${cam_post_dir}$encload_dll ufusr
5 Y z ]6 t7 R g- q! w" a encload [file nativename $encrypted_post_file]
& A( X# u# Y9 K}
0 o4 W8 P' s0 @( s+ L5 h" c 但是不成功! 还请大佬教一下 |
|