• <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)  編輯 收藏 引用 所屬分類: 編碼點滴

            久久99精品国产麻豆蜜芽| 天天影视色香欲综合久久| 久久午夜无码鲁丝片| 2021国内久久精品| 久久精品人人做人人妻人人玩| 99久久久精品| 国产成人无码精品久久久久免费 | 99久久久久| 久久综合给合久久狠狠狠97色 | 久久久久久久尹人综合网亚洲| 日韩影院久久| 国产精品欧美久久久久天天影视| 2021国产精品久久精品| 中文字幕亚洲综合久久| 久久九九久精品国产免费直播| 99久久国产亚洲高清观看2024 | 国产精品久久永久免费| 欧美激情精品久久久久久久| 91精品国产乱码久久久久久| 国产成人久久精品一区二区三区| 午夜精品久久久内射近拍高清| 99热成人精品热久久669| 午夜天堂av天堂久久久| 亚洲精品蜜桃久久久久久| 久久受www免费人成_看片中文| 亚洲国产精品无码久久青草| 热RE99久久精品国产66热| 国产精品va久久久久久久| 欧美午夜A∨大片久久 | 久久精品国产99国产精品| 思思久久好好热精品国产| 久久精品嫩草影院| 性高湖久久久久久久久AAAAA | 九九久久99综合一区二区| 无码国内精品久久人妻麻豆按摩| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 欧美精品一区二区精品久久| 久久久久亚洲国产| 精品国产乱码久久久久久郑州公司| 热久久国产欧美一区二区精品| 久久亚洲精品中文字幕三区|