|
发表于 2020-10-11 16:00:55
|
显示全部楼层
我把要加密的代码替换成生成出来的set cam_post_dir [MOM_ask_env_var UGII_CAM_POST_DIR]
0 E* Y6 ]6 t3 c! s* yset this_post_dir "[file dirname [info script]]" g* t: E. u6 d3 s$ G& N
set encrypted_post_file "[file rootname [info script]]ab_crypt.txt"
1 m& p$ I4 z# Z, f! mif { ![file exists $encrypted_post_file] } {/ D( b8 E S ?4 N5 d9 j
set __msg "ERROR in[info script] :"$encrypted_post_file" is not found."
9 q3 I' X1 [3 g$ q% `0 u MOM_abort $__msg
+ Z8 V, |5 s6 u}
! X6 h3 ^/ d7 x( @: A& a$ L
; l P& v2 h4 q3 X+ Z########################################################################: G* v( L6 D+ O1 T
set x64 0 ; set path "" ;; D4 v! ~8 M& Z0 u. h6 r* e Q l
set root_dir [MOM_ask_env_var UGII_ROOT_DIR] ;* _; @0 A7 ]9 ?. {: m7 H/ d
set os_64 ${root_dir}ugtcl.dll
: P2 Z% d4 {) M4 O% ?3 H3 t if { [file exists $os_64] } {9 g2 q, R0 `% u" H6 j( r3 |$ x
set sz [ file size $os_64 ] ; set sz [ expr double($sz) ]
- b# D5 `9 J* n! }$ k4 H9 n0 l# a if {$sz>600000.} { set x64 1 ; } else { set x64 0 ; } p9 l6 F" g' Y( \9 V$ `. d
} else { set x64 1 ; }' i0 V) r" H" S! Z
if {$x64} { set encload_dll ${path}encload_x64.dll ; } else { set encload_dll ${path}encload_x32.dll ; }# B( D& w" f3 s% G# d$ Z1 Z
if { ![file exists ${cam_post_dir}$encload_dll] } {
& R* U* y9 O, E9 j/ E- X8 S0 { set __msg "ERROR in[info script] :Shared library "Encload" is not found in ${cam_post_dir}.") X( l9 S) j @. f- }9 _* }
MOM_abort $__msg# k! B6 b7 k0 I) L* I5 K' e
}9 v- ^: A1 Q. O3 a$ L
$ o2 {4 d, e, V3 V0 j! k########################################################################! I+ G; a8 V3 [: I( M5 `5 z
catch {
! \1 I, ?. w, s MOM_run_user_function ${cam_post_dir}$encload_dll ufusr% p; I2 q3 M% b
encload [file nativename $encrypted_post_file]# g6 B# _+ c. N0 H0 d, ]
}& g3 C, c, F' e& t
但是不成功! 还请大佬教一下 |
|