中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 搜索 | 上传 | 帮助 »
作者:
标题: dos和vbs明文密码大比拼 上一主题 | 下一主题
wert123
中级用户





积分 301
发帖 135
注册 2007-5-15
状态 离线
『楼 主』:  dos和vbs明文密码大比拼 使用 LLM 解释/回答一下

<1>下面的hP1X500Pf3/f1/5++u5x到底是什么玩意啊,它是什么原理啊
<2>在不加密的vbs和dos脚本本身的情况下,怎样才能做到使它们的密码更隐秘啊,希望大家告诉我,有更好的方法吗
@echo off&@color f0
title 163邮箱登陆

chcp 437>nul&graftabl 936>nul
echo hP1X500Pf3/f1/5++u5x>%temp%\in.com

set username=
set /p username=请输入用户名:
set /p password=请输入密码:<nul
for /f "tokens=*" %%i in ('%temp%\in.com') do set password=%%i

del %temp%\in.com
start "163邮箱登录中" "https://reg.163.com/logins.jsp?username=%username%&password=%password%&url=http://fm163.163.com/coremail/fcg/ntesdoor2"


set wshshell=createobject("wscript.shell")
mima=Inputbox("给我密码")
if mima=chr(97)&chr(98)&chr(99) then
wshshell.run "notepad"
else
end if


2007-6-1 15:44
查看资料  发短消息  网志   编辑帖子  回复  引用回复
baomaboy
银牌会员





积分 1513
发帖 554
注册 2005-12-30
状态 离线
『第 2 楼』:   使用 LLM 解释/回答一下

p看不懂
第二个相当于密码是abc




好多菩提树,好多明镜台。本来好多物,好多的尘埃。
2007-6-1 15:53
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
baomaboy
银牌会员





积分 1513
发帖 554
注册 2005-12-30
状态 离线
『第 3 楼』:   使用 LLM 解释/回答一下


if mima="abc" then




好多菩提树,好多明镜台。本来好多物,好多的尘埃。
2007-6-1 15:54
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
slore
铂金会员





积分 5212
发帖 2478
注册 2007-2-8
状态 离线
『第 4 楼』:   使用 LLM 解释/回答一下

Dim WshSHell,fso,file
Set WshSHell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

If WScript.Arguments.Count = 0 Then
'***********************创建MiMa.VBS脚本*****************************************
Set file = fso.createtextfile("MiMa.vbs")
file.writeline "Set WshSHell=createobject(""WScript.Shell"")"
file.writeline "Set objPassword = CreateObject(""ScriptPW.Password"")"
file.writeline "WScript.StdOut.Write ""请输入你的密码:"""
file.writeline "strPassword = """""""" & objPassword.GetPassword() & """""""""
file.writeline "WshSHell.run ""wscript.exe """"" & _
WScript.ScriptName & """"" "" & strPassword,1,False"
file.writeline "Set objPassword = Nothing"
file.writeline "Set WshSHell = Nothing"
file.writeline "wscript.quit"
file.Close
'*******************************************************************************
WshSHell.run "cscript.exe MiMa.vbs",1,False
Set file = Nothing
Wscript.quit
Else
MsgBox "你输入的密码是:" & WScript.Arguments(0)
End If

Set fso = Nothing
Set WshSHell = Nothing


2007-6-1 16:42
查看资料  发短消息  网志   编辑帖子  回复  引用回复
lxmxn
版主




积分 11386
发帖 4938
注册 2006-7-23
状态 离线
『第 5 楼』:   使用 LLM 解释/回答一下

Originally posted by wert123 at 2007-6-1 15:44:
<1>下面的hP1X500Pf3/f1/5++u5x到底是什么玩意啊,它是什么原理啊
<2>在不加密的vbs和dos脚本本身的情况下,怎样才能做到使它们 ...


参考:

http://www.cn-dos.net/forum/viewthread.php?tid=26795

http://www.cn-dos.net/forum/viewthread.php?tid=29806


2007-6-1 23:09
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
wert123
中级用户





积分 301
发帖 135
注册 2007-5-15
状态 离线
『第 6 楼』:   使用 LLM 解释/回答一下

都是高手啊


2007-6-2 10:14
查看资料  发短消息  网志   编辑帖子  回复  引用回复
qzwqzw
银牌会员

天的白色影子


积分 2343
发帖 636
注册 2004-3-6
状态 离线
『第 7 楼』:   使用 LLM 解释/回答一下

将口令做成密文最常用的办法就是

将输入口令和待比对口令分别进行md5转换

然后直接比照两个md5码是否匹配

关于批处理下md5的讨论


===== 7d0150cbdf4d56c1 - 1a7f0e566e56642e =====
===== alt.lang.asm - MD5 optimization for const data&#39;s length - Tues, Mar 14 2006 3:51 =====


