Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Exile 1.8 - The Password Manager

, 6 Mar 2005
Yet another password manager.
exile_18_setup.zip
exile_exe.zip
exile_exe_staticmfc.zip
exile_src.zip
exile
Exile
Exile.exe.manifest
exile.dep
exile.dsp
exile.dsw
res
aboveimportant.ico
advanced.bmp
belowcritical.ico
belowinsignificant.ico
belownormal.ico
changeicon.bmp
cold.ico
collapsed.ico
critical.ico
editcategory.bmp
editelement.bmp
enterpassword.bmp
error.ico
exile.ico
expanded.ico
exporttoxml.bmp
find.ico
found.ico
important.ico
insertcategory.bmp
insertelement.bmp
insignificant.ico
md5hashgenerator.bmp
new.bmp
normal.ico
options.bmp
passwordgenerator.bmp
rsasecurity.bmp
rsasecurity.ico
search.cur
storageproperties.bmp
switch.bmp
unimportant.ico
veryimportant.ico
vssver.scc
Icons
res
icon1.ico
icon10.ico
icon11.ico
icon12.ico
icon13.ico
icon14.ico
icon15.ico
icon16.ico
icon17.ico
icon18.ico
icon19.ico
icon2.ico
icon20.ico
icon21.ico
icon22.ico
icon23.ico
icon24.ico
icon25.ico
icon26.ico
icon27.ico
icon28.ico
icon3.ico
icon4.ico
icon5.ico
icon6.ico
icon7.ico
icon8.ico
icon9.ico
md5
md5.dep
md5.dsp
mdx
pwsinfo
passwordstorageshellext.rgs
pwsinfo.def
pwsinfo.dep
pwsinfo.dsp
pwsinfo.dsw
PwsInfo.tlb
pwsinfops.def
pwsinfops.mk
rc5
rc5.dep
rc5.dsp
xml
exile_src_vs2003.zip
Exile.dep
Exile.dsp
Exile.dsw
Exile.suo
msxml3.tlh
msxml3.tli
res
AboveImportant.ico
Advanced.bmp
BelowCritical.ico
BelowInsignificant.ico
BelowNormal.ico
ChangeIcon.bmp
Cold.ico
Critical.ico
EditCategory.bmp
EditElement.bmp
EnterPassword.bmp
Error.ico
Exile.ico
ExportToXML.bmp
Find.ico
Found.ico
Icon1.ico
Icon10.ico
Icon11.ico
Icon12.ico
Icon13.ico
Icon14.ico
icon15.ico
Icon16.ico
Icon17.ico
Icon18.ico
Icon19.ico
Icon2.ico
Icon20.ico
Icon21.ico
Icon22.ico
Icon23.ico
Icon24.ico
Icon25.ico
Icon26.ico
Icon27.ico
Icon28.ico
Icon3.ico
Icon4.ico
Icon5.ico
Icon6.ico
Icon7.ico
Icon8.ico
Icon9.ico
Important.ico
InsertCategory.bmp
InsertElement.bmp
Insignificant.ico
MD5HashGenerator.bmp
New.bmp
Normal.ico
Options.bmp
PasswordGenerator.bmp
RSASecurity.bmp
rsasecurity.ico
Search.cur
StorageProperties.bmp
Switch.bmp
Unimportant.ico
VeryImportant.ico
vssver.scc
MD5
MD5.dep
MD5.dsp
PwsInfo
PasswordStorageShellExt.rgs
PwsInfo.def
PwsInfo.dep
PwsInfo.dsp
PwsInfo.dsw
PwsInfo.tlb
PwsInfops.def
PwsInfops.mk
RC5
RC5.dep
RC5.dsp
/********************************************************************
	Created:	27/3/2004, 18:23
	File name: 	D:\Projects\Exile\Exile\typedefs.h
	File path:	D:\Projects\Exile\Exile
	File base:	typedefs
	File ext:	h
	Author:		Gogolev Anton
*********************************************************************/

#ifndef __TYPEDEFS_H__
#define __TYPEDEFS_H__

#include <map>
#include <vector>
#include "../MD5/MD5.h"

//////////////////////////////////////////////////////////////////////////
// Storage Constants and Structures

// Exile Password Storage file layout:
//	1. Storage Header (STORAGEHEADER)
//	2. Tree Structure information (Left Parenthesis Notation)
//	3. Private entries (ENTRY)
//  4. Advanced entries (ADVANCED)

// Storage flags
const long SF_ANSI_VERSION = 0x0001; // ANSI storage version
const long SF_UNICODE_VERSION = 0x0002; // As opposed to ANSI - Unicode version

// Storage tag
const long STORAGETAG = 0xE2077737; // .pws with bytes reversed

// Current storage version
const long STORAGEVERSION = MAKELONG(5, 1);

// Storage structores
typedef struct tagSTORAGEHEADER {
	long lTag; // Storage tag
	long lVersion; // Storage version
	long lAdvanced; // Prior to 1.5 it was reserved, now - number of ADVANCED structures
	long lFlags; // Storage flags
	int nKeySize; // Key size (in bits)
	int nRounds; // Rounds of encryption
	MD5HASH hsPassword; // "User Name + Password", hashed
	long lIndex; // Maximum ID of entries
	long lElements; // Number of elements
	long lNodes; // Nodes in a tree
} STORAGEHEADER, *LPSTORAGEHEADER;

