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

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 7 [8] 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ... 127
71  Programación / Programación C/C++ / Re: Ayuda con codigo C++ en: 6 Abril 2011, 03:09 am
Existe algo llamado GESHI
72  Seguridad Informática / Análisis y Diseño de Malware / Re: Ayuda para analizar lo que hace este virus. en: 5 Abril 2011, 20:51 pm
Una recomendacion para cuando vayas a subir un Virus para analisis... colocale contraseña, preferiblemente INFECTED.
73  Programación / Programación C/C++ / Re: C++ cin ?? en: 3 Abril 2011, 20:23 pm
Se me ocurriria utilizar Cin.get() y conio.h para utilizar gotoxy()
74  Programación / Programación C/C++ / Re: Practicando con fstream en: 3 Abril 2011, 16:12 pm
Xafi un consejo... cuando crees una funcion para que esta sea verdaderamente util no puede utilizar y/o modificar valores globales dentro del cuerpo de esta.
75  Seguridad Informática / Análisis y Diseño de Malware / [SRC][C++/ASM] ClsAntiDebug en: 3 Abril 2011, 07:17 am
 Aqui les traigo una clase para colocar mecanismos contra Debuggers en nuestros codigos de una forma rapida y sencilla. Los metodos estan claros y simplemente se deben utilizar depende el metodo que deseemos utilizar para detectar los Debuggers. Estan integrados los metodos de deteccion a traves del PEB, del NTGlobal, utilizando los nombres comunes de los procesos de OllyDBG, IDA Pro y Win32DASM. En el metodo TimeStamp deben verificar antes de dar un valor el tiempo que dura la funcion que toma como segundo parametro. Tenemos otro metodo que es el metodo Protect, el cual toma una funcion y verifica con los tres primeros metodos de deteccion para verificar que no estan siendo Debuggeados, de caso contrario ejecutara una funcion que toma como parametro.

Como lo prometido es deuda aqui van los codigos:

Código
  1. #ifndef __ClsAntiDebug__
  2. #define __ClsAntiDebug__
  3. #include <windows.h>
  4. #include <tlhelp32.h>
  5.  
  6. class ClsAntiDebug
  7. {
  8. private:
  9. bool Debugged;
  10. public:
  11. ClsAntiDebug();
  12. void __declspec() PEBDebug();
  13. void __declspec() NTGlobalDebug();
  14. void __declspec() DebuggerActive();
  15. void __declspec() TimeStamp(int time, void *func);
  16. void Protect(void *func);
  17. bool IsDebugged();
  18. };
  19. #endif

Aqui debajo estan las declaraciones de los metodos en la clase:

