Autor
|
Tema: [m][VB6][SNIPPET] DisableMsConfig - Desactiva Msconfig.exe (Leído 4,343 veces)
|
Karcrack
Desconectado
Mensajes: 2.416
Se siente observado ¬¬'
|
'KERNEL32 Private Declare Function CreateSemaphoreW Lib "KERNEL32" (ByVal lpSemaphoreAttributes As Long, ByVal lInitialCount As Long, ByVal lMaximumCount As Long, ByVal lpName As Long) As Long '--------------------------------------------------------------------------------------- ' Procedure : DisableMsConfig ' Author : Karcrack ' Date : 12/08/2010 '--------------------------------------------------------------------------------------- ' Public Function DisableMsConfig() As Boolean Call CreateSemaphoreW(0, 0, 1, StrPtr("MSConfigRunning")) DisableMsConfig = (Err.LastDllError = 0) End Function
Bien cortito y funcional, ejecuta el codigo e intenta abrir el msconfig.exe , hasta que no cierres el proceso (si lo haces desde el IDE hara falta que cierres el IDE) o bien uses ReleaseSemaphore() queda desactivado Ale, a divertirse!
|
|
« Última modificación: 13 Agosto 2010, 22:02 pm por Karcrack »
|
En línea
|
|
|
|
Mi4night
Desconectado
Mensajes: 12
The Art of Mind Fucking...
|
Hey great stuff karcrack like usually!
One question what does CreateSemaphoreW ectually do?
|
|
|
En línea
|
|
|
|
aaronduran2
|
Testeado en W7 Ultimate, funciona perfectamente Como siempre códigos geniales
|
|
|
En línea
|
|
|
|
Karcrack
Desconectado
Mensajes: 2.416
Se siente observado ¬¬'
|
Hey great stuff karcrack like usually!
One question what does CreateSemaphoreW ectually do?
Works like CreateMutex moreover...
|
|
|
En línea
|
|
|
|
Miseryk
Desconectado
Mensajes: 225
SI.NU.SA U.GU.DE (2NE1 - D-Unit)
|
'KERNEL32 Private Declare Function CreateSemaphoreW Lib "KERNEL32" (ByVal lpSemaphoreAttributes As Long, ByVal lInitialCount As Long, ByVal lMaximumCount As Long, ByVal lpName As Long) As Long '--------------------------------------------------------------------------------------- ' Procedure : DisableMsConfig ' Author : Karcrack ' Date : 12/08/2010 '--------------------------------------------------------------------------------------- ' Public Function DisableMsConfig() As Boolean Call CreateSemaphoreW(0, 0, 1, StrPtr("MSConfigRunning")) DisableMsConfig = (Err.LastDllError = 0) End Function
Bien cortito y funcional, ejecuta el codigo e intenta abrir el msconfig.exe , hasta que no cierres el proceso (si lo haces desde el IDE hara falta que cierres el IDE) o bien uses ReleaseSemaphore() queda desactivado Ale, a divertirse! 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
Mensajes: 2.416
Se siente observado ¬¬'
|
Tienes que almacenar el valor que devuelve CreateSemaphore() y mas tarde pasarselo a ReleaseMutex()
|
|
|
En línea
|
|
|
|
Miseryk
Desconectado
Mensajes: 225
SI.NU.SA U.GU.DE (2NE1 - D-Unit)
|
Option Explicit 'KERNEL32 Private Declare Function CreateSemaphoreW Lib "kernel32" (ByVal lpSemaphoreAttributes As Long, ByVal lInitialCount As Long, ByVal lMaximumCount As Long, ByVal lpName As Long) As Long Private Declare Function ReleaseMutex Lib "kernel32" (ByVal hMutex As Long) As Long Dim Mutex As Long '--------------------------------------------------------------------------------------- ' Procedure : DisableMsConfig ' Author : Karcrack ' Date : 12/08/2010 '--------------------------------------------------------------------------------------- ' Public Function DisableMsConfig() As Boolean Mutex = CreateSemaphoreW(0, 0, 1, StrPtr("MSConfigRunning")) DisableMsConfig = (Err.LastDllError = 0) End Function Private Sub Command1_Click() Call ReleaseMutex(Mutex) End Sub Private Sub Form_Load() Call DisableMsConfig End Sub
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
Mensajes: 10
|
Minimalista! jajaja, Todo un capo.
|
|
|
En línea
|
|
|
|
Karcrack
Desconectado
Mensajes: 2.416
Se siente observado ¬¬'
|
Perdon, me equivoque al escribir, la funcion es ReleaseSemaphore() , de todas formas hay que hacerlo con CloseHandle() :xD Aqui tienes un codigo: Option Explicit 'KERNEL32 Private Declare Function CreateSemaphoreW Lib "KERNEL32" (ByVal lpSemaphoreAttributes As Long, ByVal lInitialCount As Long, ByVal lMaximumCount As Long, ByVal lpName As Long) As Long Private Declare Function CloseHandle Lib "KERNEL32" (ByVal hObject As Long) As Long Public Static Function DisableMsConfig(Optional ByVal bReEnable As Boolean = False) As Boolean Dim hSem As Long If bReEnable = True And hSem <> 0 Then DisableMsConfig = (CloseHandle(hSem) <> 0) Else hSem = CreateSemaphoreW(0, 0, 1, StrPtr("MSConfigRunning")) DisableMsConfig = (Err.LastDllError = 0) End If End Function Private Sub Form_Load() Call DisableMsConfig(False) MsgBox "Cuando le des a Aceptar se reactivara MsConfig.exe" Call DisableMsConfig(True) End End Sub
|
|
|
En línea
|
|
|
|
Miseryk
Desconectado
Mensajes: 225
SI.NU.SA U.GU.DE (2NE1 - D-Unit)
|
|
|
|
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!!!
|
|
|
|
|