//////////////////////////////////////////////////////////////////////////
// Private Entries and Stuff...

// Fields sizes
const unsigned int nNameLength = 64; // Entry / Category name length
const unsigned int nLoginLength = 64; // Login length
const unsigned int nPasswordLength = 64;
const unsigned int nAddressLength = 128;
const unsigned int nNotesLength = 1024;
const unsigned int nWindowTitleLength = 128; // See SMARTTYPE and ADVANCED

// Entry flags
const unsigned int EF_CATEGORY = 0x0001; // The entry is a Category
const unsigned int EF_ELEMENT = 0x0002; // The entry is an Element
const unsigned int EF_ROOTCATEGORY = 0x0004; // To distinguish a Root Category

// Storage Versions 1.1, 1.2 Extended parameters
typedef struct tagEXTENDED {
	WORD wVKCode; // Virtual key code (for element hot key)
	WORD wModifiers; // Modifiers for hot key
	BYTE cRating; // New for 1.2 - Item (both Element and Category) Rating
} EXTENDED, *LPEXTENDED;

// This is where all information is stored. Its size (in bytes) must be
// a multiple of 8 since RC5 works with 64-bit block size.
// For ANSI we have 1392 bytes (174 blocks) for each entry (with 48 bytes reserved for future use).
// For Unicode we have 2736 bytes (342 blocks, again with 48 bytes reserved).
typedef struct tagPRIVATEENTRY {
	TCHAR szName[nNameLength];
	TCHAR szLogin[nLoginLength];
	TCHAR szPassword[nPasswordLength];
	TCHAR szAddress[nAddressLength];
	TCHAR szNotes[nNotesLength];
	union
	{
		BYTE abReserved[48]; // Set to 0 for Storage version 1.0;
		EXTENDED exData; // Extended data
	};	
} PRIVATEENTRY, *LPPRIVATEENTRY;

// Advanced Parameters. For version 1.5 it contains
// Window Title and Control IDs, where Login and Password
// are supposed to be entered. The array of parameters is
// written _after_ array of ENTRY structures.

// Version 1.5 SmartType Information
typedef struct tagSMARTTYPEINFO {
	BOOL bEnabled;
	int nPasswordCtrlID;
	int nLoginCtrlID;
	TCHAR szWindowTitle[nWindowTitleLength];
} SMARTTYPEINFO, *LPSMARTTYPEINFO;

typedef struct tagADVANCED {
	long lID; // Entry ID to which this structure is assigned
	SMARTTYPEINFO sti; // SmartType Info
	BYTE abReserved[512]; // For future use. Set to 0
} ADVANCED, *LPADVANCED;

// A wrapper for PRIVATEENTRY plus data which is not supposed
// to be encrypted, such as Flags, ID.
typedef struct tagENTRY {
	unsigned int nFlags; // Entry Flags
	long lID; // Entry ID, must be greater than 0;
	long lIconID; // Entry icon ID;
	long lReserved; // It's better to set it to 0
	PRIVATEENTRY pePrivate;
} ENTRY, *LPENTRY;

typedef std::map<long, ENTRY> MENTRY, *LPMENTRY; // Map long to Entry
typedef std::map<long, ADVANCED> MADVANCED, *LPMADVANCED; // Map long to ADVANCED

// Key info
// Used to store key information
typedef struct tagKEYINFO {
	MD5HASH hsPassword; // "User Name + Password", hashed
	BYTE *pbKey; // Pointer to Key (nKeySize / 8 bytes of data)
	int nRounds; // Rounds of encryption
	int nKeySize; // Key size (in bits)
} KEYINFO, *LPKEYINFO;

//////////////////////////////////////////////////////////////////////////
// Tree Structure tokens
// Negative values to distinguish tokens from nodes

const long TST_LEFTBRACKET = -1; 
const long TST_RIGHTBRACKET = -2;

//////////////////////////////////////////////////////////////////////////
// Tree Control Item Flags

// Item can be a drop target
const LPARAM TCIF_DROPTARGET = 0x8000; 

// Whether a drop target or not
inline BOOL IsDropTarget(const LPARAM &lParam) 
{
	return (lParam & TCIF_DROPTARGET);
}

// Sets item to be a drop target
inline LPARAM SetDropTarget(const LPARAM &lParam)
{
	return (lParam | TCIF_DROPTARGET);
}

// Real item LPARAM, regardless of it being either a
// drop target or not.
inline LPARAM GetItemParam(const LPARAM &lParam) 
{
	return (lParam & (~TCIF_DROPTARGET));
}

typedef std::vector<LONG> VTREE;

#endif //__TYPEDEFS_H__

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

AntonGogolev
Web Developer
Russian Federation Russian Federation
I'll think about it later on...

| Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 7 Mar 2005
Article Copyright 2004 by AntonGogolev
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid