Brief introduction:
Pjsecure is a C-style Win32 dynamic link library, which can be used to realize the network Copy registration function of software products.
Quickly obtain the network card address of the remote machine by calling the RCP function uuidcreate or uuidcreatesequential.
The export function in Pjsecure uniquely identifies a computer based on two information. The first function gets the NIC address of the installed NIC, which is a 12-digit number that is guaranteed to be unique by the manufacturer of the NIC. The second function returns the serial number of the machine C disk. With two of information, you can successfully create your own software registration mechanism.
The source code contains the definition and implementation of the Pjsecure and a console program that tests the DLL.
Supports Unicode and provides build configuration options along with the source code.
API Reference:
Getnicaddress
BOOL getnicaddress (LPTSTR psznicaddress, UINT nbufsize);
Parameters
Psznicaddress if the function call succeeds, save the NIC address with this parameter.
The length of the nbufsize psznicaddress parameter should be at least 13 or greater.
Comments
This function gets the NIC address of the NIC on the client machine. The calling program is responsible for allocating buffers to receive the address. All NIC addresses are 12 bytes long, so you should allocate at least 13 bytes of space to hold the address before calling the function. The function calls the RCP function UuidCreate or uuidcreatesequential internally. This means that the code does not rely on any specialized network protocols that are installed. Returns FALSE if the function call successfully returns TRUE.
Getcdriveserialnumber
BOOL Getcdriveserialnumber (Lpdword pdwserialnumber);
Parameters
Pdwserialnumber DWORD Pointer that receives the serial number of the "C" disk based on the return value of the function.
Comments
Returns FALSE if the function call successfully returns TRUE. The return value in Pdwserialnumber can be displayed with the "VOL" command line command. For security-sensitive programs, calling this function can be used as a secondary means to obtain confirmation information about the customer.
Copyright Notice:
You can include this source code in any product that is published in binary form (including commercial, shared, free, or otherwise)
You can modify the source code in any way without modifying the top copyright rules for each module (*.h, *.cpp)
If you want to split the source code with your application, only allow the author's latest release to be distributed, to ensure that sources are unique.
Precautions:
If you run the program on Windows 2000, replace the UuidCreate call with a uuidcreatesequential call.
This article supporting source code