? ?廣州龍躍自動化專業(yè)破解解密各類plc加密,全國24小時聯(lián)系手機:18520649527 【關(guān)技術(shù)】 微信:guanshiyou009如有任何問題請打手機或者添加微信,謝謝支持
PLC解密,全國上門PLC解密維修找龍躍自動化PLC解密網(wǎng)vb編寫plc解密源碼,專業(yè)PLC解密師傅電話18520649527;提供三菱plc解密,臺達plc解密,西門子plc解密,信捷plc解密等各類PLC解密vb加密程序代碼例題及觸摸屏解密維修服務(wù), 【加微信:guanshiyou009】或者致電PLC解密師傅電話18520649527
vb 暴力破解密碼程序的過程?
工作繁忙難免產(chǎn)生意外,比如對重要的word文檔加密之后卻把密碼忘得一干二凈,這幾乎會發(fā)生在每個人的身上。這時你可能會焦急萬分,不過我勸你不要太緊張,有空來程序谷坐坐,一定會有好的答案的。下面我們就來看看用窮舉法暴力破解word密碼的程序,當然,為了簡單起見,程序只針對密碼是數(shù)字的情況做了處理,字符型的密碼與此類似,不再多說了。
一、引言
大家都知道,office家族跟VB有千絲萬縷的聯(lián)系,Microsoft office組件中的所有應(yīng)用程序都內(nèi)建有VBA,這樣就可以通過VB或VBA操作word 應(yīng)用程序中的對象,用窮舉測試的辦法達到找回丟失密碼的目的,非常簡單吧!
二、實現(xiàn)過程
下面來看一看程序的具體編制過程。程序采用VB編程實現(xiàn),需要機器安裝有VB應(yīng)用程序及Microsoft office組件。打開VB,新建一個VB工程,取名Proc_word,將啟動窗體命名為FrmMain,選擇“工程”菜單中的“引用”,在“引用”對話框中選擇 “Microsoft word8.0 Object Library”(這一步很重要,你必須選擇這一ActiveX部件,否則代碼不能正確運行,順便說一句,如果安裝的是office2000,那么應(yīng)該選擇“Microsoft word9.0 Object Library”)。同時在“工程”菜單中“部件”對話框中選擇添加“Microsoft Windows common controls -2.5(sp2)”,以便在窗體設(shè)計中可以使用微調(diào)控件。
好了,現(xiàn)在可以動手編制程序了。在剛才FrmMain窗體的左側(cè)添加一個框架控件,并在此控件內(nèi)加入一個驅(qū)動器列表框、一個目錄列表框和一個文件列表框控件。在FrmMain窗體的右下側(cè)添加兩個命令按鈕,在右上側(cè)添加三個標簽控件、兩個文本框控件和一個微調(diào)控件,你可以參考附圖來設(shè)計。接著,將框架的Caption屬性設(shè)置成“請選擇需要破譯的word文檔”;保持目錄列表框、驅(qū)動器列表框、文件列表框、文本框、微調(diào)控件缺省名稱不變;將文件列表框的Pattern屬性設(shè)置成“*.DOC”,目的是只顯示目錄下的 word文件;將第一個標簽控件Caption屬性設(shè)置成“該程序破譯八位以下純數(shù)字組合word文檔密碼”,將第二個標簽Caption屬性設(shè)置成“解密進度”,將第三個標簽Caption屬性設(shè)置成“請選擇破譯密碼位數(shù)”;將第二個文本框的Text屬性設(shè)置成“4”,這是缺省密碼位數(shù);將微調(diào)按鈕的 BuddyControl屬性設(shè)置成Text2就能和第二個文本框關(guān)聯(lián),BuddyProperty 改成Text,Max、Min屬性分別設(shè)置成“8”和“1”,表示最長密碼位數(shù)和最短密碼位數(shù),將Wrap屬性設(shè)置成True,將Increment屬性設(shè)置成“1”,以便每單擊一次加1或減1;將兩個命令按鈕的名稱分別改成 “cmdopendoc”和“cmdquit”,Caption屬性分別設(shè)置成“文件打開”、“系統(tǒng)退出”。以上就把各控件的屬性設(shè)置完了,接著編寫代碼也就不是什么難事兒了。
下面就是全部的源程序,適當?shù)淖⑨層兄诖蠹依斫獬绦?。你還可以通過設(shè)置斷點來跟蹤密碼生成部分,看看程序編制的原理。
VB 加密與解密的程序代碼
加密:
Private?Function JiaMi(ByVal varPass As String) As String '參數(shù)varPass是需要加密的文本內(nèi)容
Dim varJiaMi As String * 20
Dim varTmp As Double
Dim strJiaMi As String
Dim I
For I = 1 To Len(varPass)
varTmp = AscW(Mid$(varPass, I, 1))
varJiaMi = Str$(((((varTmp * 1.5) / 5.6) * 2.7) * I))
strJiaMi = strJiaMi varJiaMi
Next?I
JiaMi = strJiaMi
End?Function
解密函數(shù):
Private?Function JieMi(ByVal varPass As String) As String '參數(shù)varPass是需要解密的密文內(nèi)容
Dim varReturn As String * 20
Dim varConvert As Double
Dim varFinalPass As String
Dim varKey As Integer
Dim varPasslenth As Long
varPasslenth = Len(varPass)
For I = 1 To varPasslenth / 20
varReturn = Mid(varPass, (I - 1) * 20 + 1, 20)
varConvert = Val(Trim(varReturn))
varConvert = ((((varConvert / 1.5) * 5.6) / 2.7) / I)
varFinalPass = varFinalPass ChrW(Val(varConvert))
Next?I
JieMi = varFinalPass
End?Function
擴展資料:
注意事項
編寫加密程序,將用戶輸入的一個英文句子加密為加密字符串,然后輸出加密字符串。假設(shè)句子長度不超過100個字符。
根據(jù)給定的句子加密函數(shù)原型SentenceEncoding,編寫函數(shù)SentenceEncoding調(diào)用給定的字符加密函數(shù)CharEncoding完成句子加密。
然后,編寫主程序提示用戶輸入英文句子,然后調(diào)用函數(shù)SentenceEncoding對句子加密,最后輸出加密后的句子。
字符加密規(guī)則為大寫字母和小寫字母均加密為其補碼, 我們定義ASCII碼值相加為’A’+’Z’即155的兩個大寫字母互為補碼,ASCII碼值相加為’a’+’z’即219的兩個小寫字母互為補碼。
空格用@代替,句號以#代替,其它字符用句點代替。
函數(shù)原型:
void SentenceEncoding(char *soure,char *code);
功能:對待加密字符串source加密后保存加密字符串到code.
參數(shù):char *soure,指向待加密句子的字符串指針;
char *code 指向加密字符串的字符串指針;
字符加密函數(shù)代碼。
能給我發(fā)個VB與三菱PLC通訊的源代碼實例嗎,非常感謝啊
得說明是什么型號的PLC啊,串口還是網(wǎng)口,VB6還是VB.NET?
算了,寫段代碼,VB.NET與Q系列以太網(wǎng)通訊的:
Imports?System.Net
Imports?System.Runtime.InteropServices
Public?Class?Form1
????Dim?Handle1?As?Int32
????Dim?EntLink1?As?Boolean
????Dim?ScanCount1?As?Long
????Dim?PLC?As?New?EntQsPlc_Asc.PlcClient'EntQsPlc_ASC.DLL是Q系列以太網(wǎng)通訊組件
????Public?Declare?Function?timeGetTime?Lib?"winmm.dll"?()?As?UInt32
????Private?Sub?Form1_Load(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?MyBase.Load
????????Me.CenterToScreen()
????????cmbReadMry.Items.Clear()
????????cmbReadMry.Items.Add("X")
????????cmbReadMry.Items.Add("Y")
????????cmbReadMry.Items.Add("M")
????????cmbReadMry.Items.Add("D")
????????cmbReadMry.Items.Add("R")
????????cmbReadMry.Items.Add("Z")
????????'
????????cmbWriteMry.Items.Clear()
????????cmbWriteMry.Items.Add("X")
????????cmbWriteMry.Items.Add("Y")
????????cmbWriteMry.Items.Add("M")
????????cmbWriteMry.Items.Add("D")
????????cmbWriteMry.Items.Add("R")
????????cmbWriteMry.Items.Add("Z")
????????'
????????cmbBitMry.Items.Clear()
????????cmbBitMry.Items.Add("X")
????????cmbBitMry.Items.Add("Y")
????????cmbBitMry.Items.Add("M")
????????'
????????cmbReadType.Items.Clear()
????????cmbReadType.Items.Add("INT16")
????????cmbReadType.Items.Add("UINT16")
????????cmbReadType.Items.Add("DINT32")
????????cmbReadType.Items.Add("HEX32")
????????cmbReadType.Items.Add("REAL32")
????????cmbReadType.Items.Add("BIN16")
????????'
????????cmbWriteType.Items.Clear()
????????cmbWriteType.Items.Add("INT16")
????????cmbWriteType.Items.Add("UINT16")
????????cmbWriteType.Items.Add("DINT32")
????????cmbWriteType.Items.Add("HEX32")
????????cmbWriteType.Items.Add("REAL32")
????????cmbWriteType.Items.Add("BIN16")
????????cmbReadMry.SelectedIndex?=?3
????????cmbWriteMry.SelectedIndex?=?3
????????cmbBitMry.SelectedIndex?=?2
????????cmbReadType.SelectedIndex?=?0
????????cmbWriteType.SelectedIndex?=?0
????????lstRead.Items.Clear()
????????txtWrite.Text?=?""
????????'
????????cmbCmdType.SelectedIndex?=?0
????End?Sub
????Private?Sub?butLink_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?butLink.Click
????????Dim?re?As?Short
????????Dim?restr?As?String?=?""
????????re?=?PLC.EntLink(Trim(txtLocalIP.Text),?Val(txtLocalPort.Text),?Trim(txtRemoteIP.Text),?Val(txtRemotePort.Text),?"DEMO",?Handle1,?1000,?CBool(cmbCmdType.SelectedIndex))
????????txtReLink.Text?=?re.ToString
????????If?re?=?0?Then
????????????EntLink1?=?True
????????????MsgBox("PLC聯(lián)接成功!?")
????????Else
????????????EntLink1?=?False
????????????MsgBox("PLC聯(lián)接失敗:?"??restr)
????????End?If
????End?Sub???????????
????Private?Sub?butClose_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?butClose.Click
????????Dim?re?As?Short
????????If?Not?EntLink1?Then
????????????MsgBox("還未與PLC建立聯(lián)接!")
????????????Exit?Sub
????????End?If
????????re?=?PLC.DeLink(Handle1)
????????txtReClose.Text?=?re.ToString
????End?Sub
????Private?Sub?butRead_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?butRead.Click
????????Dim?re?As?Short
????????Dim?i?As?Short
????????Dim?RD()?As?Object
????????ReDim?RD(Val(txtReadCnt.Text?-?1))
????????If?Not?EntLink1?Then
????????????MsgBox("還未與PLC建立聯(lián)接!")
????????????'?Exit?Sub
????????End?If
????????Dim?mry?As?EntQsPlc_Asc.PlcClient.PlcMemory?=?cmbReadMry.SelectedIndex?+?1
????????Dim?typ?As?EntQsPlc_Asc.PlcClient.DataType?=?cmbReadType.SelectedIndex?+?1
????????re?=?PLC.CmdRead(Handle1,?mry,?typ,?CInt(txtReadAdd.Text),?CUShort(txtReadCnt.Text),?RD)
????????txtReRead.Text?=?re.ToString
????????lstRead.Items.Clear()
????????For?i?=?0?To?UBound(RD)?Step?1
????????????If?Not?IsNothing(RD(i))?Then?lstRead.Items.Add(RD(i))
????????Next?i
????????If?re??0?Then
????????????Timer1.Enabled?=?False
????????????butScan.Text?=?"Cycle?R/W"
????????End?If
????End?Sub
????Private?Sub?butWrite_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?butWrite.Click
????????Dim?re?As?Short
????????Dim?i?As?Short
????????Dim?temp()?As?String
????????Dim?WD()?As?Object
????????If?Not?EntLink1?Then
????????????MsgBox("還未與PLC建立聯(lián)接!")
????????????Exit?Sub
????????End?If
????????ReDim?WD(Val(txtWriteCnt.Text)?-?1)
????????temp?=?Split(txtWrite.Text,?vbCrLf)
????????For?i?=?0?To?UBound(WD)?Step?1
????????????If?i??UBound(temp)?Then
????????????????WD(i)?=?0
????????????Else
????????????????WD(i)?=?Trim(temp(i))
????????????End?If
????????Next?i
????????Dim?mry?As?EntQsPlc_Asc.PlcClient.PlcMemory?=?cmbWriteMry.SelectedIndex?+?1
????????Dim?typ?As?EntQsPlc_Asc.PlcClient.DataType?=?cmbWriteType.SelectedIndex?+?1
????????re?=?PLC.CmdWrite(Handle1,?mry,?typ,?CInt(txtWriteAdd.Text),?CUShort(txtWriteCnt.Text),?WD)
????????txtReWrite.Text?=?re.ToString
????????If?re??0?Then
????????????Timer1.Enabled?=?False
????????????butScan.Text?=?"Cycle?R/W"
????????End?If
????End?Sub
????
????
????Private?Sub?butScan_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?butScan.Click
????????If?Not?EntLink1?Then
????????????MsgBox("還未與PLC建立聯(lián)接!")
????????????Exit?Sub
????????End?If
????????Timer1.Enabled?=?Not?Timer1.Enabled
????????If?Timer1.Enabled?Then
????????????ScanCount1?=?0
????????????butScan.Text?=?"Stop?R/W"
????????Else
????????????butScan.Text?=?"Cycle?R/W"
????????End?If
????End?Sub
????Private?Sub?Timer1_Tick(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?Timer1.Tick
????????Timer1.Enabled?=?False
????????Dim?tim?As?Integer?=?timeGetTime
????????If?Not?EntLink1?Then
????????????MsgBox("還未與PLC建立聯(lián)接!")
????????????Exit?Sub
????????End?If
????????'
????????Call?butRead_Click(Nothing,?Nothing)
????????Call?butWrite_Click(Nothing,?Nothing)
????????'
????????If?(Val(txtReRead.Text)??0)?Or?(Val(txtReWrite.Text)??0)?Then
????????????butScan.Text?=?"Cycle?R/W"
????????????Exit?Sub
????????Else
????????????ScanCount1?+=?1
????????????txtScanCnt.Text?=?ScanCount1
????????????txtScanPrd.Text?=?(timeGetTime?-?tim)??"ms"
????????End?If
????????Timer1.Enabled?=?True
????End?Sub
????Private?Sub?butBitTest_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?butBitTest.Click
????????If?Not?EntLink1?Then
????????????MsgBox("還未與PLC建立聯(lián)接!")
????????????Exit?Sub
????????End?If
????????Dim?rd?As?Boolean
????????Dim?re?As?Short
????????Dim?mry?As?EntQsPlc_Asc.PlcClient.PlcMemory?=?cmbBitMry.SelectedIndex?+?1
????????re?=?PLC.Bit_Test(Handle1,?mry,?CUShort(txtBitAdd.Text),?rd)
????????txtBitTest.Text?=?rd
????????txtReBit.Text?=?re
????End?Sub
????Private?Sub?butBitSet_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?butBitSet.Click
????????If?Not?EntLink1?Then
????????????MsgBox("還未與PLC建立聯(lián)接!")
????????????Exit?Sub
????????End?If
????????Dim?re?As?Short
????????re?=?PLC.Bit_Set(Handle1,?cmbBitMry.SelectedIndex?+?1,?Val(txtBitAdd.Text))
????????txtReBit.Text?=?re
????End?Sub
????Private?Sub?butBitRst_Click(ByVal?sender?As?System.Object,?ByVal?e?As?System.EventArgs)?Handles?butBitRst.Click
????????If?Not?EntLink1?Then
????????????MsgBox("還未與PLC建立聯(lián)接!")
????????????Exit?Sub
????????End?If
????????Dim?re?As?Short
????????re?=?PLC.Bit_Reset(Handle1,?cmbBitMry.SelectedIndex?+?1,?Val(txtBitAdd.Text))
????????txtReBit.Text?=?re
????End?Sub
End?Class
[img]PLC解密,全國上門PLC解密維修找龍躍自動化PLC解密網(wǎng)vb編寫plc解密源碼,專業(yè)PLC解密師傅電話18520649527;提供三菱plc解密,臺達plc解密,西門子plc解密,信捷plc解密等各類PLC解密vb加密程序代碼例題及觸摸屏解密維修服務(wù), 【加微信:guanshiyou009】或者致電PLC解密師傅電話18520649527
? ?廣州龍躍自動化專業(yè)破解解密各類plc加密,全國24小時聯(lián)系手機:18520649527 【關(guān)技術(shù)】 微信:guanshiyou009如有任何問題請打手機或者添加微信,謝謝支持