⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dllinterface.cs

📁 非常著名的PE文件压缩引擎
💻 CS
字号:
//
// aPLib compression library  -  the smaller the better :)
//
// C# wrapper
//
// Copyright (c) 1998-2005 by Joergen Ibsen / Jibz
// All Rights Reserved
//
// http://www.ibsensoftware.com/
//

namespace IbsenSoftware.aPLib
{
	using System.Runtime.InteropServices;

	public class DllInterface
	{
		// declare delegate type used for compression callback
		public delegate int CompressionCallback(
			int length,
			int slen,
			int dlen,
			int cbparam
		);

		[DllImport("aplib.dll")]
		public static extern int aP_pack(
			[In]  byte[] source,
			[Out] byte[] destination,
			      int length,
			[In]  byte[] workmem,
			      CompressionCallback callback,
			      int cbparam
		);

		[DllImport("aplib.dll")]
		public static extern int aP_workmem_size(int length);

		[DllImport("aplib.dll")]
		public static extern int aP_max_packed_size(int length);

		[DllImport("aplib.dll")]
		public static extern int aP_depack_asm(
			[In]  byte[] source,
			[Out] byte[] destination
		);

		[DllImport("aplib.dll")]
		public static extern int aP_depack_asm_fast(
			[In]  byte[] source,
			[Out] byte[] destination
		);

		[DllImport("aplib.dll")]
		public static extern int aP_depack_asm_safe(
			[In]  byte[] source,
			      int srclen,
			[Out] byte[] destination,
			      int dstlen
		);

		[DllImport("aplib.dll")]
		public static extern int aP_crc32([In] byte[] source, int length);

		[DllImport("aplib.dll")]
		public static extern int aPsafe_pack(
			[In]  byte[] source,
			[Out] byte[] destination,
			      int length,
			[In]  byte[] workmem,
			      CompressionCallback callback,
			      int cbparam
		);

		[DllImport("aplib.dll")]
		public static extern int aPsafe_check([In] byte[] source);

		[DllImport("aplib.dll")]
		public static extern int aPsafe_get_orig_size([In] byte[] source);

		[DllImport("aplib.dll")]
		public static extern int aPsafe_depack(
			[In]  byte[] source,
			      int srclen,
			[Out] byte[] destination,
			      int dstlen
		);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -