Code protection
- From: "Boni" <oilia@nospam>
- Date: Wed, 6 Apr 2005 20:21:54 +0200
Dear all,
in order to protect my assembly component from decompilation I implemented
following schema:
I created mixed mode C++ project wich has managed cProxy class and unmanaged
cMemLoader. In the cMemLoader I load encrypted assembly, decrypt it into
memory buffer and then marshal this buffer into managed memory and load the
assembly from memory.
Although I am not sure if this approach is good enough and how easy is it to
break.
Can anybody comment on this? Improvements are welcome too.
Thanks in advance,
Boni
void cProxy::Load(void){
m_pLoader=new cMemLoader(C:\\edit\\MyEncriptedManaged.dll
m_pLoader->DecriptLoad();
unsigned char _pManagedBuff __gc[]=__gc new unsigned char __gc
[m_pLoader->m_file_size] ;
Marshal::Copy(m_pLoader->m_pBuff,_pManagedBuff,0,m_pLoader->m_file_size);
delete m_pLoader;
m_Asm= Assembly::Load(_pManagedBuff);
System::Type *_Types __gc[]= m_Asm->GetTypes();
Object *_Instance = 0;
MethodInfo *_Methods __gc[]= _Types[0]->GetMethods();
_Instance = System::Activator::CreateInstance(_Types[0]);
_Methods[0]->Invoke(_Instance,0);
}
.
- Follow-Ups:
- Re: Code protection
- From: Ignacio Machin \( .NET/ C# MVP \)
- Re: Code protection
- Prev by Date: Printing
- Next by Date: RE: Read recordset file
- Previous by thread: Printing
- Next by thread: Re: Code protection
- Index(es):
Loading