Código
  1. #include "AntiDebug.h"
  2.  
  3. ClsAntiDebug::ClsAntiDebug()
  4. {
  5. this->Debugged=false;
  6. }
  7.  
  8. bool ClsAntiDebug::IsDebugged()
  9. {
  10. return this->Debugged;
  11. }
  12.  
  13. void __declspec() ClsAntiDebug::PEBDebug()
  14. {
  15. __asm
  16. {
  17. _PEBLoop:
  18. push 500
  19. call dword ptr ds:[Sleep]
  20. xor edx, edx
  21. mov dl,0x30
  22. mov esi, fs:[edx]
  23. movzx eax, byte ptr[esi+2]
  24. dec eax
  25. jne _PEBLoop
  26. inc eax
  27. }
  28. this->Debugged = true;
  29. }
  30.  
  31. void __declspec() ClsAntiDebug::NTGlobalDebug()
  32. {
  33. __asm
  34. {
  35. _NTLoop:
  36. push 500
  37. call dword ptr ds:[Sleep]
  38. xor edx, edx
  39. mov dl,0x30
  40. mov esi, fs:[edx]
  41. movzx eax, byte ptr[esi+0x68]
  42. and eax,eax
  43. je _NTLoop
  44. xor eax,eax
  45. inc eax
  46. }
  47. this->Debugged = true;
  48. }
  49.  
  50. void __declspec() ClsAntiDebug::DebuggerActive()
  51. {
  52. HANDLE hProcSnap;
  53. PROCESSENTRY32 pProcess;
  54. LPTSTR Exename;
  55. int strlength;
  56. int deb[3]={18416231/*IDA Pro*/,997340682/*W32DASM*/,1853255255/*OllyDbg*/};
  57. int i;
  58. do
  59. {
  60. hProcSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
  61. pProcess.dwSize = sizeof(PROCESSENTRY32);
  62. Process32First(hProcSnap,&pProcess);
  63. do
  64. {
  65. strlength = strlen(pProcess.szExeFile);
  66. __asm
  67. {
  68. lea eax,[pProcess.szExeFile]
  69. mov ecx,dword ptr[strlength]
  70. xor edx,edx
  71. xor edi, edi
  72. push edi
  73. gethash:
  74. pop edi
  75. xor dl, byte ptr[eax+edi]
  76. rol edx,8
  77. inc edi
  78. push edi
  79. xor edi,ecx
  80. jne gethash
  81. mov [strlength],edx/*We don't need strlength, so we recycle to get
  82.     The Hash on Int Variable*/
  83. pop edi
  84. }
  85. for(i=0;i<3;i++)if (strlength==deb[i])
  86. {
  87. this->Debugged = true;
  88. __asm{jmp ___end}
  89. }
  90. }while(Process32Next(hProcSnap,&pProcess));
  91. Sleep(500);
  92. }while(1);
  93. __asm
  94. {___end:}
  95. }
  96. void __declspec() ClsAntiDebug::Protect(void *func)
  97. {
  98.  
  99. do
  100. {
  101. switch(GetTickCount()%4)
  102. {
  103. case 0:this->PEBDebug();break;
  104. case 1:this->NTGlobalDebug();break;
  105. case 2:this->DebuggerActive();break;
  106. };
  107. if (this->Debugged)
  108. {
  109. __asm
  110. {
  111. call [func]
  112. }
  113. }
  114. Sleep(500);
  115. }while(1);
  116. }
  117.  
  118. void __declspec() ClsAntiDebug::TimeStamp(int time,void *func)
  119. {
  120. __asm
  121. {
  122. rdtsc
  123. mov ebx,eax
  124. call [func]
  125. rdtsc
  126. sub eax, ebx
  127. cmp eax, [time]
  128. jna ___rtend
  129. }
  130. this->Debugged = true;
  131. __asm{___rtend: }
  132. }

Aqui tenemos una muestra de como utilizar la clase:

Código
  1. #pragma comment(linker,"/ENTRY:main")
  2.  
  3. #include "AntiDebug.h"
  4. void CALLBACK HolaMundo()
  5. {
  6. int i;
  7. i++;
  8. i++;
  9. }
  10.  
  11. int __declspec() main()
  12. {
  13.  
  14. ClsAntiDebug *Debugger=new(ClsAntiDebug);
  15. Debugger->TimeStamp(200,HolaMundo);
  16. if (Debugger->IsDebugged())MessageBox(0,"Hola","Mundo",0);
  17. Debugger->Protect(HolaMundo);
  18. return 0;
  19. }
