自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

记事本

记录了一些日常中碰到的问题或经验。

  • 博客(1)
  • 资源 (4)
  • 收藏
  • 关注

原创 .Net并行处理之Parallel类

C#并行处理之Parallel0x00 简介0x01 命名空间Parallel 所在的命名空间是 System.Threading.Tasks,看名字就知道与线程,任务有关。使用时 using System.Threading.Tasks;即可使用Parallel类的方法0x02 并行方法Parallel对象提供了3种方法来实现 数据和任务的并行Parallel.ForParal...

2019-05-09 16:27:28 3205

C# 优雅的 APIHOOK 支持X86+X64源码

using System; using System.Runtime.InteropServices; namespace NativeHook.Test { public delegate Int32 MessageBoxW(IntPtr hWnd, [MarshalAs(UnmanagedType.LPWStr)] string lpText, [MarshalAs(UnmanagedType.LPWStr)] string lpCaption, UInt32 uType); public class MessageBoxHook : NtAPIHook { [DllHook("user32", EntryPoint = "MessageBoxW")] public Int32 MessageBox(IntPtr owner, string text, string caption, UInt32 options) { //拦截信息 Console.Title = caption; Console.WriteLine(text); //调用源函数 return Origin.Invoke(owner, text, caption, options); } } } [STAThread] static void Main(string[] args) { using (var hook = new MessageBoxHook()) { //绕过Hook直接调用源函数 hook.Origin(IntPtr.Zero, "111", "222", 0); //调用Api 被Hook MessageBox.Show("Hello world", "666", MessageBoxButtons.YesNoCancel); } //Hook解除拦截不到 MessageBox.Show("Hello world", "666", MessageBoxButtons.YesNoCancel); }

2018-09-21

C# 从内存加载动态链接库

纯C# 实现的 从内存加载动态链接库,支持加壳的DLL,使用方便 class Program { public delegate Int32 CompressHandle(ref Byte dest,ref Int32 len, Byte [] source,Int32 sourcelen); static void Main(string[] args) { Byte[] source = new byte[10000]; Byte[] dest = new byte[10000]; Int32 len = source.Length; Byte[] dllBin = File.ReadAllBytes("zlib1.dll"); using (var dll = new DllLoader()) { if (dll.LoadLibrary(dllBin)) { var Compress = dll.GetProcDelegate("compress"); if (Compress != null) { var result = Compress.Invoke(ref dest[0], ref len, source, len); Console.WriteLine(result); } } } } }

2018-09-08

Vb6 InLineHook(通用版)

Vb6 开发的 InLineHook (APIHook) 兼容 XP WIN7 SERVER2003 WIN2000 源码

2013-03-11

Obj文档解析

解析M$的Obj文档,Vb生成的 Obj文档,功能齐全 可编辑 源码

2013-03-10

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除