Click here to Skip to main content
15,895,606 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Group policy editor api Pin
Richard MacCutchan31-Aug-20 20:57
mveRichard MacCutchan31-Aug-20 20:57 
GeneralRe: Group policy editor api Pin
Member 1487268131-Aug-20 21:33
Member 1487268131-Aug-20 21:33 
GeneralRe: Group policy editor api Pin
Richard MacCutchan31-Aug-20 21:40
mveRichard MacCutchan31-Aug-20 21:40 
AnswerRe: Group policy editor api Pin
Randor 1-Sep-20 23:24
professional Randor 1-Sep-20 23:24 
QuestionWindows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill30-Aug-20 12:01
jackngill30-Aug-20 12:01 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Mircea Neacsu30-Aug-20 16:47
Mircea Neacsu30-Aug-20 16:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill30-Aug-20 22:26
jackngill30-Aug-20 22:26 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill2-Sep-20 22:48
jackngill2-Sep-20 22:48 
Here is one encouraging bit of news though I have stumbled upon the very thing I need called WFPReplacer, it is a commandline windows utility that pretty well does what I want & generally in the same manner. it disables WFP for both singular files & can be used for wholesale switching off of WFP if the right file is replaced. All I need to do is write a batch file as a front end to back up the system files I want to disable use WFPReplacer.exe. So if in the event of the proceedings the routine gets stuffed I can revert back to the backed up files. I think this program uses the same type of embedded coding but is written in Delphi/pascal, it is called Remko Weijnen's Blog (Remko's Blog) "replacing Wfp protected files".

I generally like to leave whatever I am doing on a positive note. And NO I do not have any interest in coding Malware, so just in case someone else lands on this forum & is trying to accomplish a similair exercise here is the code that one can compile (This is not my code it belongs to Remko Weijnen's Blog (Remko's Blog)) Please be advised it is NOT C++ it is a commandline exe Delhi/Pascal found at this link, so all credits belong to him. The link is:

https://www.remkoweijnen.nl/blog/2012/12/05/replacing-wfp-protected-files/

Delphi
DWORD __stdcall SfcFileException(RPC_BINDING_HANDLE hServer, LPCWSTR lpSrc, int Unknown)
{
  RPC_BINDING_HANDLE hServerVar; // eax@2
  int nts; // eax@6
  __int32 dwResult; // eax@7
  DWORD dwResultVar; // esi@9
  int v8; // [sp+8h] [bp-8h]@1
  int v9; // [sp+Ch] [bp-4h]@1

  LOWORD(v8) = 0;
  *(int *)((char *)&v8 + 2) = 0;
  HIWORD(v9) = 0;
  if ( !hServer )
  {
    hServerVar = _pRpcHandle;
    if ( !_pRpcHandle )
    {
      hServerVar = SfcConnectToServer(0);
      _pRpcHandle = hServerVar;
      if ( !hServerVar )
        return 0x6BA;                           // RPC_S_SERVER_UNAVAILABLE
    }
    hServer = hServerVar;
  }
  nts = SfcRedirectPath(lpSrc, (int)&v8);
  if ( nts >= 0 )
    dwResult = SfcCli_FileException((int)hServer, v9, Unknown).Simple;
  else
    dwResult = RtlNtStatusToDosError(nts);
  dwResultVar = dwResult;
  MemFree(v9);
  return dwResultVar;
}


Also as one further warning (Unless you know what you are doing!!!) do not attempt to use this program, ALWAYS ALWAYS ALWAYS backup your system files before deletion or alteration.
What this program will do is disarm WFP for 60 seconds whilst you intercange or amend your files. Example usage for example is:
WfpReplacer.exe c:\windows\Notepad.exe (Errorlevel true or false will be produced on execution).

Best Regards
David
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 2:59
David Crow3-Sep-20 2:59 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill3-Sep-20 4:01
jackngill3-Sep-20 4:01 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 4:23
David Crow3-Sep-20 4:23 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 6:41
Victor Nijegorodov3-Sep-20 6:41 
QuestionRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 7:08
David Crow3-Sep-20 7:08 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 7:47
Victor Nijegorodov3-Sep-20 7:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 7:57
David Crow3-Sep-20 7:57 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 8:04
Victor Nijegorodov3-Sep-20 8:04 
QuestionRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 8:09
David Crow3-Sep-20 8:09 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 9:27
Victor Nijegorodov3-Sep-20 9:27 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 8:07
Victor Nijegorodov3-Sep-20 8:07 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 7:47
Victor Nijegorodov3-Sep-20 7:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill3-Sep-20 11:41
jackngill3-Sep-20 11:41 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 22:29
Victor Nijegorodov3-Sep-20 22:29 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 4:08
Victor Nijegorodov3-Sep-20 4:08 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill4-Sep-20 2:11
jackngill4-Sep-20 2:11 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov4-Sep-20 7:59
Victor Nijegorodov4-Sep-20 7:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.