76  Foros Generales / Foro Libre / Re: Dime dónde vives y te diré cuál es el tamaño que tiene tu pene en: 26 Marzo 2011, 15:41 pm
... ya me estan fastidiando, cambienle el nombre a la comunidad a elpene.net si van a seguir con el tema
77  Seguridad Informática / Análisis y Diseño de Malware / Re: Problema con Norton en: 23 Marzo 2011, 18:53 pm
Este Post lo han borrado 3 veces en el dia...
78  Programación / .NET (C#, VB.NET, ASP) / [SRC/VB.Net]Ec2Solver en: 18 Marzo 2011, 03:53 am
Soluciona Ecuaciones de 2do Grado... contiene un modulo el cual cree especialmente para esta ocasion.

Modulo Ec2Solver
Código
  1. Module Ec2Solver
  2.    '*----------------------------------------------------------------------------------------------*
  3.    '| Author: [L]ord [R]NA                                                                         |
  4.    '| Country: Dominican Republic                                                                  |
  5.    '*----------------------------------------------------------------------------------------------*
  6.    ' Description: A Module to solve 2nd Degree Equations. The Module Ec2Solver has a Function that |
  7.    ' Get the First 3 constant value of the equation And 2 Double Variables are public in the module|
  8.    ' to get the possible values of X. If everything is Ok the Function return True and if it's     |
  9.    ' something wrong Return False.                                                                 |
  10.    '*----------------------------------------------------------------------------------------------*
  11.    '|Website: http://lordrna.co.cc/ http://foro.h-sec.org/                                         |
  12.    '|Mail: lordrna@h-sec.org                                                                       |
  13.    '*----------------------------------------------------------------------------------------------*
  14.    Public X1 As Double, X2 As Double
  15.    Dim A1 As Double, B1 As Double, C1 As Double
  16.  
  17.    Public Function Ec2Solver(ByVal A As String, ByVal B As String, ByVal C As String) As Boolean
  18.        If Double.TryParse(A, A1) And Double.TryParse(B, B1) And Double.TryParse(C, C1) Then
  19.            Ec2Solver = Ec2Solver(A1, B1, C1)
  20.        Else
  21.            Ec2Solver = False
  22.        End If
  23.    End Function
  24.  
  25.    Public Function Ec2Solver(ByVal A As Double, ByVal B As Double, ByVal C As Double) As Boolean
  26.  
  27.        Dim temp As Double
  28.        X1 = 0
  29.        X2 = 0
  30.        If A = 0 Then Ec2Solver = False
  31.        If B = 0 And A <> 0 Then
  32.            If C / A > 0 Then
  33.                Ec2Solver = False
  34.            Else
  35.                If C = 0 Then
  36.                    Ec2Solver = True
  37.                Else
  38.                    X1 = -System.Math.Sqrt(System.Math.Abs(C / A))
  39.                    X2 = System.Math.Sqrt(System.Math.Abs(C / A))
  40.                    Ec2Solver = True
  41.                End If
  42.            End If
  43.        ElseIf C = 0 Then
  44.            X1 = B / A
  45.            Ec2Solver = True
  46.        Else
  47.            temp = (System.Math.Pow(B, 2)) - 4 * A * C
  48.            If temp < 0 Then
  49.                Ec2Solver = False
  50.            Else
  51.                temp = System.Math.Sqrt(temp) / (2 * A)
  52.                X1 = -B + temp
  53.                X2 = -B - temp
  54.                Ec2Solver = True
  55.            End If
  56.        End If
  57.  
  58.    End Function
  59. End Module
  60.  

Source
Código
  1. Public Class Form1
  2.  
  3.    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4.        A.Clear()
  5.        B.Clear()
  6.        C.Clear()
  7.        X1.Clear()
  8.        X2.Clear()
  9.    End Sub
  10.  
  11.    Private Sub A_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles A.Click
  12.        A.Text = ""
  13.    End Sub
  14.  
  15.    Private Sub B_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles B.Click
  16.        B.Text = ""
  17.    End Sub
  18.  
  19.    Private Sub C_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles C.Click
  20.        C.Text = ""
  21.    End Sub
  22.  
  23.    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  24.        If Len(A.Text) = 0 Or A.Text = "0" Then A.Text = "1"
  25.        If Len(B.Text) = 0 Then B.Text = "0"
  26.        If Len(C.Text) = 0 Then C.Text = "0"
  27.  
  28.        If Ec2Solver.Ec2Solver(A.Text, B.Text, C.Text) = True Then
  29.            X1.Text = Str(Ec2Solver.X1)
  30.            X2.Text = Str(Ec2Solver.X2)
  31.        Else
  32.            X1.Text = "Sin Solucion"
  33.            X2.Text = "Real"
  34.        End If
  35.    End Sub
  36. End Class
79  Programación / Ejercicios / Re: Solución ejercicio C 107 en: 18 Marzo 2011, 03:51 am
... al parecer no me entendiste, en C se necesita utilizar Malloc para crear Arrays dinamicos, en C++ los puedes crear simplemente asignando un valor a una variable X y luego declarando un array al cual le pasas la variable como cantidad de elementos... lo ultimo es lo que estas haciendo en el codigo.
80  Programación / Ejercicios / Re: Solución ejercicio C 107 en: 15 Marzo 2011, 16:40 pm
Código
  1. int numeros[cantidad]; //Aca se almacenan los numeros como se introducen
  2.    int resultado[cantidad]; //Aca es donde se ordenan

Estas lineas solo son validas en C++, aparte estas utilizando cstdlib y cstdio por lo tanto estas atacando el problema desde C++ y no desde C.
Páginas: 1 2 3 4 5 6 7 [8] 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ... 127
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines