|
|
发表于 2020-10-11 16:00:55
|
显示全部楼层
我把要加密的代码替换成生成出来的set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR]
$ n# t7 v. C* I% @set this_post_dir "[file dirname [info script]]", q! I; r5 j5 N/ ^5 G. X9 g" X
set encrypted_post_file "[file rootname [info script]]ab_crypt.txt"; g" Z- }3 B. \6 d
if { ![file exists $encrypted_post_file] } {5 n! s K! b# b: D/ s; Q
set __msg "ERROR in[info script] :"$encrypted_post_file" is not found."5 {2 p' T5 u2 M5 u
MOM_abort $__msg
! w) [- X. T' t/ W: G! T}
1 T9 }& U6 L" _2 V
# \, ]9 P$ {3 k/ K; X% n: S########################################################################9 z* L1 m; \( p
set x64 0 ; set path "" ;
: M& O. j+ j1 e set root_dir [MOM_ask_env_var UGII_ROOT_DIR] ;
' L) @ R3 l% E# L, I set os_64 ${root_dir}ugtcl.dll
% j6 c6 c- X% g1 l% d! V3 r! }6 C$ Q if { [file exists $os_64] } {
5 I- v5 e+ C9 O% B" q8 I0 {+ f set sz [ file size $os_64 ] ; set sz [ expr double($sz) ]
4 a6 g( T3 O1 W) W9 | if {$sz>600000.} { set x64 1 ; } else { set x64 0 ; }
; h. j5 a- h. b- J V' r' g. j } else { set x64 1 ; }
4 ^& B* A+ Z F: S/ N if {$x64} { set encload_dll ${path}encload_x64.dll ; } else { set encload_dll ${path}encload_x32.dll ; }% s2 J% t {1 p. B# i/ z! I
if { ![file exists ${cam_post_dir}$encload_dll] } {7 L$ f4 w3 O! p6 P% b/ s6 {
set __msg "ERROR in[info script] :Shared library "Encload" is not found in ${cam_post_dir}."* T0 m6 m% Z1 I* U
MOM_abort $__msg$ H( K/ ~4 C7 \
}; ]6 [7 j1 ?6 s* H. ~7 E) X7 \
1 I* e+ ~) F; ?& Z+ Z7 |
######################################################################## f; ]- P7 _, b
catch {
5 ?6 F9 |2 b5 f X7 L MOM_run_user_function ${cam_post_dir}$encload_dll ufusr6 i1 m! l) g; ?$ r3 }9 W3 ]
encload [file nativename $encrypted_post_file]4 ?. M! L3 c% F/ B
}7 l/ H7 V9 ~ s t
但是不成功! 还请大佬教一下 |
|