Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as text by 0xIvan32 ( 17 years ago )
format PE GUI 4.0
entry MyEntry

include 'C:INCLUDEWin32a.inc'

section '.data' data readable writeable

gIst 	dd 0
gWnd 	dd 0
startLo dd 0
endLo 	dd 0
szText db 80h dup(0)
szTest0 db 1000h dup(100)
szTest1 db 1000h dup(111)
section '.code' code readable executable

MyEntry:
	invoke GetModuleHandle,eax
	mov [gIst],eax
	invoke DialogBoxParam,eax,1,0,DlgProc,0 
ExitApp:
	invoke ExitProcess,0

proc DlgProc,hWnd,uMsg,wParam,lParam
	push edi esi ebx
	mov eax,[uMsg]
	cmp	eax,WM_COMMAND
	je	jCOMMAND
	cmp	eax,WM_INITDIALOG
	je	jINITDIALOG
	cmp	eax,WM_CLOSE
	je	jCLOSE
	xor eax,eax
	jmp finish

jINITDIALOG:
	mov eax,[hWnd]
	mov [gWnd],eax
	call Compare
	mov eax,1
	jmp finish
	
jCOMMAND:
	mov eax,[wParam]
	cmp	eax,1000
	je	a1000
	xor eax,eax
	jmp finish
	
a1000:
	invoke SendMessage,[hWnd],WM_CLOSE,0,0
	mov eax,1
	jmp finish
	
jCLOSE:	
	invoke EndDialog,[hWnd],0
	mov eax,1
	
finish:
	pop ebx esi edi
	ret
endp
proc Compare  
	mov esi,szTest0
	mov edi,szTest1
	mov ecx,1000h
	rdtsc
	mov [startLo],eax
	repne mov eax,ebx
	rdtsc
	sub eax,[startLo]
	mov [endLo],eax
	invoke _itoa,[endLo],szText,10
	pop eax eax eax
	invoke MessageBox,0,szText,0,0
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	mov esi,szTest0
	mov edi,szTest1
	mov ecx,1000h
	rdtsc
	mov [startLo],eax
	repne movsb
	rdtsc
	sub eax,[startLo]
	mov [endLo],eax
	invoke _itoa,[endLo],szText,10
	pop eax eax eax
	invoke MessageBox,0,szText,0,0
	ret
endp
section '.idata' import data readable writeable

  library kernel, 'KERNEL32.DLL',
	  user,   'USER32.DLL',
	  ntdll, 'NTDLL.DLL'
  import ntdll,
  	  _itoa,'_itoa'
  import  kernel,
	  GetModuleHandle,'GetModuleHandleA',
	  ExitProcess,	  'ExitProcess'

  import  user,
      MessageBox,'MessageBoxA',
	  DialogBoxParam, 'DialogBoxParamA',
	  EndDialog,	  'EndDialog',
	  SendMessage,	  'SendMessageA'

section '.rsrc' resource from 'TestUtility.res' data readable

 

Revise this Paste

Children: 6284
Your Name: Code Language: