Click here to Skip to main content
15,892,674 members
Articles / Programming Languages / C++

Winlogon using Mobile Disk

Rate me:
Please Sign up or sign in to vote.
4.83/5 (25 votes)
30 Nov 2007CPOL6 min read 136.6K   2.6K   89  
This is a full set of applications that can be used to logon to Windows system using mobile disk. No password typing.
// UserInfo.h: interface for the CUserInfo class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_USERINFO_H__FFF6636D_773C_491B_A605_CC9D064BD417__INCLUDED_)
#define AFX_USERINFO_H__FFF6636D_773C_491B_A605_CC9D064BD417__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Windows.h"
#include "stdio.h"

//typedef unsigned long DWORD;
//typedef int BOOL;

typedef struct _USER_INFO
{
	char	lpUserName[30];
	char	lpPassword[30];
	DWORD	dwMagic;
	char	lpDomain[40];
	char	lpVolName[20];
	char	lpFileSystem[20];
	DWORD	dwVolSerialNo;

	DWORD	dwLogonType;
	char	lpWindowsUser[30];
	char	lpWindowsPassword[30];

}USER_INFO;

#define DISK_FILE_NAME "user.info"
#define FIND_DRIVE_TYPE DRIVE_REMOVABLE

class CUserInfo  
{
public:
	char m_lpLocalSecurityKey[255];
	BOOL SaveSecurityKey(char *lpKey);
	char* EncodeData(void *lpData, int len);
	BOOL ValidDiskPresent();
	void Print(USER_INFO user_info);
	USER_INFO Decode(USER_INFO user_info);
	USER_INFO Encode(USER_INFO user_info);
	USER_INFO LoadUserInfo(char *lpPath);
	DWORD GetRandomMagic();
	DWORD GetMagicFunctionValue(int id);
	BOOL CheckMagic(USER_INFO user_info);
	BOOL CheckDisk(USER_INFO user_info, int nDrive);
	BOOL CreateDiskFile(USER_INFO user, char *lpPath);

	BOOL CheckSecurityKey(char *lpSecurityKey);

	DWORD	m_dwMagicValues[60];

	CUserInfo();

	virtual ~CUserInfo();
	
};

#endif // !defined(AFX_USERINFO_H__FFF6636D_773C_491B_A605_CC9D064BD417__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Microsoft
United States United States
Have completed BSc in Computer Science & Engineering from Shah Jalal University of Science & Technology, Sylhet, Bangladesh (SUST).

Story books (specially Masud Rana series), tourism, songs and programming is most favorite.

Blog:
Maruf Notes
http://blog.kuashaonline.com

Comments and Discussions