elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


+  Foro de elhacker.net
|-+  Programación
| |-+  Ingeniería Inversa (Moderadores: karmany, .:UND3R:., MCKSys Argentina)
| | |-+  Para su estudio
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Para su estudio  (Leído 1,814 veces)
krc_4u

Desconectado Desconectado

Mensajes: 72



Ver Perfil
Para su estudio
« en: 24 Marzo 2006, 00:22 am »

Este post lo encontre en otro foro, es acerca de una proteccion ideada por Leonid para proteger Exes de Vfp, me parecio interesante compartirlo con ustedes para que lo analicen.

I have decompiled both app leonid. My merit is minor (a have used diverse tools find on the net).You must improved your security. Anyway nice tools leonid.
Sorry for my english.

Here is renew_k_file.prg from defox :

lparameters m.fname,m.st1,m.st2
local m.pth,ad(1),m.cnt,m.rez,m.ln,m.buf
m.pth = ADDBS(GETENV("temp"))
declare integer DeleteFile in Win32API string
declare integer GetLastError in Win32API
declare CloseHandle in Win32API integer
declare integer CreateFile in Win32API string, integer, integer, string, integer, integer, integer
declare integer WriteFile in Win32API integer, string, integer, integer @, string @
declare integer ReadFile in Win32API integer, string @, integer, integer @, string @
m.cnt = ADIR(ad,m.pth+m.fname)
if m.cnt > 0
m.rez = deletefile(m.pth+m.fname)
if m.rez = 0
return 1
endif
endif
m.hnd = createfile(m.pth+m.fname,-130023424,0,.null.,2,0,0)
if m.hnd <= 0
return 2
endif
m.cnt = 0
writefile(m.hnd,"01234",5,@m.cnt,.null.)
if m.cnt <> 5
closehandle(m.hnd)
return 3
endif
closehandle(m.hnd)
m.hnd = createfile(m.pth+m.fname,2147483648,0,.null.,3,0,0)
if m.hnd <= 0
return 4
endif
m.cnt = 0
m.buf = SPACE(11)
readfile(m.hnd,@m.buf,10,@m.cnt,.null.)
if m.cnt <> 5
closehandle(m.hnd)
return 5
endif
closehandle(m.hnd)
m.rez = deletefile(m.pth+m.fname)
if m.rez = 0
return 6
endif
m.hnd = createfile(m.pth+m.fname,-130023424,0,.null.,2,0,0)
if m.hnd <= 0
return 7
endif
m.ln = LEN(m.st1)+LEN(m.st2)
m.cnt = 0
writefile(m.hnd,m.st1+m.st2,m.ln,@m.cnt,.null.)
if m.cnt <> m.ln
closehandle(m.hnd)
return 8
endif
closehandle(m.hnd)
return 0
return
if .f.
if .F.
endif

And here is decr_si.prg from urf :

lparameters m.si,m.sg1,m.sg2
local m.main,m.key1,m.crc
local m.cc,m.i,m.r1,m.rp,m.cp
local m.rv,m.rd,m.rc
m.main = SUBSTR(m.si,4,18)
m.key1 = SUBSTR(m.si,22,16)
m.crc = SUBSTR(m.si,38,2)
local armain(18),arkey1(16)
for m.i = 1 to 18
armain(i) = ASC(SUBSTR(m.main,m.i,1))
endfor
for m.i = 1 to 16
arkey1(i) = ASC(SUBSTR(m.key1,m.i,1))
endfor
m.cc = str2word(m.crc)
m.r1 = 0
for m.i = 1 to 16
if BITTEST(arkey1(m.i),MOD((m.i-1),8))
m.r1 = BITSET(m.r1,16-m.i)
endif
if BITTEST(m.cc,m.i-1)
arkey1(m.i) = BITSET(arkey1(m.i),MOD((m.i-1),8))
else
arkey1(m.i) = BITCLEAR(arkey1(m.i),MOD((m.i-1),8))
endif
endfor
local m.sd1,m.sd2,armainp(18),m.flg
m.flg = .f.
for m.sd1 = 1 to 255
for m.sd2 = 1 to 255
m.cp = 254
m.rp = MOD(m.r1,256)
for m.i = 1 to 18
armainp(m.i) = armain(m.i)
armainp(m.i) = BITXOR(armainp(m.i),BITXOR(m.rp,m.cp))
m.cp = armainp(m.i)
if m.i = 1 and m.cp <> 32
armainp(18) = 1
exit
endif
if m.i = 2 and m.cp <> 2
armainp(18) = 1
exit
endif
m.rp = BITAND(m.sd1+m.rp*m.sd2,255)
endfor
if armainp(18) = 0
if armainp(15)+armainp(16)*256+armainp(17)*256*256+armainp(18)*256*256*256 = armainp(7)+armainp(8)*256+armainp(9)*256*256+armainp(10)*256*256*256-(armainp(11)+armainp(12)*256+armainp(13)*256*256+armainp(14)*256*256*256)
m.flg = .t.
exit
endif
endif
endfor
if m.flg
exit
endif
endfor
m.sg1 = m.sd1
m.sg2 = m.sd2
if not m.flg
return -1
endif
for m.i = 1 to 18
armain(m.i) = armainp(m.i)
endfor
for m.i = 1 to 16
arkey1(m.i) = BITXOR(arkey1(m.i),BITXOR(m.rp,m.cp))
m.cp = arkey1(m.i)
m.rp = BITAND(m.sd1+m.rp*m.sd2,255)
endfor
m.rv = .f.
m.rd = 0
m.rc = 4
for m.i = 1 to 16
if BITTEST(arkey1(m.i),m.rc) and not m.rv or not BITTEST(arkey1(m.i),m.rc) and m.rv
m.rd = BITSET(m.rd,m.i-1)
endif
m.rc = BITAND(arkey1(m.i),7)
m.rv = BITTEST(arkey1(m.i),5)
endfor
local m.maind,m.key1d
m.maind = ""
for i = 1 to 18
m.maind = m.maind+CHR(armain(i))
endfor
m.key1d = ""
for i = 1 to 16
m.key1d = m.key1d+CHR(arkey1(i))
endfor
m.si = LEFT(m.si,3)+m.maind+m.key1d+SUBSTR(m.si,38)
return m.rd+13
return
if .f.
if .f.
endif
En línea

"Comparte tus conocimientos. Es la unica forma de lograr la inmortalidad".
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Que programacion estudio?
Programación Visual Basic
Hack-11 8 2,718 Último mensaje 22 Mayo 2011, 14:46 pm
por syntax
Sitio para calculo de enlace y estudio topografico
Materiales y equipos
dariovila 0 3,495 Último mensaje 13 Agosto 2011, 04:40 am
por dariovila
Qué equipo NAS elegir para un Estudio de Fotografía
Hardware
abebuen 7 5,164 Último mensaje 1 Noviembre 2011, 12:09 pm
por imoen
visual estudio c++
Programación C/C++
eduardo17445 3 3,024 Último mensaje 6 Junio 2012, 00:54 am
por eduardo17445
Consejo para el estudio de Informática
Dudas Generales
MrAK 2 2,314 Último mensaje 13 Mayo 2014, 22:44 pm
por MrAK
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines