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

📄 memio.asm

📁 Cracker终结者——提供最优秀的软件保护技术
💻 ASM
字号:
%include "vxdn.inc"
%include "win32n.inc"
%include "util.mac"


%ifndef MAKEDEP

global GetHeap
global GetMem
global FreeHeap
global FreeMem
global IsBadPtr


bits 32


segment _LTEXT

;HANDLE GetMem(DWORD SIZE)
;
; Allocate SIZE and return Handle (0 on failure).

GetHeap:
GetMem:
	push	ebp
	mov	ebp,esp
	push	edx
	push	ecx

%define SIZE ebp+8

	VMMCall	_HeapAllocate, dword [SIZE], byte HEAPZEROINIT

	pop	ecx
	pop	edx
	pop	ebp

%undef SIZE

	retn	4


;BOOL   FreeMem(HANDLE hMem)
;
; Free Block of memory and return TRUE on success.

FreeHeap:
FreeMem:
	push	ebp
	mov	ebp,esp
	push	edx
	push	ecx

%define hMem ebp+8

	VMMCall	_HeapFree, dword [hMem], byte 0

	pop	ecx
	pop	edx
	pop	ebp

%undef hMem

	retn	4


;BOOL   IsBadPtr(DWORD hBase, DWORD NbBytes)
;
; Check if NbBytes starting with hBase can be read.
; Return 0 if read can be performed.

IsBadPtr:
	push	ebp
	mov	ebp,esp
	push	edx
	push	ecx

%define hBase ebp+8
%define NbBytes ebp+12

	VMMCall	_Assert_Range, dword [hBase], dword [NbBytes], byte 0, byte 0, byte ASSERT_RANGE_NULL_BAD
	cmp	eax,byte 1
	sbb	eax,eax
	inc	eax

	pop	ecx
	pop	edx
	pop	ebp

%undef hBase
%undef NbBytes

	retn	8

%endif

⌨️ 快捷键说明

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