spamt...@crayne.org wrote:

> Hi all.
> I found optimized ASM code for md5 hash generation:
> hXXp://www.rewolf.cjb.net/
> Could any one help to adapt this code for greater string lengths.

What do you mean with "greater string lengths"? MD5 adds the
length of the message as a 64 bit value. But even if your message
is greater the 2^64 byte (don't think you have a disk big enough
to hold such a message) you can use MD5 (only the low-order 64
bits of the message size are appended). Read RFC1321 for more
information.

Here the source code for a very simple MD5 implementation
(correct only for a file size up to 2^61 bytes because it uses
a 64 bit bit-counter instead of a byte-counter). It is size
optimized (to embed it within a batch program) and therefore
slow. There is a faster (but bigger) assembler version from
Laura ( http://lf.1accesshost.com/TOOLS/TOOLS.HTM ).

@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>md5.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>md5.com
echo EFeL@GKBfDbSEFeLHGObnLj}EFeL}GSrWy




UbePveGs>>md5.com
echo efOVKEbCOHep?Fjfv1zRefYSKEJEAHexbefDeCUPfOv1EbePHeGCgjONnz>>md5.com
echo ?MfPvPEJeXefCSGErCrefDjKEpefQSKEJEOve=JefDfCEPErePefGSfEBO>>md5.com
echo uNe`B?zEf??OCBe@G_=Mf??OCBe@B?\Mf??O?JIi??B??Re=BefDfCEPEH>>md5.com
echo eHHefdeOEPCmBM}@ex?G?BCr?CEBexB}O{?z?]HANWWe~VE@e@eGWR@eWD>>md5.com
echo GSEKeWeTOE@oWeGSE@e@eGKR?B]LA@??DCB?GFE?JIH?MLK?E@N?D?J?CN>>md5.com
echo I?BMH?ALG?DKF?MJG?FC@??LI?HEB?ANK?MF??BKD?G@I?LEN?AJC?KFH?>>md5.com
echo FUP?UPK?PKF?KFU?DUP?SMH?MHD?HDS?DSM?SMH?OJC?JCV?CVO?VOJ?OJ>>md5.com
echo C?IEV?ETN?TNI?NIE?IET?wTNOVicuFvUxoZg1mc_o@=Mz{NnQEitrRFFE>>md5.com
echo goE`ET@WWW=nnh?eJCvf~ZpuV}~zaHda@r?>>md5.com
echo ufP??\e]YDuFimO\hFRUn
Nh}J_JTou>>md5.com
echo z]}~{iZ}EffygKDi`mSno{G\D_OxCodXS~eZX}a{wfUd1SCCk]shaoi~VM>>md5.com
echo bfBHxjSI{R_yZXBVKQdx=NKW~ns~C\Pf}NDU_ngu}ker@BSCP`bIAMGcvR>>md5.com
echo }tyqtKQz=yPiVbjERz0x>>md5.com
::
:: usage md5 <infile >outfile

The source:

@=$100
move.l #$67452301,a
move.l #$efcdab89,b
move.l #$98badcfe,c
move.l #$10325476,d

eor.l r4,r4 ; low bit count
eor.l r5,r5 ; high bit count
_10: move.b #$3f,m0
move.w #buf,r1
move.w #64,r2
eor.w r3,r3
trap #$21
bcs.b _100
cmp.w #64,r0
bne.b _20
bsr.w md5
addq.l #64,r4
addcq.l #0,r5
br.b _10

_20: ext.l r0 ; clear high word
add.l r0,r4
addcq.l #0,r5
dsl.l #3,r5<r4
lsl.l #3,r4

move.w #buf,r6
add.w r0,r6
move.b #$80,(r6.w)
_30: inc.w r6
move.b #0,(r6.w)
cmp.w #buf+63,r6
blo.b _30

cmp.w #56,r0
blo.b _40
bsr.w md5
eor.w r0,r0
move.w #buf-1,r6
br.b _30

_40: move.l r4,buf+56
move.l r5,buf+60
bsr.w md5

move.w #a,r5
move.w #buf,r6
move.w #16,r2
_60: move.b (r5.w),r0
lsr.b #4,r0
bsr.w _70
move.b (r5.w),r0
inc.w r5
and.b #$0f,r0
bsr.w _70
dbf.w r2,_60
move.b #$40,m0
move.w #buf,r1
move.w #32,r2
move.b #1,r3
trap #$21
_100: rts.w

_70: add.b #'0',r0
cmp.b #'9',r0
bls.b _50
add.b #'a'-'9'-1,r0
_50: move.b r0,(r6.w)
inc.w r6
rts.w

md5: ; see RFC 1321
move.l r5,-(sp) ; don't modify r4 and r5

move.l a,r0
move.l r0,a0
move.l r0,-(sp)
move.l b,r0
move.l r0,b0
move.l r0,-(sp)
move.l c,r0
move.l r0,c0
move.l r0,-(sp)
move.l d,r0
move.l r0,d0
move.l r0,-(sp)

move.l #a,r5
eor.l r3,r3
_10: cmp.b #15,r3
bhi.b _20
move.l 4.b(r5),r0
move.l r0,r1
and.l 8.b(r5),r1
not.l r0
and.l 12.b(r5),r0
or.l r1,r0
br.b _50

_20: cmp.b #31,r3
bhi.b _30
move.l 12.b(r5),r0
move.l r0,r1
and.l 4.b(r5),r1
not.l r0
and.l 8.b(r5),r0
or.l r1,r0
br.b _50

_30: cmp.b #47,r3
bhi.b _40
move.l 4.b(r5),r0
eor.l 8.b(r5),r0
eor.l 12.b(r5),r0
br.b _50

_40: move.l 12.b(r5),r0
not.l r0
or.l 4.b(r5),r0
eor.l 8.b(r5),r0

_50: add.l (r5),r0
movu.bl index(r3),r6
add.l buf(r6*4),r0
add.l sin(r3*4),r0
move.b shift(r3),r2
rol.l r2,r0

add.l 4.b(r5),r0
move.l r0,(r5)
move.l r0,16.b(r5)
subq.l #4,r5
cmp.l #b0,r5
bhs.b _60
addq.l #16,r5
_60: inc.b r3
cmp.b #64,r3
blo.w _10

move.l (sp)+,r0
add.l r0,d
move.l (sp)+,r0
add.l r0,c
move.l (sp)+,r0
add.l r0,b
move.l (sp)+,r0
add.l r0,a
move.l (sp)+,r5
rts.w

even 4
index: dc.b 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15
dc.b 1, 6,11, 0, 5,10,15, 4, 9,14, 3, 8,13, 2, 7,12
dc.b 5, 8,11,14, 1, 4, 7,10,13, 0, 3, 6, 9,12,15, 2
dc.b 0, 7,14, 5,12, 3,10, 1, 8,15, 6,13, 4,11, 2, 9

shift: dc.b 7,12,17,22, 7,12,17,22, 7,12,17,22, 7,12,17,22
dc.b 5, 9,14,20, 5, 9,14,20, 5, 9,14,20, 5, 9,14,20
dc.b 4,11,16,23, 4,11,16,23, 4,11,16,23, 4,11,16,23
dc.b 6,10,15,21, 6,10,15,21, 6,10,15,21, 6,10,15,21

sin:
dc.l $d76aa478, $e8c7b756, $242070db, $c1bdceee, $f57c0faf, $4787c62a
dc.l $a8304613, $fd469501, $698098d8, $8b44f7af, $ffff5bb1, $895cd7be
dc.l $6b901122, $fd987193, $a679438e, $49b40821, $f61e2562, $c040b340
dc.l $265e5a51, $e9b6c7aa, $d62f105d, $02441453, $d8a1e681, $e7d3fbc8
dc.l $21e1cde6, $c33707d6, $f4d50d87, $455a14ed, $a9e3e905, $fcefa3f8
dc.l $676f02d9, $8d2a4c8a, $fffa3942, $8771f681, $6d9d6122, $fde5380c
dc.l $a4beea44, $4bdecfa9, $f6bb4b60, $bebfbc70, $289b7ec6, $eaa127fa
dc.l $d4ef3085, $04881d05, $d9d4d039, $e6db99e5, $1fa27cf8, $c4ac5665
dc.l $f4292244, $432aff97, $ab9423a7, $fc93a039, $655b59c3, $8f0ccc92
dc.l $ffeff47d, $85845dd1, $6fa87e4f, $fe2ce6e0, $a3014314, $4e0811a1
dc.l $f7537e82, $bd3af235, $2ad7d2bb, $eb86d391

blk.b 1024 ; because of trace cache P4

b0: blk.l 1
c0: blk.l 1
d0: blk.l 1
a: blk.l 1
b: blk.l 1
c: blk.l 1
d: blk.l 1
a0: blk.l 1

buf:


===== 252cb1e58b6f53b7 - 43a91e8c1b600fae =====
===== alt.msdos.batch - A batch to compare two folders - Fri, Oct 5 2001 7:11 =====


Ankybaby wrote:

> Hello,

