每个人都有自己的知识体系。
Toggle navigation
Home
随笔
C#/.Net
树莓派 / Raspberry
皓月汉化组
Beego
Golang
OxideMod
apache
haproxy
windows
Java
Objective-C
日语/罗马音歌词/日语常识
MongoDB
python
电学
公告
Minecraft服务器-公告
NanoPi
C4D (CINEMA 4D)
生活
推流/m3u8/rtmp/rtsp
Unity3d
ffmpeg
数据结构
区块链
tarui
UnityForPSVita
About Me
Archives
Tags
CPUID
2017-01-11 16:35:43
163
0
0
akiragatsu
using System; using System.Runtime.InteropServices; namespace CrtAsmOfEmbeded_x86 { static partial class Program { [DllImport("kernel32.dll", SetLastError = true)] private static extern bool VirtualProtect(byte[] lpAddress, int dwSize, uint flNewProtect, out uint lpflOldProtect); [DllImport("user32.dll", SetLastError = true)] private static extern IntPtr CallWindowProc(byte[] lpPrevWndFunc, int hWnd, int Msg, int wParam, int lParam); private const int NULL = 0; private const int PAGE_EXECUTE_READWRITE = 64; } static partial class Program { private static readonly byte[] buf_asm = { 85, 139, 236, 129, 236, 192, 0, 0, 0, 83, 86, 87, 141, 189, 64, 255, 255, 255, 185, 48, 0, 0, 0, 184, 204, 204, 204, 204, 243, 171, 184, 0, 0, 0, 0, 51, 210, 15, 162, 137, 85, 252, 137, 69, 248, 184, 1, 0, 0, 0, 51, 201, 51, 210, 15, 162, 137, 85, 244, 137, 69, 240, 139, 69, 252, 137, 69, 236, 139, 69, 248, 137, 69, 232, 139, 69, 244, 137, 69, 228, 139, 69, 240, 137, 69, 224, 141, 69, 236, 95, 94, 91, 139, 229, 93, 195 }; } static partial class Program { private static void VirtualProtect(byte[] address) { uint lpflOldProtect; VirtualProtect(address, address.Length, PAGE_EXECUTE_READWRITE, out lpflOldProtect); } } static partial class Program { private static string GetCPUID() { VirtualProtect(buf_asm); IntPtr ptr = CallWindowProc(buf_asm, NULL, NULL, NULL, NULL); int s1 = Marshal.ReadInt32(ptr); int s2 = Marshal.ReadInt32(ptr, 4); int s3 = Marshal.ReadInt32(ptr, 8); int s4 = Marshal.ReadInt32(ptr, 12); return s1.ToString("X") + s2.ToString("X") + s3.ToString("X") + s4.ToString("X"); } } static partial class Program { [STAThread] static void Main() { Console.WriteLine(GetCPUID()); Console.ReadKey(false); } } }
Pre:
查询语句
Next:
Themida.NET脱壳教程
0
likes
163
Weibo
Wechat
Tencent Weibo
QQ Zone
RenRen
Submit
Sign in
to leave a comment.
No Leanote account?
Sign up now.
0
comments
More...
Table of content
No Leanote account? Sign up now.