Click to See Complete Forum and Search --> : Whats this code do?


RedCamel
January 11th, 2007, 07:00 PM
I have some code that I have no idea what it does can someone help me out. I’m not any good with c/c++. I pulled this out of a dll with reflector…I’m trying to take the logic to C#. The original dev has moved on and svn was moved to pvcs and this was a dead project and didn’t make it.

namespace Secv {
public ref class SecVal
{
// Methods
private:
String^ wrap(char modopt(IsSignUnspecifiedByte^)* inpass)
{
if ((inpass != nullptr))
{
array<Object^>^ objArray1 = gcnew array<Object^>(1);
ValueType^ modopt(IntPtr) modopt(IsBoxed^) local1 = ((ValueType^ modopt(IntPtr) modopt(IsBoxed^)) IntPtr());
((IntPtr) local1) = gcnew IntPtr(inpass) ;
return Marshal::PtrToStringAnsi(((IntPtr) local1));
}
return nullptr;
}
public:
String^ val(Assembly^ iptAssembly)
{
IntPtr ptr2 = IntPtr();
IEnumerator^ enumerator1 = iptAssembly->Evidence->GetEnumerator();
unsigned int num2 = ((unsigned int) iptAssembly->Evidence->Count);
char modopt(IsSignUnspecifiedByte^)** localPtrPtr1 = ::new(((num2 > 1073741823) ? unsigned int::MaxValue : (num2 << 2)));
int num1 = 0;
if (enumerator1->MoveNext())
{
do
{
IntPtr ptr1 = Marshal::StringToHGlobalAnsi(enumerator1->Current->ToString());
if ((ptr1 != IntPtr::Zero))
{
(num1 * 4)[localPtrPtr1] = ((int) ((void*) ptr1));
}
num1++;
}
while(enumerator1->MoveNext());
}
return this->wrap(::validation(localPtrPtr1, num1));
}
};
}