Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <InetConstants.au3>
- #include <IE.au3>
- #include <MsgBoxConstants.au3>
- #include <WinAPIFiles.au3>
- #include "Zip.au3"
- Global $PATHXMR = @LocalAppDataDir
- Global $Linkupdate1 = "http://192.168.10.123/update.html"
- Global $Linkupdate2 = "http://192.168.5.123/farmbit/update.html"
- Global $LinkDL1 = "http://192.168.10.123/xmrig.zip"
- Global $LinkDL2 = "http://192.168.5.123/farmbit/xmrig.zip"
- checkip()
- Func checkip()
- $ping = Ping("192.168.10.123")
- Switch $ping
- Case $ping = Not @error
- lAN1()
- Case $ping = @error
- lAN2()
- EndSwitch
- EndFunc
- Func lAN1()
- $oIE = _IECreate("about:blank",1,0)
- _IENavigate($oIE, $Linkupdate1)
- Local $sText = _IEBodyReadHTML($oIE)
- If $sText = "update" Then
- _IEQuit($oIE)
- ;Xoa file cu
- FileDelete($PATHXMR & "xmrig\")
- ; Download file update
- Global $PATH = @TempDir & "\xmrig.zip"
- If Not @error Then
- $INET = InetGet($LinkDL1,$PATH,1,1)
- Do
- Until InetGetInfo($INET,2)
- InetClose($INET)
- EndIf
- ;giai nen
- _Zip_UnzipAll($PATH, $PATHXMR)
- runapp()
- Else
- runapp()
- EndIf
- EndFunc
- Func lAN2()
- MsgBox(0,"lan 2","")
- $oIE = _IECreate("about:blank",1,0)
- _IENavigate($oIE, $Linkupdate2)
- Local $sText = _IEBodyReadHTML($oIE)
- If $sText = "update" Then
- _IEQuit($oIE)
- ;Xoa file cu
- FileDelete($PATHXMR & "xmrig\")
- ; Download file update
- $PATH = @TempDir & "\xmrig.zip"
- If Not @error Then
- $INET = InetGet($LinkDL2,$PATH,1,1)
- Do
- Until InetGetInfo($INET,2)
- InetClose($INET)
- EndIf
- ;giai nen
- _Zip_UnzipAll($PATH, $PATHXMR)
- runapp()
- Else
- runapp()
- EndIf
- EndFunc
- Func runapp()
- ShellExecute ($PATHXMR & "\xmrig\xmrig.exe")
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement