Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

First my english is not perfect.

I want to implement code protection for our simulation models (aircraft).

My questions:

1. How to protect a CAB file (MsZip) with a password? ZIP programs can not do that.

2. A dll (c ++ - I have created) for a game read this password protected CAB file (content).

Possible?

Regards,

Alex

What I have tried:

////////////////////////////////////////////////////////////////////////////
// Function: main.cpp (Main - SDProtect.dll)                              //
// Erstellt:                                                              //
// Geändert:                                                              //
////////////////////////////////////////////////////////////////////////////

//Macros
#define _WINSOCKAPI_

//Pragma Warning 
#pragma warning (disable : 4005)

//C++ Header
#include "main.h"
#include <iostream>
#include <winsock2.h>
#include <stdlib.h>
#include <stdio.h>
#include <shellapi.h>
#include <Shlwapi.h>
#include <direct.h>
#include <tchar.h>
#include <atlstr.h>

//Pragma
#pragma comment(lib,"ws2_32")
#pragma comment(lib, "shlwapi.lib")

// near the top of your CPP file
//EXTERN_C IMAGE_DOS_HEADER __ImageBase;


////////////////////////////////////////////////////////////////////////////
// Function:                                                              //
// Erstellt:                                                              //
// Geändert:                                                              //
////////////////////////////////////////////////////////////////////////////
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID _Reserved){
	
	//Read Password protect CAB File
	

}
Posted
Updated 13-Mar-19 4:52am

 
Share this answer
 
Comments
Daim Raqib 12-Feb-24 6:34am    
How too create pasword cab
file
One more thing - don't read the file in DllMain. That is called when processes and threads load or unload the library. You need to implement another function to do the reading and export it from your library with __declspec(dllexport).
 
Share this answer
 
The Microsoft CAB format doesn't support password protection.

If you want to "protect" the content, you'll either have to put the .CAB files in a .ZIP file that does support password protection and unzip the file to get at the .CAB

Or

Don't use a CAB and use a different format that does support the features you want.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900