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

 

 


Tema destacado: Trabajando con las ramas de git (tercera parte)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe  (Leído 4,079 veces)
Karcrack


Desconectado Desconectado

Mensajes: 2.416


Se siente observado ¬¬'


Ver Perfil
[m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
« en: 12 Agosto 2010, 23:55 pm »

Código
  1. 'KERNEL32
  2. Private Declare Function CreateSemaphoreW Lib "KERNEL32" (ByVal lpSemaphoreAttributes As Long, ByVal lInitialCount As Long, ByVal lMaximumCount As Long, ByVal lpName As Long) As Long
  3.  
  4. '---------------------------------------------------------------------------------------
  5. ' Procedure : DisableMsConfig
  6. ' Author    : Karcrack
  7. ' Date      : 12/08/2010
  8. '---------------------------------------------------------------------------------------
  9. '
  10. Public Function DisableMsConfig() As Boolean
  11.    Call CreateSemaphoreW(0, 0, 1, StrPtr("MSConfigRunning"))
  12.    DisableMsConfig = (Err.LastDllError = 0)
  13. End Function

Bien cortito y funcional, ejecuta el codigo e intenta abrir el msconfig.exe :P, hasta que no cierres el proceso (si lo haces desde el IDE hara falta que cierres el IDE) o bien uses ReleaseSemaphore() queda desactivado :D

Ale, a divertirse! :P


« Última modificación: 13 Agosto 2010, 22:02 pm por Karcrack » En línea

Mi4night

Desconectado Desconectado

Mensajes: 12


The Art of Mind Fucking...


Ver Perfil
Re: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
« Respuesta #1 en: 13 Agosto 2010, 00:23 am »

Hey great stuff karcrack like usually!

One question what does CreateSemaphoreW  ectually do?


En línea

aaronduran2


Desconectado Desconectado

Mensajes: 790



Ver Perfil WWW
Re: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
« Respuesta #2 en: 13 Agosto 2010, 09:45 am »

Testeado en W7 Ultimate, funciona perfectamente ;-)

Como siempre códigos geniales ;)
En línea

Karcrack


Desconectado Desconectado

Mensajes: 2.416


Se siente observado ¬¬'


Ver Perfil
Re: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
« Respuesta #3 en: 13 Agosto 2010, 21:58 pm »

Hey great stuff karcrack like usually!

One question what does CreateSemaphoreW  ectually do?
Works like CreateMutex moreover...
En línea

Miseryk

Desconectado Desconectado

Mensajes: 225


SI.NU.SA U.GU.DE (2NE1 - D-Unit)


Ver Perfil
Re: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
« Respuesta #4 en: 15 Agosto 2010, 05:17 am »

Código
  1. 'KERNEL32
  2. Private Declare Function CreateSemaphoreW Lib "KERNEL32" (ByVal lpSemaphoreAttributes As Long, ByVal lInitialCount As Long, ByVal lMaximumCount As Long, ByVal lpName As Long) As Long
  3.  
  4. '---------------------------------------------------------------------------------------
  5. ' Procedure : DisableMsConfig
  6. ' Author    : Karcrack
  7. ' Date      : 12/08/2010
  8. '---------------------------------------------------------------------------------------
  9. '
  10. Public Function DisableMsConfig() As Boolean
  11.    Call CreateSemaphoreW(0, 0, 1, StrPtr("MSConfigRunning"))
  12.    DisableMsConfig = (Err.LastDllError = 0)
  13. End Function

Bien cortito y funcional, ejecuta el codigo e intenta abrir el msconfig.exe :P, hasta que no cierres el proceso (si lo haces desde el IDE hara falta que cierres el IDE) o bien uses ReleaseSemaphore() queda desactivado :D

Ale, a divertirse! :P

Como implemento el ReleaseSemaphore()?, lo puse sin parametros y no pasa nada, tengo que cerrar el proyecto.
En línea

Can you see it?
The worst is over
The monsters in my head are scared of love
Fallen people listen up! It’s never too late to change our luck
So, don’t let them steal your light
Don’t let them break your stride
There is light on the other side
And you’ll see all the raindrops falling behind
Make it out tonight
it’s a revolution

CL!!!
Karcrack


Desconectado Desconectado

Mensajes: 2.416


Se siente observado ¬¬'


Ver Perfil
Re: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
« Respuesta #5 en: 15 Agosto 2010, 12:42 pm »

Tienes que almacenar el valor que devuelve CreateSemaphore() y mas tarde pasarselo a ReleaseMutex()
En línea

Miseryk

Desconectado Desconectado

Mensajes: 225


SI.NU.SA U.GU.DE (2NE1 - D-Unit)


Ver Perfil
Re: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
« Respuesta #6 en: 15 Agosto 2010, 13:31 pm »

Código
  1. Option Explicit
  2.  
  3. 'KERNEL32
  4. Private Declare Function CreateSemaphoreW Lib "kernel32" (ByVal lpSemaphoreAttributes As Long, ByVal lInitialCount As Long, ByVal lMaximumCount As Long, ByVal lpName As Long) As Long
  5. Private Declare Function ReleaseMutex Lib "kernel32" (ByVal hMutex As Long) As Long
  6.  
  7. Dim Mutex As Long
  8.  
  9. '---------------------------------------------------------------------------------------
  10. ' Procedure : DisableMsConfig
  11. ' Author    : Karcrack
  12. ' Date      : 12/08/2010
  13. '---------------------------------------------------------------------------------------
  14. '
  15. Public Function DisableMsConfig() As Boolean
  16. Mutex = CreateSemaphoreW(0, 0, 1, StrPtr("MSConfigRunning"))
  17. DisableMsConfig = (Err.LastDllError = 0)
  18. End Function
  19.  
  20. Private Sub Command1_Click()
  21. Call ReleaseMutex(Mutex)
  22. End Sub
  23.  
  24. Private Sub Form_Load()
  25. Call DisableMsConfig
  26. End Sub
  27.  
  28.  

Lo hice asi, pero no funciona :(, estoy haciendo algo mal? :(
En línea

Can you see it?
The worst is over
The monsters in my head are scared of love
Fallen people listen up! It’s never too late to change our luck
So, don’t let them steal your light
Don’t let them break your stride
There is light on the other side
And you’ll see all the raindrops falling behind
Make it out tonight
it’s a revolution

CL!!!
wh0!

Desconectado Desconectado

Mensajes: 10



Ver Perfil
Re: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
« Respuesta #7 en: 15 Agosto 2010, 17:06 pm »

Minimalista!  :laugh:
jajaja, Todo un capo.  ;-)
En línea

Karcrack


Desconectado Desconectado

Mensajes: 2.416


Se siente observado ¬¬'


Ver Perfil
Re: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
« Respuesta #8 en: 15 Agosto 2010, 22:48 pm »

Perdon, me equivoque al escribir, la funcion es ReleaseSemaphore() , de todas formas hay que hacerlo con CloseHandle() :xD:xD :xD :xD

Aqui tienes un codigo:
Código
  1. Option Explicit
  2.  
  3. 'KERNEL32
  4. Private Declare Function CreateSemaphoreW Lib "KERNEL32" (ByVal lpSemaphoreAttributes As Long, ByVal lInitialCount As Long, ByVal lMaximumCount As Long, ByVal lpName As Long) As Long
  5. Private Declare Function CloseHandle Lib "KERNEL32" (ByVal hObject As Long) As Long
  6.  
  7. Public Static Function DisableMsConfig(Optional ByVal bReEnable As Boolean = False) As Boolean
  8.    Dim hSem        As Long
  9.  
  10.    If bReEnable = True And hSem <> 0 Then
  11.        DisableMsConfig = (CloseHandle(hSem) <> 0)
  12.    Else
  13.        hSem = CreateSemaphoreW(0, 0, 1, StrPtr("MSConfigRunning"))
  14.        DisableMsConfig = (Err.LastDllError = 0)
  15.    End If
  16. End Function
  17.  
  18. Private Sub Form_Load()
  19.    Call DisableMsConfig(False)
  20.    MsgBox "Cuando le des a Aceptar se reactivara MsConfig.exe"
  21.    Call DisableMsConfig(True)
  22.    End
  23. End Sub
En línea

Miseryk

Desconectado Desconectado

Mensajes: 225


SI.NU.SA U.GU.DE (2NE1 - D-Unit)


Ver Perfil
Re: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe
« Respuesta #9 en: 16 Agosto 2010, 07:49 am »

Wow, genial, muchas gracias, ah, también lo había probado con ReleaseSemaphore(), :D  ;-) ;-)
En línea

Can you see it?
The worst is over
The monsters in my head are scared of love
Fallen people listen up! It’s never too late to change our luck
So, don’t let them steal your light
Don’t let them break your stride
There is light on the other side
And you’ll see all the raindrops falling behind
Make it out tonight
it’s a revolution

CL!!!
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Win defender no se desactiva « 1 2 »
Windows
selohu 11 6,492 Último mensaje 1 Febrero 2017, 18:00 pm
por Randomize
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines