• 大小: 725KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-19
  • 语言: 其他
  • 标签: WinRing0  源码  

资源简介

WinRing0及其源码,通过获取ring0权限,可以在应用程序中直接执行CPU需要ring0才能执行的指令。

资源截图

代码片段和文件信息

//-----------------------------------------------------------------------------
//     Author : hiyohiyo
//       Mail : hiyohiyo@crystalmark.info
//        Web : http://openlibsys.org/
//    License : The modified BSD license
//
//                          Copyright 2007 OpenLibSys.org. All rights reserved.
//-----------------------------------------------------------------------------

#include “stdafx.h“
#include “Driver.h“
#include 
#include “OlsDll.h“

//-----------------------------------------------------------------------------
//
// Global
//
//-----------------------------------------------------------------------------

extern HANDLE gHandle;

//-----------------------------------------------------------------------------
//
// Prototypes
//
//-----------------------------------------------------------------------------

static BOOL InstallDriver(SC_HANDLE hSCManager LPCTSTR DriverId LPCTSTR DriverPath);
static BOOL RemoveDriver(SC_HANDLE hSCManager LPCTSTR DriverId);
static BOOL StartDriver(SC_HANDLE hSCManager LPCTSTR DriverId);
static BOOL StopDriver(SC_HANDLE hSCManager LPCTSTR DriverId);
static BOOL SystemInstallDriver(SC_HANDLE hSCManager LPCTSTR DriverId LPCTSTR DriverPath);
static BOOL IsSystemInstallDriver(SC_HANDLE hSCManager LPCTSTR DriverId LPCTSTR DriverPath);

//-----------------------------------------------------------------------------
//
// Manage Driver
//
//-----------------------------------------------------------------------------

BOOL ManageDriver(LPCTSTR DriverId LPCTSTR DriverPath USHORT Function)
{
SC_HANDLE hSCManager = NULL;
BOOL rCode = FALSE;
DWORD error = NO_ERROR;

if(DriverId == NULL || DriverPath == NULL)
{
return FALSE;
}
hSCManager = OpenSCManager(NULL NULL SC_MANAGER_ALL_ACCESS);

    if(hSCManager == NULL)
{
        return FALSE;
    }

    switch(Function)
{
case OLS_DRIVER_INSTALL:
if(InstallDriver(hSCManager DriverId DriverPath))
{
rCode = StartDriver(hSCManager DriverId);
}
break;
case OLS_DRIVER_REMOVE:
if(! IsSystemInstallDriver(hSCManager DriverId DriverPath))
{
StopDriver(hSCManager DriverId);
rCode = RemoveDriver(hSCManager DriverId);
}
break;
case OLS_DRIVER_SYSTEM_INSTALL:
if(IsSystemInstallDriver(hSCManager DriverId DriverPath))
{
rCode = TRUE;
}
else
{
if(! OpenDriver())
{
StopDriver(hSCManager DriverId);
RemoveDriver(hSCManager DriverId);
if(InstallDriver(hSCManager DriverId DriverPath))
{
StartDriver(hSCManager DriverId);
}
OpenDriver();
}
rCode = SystemInstallDriver(hSCManager DriverId DriverPath);
}
break;
case OLS_DRIVER_SYSTEM_UNINSTALL:
if(! IsSystemInstallDriver(hSCManager DriverId DriverPath))
{
rCode = TRUE;
}
else
{
if(gHandle != INVALID_HANDLE_VALUE)
{
CloseHandle(gHandle);
gHandle = INVALID_HANDLE_VALUE;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1128  2009-03-01 10:23  WinRing0\COPYRIGHT-ja.txt

     文件       1274  2009-03-01 10:23  WinRing0\COPYRIGHT.txt

     文件      38601  2009-08-15 19:44  WinRing0\manual.chm

     文件       2489  2009-05-24 11:15  WinRing0\ReadMe-ja.html

     文件       2400  2009-05-24 11:15  WinRing0\ReadMe.html

     文件      65536  2009-05-24 11:34  WinRing0\release\WinRing0.dll

     文件       8043  2009-05-24 11:34  WinRing0\release\WinRing0.exp

     文件      14774  2009-05-24 11:34  WinRing0\release\WinRing0.lib

     文件      14416  2008-07-26 22:30  WinRing0\release\WinRing0.sys

     文件       8620  2008-07-26 22:20  WinRing0\release\WinRing0.vxd

     文件     229376  2009-05-24 11:33  WinRing0\release\WinRing0SampleCpp.exe

     文件     331776  2009-05-24 11:34  WinRing0\release\WinRing0SampleCppX64.exe

     文件     177152  2009-12-05 00:17  WinRing0\release\WinRing0SampleCs.exe

     文件      57856  2009-05-27 21:59  WinRing0\release\WinRing0x64.dll

     文件       8235  2009-05-24 11:34  WinRing0\release\WinRing0x64.exp

     文件      15120  2009-05-24 11:34  WinRing0\release\WinRing0x64.lib

     文件      14544  2008-07-26 22:30  WinRing0\release\WinRing0x64.sys

     文件       1773  2009-05-27 21:46  WinRing0\source\dll\CpuidX64.asm

     文件       7740  2007-11-22 08:36  WinRing0\source\dll\Driver.cpp

     文件        630  2007-12-24 11:10  WinRing0\source\dll\Driver.h

     文件      31944  2009-05-27 21:59  WinRing0\source\dll\OlsApi.cpp

     文件       1235  2009-03-01 12:43  WinRing0\source\dll\OlsApi.def

     文件      20127  2009-05-23 12:11  WinRing0\source\dll\OlsApi.h

     文件      10757  2009-03-01 22:09  WinRing0\source\dll\OlsApiInit.h

     文件       5280  2009-03-01 22:13  WinRing0\source\dll\OlsApiInitDef.h

     文件       2907  2009-03-01 22:13  WinRing0\source\dll\OlsApiInitExt.h

     文件       2337  2007-12-24 11:11  WinRing0\source\dll\OlsDef.h

     文件       9100  2008-07-26 11:10  WinRing0\source\dll\OlsDll.cpp

     文件       1727  2009-05-23 08:34  WinRing0\source\dll\OlsDll.h

     文件       2395  2009-05-23 08:34  WinRing0\source\dll\OlsDll.rc

............此处省略82个文件信息

评论

共有 条评论