> I try to make a batch to compare two folders (that I know the name and
> the place where they are) with subfolders (that I don't know the names).

> Is there a way to do that in ms-dos mode ? Do you know a dos-utilities
> or a way to solve this problem

The following batch generates a MD5 checksum for each file in the
two directories and then compares this two files. If you save _2.chk,
you can later check if somebody has modified your saved files.

usage: dircomp.bat dir1 dir2

When you execute this batch, the current directory must not be
one of the two directories which are compared, because temporary
files are generated in the current directory. The temporary
files are not deleted, so you can see what happens in the batch.
To use this batch in DOS 6, you have to remove the " " from the
filenames. Source code for the two programs see older postings.

@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>md5.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU!WvX0GwUY Wv;ovBX2Gv0ExGIuht6>>md5.com
echo lpepy~saxCEbp??@`LZN=fqDt??PBeHcg?Dvj?gpOecfD@epd@e=E}BwE@>>md5.com
echo Co?CEbCEEL}@?wqDDOw=uBIq?C?BgF}?pkjCDrHeffC}mK?sgBBa}ACE~M>>md5.com
echo ?OxA?CIqgCgrI?V_cECCNgNKma?{y?sexCEbr?__`L@KoCBBux{OfCA?FD>>md5.com
echo GQ`eBfeBaOCubIe`eHbeBceCyQBi`A}beh`eCceBmOCAbMa}eH??B?Zpep>>md5.com
echo Nz?MfYvPEJeXHeCcefAVGUbCOve=befDeKEPjOH{z?FxYv1CJefdeKEPfA>>md5.com
echo H]UbePveCsefOVGEbCOHep?gjbvnzRefPSCEJErefDfGEPErePQjKKJefd>>md5.com
echo eKEPfOv1EJePefCSGErCBefDefESzuNg?Bu?ef?S=CB_?CEBef?S\CB_?B>>md5.com
echo uAIf?cBuJEe??Of?R1EBePefCSfEHQEHeXBeOceCmRU}@M??B?eCrPOEBM>>md5.com
echo ?B}nN?zF~HAuu`eh@eCCBaE?E@e@eBqOCy`IE@e@eBeOUE@?`eBceC}QiE>>md5.com
echo @?@eBCBYE?A`ex@eCCBmE?E@e@BB]oLjHy




PaHARjOe=WpxxBMUG`eAaHsUu]do?r?XYP?Vie]`hu>>md5.com
echo FznO\@SRUF@AC`W`ezRzG~Lef~U``rBvFoTLFqSlsNDDYDhbhnnbwzAX{N>>md5.com
echo IfndLiK`yxApu@~zaFpHl\`XdwKoiC=vhc}iJ]N1zJ_d{oufE}~ygZ}H`f>>md5.com
echo yboDiJDSnNCG\GSOx{XdXnweZ~1a{HkUddaCCFVshkBi~RSbfa_xjaB{R}>>md5.com
echo dZXTKKQMs=NuP~n~DC\hg}Nde_n=S}kKb@B`GP`A}AMXtvRL=yqbVQz}RP>>md5.com
echo iwRjE}0>>md5.com

echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>edl.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU!WvX0GwUY Wv;ovBX2Gv0ExGIuht6>>edl.com
echo ?@}I{uNWEF~NuCIOEFAKLCK_Ij@KEuHAEFCKYCK_






JqJBBcBTmKJ\jbB{]KFrj~CIE?jABrokrAA_@NJBHmBTnMR1JyjxBo>>edl.com
echo IxrhgBFsj?]rM}s~guspj?Trb{gA{OsLXssTsy{Ok{cQ{dsHhsKdsQ{Sq{>>edl.com
echo jQKqsHVk_OCAx@b@f{W@CosI}1BHIz}hjzK}G~guNw



\CMaAy?sexCM_H?@_`LJNDB`Lbca??ao??CO?0>>edl.com

if exist _1.chk del _1.chk
if exist _2.chk del _2.chk
dir /l/b/s/a-d %1 | sort >_1
dir /l/b/s/a-d %2 | sort >_2
edl """md5 <$22$#0$22$3e$3e_1.chk$0d$0aecho $#0$3e$3e_1.chk"<_1>_1.bat
edl """md5 <$22$#0$22$3e$3e_2.chk$0d$0aecho $#0$3e$3e_2.chk"<_2>_2.bat
call _1.bat
call _2.bat
edl " \" "$#1 $R" <_1.chk >_1a.chk
edl " \" "$#1 $R" <_2.chk >_2a.chk
fc _1a.chk _2a.chk
del edl.com
del md5.com
::del _1
::del _2
::del _1.bat
::del _2.bat
::del _1a.chk
::del _2a.chk

:: usage: edl "string1" "string2" <infile >outfile
:: replaces any non empty line in infile by string2
:: (a line is non empty if it contains at least one
:: character greater 0x20) and writes it to outfile.
::
:: Any character in string1 separates words
::
:: string2 can contain:
:: $00-$ff : hexbytes
:: $:abcd : input line ab,cd hex values
:: $#0 : complete input line
:: $#n (n=1..8) : n. word in input line
:: $#9 : 9. word (or last word if there are
:: more than 9 words) in input line
:: $l : line till first separator char
:: $L : line till last separator char
:: $r : line after first separator char
:: $R : line after last separator char
:: $ty : year
:: $tm : month
:: $td : day


===== 3970b482d2a0cb1b - 68b27fc2e8fcc398 =====
===== alt.msdos.batch.win9x-me - Password Question - Wed, Dec 17 2003 8:26 =====


gimpy wrote:

> The first batch would ask the person to create a username, and
> password. It would then send the username and password to a .ini file.
> When the user wants to log in, the above script would prompt for
> password, and then read the .ini file to check if the password is
> correct. Does anyone know how I could do this?

Here is a solution with the MD5 algorithm from RSA (see RFC 1321):

usage: login passwd

To add a new user, enter: login passwd user

Source code for md5.com and ech.com see older postings in this group.

:::::::::::::::::::::::: login.bat ::::::::::::::::::::::::::::::::::::::::
@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>md5.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>md5.com
echo EuNGH??AFs?Fv{G@oAu`EHvwAE@mCE?KEE?u@?C_?@}N@uq=bB_bg?yq}?>>md5.com
echo s_~A=bx?AaI?O_g?C{VgCKCI?GNcE@?NgBsmanAy?h_x?G@r?GB`Lr{oC?>>md5.com
echo AuxCGfC_BFDs=`exbeAceCPQB@`ATbeh`eCceBDOCXbIH`eHbeBceC\QA=>>md5.com
echo }Me??O?ZpkvNzRefYSCEJEAHexbefDeGUPfOv1EbePHeKCFjO11z?MfYvP>>md5.com
echo EJeXHeKcefAVCUbCOve=befDeGEPjOH{z?gwPvnCJefdfCEPErePefGSKE>>md5.com
echo rCfQjREJeXveKsefOVCEJCrefDfGEPEBe@NefDPzuI??B?BefDA=Cg????>>md5.com
echo BefDP\Cg??B?JIfh?BP@Re?sef?VCEBCHefdefESOEHEmBex@eCcAp}Nr?>>md5.com
echo ?OBeCc}OErz?BzAN?`e~H\CP`IE@e@eA=RLE@?`eBceCTQ@E@?@eBCApEK>>md5.com
echo X`eh@eCCBDE?E@e@eAtRC\`IE@e@eBHOxE@oHBAknLj}y




ZpJY}~~nH
YPTFiew\hu]UnOoCSRPe@AwGW`}fRz~`Le~FU`KFBvksTL{YSlRhDDpwh>>md5.com
echo bz{nb}nAXRKIfXALiW~yx{pu@]`aFQKl\E=dw{}iClNhcy_J]VuzJx~{oh>>md5.com
echo }E}]ygZqi`fwnoDq\DSBxCGAXSO~ZXdz{we1d1aQCkUxhaC@~VszfBicjS>>md5.com
echo bgR_xgXB{1QdZdNKKbns==\P~1NDCYng}Xke_NBS}R`b@gMGPOR}AUqtvr>>md5.com
echo z=ygiVQNERPmERjn0x>>md5.com

echo XP,;P_,EP0Ex0Ez0Em3Em-ZBP(Eiu!






== echo %2:%p%>>passwd
find "%p%" <passwd>nul
if errorlevel 1 echo unknown password
if errorlevel 1 goto ende
echo password accepted

:ende
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


===== ae73a4ef0c1cd91f - 91ba7218be435732 =====
===== de.comp.os.msdos - Zeichenkette mit md5sum unter DOS berechnen - Wed, Feb 25 2004 3:00 =====


Reinhard Janz wrote:

> "Herbert Kleebauer" schrieb:
> > echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>md5.com
> > echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>md5.com
> ...

> Wie oder womit erstellst Du solchen ASCII-Code von COM-Dateien?

Von Laura Fairhead:

>> Assemble .COM file using MASM6+ and convert .COM file
>> to ascii-code using my CM3 utility ( http://lf.8k.com/TOOLS/TOOLS.HTM )

oder:

ftp://137.193.64.130/pub/assembler/ube.zip


===== 31a32bffc8bd6312 - a06643306f62b881 =====
===== alt.lang.asm - md5 optimzation in asm - Wed, Oct 12 2005 12:52 =====


nobody wrote:

> You gonna laugh but I just realized that my code was compiled using
> debug configuration. I just tried the released version and it's about the
> same speed as fastsum now (doh). Anyhow if the code can go even faster let
> me know. I was running with a P4-2.8 (but code only detected 2600)

If it is a 16 bit program, then maybe reading the file is the most
time consuming part. Laura has write a pretty fast 16 bit com
program ( http://lf.8k.com/TOOLS/TOOLS.HTM ). I'm more interested
in a small than a fast program (to include it in a batch file for
testing for file copy errors):

@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>md5.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>md5.com
echo EFeL@GKBfDbSEFeLHGObnLj}EFeL}GSrWy




UbePveGs>>md5.com
echo efOVKEbCOHep?Fjfv1zRefYSKEJEAHexbefDeCUPfOv1EbePHeGCgjONnz>>md5.com
echo ?MfPvPEJeXefCSGErCrefDjKEpefQSKEJEOve=JefDfCEPErePefGSfEBO>>md5.com
echo uNe`B?zEf??OCBe@G_=Mf??OCBe@B?\Mf??O?JIi??B??Re=BefDfCEPEH>>md5.com
echo eHHefdeOEPCmBM}@ex?G?BCr?CEBexB}O{?z?]HANWWe~VE@e@eGWR@eWD>>md5.com
echo GSEKeWeTOE@oWeGSE@e@eGKR?B]LA@??DCB?GFE?JIH?MLK?E@N?D?J?CN>>md5.com
echo I?BMH?ALG?DKF?MJG?FC@??LI?HEB?ANK?MF??BKD?G@I?LEN?AJC?KFH?>>md5.com
echo FUP?UPK?PKF?KFU?DUP?SMH?MHD?HDS?DSM?SMH?OJC?JCV?CVO?VOJ?OJ>>md5.com
echo C?IEV?ETN?TNI?NIE?IET?wTNOVicuFvUxoZg1mc_o@=Mz{NnQEitrRFFE>>md5.com
echo goE`ET@WWW=nnh?eJCvf~ZpuV}~zaHda@r?>>md5.com
echo ufP??\e]YDuFimO\hFRUn
Nh}J_JTou>>md5.com
echo z]}~{iZ}EffygKDi`mSno{G\D_OxCodXS~eZX}a{wfUd1SCCk]shaoi~VM>>md5.com
echo bfBHxjSI{R_yZXBVKQdx=NKW~ns~C\Pf}NDU_ngu}ker@BSCP`bIAMGcvR>>md5.com
echo }tyqtKQz=yPiVbjERz0x>>md5.com
::
:: usage md5 <infile >outfile

The source:

@=$100
move.l #$67452301,a
move.l #$efcdab89,b
move.l #$98badcfe,c
move.l #$10325476,d

eor.l r4,r4 ; low bit count
eor.l r5,r5 ; high bit count
_10: move.b #$3f,m0
move.w #buf,r1
move.w #64,r2
eor.w r3,r3
trap #$21
bcs.b _100
cmp.w #64,r0
bne.b _20
bsr.w md5
addq.l #64,r4
addcq.l #0,r5
br.b _10

_20: ext.l r0 ; clear high word
add.l r0,r4
addcq.l #0,r5
dsl.l #3,r5<r4
lsl.l #3,r4

move.w #buf,r6
add.w r0,r6
move.b #$80,(r6.w)
_30: inc.w r6
move.b #0,(r6.w)
cmp.w #buf+63,r6
blo.b _30

cmp.w #56,r0
blo.b _40
bsr.w md5
eor.w r0,r0
move.w #buf-1,r6
br.b _30

_40: move.l r4,buf+56
move.l r5,buf+60
bsr.w md5

move.w #a,r5
move.w #buf,r6
move.w #16,r2
_60: move.b (r5.w),r0
lsr.b #4,r0
bsr.w _70
move.b (r5.w),r0
inc.w r5
and.b #$0f,r0
bsr.w _70
dbf.w r2,_60
move.b #$40,m0
move.w #buf,r1
move.w #32,r2
move.b #1,r3
trap #$21
_100: rts.w

_70: add.b #'0',r0
cmp.b #'9',r0
bls.b _50
add.b #'a'-'9'-1,r0
_50: move.b r0,(r6.w)
inc.w r6
rts.w

md5: ; see RFC 1321
move.l r5,-(sp) ; don't modify r4 and r5

move.l a,r0
move.l r0,a0
move.l r0,-(sp)
move.l b,r0
move.l r0,b0
move.l r0,-(sp)
move.l c,r0
move.l r0,c0
move.l r0,-(sp)
move.l d,r0
move.l r0,d0
move.l r0,-(sp)

move.l #a,r5
eor.l r3,r3
_10: cmp.b #15,r3
bhi.b _20
move.l 4.b(r5),r0
move.l r0,r1
and.l 8.b(r5),r1
not.l r0
and.l 12.b(r5),r0
or.l r1,r0
br.b _50

_20: cmp.b #31,r3
bhi.b _30
move.l 12.b(r5),r0
move.l r0,r1
and.l 4.b(r5),r1
not.l r0
and.l 8.b(r5),r0
or.l r1,r0
br.b _50

_30: cmp.b #47,r3
bhi.b _40
move.l 4.b(r5),r0
eor.l 8.b(r5),r0
eor.l 12.b(r5),r0
br.b _50

_40: move.l 12.b(r5),r0
not.l r0
or.l 4.b(r5),r0
eor.l 8.b(r5),r0

_50: add.l (r5),r0
movu.bl index(r3),r6
add.l buf(r6*4),r0
add.l sin(r3*4),r0
move.b shift(r3),r2
rol.l r2,r0

add.l 4.b(r5),r0
move.l r0,(r5)
move.l r0,16.b(r5)
subq.l #4,r5
cmp.l #b0,r5
bhs.b _60
addq.l #16,r5
_60: inc.b r3
cmp.b #64,r3
blo.w _10

move.l (sp)+,r0
add.l r0,d
move.l (sp)+,r0
add.l r0,c
move.l (sp)+,r0
add.l r0,b
move.l (sp)+,r0
add.l r0,a
move.l (sp)+,r5
rts.w

even 4
index: dc.b 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15
dc.b 1, 6,11, 0, 5,10,15, 4, 9,14, 3, 8,13, 2, 7,12
dc.b 5, 8,11,14, 1, 4, 7,10,13, 0, 3, 6, 9,12,15, 2
dc.b 0, 7,14, 5,12, 3,10, 1, 8,15, 6,13, 4,11, 2, 9

shift: dc.b 7,12,17,22, 7,12,17,22, 7,12,17,22, 7,12,17,22
dc.b 5, 9,14,20, 5, 9,14,20, 5, 9,14,20, 5, 9,14,20
dc.b 4,11,16,23, 4,11,16,23, 4,11,16,23, 4,11,16,23
dc.b 6,10,15,21, 6,10,15,21, 6,10,15,21, 6,10,15,21

sin:
dc.l $d76aa478, $e8c7b756, $242070db, $c1bdceee, $f57c0faf, $4787c62a
dc.l $a8304613, $fd469501, $698098d8, $8b44f7af, $ffff5bb1, $895cd7be
dc.l $6b901122, $fd987193, $a679438e, $49b40821, $f61e2562, $c040b340
dc.l $265e5a51, $e9b6c7aa, $d62f105d, $02441453, $d8a1e681, $e7d3fbc8
dc.l $21e1cde6, $c33707d6, $f4d50d87, $455a14ed, $a9e3e905, $fcefa3f8
dc.l $676f02d9, $8d2a4c8a, $fffa3942, $8771f681, $6d9d6122, $fde5380c
dc.l $a4beea44, $4bdecfa9, $f6bb4b60, $bebfbc70, $289b7ec6, $eaa127fa
dc.l $d4ef3085, $04881d05, $d9d4d039, $e6db99e5, $1fa27cf8, $c4ac5665
dc.l $f4292244, $432aff97, $ab9423a7, $fc93a039, $655b59c3, $8f0ccc92
dc.l $ffeff47d, $85845dd1, $6fa87e4f, $fe2ce6e0, $a3014314, $4e0811a1
dc.l $f7537e82, $bd3af235, $2ad7d2bb, $eb86d391

blk.b 1024 ; because of trace cache P4

b0: blk.l 1
c0: blk.l 1
d0: blk.l 1
a: blk.l 1
b: blk.l 1
c: blk.l 1
d: blk.l 1
a0: blk.l 1

buf:


===== 68e561ced2cb5e8a - f7b4077e61f9fc36 =====
===== alt.msdos.batch - Using DOS &quot;Comp&quot; Command, How to store/view results? - Wed, Sep 28 2005 2:26 =====


Martin wrote:

> I need to run the DOS file compare command on a large number of files
> (about 800) in one batch. Basically I've copied the files from my
> external USB DVD drive onto my hard drive, and want to make certain
> that they contain no errors.

If you do a compare after you have copied the files, I suppose
Windows compares it with the version in the disk cache and don't
read it again from the USB device. So better disconnect an reconnect
the USB device before the compare. But if the file on the USB device
is corrupted, then the compare doesn't give you an error, it simple
compares two identical but corrupted files. So better generate
md5 checksums for the files before copying them to the USB device
and store this checksums also on the USB device. After you
copied the files from the USB device, recreate the checksums and
compare them with ones stored on the USB device. You can also
zip all the files into one zip file before copying them to the
USB device. The unzip program will recognize if the zip file
is corrupted.

If you can't use an external md5 program, you can include a
small (but slow) md5 program within your batch file:

@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>md5.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>md5.com
echo lpepupepy~saxC1bp??@`LZN=xqDt??P}gL
~B=uqLq?wOGgI~M>>md5.com
echo efj1VmHAHeDcDZu??sgBBz}AC1~M?OxA?CIqgCgrI?V_cECCNgNKma?{y?>>md5.com
echo sexC1br?__`L@KoCBBux{OfCA?FDGQUeBVz`eHbeBceCNRB~`ARbex`eCc>>md5.com
echo eBBPCVbMF`eXbeBceCZRBz}Ae??O?ZpkvNzRefYSCEJEAHexbefDeGUPfO>>md5.com
echo v1EbePHeKCFjO11z?MfYvPEJeXHeKcefAVCUbCOve=befDeGEPjOH{z?gw>>md5.com
echo PvnCJefdfCEPErePefGSKErCfQjREJeXveKsefOVCEJCrefDfGEPEBe@Ne>>md5.com
echo fDNzuY??B?BefD1=Cw??C?BefDN\Cw??B?JIfh?BNARe?sef?VCEBCHefd>>md5.com
echo efESOEHEmBex@eCcBn}Br??OBeCc}OErz?BzAN?`e~H\CN`ME@e@eBzOJE>>md5.com
echo @O`eBceCRR~E@?@eBCBnE?V`ex@eCCBBECE@e@eBrOCZ`ME@e@eBFPvE@?>>md5.com
echo ]eBSjHBj}nL~Wy




