WINXP/2 K digital signature status settings

Source: Internet
Author: User

DWORD winapi setdriversign ()

{

Hkey HREG;

DWORD dwlen;

DWORD dwseed;

DWORD hprov;

DWORD hhash;

DWORD dwdata;

Byte bhash [16];

If (regopenkeyexa (HKEY_LOCAL_MACHINE, "system // WPA // PNP", 0, key_read, & HREG) = error_success)

{

Dwlen = 4;

Regqueryvalueexa (HREG, "Seed", 0, 0, (lpbyte) & dwseed, & dwlen );

Regclosekey (HREG );

Cryptacquirecontext (& hprov, 0, 0, prov_rsa_full, crypt_verifycontext );

Cryptcreatehash (hprov, 0x8003,0, 0, & hhash );

Dwdata = 0;

Crypthashdata (hhash, (byte *) & dwdata, 4,0 );

Crypthashdata (hhash, (byte *) & dwseed, 4,0 );

Dwlen = 16;

Cryptgethashparam (hhash, hp_hashval, & bhash [0], & dwlen, 0 );

Cryptdestroyhash (hhash );

Cryptreleasecontext (hprov, 0 );

// HKEY_LOCAL_MACHINE/software/Microsoft/Windows/CurrentVersion/setup privatehash bin MD5

// HKEY_LOCAL_MACHINE/software/Microsoft/driver signing policy bin 0

// HKEY_LOCAL_MACHINE/software/Microsoft/non-driver signing policy bin 0

// HKEY_CURRENT_USER/software/Microsoft/driver signing policy DWORD 0

Lpparameter = 0;

Regopenkeyexa (HKEY_LOCAL_MACHINE, "software // Microsoft // driver signing", 0, key_write, & HREG );

Regsetvalueexa (HREG, "policy", 0, REG_BINARY, (byte *) & dwdata, 1 );

Regclosekey (HREG );

Regopenkeyexa (HKEY_LOCAL_MACHINE, "software // Microsoft // non-driver signing", 0, key_write, & HREG );

Regsetvalueexa (HREG, "policy", 0, REG_BINARY, (byte *) & dwdata, 1 );

Regclosekey (HREG );

Regopenkeyexa (HKEY_CURRENT_USER, "software // Microsoft // driver signing", 0, key_write, & HREG );

Regsetvalueexa (HREG, "policy", 0, REG_BINARY, (byte *) & dwdata, 1 );

Regclosekey (HREG );

Regopenkeyexa (HKEY_LOCAL_MACHINE, "software // Microsoft // windows // CurrentVersion // setup", 0, key_write, & HREG );

Regsetvalueexa (HREG, "privatehash", 0, REG_BINARY, & bhash [0], 16 );

Regclosekey (HREG );

}

Return 0;

}

AboveCodeAfter execution, the hardware-driven digital signature status in WINXP/2003 is set to ignore.

I strongly despise some previous methods of simulating the mouse and keyboard, and I have no technical knowledge at all. Haha

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.