Jump to content
Tuts 4 You

PELock DialogBox

Sean Park - Lovejoy

1 Screenshot

It's a PELock'ed file. Try to unpack it if you have time, if you are a skilled code reverser or the author, you maybe can do it.

Thank you for your effort in advance.

.model flat, stdcall
option casemap:none

include     		kernel32.inc
includelib 	kernel32.lib
include		windows.inc
include		user32.inc
includelib		user32.lib
includelib		gdi32.lib
include		gdi32.inc


WindowTitle	db	"This is the text of our window",0
EditText		db	"This is the text of the editbox",0

icon			equ	1
cursor		equ	2

font	LOGFONT	<-18,0,0,0,FW_NORMAL, FALSE, FALSE,FALSE,0,3,2,1,34,"Impact">

hInstance	HINSTANCE	?

hCursor	dd	?
hFont	dd	?
hBrush	dd	?



invoke GetModuleHandle, NULL
mov hInstance, eax
invoke DialogBoxParam, hInstance, 1001, NULL, Addr DlgProc, NULL
invoke ExitProcess,0

DlgProc Proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM

.if uMsg == WM_COMMAND
	mov eax, wParam
	.if eax == 1003
	.elseif eax == 1004
	invoke SendMessage, hWnd, WM_CLOSE, 0, 0

.elseif uMsg == WM_INITDIALOG
	invoke SetWindowText, hWnd, Addr WindowTitle
	invoke SetDlgItemText, hWnd, 1002, Addr EditText

	invoke LoadImage, hInstance, icon,IMAGE_ICON, 0, 0, LR_SHARED
	invoke SendMessage, hWnd, WM_SETICON, ICON_SMALL,eax
	invoke LoadImage, hInstance, cursor, IMAGE_CURSOR, 0, 0, LR_SHARED
	mov hCursor, eax
	invoke CreateFontIndirect, Addr font
	mov hFont, eax
	invoke GetDlgItem, hWnd, 1002
	invoke SendMessage, eax, WM_SETFONT, hFont, 0
	invoke CreateSolidBrush, 13447834
	mov hBrush,eax
	invoke GetDlgItem, hWnd, 1003
	invoke EnableWindow, eax, TRUE
.elseif uMsg == WM_CTLCOLORDLG
	mov eax, hBrush
.elseif uMsg == WM_CTLCOLOREDIT
	invoke SetTextColor, wParam, Red
	invoke SetBkMode, wParam, TRANSPARENT
	invoke GetSysColorBrush, COLOR_WINDOW
.elseif uMsg == WM_SETCURSOR
	invoke SetCursor, hCursor

.elseif uMsg == WM_CLOSE
	invoke EndDialog, hWnd, NULL
	mov eax, FALSE
	mov eax, TRUE
DlgProc endp

End Start

I have tried but... still can't.

User Feedback

Recommended Comments

There are no comments to display.

  • Create New...