da@r?ufP??\e]YDuFimO\hFRUn

Nh}J_JTouz]}~{iZ}EffygKDi`mSno{G\D_OxCodXS~eZX}>>md5.com
echo a{wfUd1SCCk]shaoi~VMbfBHxjSI{R_yZXBVKQdx=NKW~ns~C\Pf}NDU_n>>md5.com
echo gu}ker@BSCP`bIAMGcvR}tyqtKQz=yPiVbjERz0x>>md5.com
::
:: usage md5 <infile >outfile


2007-6-2 10:45
查看资料  发短消息  网志   编辑帖子  回复  引用回复
stornager
中级用户

scriptlover


积分 328
发帖 131
注册 2007-3-25
状态 离线
『第 8 楼』:   使用 LLM 解释/回答一下

qzwqzw兄真强,收下慢蛮研究。。。。




scriptlover
Be with script forever!!
2007-6-2 16:15
查看资料  发送邮件  发短消息  网志   编辑帖子  回复  引用回复
wert123
中级用户





积分 301
发帖 135
注册 2007-5-15
状态 离线
『第 9 楼』:   使用 LLM 解释/回答一下

===== 7d0150cbdf4d56c1 - 1a7f0e566e56642e =====
===== alt.lang.asm - MD5 optimization for const data&#39;s length - Tues, Mar 14 2006 3:51 =====


