Program loader using native c++

257 views Asked by At

I have a dotnet winform application compressed and protected by RPX Packer with a password. The application can be opened from the windows command prompt supplying the password as the command line argument(e.g. MyApp.exe ). Instead of the command prompt I want to start the dotnet app from a native C++ application. I tried the following code which works without a password, but with a password some cryptographic error comes.

#include "stdafx.h"
#include "windows.h"
#include "shellapi.h"

int _tmain(int argc, _TCHAR* argv[])
{
  SHELLEXECUTEINFO shExecInfo;

  shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);

  shExecInfo.fMask = NULL;
  shExecInfo.hwnd = NULL;
  shExecInfo.lpVerb = L"runas";
  shExecInfo.lpFile = L"MyApp.exe";
  shExecInfo.lpParameters = L"password";
  shExecInfo.lpDirectory = NULL;
  shExecInfo.nShow = SW_NORMAL;
  shExecInfo.hInstApp = NULL;

  ShellExecuteEx(&shExecInfo);

  return 0;
  }

How do I achieve this?

0

There are 0 answers