分类: Delphi
2011-05-05 00:00:58
;※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
; Random Icons.exe
;※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
; Author: Goly
; Email:
; QQ: 402295354
; Site:
;★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
; Core Code:
; 1.random随机数生成算法,直观感受随机数的魅力
;★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
.386
.model flat, stdcall
option casemap:none
include windows.inc
include user32.inc
include kernel32.inc
include gdi32.inc
includelib user32.lib
includelib kernel32.lib
includelib gdi32.lib
.const
.data
res_x dd 800
res_y dd 600
rnd_seed dd ?
h_icon dd ?
dc_screen dd ?
.code
rand proc
push ecx
push edx
mov eax,rnd_seed
mov ecx,eax
imul eax,41C64E6Dh
add eax,03039h
mov rnd_seed,eax
xor eax,ecx
pop edx
pop ecx
ret
rand endp
get_rnd_range proc
push ecx
push edx
mov ecx,eax
call rand
xor edx,edx
div ecx
mov eax,edx
pop edx
pop ecx
ret
get_rnd_range endp
start:
dw 310fh;rdtsc
mov rnd_seed,eax
push IDI_WARNING
xor eax,eax
push eax
call LoadIconA
or eax,eax
jz _exit
mov h_icon,eax
xor eax,eax
push eax
call GetDC
or eax,eax
jz _exit
mov dc_screen,eax
mov ecx,100h
_loop:
push eax
push ecx
mov edx,eax
push h_icon
mov eax,res_y
call get_rnd_range
push eax
mov eax,res_x
call get_rnd_range
push eax
push dc_screen
call DrawIcon
pop ecx
pop eax
loop _loop
_exit:
push 0
call ExitProcess
end start
修改自《Billy Belcebu Virus Writing Guide 1.00 for Win32》