spamt...@crayne.org wrote:

> Hi all.
> I found optimized ASM code for md5 hash generation:
> hXXp://www.rewolf.cjb.net/
> Could any one help to adapt this code for greater string lengths.

What do you mean with "greater string lengths"? MD5 adds the
length of the message as a 64 bit value. But even if your message
is greater the 2^64 byte (don't think you have a disk big enough
to hold such a message) you can use MD5 (only the low-order 64
bits of the message size are appended). Read RFC1321 for more
information.

Here the source code for a very simple MD5 implementation
(correct only for a file size up to 2^61 bytes because it uses
a 64 bit bit-counter instead of a byte-counter). It is size
optimized (to embed it within a batch program) and therefore
slow. There is a faster (but bigger) assembler version from
Laura ( http://lf.1accesshost.com/TOOLS/TOOLS.HTM ).

@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>md5.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>md5.com
echo EFeL@GKBfDbSEFeLHGObnLj}EFeL}GSrWy



完全不懂,不是从外国网站上贴上去的吧

Last edited by wert123 on 2007-6-5 at 06:37 PM ]


2007-6-5 18:33
查看资料  发短消息  网志   编辑帖子  回复  引用回复
wert123
中级用户





积分 301
发帖 135
注册 2007-5-15
状态 离线
『第 10 楼』:   使用 LLM 解释/回答一下

Originally posted by slore at 2007-6-1 04:42 PM:
Dim WshSHell,fso,file
Set WshSHell = CreateObject("WScript.Sh ...


强啊~~~~~~~
顺便问哈啊,是不是只能有一个WScript.Arguments(0)啊,
能传递多个变量吗


2007-6-6 22:37
查看资料  发短消息  网志   编辑帖子  回复  引用回复
slore
铂金会员





积分 5212
发帖 2478
注册 2007-2-8
状态 离线
『第 11 楼』:   使用 LLM 解释/回答一下

实际情况需要自己修改……我这里只用了一个


2007-6-7 19:27
查看资料  发短消息  网志   编辑帖子  回复  引用回复
wert123
中级用户





积分 301
发帖 135
注册 2007-5-15
状态 离线
『第 12 楼』:   使用 LLM 解释/回答一下

Originally posted by slore at 2007-6-7 07:27 PM:
实际情况需要自己修改……我这里只用了一个

这个我不会自己修改,怎么修改啊,还希望大虾再帮我举个例子吧


2007-6-7 19:50
查看资料  发短消息  网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: