作者:电脑信息网日期:
返回目录:电脑蓝屏
Private Declare Function SetProcessAffinityMask Lib "kernel32.dll" (ByVal hProcess As Integer, ByVal dwProcessAffinityMask As Long) As Boolean
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal Hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
'参数7a686964616fe58685e5aeb9337说明:Hwnd 窗口句柄 ,CpuSer 设置当前窗口在那个CPU上运行【CPU(0) 参数为 1,CPU(1) 参数为 2..其余自己琢磨】
Private Function SetCpu(ByVal Hwnd As Long, ByVal CpuSer As Long)
Dim pid, hProcess As Long
Process_All_Access = &H1F0FFF
Call GetWindowThreadProcessId(Hwnd, pid)
hProcess = OpenProcess(Process_All_Access, False, pid)
SetProcessAffinityMask hProcess, CpuSer
End Function
弄了一下午,麻烦楼主好评
用VBS的话不要有过多指望,只要人家能看到你的VBS代码,就可以知道你的加密方法。
不过你可以将VBS编译为exe。
如果可能,建议用AutoIt吧(帮助中自带示例)。
如果实在想要VBS的代码,可以参考下面这段。将数据转换为十六进制ASCII码。
Function GenerateCode(strText)
'输入字符串(strText),返回十六进制ANSI编码
Dim i
For i=1 to Len(strText)
GenerateCode = GenerateCode & Hex(Asc(Mid(strText,i,1)))
Next
End Function
Function GetText(strCode)
'输入十六进制ANSI编码(strCode),返回字符串原文
Dim i,strTmp
For i=1 to Len(strCode) Step 2
strTmp = "&h" & Mid(strCode,i,2)
If CInt(strTmp)<128 Then
GetText = GetText & Chr(strTmp)
Else
i = i + 2
GetText = GetText & Chr(strTmp & Mid(strCode,i,2))
End If
Next
End Function
以命令行方式运行脚本,可通过如下方法获取脚本参数e68a84e8a2ade799bee5baa6339(传入的数据)。
Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
WScript.Echo objArgs(I)
Next
这是VBS帮助里的原例子。
这几个API,看看吧GetProcessAffinityMask SetProcessAffinityMask SetThreadAffinityMask