• <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>
            <2025年6月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345

            統計

            • 隨筆 - 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 小蔥蘸醬 閱讀(1273) 評論(0)  編輯 收藏 引用 所屬分類: 編碼點滴

            国产精品乱码久久久久久软件| 天堂久久天堂AV色综合| 久久久久一区二区三区| 9999国产精品欧美久久久久久| 欧美粉嫩小泬久久久久久久| 久久久久99这里有精品10| av国内精品久久久久影院| 91亚洲国产成人久久精品| 久久综合色老色| …久久精品99久久香蕉国产| 久久人妻少妇嫩草AV无码蜜桃| 色婷婷综合久久久中文字幕| 国产精品99久久久久久宅男| 久久亚洲AV无码精品色午夜| 久久久九九有精品国产| 九九精品久久久久久噜噜| 久久精品国产亚洲欧美| 久久亚洲精品成人无码网站| 久久AⅤ人妻少妇嫩草影院| 99久久久国产精品免费无卡顿| 久久久久久综合网天天| 久久精品国产第一区二区| 国产一区二区三区久久精品| 精品久久久无码21p发布| 91久久福利国产成人精品| 久久精品国产亚洲AV高清热 | 中文无码久久精品| 久久99精品国产麻豆不卡| 成人国内精品久久久久影院| 亚洲AV无码成人网站久久精品大| 亚洲乱码日产精品a级毛片久久 | 久久e热在这里只有国产中文精品99| 亚洲色欲久久久综合网| 久久成人国产精品免费软件| 色欲综合久久躁天天躁| 久久亚洲av无码精品浪潮| 久久亚洲电影| 人人妻久久人人澡人人爽人人精品| 久久伊人影视| 国产精品久久久久久久app| 久久精品一本到99热免费|