Click here to Skip to main content
14,689,402 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Group policy editor api Pin
Richard MacCutchan31-Aug-20 21:57
mveRichard MacCutchan31-Aug-20 21:57 
GeneralRe: Group policy editor api Pin
Member 1487268131-Aug-20 22:33
MemberMember 1487268131-Aug-20 22:33 
GeneralRe: Group policy editor api Pin
Richard MacCutchan31-Aug-20 22:40
mveRichard MacCutchan31-Aug-20 22:40 
AnswerRe: Group policy editor api Pin
Randor 2-Sep-20 0:24
professional Randor 2-Sep-20 0:24 
QuestionWindows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill30-Aug-20 13:01
Memberjackngill30-Aug-20 13:01 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Mircea Neacsu30-Aug-20 17:47
MemberMircea Neacsu30-Aug-20 17:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill30-Aug-20 23:26
Memberjackngill30-Aug-20 23:26 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill2-Sep-20 23:48
Memberjackngill2-Sep-20 23: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/

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 3:59
MemberDavid Crow3-Sep-20 3:59 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill3-Sep-20 5:01
Memberjackngill3-Sep-20 5:01 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 5:23
MemberDavid Crow3-Sep-20 5:23 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 7:41
MemberVictor Nijegorodov3-Sep-20 7:41 
QuestionRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 8:08
MemberDavid Crow3-Sep-20 8:08 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 8:47
MemberVictor Nijegorodov3-Sep-20 8:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 8:57
MemberDavid Crow3-Sep-20 8:57 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 9:04
MemberVictor Nijegorodov3-Sep-20 9:04 
QuestionRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
David Crow3-Sep-20 9:09
MemberDavid Crow3-Sep-20 9:09 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 10:27
MemberVictor Nijegorodov3-Sep-20 10:27 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 9:07
MemberVictor Nijegorodov3-Sep-20 9:07 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 8:47
MemberVictor Nijegorodov3-Sep-20 8:47 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill3-Sep-20 12:41
Memberjackngill3-Sep-20 12:41 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 23:29
MemberVictor Nijegorodov3-Sep-20 23:29 
AnswerRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov3-Sep-20 5:08
MemberVictor Nijegorodov3-Sep-20 5:08 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
jackngill4-Sep-20 3:11
Memberjackngill4-Sep-20 3:11 
GeneralRe: Windows XP Convert SystemDrive Variable e.g. %SystemDrive% - into equivelant C++ code Pin
Victor Nijegorodov4-Sep-20 8:59
MemberVictor Nijegorodov4-Sep-20 8: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.