• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            <2007年8月>
            2930311234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            統計

            • 隨筆 - 24
            • 文章 - 0
            • 評論 - 17
            • 引用 - 0

            常用鏈接

            留言簿(4)

            隨筆分類

            隨筆檔案

            相冊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            VBScript寫的計算異或的一個小工具
            工作中經常會需要計算一大串字節的異或,用計算器手工一個一個的輸入太累人了,碰巧這兩天在關注VBScript,于是就想到寫了這個工具。這是我第一次用VB,代碼很簡單,希望能對你有用。

            '==========================================================================
            '
            '
            '
             NAME: calc_xor.vbs
            '
            '
             COMMENT: Calculates the result of 'xor' all elements in the input
            '
            '
            ==========================================================================

            Option Explicit

            Dim strInput

            'Promt for string to search for in log files
            strInput = InputBox("Enter data to calc on.","calc xor","")

            if strInput = "" then
                wscript.quit
            end If

            'MsgBox(Len(strInput))

            Dim arrayBytes()
            ReDim arrayBytes(Len(strInput)/2)

            Dim i,nBytes
            Dim chHalf1,chHalf2,chWhole
            = 1
            nBytes 
            = 0

            Do While (i < Len(strInput))
            'Skip spaces between elements
            Do While Asc(Mid(strInput,i,1)) = 32 'space
                i = i + 1
            Loop 

                chHalf1 
            = Asc(Mid(strInput,i,1))
                chHalf2 
            = Asc(Mid(strInput,i+1,1))
                
            'Check and convert first half

                
            If chHalf1 >= 48 And chHalf1 <= 57 Then
                    chHalf1 
            = chHalf1 - 48
                
            ElseIf chHalf1 >= 65 And chHalf1 <= 70 Then
                    chHalf1 
            = chHalf1 - 65 + 10
                
            ElseIf chhalf1 >= 97 And chHalf1 <= 104 Then
                    chHalf1 
            = chHalf1 - 97 + 10
                
            Else
                    
            MsgBox("invalid character")
                    wscript.quit
                
            End If
                
                
            ' Check and convert the second half
                If chHalf2 >= 48 And chHalf2 <= 57 Then
                    chHalf2 
            = chHalf2 - 48
                
            ElseIf chHalf2 >= 65 And chHalf2 <= 70 Then
                    chHalf2 
            = chHalf2 - 65 + 10
                
            ElseIf chHalf2 >= 97 And chHalf2 <= 104 Then
                    chHalf2 
            = chHalf2 - 97 + 10
                
            Else
                    
            MsgBox("invalid character")
                    wscript.quit
                
            End If
                
                
            ' Combine the first and second halves together to form a whole byte
                chWhole = chHalf1 * 16 + chHalf2
                arrayBytes(nBytes) 
            = chWhole
                i 
            = i + 2
                nBytes 
            = nBytes + 1
            Loop

            'MsgBox(CStr(nBytes) + " bytes all together")

            Dim WshSHell
            set WshShell = CreateObject("WScript.Shell")
            WshShell.Run(
            "calc")
            WScript.Sleep(
            100)
            WshShell.AppActivate(
            "Calculator")
            WScript.Sleep(
            100)

            WshShell.SendKeys(
            "{F6}"'Change to Decimal
            '
            WshShell.SendKeys("{F4}") 'Change to single byte
            WScript.Sleep(100)
            WshShell.SendKeys(
            "0")
            For i =1 to nBytes
                WshShell.SendKeys(
            "{^}")
                WScript.Sleep(
            100)
                WshShell.SendKeys(arrayBytes(i
            -1))
                WScript.Sleep(
            100)
                WshShell.SendKeys(
            "{=}")
                WScript.Sleep(
            100)
            Next

            WshShell.SendKeys(
            "{F5}"'Change to Hex for easy recognition



            posted on 2007-08-03 13:05 小蔥蘸醬 閱讀(1267) 評論(0)  編輯 收藏 引用 所屬分類: 編碼點滴

            性做久久久久久久久浪潮| 久久久久久噜噜精品免费直播| 久久精品一区二区三区AV| 久久久久久久女国产乱让韩| 亚洲熟妇无码另类久久久| 青青国产成人久久91网| 无码人妻少妇久久中文字幕| 久久亚洲精品成人AV| 久久无码国产| 国产三级久久久精品麻豆三级| 久久人人爽人人爽人人片AV东京热| 中文字幕人妻色偷偷久久| 品成人欧美大片久久国产欧美...| 亚洲国产天堂久久综合| 久久91综合国产91久久精品| 欧美亚洲国产精品久久久久| 2021国产成人精品久久| 久久w5ww成w人免费| 久久精品国产2020| 亚洲AV伊人久久青青草原| 日本一区精品久久久久影院| 亚洲级αV无码毛片久久精品| 久久人妻少妇嫩草AV无码蜜桃| 久久久久99精品成人片试看| 无码人妻久久一区二区三区蜜桃| 日本免费一区二区久久人人澡| 久久亚洲AV成人无码电影| 精品久久久久久久国产潘金莲| 成人a毛片久久免费播放| 久久亚洲高清观看| 国产91色综合久久免费| 少妇内射兰兰久久| 亚洲综合日韩久久成人AV| 久久久久久午夜精品| 免费精品久久天干天干| 国产偷久久久精品专区| 久久精品无码一区二区WWW| 综合久久给合久久狠狠狠97色| 日日狠狠久久偷偷色综合免费| 少妇被又大又粗又爽毛片久久黑人| 久久精品国产黑森林|