|
|
发表于 2020-10-11 16:00:55
|
显示全部楼层
我把要加密的代码替换成生成出来的set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR]
- m- E+ d! e8 f; \set this_post_dir "[file dirname [info script]]"' J. e: @2 \6 ~& ^, ~. e: m
set encrypted_post_file "[file rootname [info script]]ab_crypt.txt"$ X5 y% x* }" g& Q" f+ e/ v" ?
if { ![file exists $encrypted_post_file] } {
6 Y e, D9 D- W! j0 `; O set __msg "ERROR in[info script] :"$encrypted_post_file" is not found."1 t9 M$ `1 E1 A4 b( W' x
MOM_abort $__msg
& u9 i: e% K# j8 [8 c% O9 v% K}8 Y4 w( ?& W; f6 o9 g2 i" @
9 _. L4 m5 G, M* a. x
########################################################################( |9 O) s( i+ R, c5 v4 ^2 h
set x64 0 ; set path "" ;# L8 t- H$ V1 |# m) m
set root_dir [MOM_ask_env_var UGII_ROOT_DIR] ;
1 X* {& Z4 {/ p* P( p- O4 M; o2 r set os_64 ${root_dir}ugtcl.dll
6 w$ J$ z9 [2 x" ^ if { [file exists $os_64] } {' f. g6 M, [3 u: c
set sz [ file size $os_64 ] ; set sz [ expr double($sz) ]
- r' w6 Z! v) ~: N/ y4 y0 t- W if {$sz>600000.} { set x64 1 ; } else { set x64 0 ; }2 q/ T# Q4 a; C+ v7 {& k9 ?0 e
} else { set x64 1 ; }7 x. G: T2 w4 c$ d$ h
if {$x64} { set encload_dll ${path}encload_x64.dll ; } else { set encload_dll ${path}encload_x32.dll ; }
1 C; T8 p, ]0 g5 G/ T if { ![file exists ${cam_post_dir}$encload_dll] } {# q& m2 ~+ N" N* I: n) \1 p
set __msg "ERROR in[info script] :Shared library "Encload" is not found in ${cam_post_dir}."
$ C$ r7 X* j0 S" D& x* R) b! ~8 y+ V MOM_abort $__msg
( b0 T3 S' O7 ^ }
0 d$ e7 i2 T; ]- n; u- z% n. s _5 |; }3 L3 m
########################################################################6 p: j8 ^+ Q6 i
catch {
4 V" Z* y* C* r! m7 [ MOM_run_user_function ${cam_post_dir}$encload_dll ufusr: c# c& F7 p( p$ y- X) i! S
encload [file nativename $encrypted_post_file]
+ j, Y: U s% x! x' m7 t! |; j}
% F3 u7 Y- H; X" _- v5 B 但是不成功! 还请大佬教一下 |
|