TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: baitang36 on August 04, 2021, 08:33:19 PM
-
;The result of this program is wrong because (Chr 0) returns an empty string, resulting in the loss of bytes with a value of 0
((= str1
"0") (setq b1
0)) ((= str1
"1") (setq b1
1)) ((= str1
"2") (setq b1
2)) ((= str1
"3") (setq b1
3)) ((= str1
"4") (setq b1
4)) ((= str1
"5") (setq b1
5)) ((= str1
"6") (setq b1
6)) ((= str1
"7") (setq b1
7)) ((= str1
"8") (setq b1
8)) ((= str1
"9") (setq b1
9)) ((= str1
"a") (setq b1
10)) ((= str1
"b") (setq b1
11)) ((= str1
"c") (setq b1
12)) ((= str1
"d") (setq b1
13)) ((= str1
"e") (setq b1
14)) ((= str1
"f") (setq b1
15)) ) ;_ cond
b1
) ;_ defun
(setq c3
(+ (* 16 c1
) c2
))
) ;_ repeat
-
So your trying to convert a fas hex dump to a ascii readable format. Is it to decrypt a file ?
-
So your trying to convert a fas hex dump to a ascii readable format. Is it to decrypt a file ?
Yes, I'm experimenting
-
I'm not sure you can. I want to say that the interpreter will always substitute "\000" as "".
I want to say something like:
but I don't think it will work (if it does, great!).
-
I'm not sure you can. I want to say that the interpreter will always substitute "\000" as "".
I want to say something like:
but I don't think it will work (if it does, great!).
it returns a symbol \\ 000
Change ('\ 000) to ("\ 000") returns an empty string
-
A friend helped me solve this problem by replacing (Chr 0) with (Chr 256). Thank you
The source code that can be used normally is as follows :
((= str1
"0") (setq b1
0)) ((= str1
"1") (setq b1
1)) ((= str1
"2") (setq b1
2)) ((= str1
"3") (setq b1
3)) ((= str1
"4") (setq b1
4)) ((= str1
"5") (setq b1
5)) ((= str1
"6") (setq b1
6)) ((= str1
"7") (setq b1
7)) ((= str1
"8") (setq b1
8)) ((= str1
"9") (setq b1
9)) ((= str1
"a") (setq b1
10)) ((= str1
"b") (setq b1
11)) ((= str1
"c") (setq b1
12)) ((= str1
"d") (setq b1
13)) ((= str1
"e") (setq b1
14)) ((= str1
"f") (setq b1
15)) ) ;_ cond
b1
) ;_ defun
(setq c3
(+ (* 16 c1
) c2
))
(setq strc3
(chr 256)) ;It is modified here )
) ;_ repeat
-
Nice! Thank you very much for posting the solution. I really appreciate that.
-
Nice! Thank you very much for posting the solution. I really appreciate that.
Thank you