;Astroid.asm
;心脏线极坐标方程:r=a(1+cosθ)
;为什么我不画成红色的呢?
;因为我的心十多年前就已经变成灰色的了。
;有兴趣可以看看我下面个人主页里面的一篇文章:《我的心》。
;不足之处,敬请指导。
;QQ:112426112
;Email:leguanyuan at 126 dot com
;Homepage:http://correy.webs.com
.386
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
include user32.inc
includelib user32.lib
includelib kernel32.lib
include gdi32.inc
includelib gdi32.lib
.code
hInstance dd ?
hWinMain dd ?
stMsg MSG <>
szClassName db "correy",0
szCaptionMain db "made by correy",0
pwndclassex dd 48,3,offset liuchunli,0,0,0,0,0,6,0,offset szClassName,0
Ainc dd 0
x_offset dd 0bbh
y_offset dd 100h
temp dd 0
xnew dd 0
ynew dd 0
liuchunli proc hWnd,uMsg,wParam,lParam
LOCAL ps:PAINTSTRUCT,hdc:HDC
local Count:DWORD,base:DWORD,count:dword
local BCircRadius:DWORD,newradius:DWORD,BaseX:DWORD
.if uMsg == WM_CLOSE
invoke DestroyWindow,hWinMain
invoke PostQuitMessage,0
.elseif uMsg == WM_PAINT
invoke BeginPaint,hWinMain,addr ps
mov hdc,eax
invoke GetStockObject,NULL_BRUSH
invoke SelectObject,hdc,eax
mov count,0
mov BCircRadius,55h
mov BaseX,8bh
.while count < 720
finit
fldpi
mov temp,180
fimul Ainc
fidiv temp
fsincos
fimul BCircRadius
fistp xnew
fimul BCircRadius
fist ynew
fmul st,st
fild xnew
fiadd BCircRadius
fmul st(0),st(0)
faddp st(1),st(0)
fsqrt
fistp newradius
mov eax,BaseX
add eax,xnew
sub eax,newradius
mov ebx,y_offset
sub ebx,ynew
sub ebx,newradius
mov ecx,BaseX
add ecx,xnew
add ecx,newradius
mov edx,y_offset
sub edx,ynew
add edx,newradius
invoke Ellipse,hdc,eax,ebx,ecx,edx
inc Ainc
inc count
.endw
invoke EndPaint,hWinMain,addr ps
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
liuchunli endp
start:invoke GetModuleHandle,0
mov hInstance,eax
mov pwndclassex+20,eax
invoke LoadIcon,hInstance,1;其实这四行也可以去掉。
mov pwndclassex+24,eax
invoke LoadCursor,0,32512
mov pwndclassex+28,eax
invoke RegisterClassEx,addr pwndclassex
invoke CreateWindowEx,200h,offset szClassName,offset szCaptionMain,0Ca0000h,80000000h,80000000h,199h,512,0,0,hInstance,0
mov hWinMain,eax
invoke ShowWindow,hWinMain,1;不想显示这一两行也可以不要。
invoke UpdateWindow,hWinMain
again:invoke GetMessage,addr stMsg,0,0,0
cmp eax,0
je exit
invoke TranslateMessage,addr stMsg;这一行也可以去掉,特别是不处理字符信息,。
invoke DispatchMessage,addr stMsg
jmp again
exit:invoke ExitProcess,0
end start
;made at 2010.03.27
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)