This commit is contained in:
locka%iol.ie 2000-03-21 23:18:05 +00:00
parent b4309b139a
commit f9dbb48adc
31 changed files with 0 additions and 1997 deletions

View File

@ -1,86 +0,0 @@
// DlgProxy.cpp : implementation file
//
#include "stdafx.h"
#include "IEPatcher.h"
#include "DlgProxy.h"
#include "IEPatcherDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CIEPatcherDlgAutoProxy
IMPLEMENT_DYNCREATE(CIEPatcherDlgAutoProxy, CCmdTarget)
CIEPatcherDlgAutoProxy::CIEPatcherDlgAutoProxy()
{
EnableAutomation();
// To keep the application running as long as an OLE automation
// object is active, the constructor calls AfxOleLockApp.
AfxOleLockApp();
// Get access to the dialog through the application's
// main window pointer. Set the proxy's internal pointer
// to point to the dialog, and set the dialog's back pointer to
// this proxy.
ASSERT (AfxGetApp()->m_pMainWnd != NULL);
ASSERT_VALID (AfxGetApp()->m_pMainWnd);
ASSERT_KINDOF(CIEPatcherDlg, AfxGetApp()->m_pMainWnd);
m_pDialog = (CIEPatcherDlg*) AfxGetApp()->m_pMainWnd;
m_pDialog->m_pAutoProxy = this;
}
CIEPatcherDlgAutoProxy::~CIEPatcherDlgAutoProxy()
{
// To terminate the application when all objects created with
// with OLE automation, the destructor calls AfxOleUnlockApp.
// Among other things, this will destroy the main dialog
AfxOleUnlockApp();
}
void CIEPatcherDlgAutoProxy::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CCmdTarget::OnFinalRelease();
}
BEGIN_MESSAGE_MAP(CIEPatcherDlgAutoProxy, CCmdTarget)
//{{AFX_MSG_MAP(CIEPatcherDlgAutoProxy)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CIEPatcherDlgAutoProxy, CCmdTarget)
//{{AFX_DISPATCH_MAP(CIEPatcherDlgAutoProxy)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IIEPatcher to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {A6031677-3B36-11D2-B44D-00600819607E}
static const IID IID_IIEPatcher =
{ 0xa6031677, 0x3b36, 0x11d2, { 0xb4, 0x4d, 0x0, 0x60, 0x8, 0x19, 0x60, 0x7e } };
BEGIN_INTERFACE_MAP(CIEPatcherDlgAutoProxy, CCmdTarget)
INTERFACE_PART(CIEPatcherDlgAutoProxy, IID_IIEPatcher, Dispatch)
END_INTERFACE_MAP()
// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {A6031675-3B36-11D2-B44D-00600819607E}
IMPLEMENT_OLECREATE2(CIEPatcherDlgAutoProxy, "IEPatcher.Application", 0xa6031675, 0x3b36, 0x11d2, 0xb4, 0x4d, 0x0, 0x60, 0x8, 0x19, 0x60, 0x7e)
/////////////////////////////////////////////////////////////////////////////
// CIEPatcherDlgAutoProxy message handlers

View File

@ -1,61 +0,0 @@
// DlgProxy.h : header file
//
#if !defined(AFX_DLGPROXY_H__A603167E_3B36_11D2_B44D_00600819607E__INCLUDED_)
#define AFX_DLGPROXY_H__A603167E_3B36_11D2_B44D_00600819607E__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
class CIEPatcherDlg;
/////////////////////////////////////////////////////////////////////////////
// CIEPatcherDlgAutoProxy command target
class CIEPatcherDlgAutoProxy : public CCmdTarget
{
DECLARE_DYNCREATE(CIEPatcherDlgAutoProxy)
CIEPatcherDlgAutoProxy(); // protected constructor used by dynamic creation
// Attributes
public:
CIEPatcherDlg* m_pDialog;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CIEPatcherDlgAutoProxy)
public:
virtual void OnFinalRelease();
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CIEPatcherDlgAutoProxy();
// Generated message map functions
//{{AFX_MSG(CIEPatcherDlgAutoProxy)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
DECLARE_OLECREATE(CIEPatcherDlgAutoProxy)
// Generated OLE dispatch map functions
//{{AFX_DISPATCH(CIEPatcherDlgAutoProxy)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_DISPATCH
DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGPROXY_H__A603167E_3B36_11D2_B44D_00600819607E__INCLUDED_)

View File

@ -1,93 +0,0 @@
// IEPatcher.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "IEPatcher.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CIEPatcherApp
BEGIN_MESSAGE_MAP(CIEPatcherApp, CWinApp)
//{{AFX_MSG_MAP(CIEPatcherApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CIEPatcherApp construction
CIEPatcherApp::CIEPatcherApp()
{
m_pIEPatcherDlg = NULL;
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CIEPatcherApp object
CIEPatcherApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CIEPatcherApp initialization
BOOL CIEPatcherApp::InitInstance()
{
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Parse the command line to see if launched as OLE server
if (RunEmbedded() || RunAutomated())
{
// Register all OLE server (factories) as running. This enables the
// OLE libraries to create objects from other applications.
COleTemplateServer::RegisterAll();
}
else
{
// When a server application is launched stand-alone, it is a good idea
// to update the system registry in case it has been damaged.
COleObjectFactory::UpdateRegistryAll();
}
// Now the scanner window
m_pIEPatcherDlg = new CIEPatcherDlg;
m_pMainWnd = m_pIEPatcherDlg;
int nResponse = m_pIEPatcherDlg->DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
delete m_pIEPatcherDlg;
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

View File

@ -1,203 +0,0 @@
# Microsoft Developer Studio Project File - Name="IEPatcher" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=IEPatcher - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "IEPatcher.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "IEPatcher.mak" CFG="IEPatcher - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "IEPatcher - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "IEPatcher - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "IEPatcher - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 5
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x1809 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x1809 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "IEPatcher - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 5
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x1809 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x1809 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "IEPatcher - Win32 Release"
# Name "IEPatcher - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\DlgProxy.cpp
# End Source File
# Begin Source File
SOURCE=.\IEPatcher.cpp
# End Source File
# Begin Source File
SOURCE=.\IEPatcher.odl
# End Source File
# Begin Source File
SOURCE=.\IEPatcher.rc
# End Source File
# Begin Source File
SOURCE=.\IEPatcherDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\ScanForFilesDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\ScannerThread.cpp
# End Source File
# Begin Source File
SOURCE=.\ScannerWnd.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\DlgProxy.h
# End Source File
# Begin Source File
SOURCE=.\IEPatcher.h
# End Source File
# Begin Source File
SOURCE=.\IEPatcherDlg.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\ScanForFilesDlg.h
# End Source File
# Begin Source File
SOURCE=.\ScannerThread.h
# End Source File
# Begin Source File
SOURCE=.\ScannerWnd.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\containsie.ico
# End Source File
# Begin Source File
SOURCE=.\res\containsmozilla.ico
# End Source File
# Begin Source File
SOURCE=.\res\doesntcontainie.ico
# End Source File
# Begin Source File
SOURCE=.\res\IEPatcher.ico
# End Source File
# Begin Source File
SOURCE=.\res\IEPatcher.rc2
# End Source File
# Begin Source File
SOURCE=.\res\unknownstatus.ico
# End Source File
# End Group
# Begin Source File
SOURCE=.\IEPatcher.reg
# End Source File
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project

View File

@ -1,53 +0,0 @@
// IEPatcher.h : main header file for the IEPATCHER application
//
#if !defined(AFX_IEPATCHER_H__A603167A_3B36_11D2_B44D_00600819607E__INCLUDED_)
#define AFX_IEPATCHER_H__A603167A_3B36_11D2_B44D_00600819607E__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
#include "IEPatcherDlg.h"
/////////////////////////////////////////////////////////////////////////////
// CIEPatcherApp:
// See IEPatcher.cpp for the implementation of this class
//
class CIEPatcherApp : public CWinApp
{
public:
CIEPatcherApp();
CIEPatcherDlg *m_pIEPatcherDlg;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CIEPatcherApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CIEPatcherApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IEPATCHER_H__A603167A_3B36_11D2_B44D_00600819607E__INCLUDED_)

View File

@ -1,41 +0,0 @@
// IEPatcher.odl : type library source for IEPatcher.exe
// This file will be processed by the MIDL compiler to produce the
// type library (IEPatcher.tlb).
[ uuid(A6031676-3B36-11D2-B44D-00600819607E), version(1.0) ]
library IEPatcher
{
importlib("stdole32.tlb");
// Primary dispatch interface for CIEPatcherDoc
[ uuid(A6031677-3B36-11D2-B44D-00600819607E) ]
dispinterface IIEPatcher
{
properties:
// NOTE - ClassWizard will maintain property information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_PROP(CIEPatcherDlgAutoProxy)
//}}AFX_ODL_PROP
methods:
// NOTE - ClassWizard will maintain method information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_METHOD(CIEPatcherDlgAutoProxy)
//}}AFX_ODL_METHOD
};
// Class information for CIEPatcherDoc
[ uuid(A6031675-3B36-11D2-B44D-00600819607E) ]
coclass IEPatcher
{
[default] dispinterface IIEPatcher;
};
//{{AFX_APPEND_ODL}}
//}}AFX_APPEND_ODL}}
};

View File

@ -1,236 +0,0 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_IEPATCHER_DIALOG DIALOGEX 0, 0, 323, 202
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "IE to Mozilla Patcher"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "&Scan...",IDC_SCAN,266,6,50,14
CONTROL "List1",IDC_FILELIST,"SysListView32",LVS_REPORT |
LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER |
WS_TABSTOP,7,59,309,136
PUSHBUTTON "&Patch",IDC_PATCH,266,26,50,14
LTEXT "Add files to the source list by selecting ""Scan"". Files containing references to Internet Explorer or Mozilla will be highlighted.",
IDC_STATIC,7,6,257,18
LTEXT "Choose ""Patch"" to apply the Mozilla patch to any selected files. The patching process does not overwrite the original file but creates a new file prepended with ""moz_"" which you may test at your leisure.",
IDC_STATIC,7,30,257,26
END
IDD_SCANFORFILES DIALOG DISCARDABLE 0, 0, 227, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Scan for files"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Type a filename or wildcard pattern or use ""Pick File..."" or ""Pick Folder...""",
IDC_STATIC,7,7,155,18
EDITTEXT IDC_FILEPATTERN,5,25,158,13,ES_AUTOHSCROLL
PUSHBUTTON "Pick File...",IDC_SELECTFILE,29,43,55,13
DEFPUSHBUTTON "OK",IDOK,170,5,50,14
PUSHBUTTON "Cancel",IDCANCEL,170,25,50,14
PUSHBUTTON "Pick Folder...",IDC_SELECTFOLDER,89,43,55,13
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "IEPatcher MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "IEPatcher\0"
VALUE "LegalCopyright", "Copyright (C) 1998\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "IEPatcher.EXE\0"
VALUE "ProductName", "IEPatcher Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_IEPATCHER_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 316
TOPMARGIN, 6
BOTTOMMARGIN, 195
END
IDD_SCANFORFILES, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 220
TOPMARGIN, 7
BOTTOMMARGIN, 56
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_CONTAINSIE ICON DISCARDABLE "res\\containsie.ico"
IDI_DOESNTCONTAINIE ICON DISCARDABLE "res\\doesntcontainie.ico"
IDI_CONTAINSMOZILLA ICON DISCARDABLE "res\\containsmozilla.ico"
IDI_UNKNOWNSTATUS ICON DISCARDABLE "res\\unknownstatus.ico"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDP_OLE_INIT_FAILED "OLE initialization failed. Make sure that the OLE libraries are the correct version."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (Ireland) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENI)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_EIRE
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif\r\n"
"#include ""res\\IEPatcher.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\IEPatcher.ico"
#endif // English (Ireland) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif
#include "res\IEPatcher.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -1,13 +0,0 @@
REGEDIT
; This .REG file may be used by your SETUP program.
; If a SETUP program is not available, the entries below will be
; registered in your InitInstance automatically with a call to
; CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll.
HKEY_CLASSES_ROOT\IEPatcher.Application = IEPatcher Application
HKEY_CLASSES_ROOT\IEPatcher.Application\CLSID = {A6031675-3B36-11D2-B44D-00600819607E}
HKEY_CLASSES_ROOT\CLSID\{A6031675-3B36-11D2-B44D-00600819607E} = IEPatcher Application
HKEY_CLASSES_ROOT\CLSID\{A6031675-3B36-11D2-B44D-00600819607E}\ProgId = IEPatcher.Application
HKEY_CLASSES_ROOT\CLSID\{A6031675-3B36-11D2-B44D-00600819607E}\LocalServer32 = IEPATCHER.EXE

View File

@ -1,622 +0,0 @@
// IEPatcherDlg.cpp : implementation file
//
#include "stdafx.h"
#include "IEPatcher.h"
#include "IEPatcherDlg.h"
#include "ScanForFilesDlg.h"
#include "ScannerThread.h"
#include "DlgProxy.h"
#include <sys/types.h>
#include <sys/stat.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
const CLSID CLSID_WebBrowser_V1 = { 0xEAB22AC3, 0x30C1, 0x11CF, { 0xA7, 0xEB, 0x00, 0x00, 0xC0, 0x5B, 0xAE, 0x0B } };
const CLSID CLSID_WebBrowser = { 0x8856F961, 0x340A, 0x11D0, { 0xA9, 0x6B, 0x00, 0xC0, 0x4F, 0xD7, 0x05, 0xA2 } };
const CLSID CLSID_InternetExplorer = { 0x0002DF01, 0x0000, 0x0000, { 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } };
const CLSID CLSID_MozillaBrowser = {0x1339B54C,0x3453,0x11D2,{0x93,0xB9,0x00,0x00,0x00,0x00,0x00,0x00}};
const IID IID_IWebBrowser = { 0xEAB22AC1, 0x30C1, 0x11CF, { 0xA7, 0xEB, 0x00, 0x00, 0xC0, 0x5B, 0xAE, 0x0B } };
const IID IID_IWebBrowser2 = { 0xD30C1661, 0xCDAF, 0x11d0, { 0x8A, 0x3E, 0x00, 0xC0, 0x4F, 0xC9, 0xE2, 0x6E } };
const IID IID_IWebBrowserApp = { 0x0002DF05, 0x0000, 0x0000, { 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } };
#define ITEM_PATCHSTATUS 1
#define IMG_DOESNTCONTAINIE 0
#define IMG_CONTAINSIE 1
#define IMG_CONTAINSMOZILLA 2
#define IMG_UNKNOWNSTATUS 3
/////////////////////////////////////////////////////////////////////////////
// CIEPatcherDlg dialog
IMPLEMENT_DYNAMIC(CIEPatcherDlg, CDialog);
CIEPatcherDlg::CIEPatcherDlg(CWnd* pParent /*=NULL*/)
: CDialog(CIEPatcherDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CIEPatcherDlg)
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
m_pAutoProxy = NULL;
}
CIEPatcherDlg::~CIEPatcherDlg()
{
// If there is an automation proxy for this dialog, set
// its back pointer to this dialog to NULL, so it knows
// the dialog has been deleted.
if (m_pAutoProxy != NULL)
m_pAutoProxy->m_pDialog = NULL;
}
void CIEPatcherDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CIEPatcherDlg)
DDX_Control(pDX, IDC_PATCH, m_btnPatch);
DDX_Control(pDX, IDC_FILELIST, m_cFileList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CIEPatcherDlg, CDialog)
//{{AFX_MSG_MAP(CIEPatcherDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_SCAN, OnScan)
ON_NOTIFY(NM_CLICK, IDC_FILELIST, OnClickFilelist)
ON_BN_CLICKED(IDC_PATCH, OnPatch)
//}}AFX_MSG_MAP
ON_MESSAGE(WM_UPDATEFILESTATUS, OnUpdateFileStatus)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CIEPatcherDlg message handlers
BOOL CIEPatcherDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Start the scanner thread
AfxBeginThread(RUNTIME_CLASS(CScannerThread), 0);
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// Add icons to image list
m_cImageList.Create(16, 16, ILC_MASK, 0, 5);
m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_DOESNTCONTAINIE));
m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_CONTAINSIE));
m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_CONTAINSMOZILLA));
m_cImageList.Add(AfxGetApp()->LoadIcon(IDI_UNKNOWNSTATUS));
// Associate image list with file list
m_cFileList.SetImageList(&m_cImageList, LVSIL_SMALL);
struct ColumnData
{
TCHAR *sColumnTitle;
int nPercentageWidth;
int nFormat;
};
ColumnData aColData[] =
{
{ _T("File"), 70, LVCFMT_LEFT },
{ _T("Patch Status"), 30, LVCFMT_LEFT }
};
// Get the size of the file list control and neatly
// divide it into columns
CRect rcFileList;
m_cFileList.GetClientRect(&rcFileList);
int nColTotal = sizeof(aColData) / sizeof(aColData[0]);
int nWidthRemaining = rcFileList.Width();
for (int nCol = 0; nCol < nColTotal; nCol++)
{
ColumnData *pData = &aColData[nCol];
int nColWidth = (rcFileList.Width() * pData->nPercentageWidth) / 100;
if (nCol == nColTotal - 1)
{
nColWidth = nWidthRemaining;
}
else if (nColWidth > nWidthRemaining)
{
nColWidth = nWidthRemaining;
}
m_cFileList.InsertColumn(nCol, pData->sColumnTitle, pData->nFormat, nColWidth);
nWidthRemaining -= nColWidth;
if (nColWidth <= 0)
{
break;
}
}
return TRUE; // return TRUE unless you set the focus to a control
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CIEPatcherDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CIEPatcherDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
// Automation servers should not exit when a user closes the UI
// if a controller still holds on to one of its objects. These
// message handlers make sure that if the proxy is still in use,
// then the UI is hidden but the dialog remains around if it
// is dismissed.
void CIEPatcherDlg::OnClose()
{
if (CanExit())
CDialog::OnClose();
}
LONG CIEPatcherDlg::OnUpdateFileStatus(WPARAM wParam, LPARAM lParam)
{
PatchStatus ps = (PatchStatus) wParam;
TCHAR *pszFile = (TCHAR *) lParam;
UpdateFileStatus(pszFile, ps);
return 0;
}
void CIEPatcherDlg::OnScan()
{
CScanForFilesDlg dlg;
if (dlg.DoModal() == IDOK)
{
CWaitCursor wc;
CFileFind op;
if (op.FindFile(dlg.m_sFilePattern))
{
op.FindNextFile();
do {
if (!op.IsDirectory())
{
AddFileToList(op.GetFilePath());
}
} while (op.FindNextFile());
op.Close();
}
}
}
void CIEPatcherDlg::OnPatch()
{
int nItem = -1;
do {
nItem = m_cFileList.GetNextItem(nItem, LVNI_ALL | LVNI_SELECTED);
if (nItem != -1)
{
m_cQueuedFileDataList[nItem]->ps = psPatchPending;
UpdateFileStatus(nItem, m_cQueuedFileDataList[nItem]->sFileName, m_cQueuedFileDataList[nItem]->ps);
}
} while (nItem != -1);
}
void CIEPatcherDlg::OnClickFilelist(NMHDR* pNMHDR, LRESULT* pResult)
{
// Check if files are selected
*pResult = 0;
}
///////////////////////////////////////////////////////////////////////////////
BOOL CIEPatcherDlg::CanExit()
{
// If the proxy object is still around, then the automation
// controller is still holding on to this application. Leave
// the dialog around, but hide its UI.
if (m_pAutoProxy != NULL)
{
ShowWindow(SW_HIDE);
return FALSE;
}
return TRUE;
}
PatchStatus CIEPatcherDlg::ScanFile(const CString &sFileName)
{
char *pszBuffer = NULL;
long nBufferSize = 0;
if (!ReadFileToBuffer(sFileName, &pszBuffer, &nBufferSize))
{
return psFileError;
}
PatchStatus ps = ScanBuffer(pszBuffer, nBufferSize, FALSE);
delete []pszBuffer;
return ps;
}
BOOL CIEPatcherDlg::WriteBufferToFile(const CString &sFileName, char *pszBuffer, long nBufferSize)
{
CString sMessage;
sMessage.Format("Saving patched file \"%s\"", sFileName);
TraceProgress(sMessage);
FILE *fDest = fopen(sFileName, "wb");
if (fDest == NULL)
{
TraceProgress("Error: Could not open destination file");
return FALSE;
}
fwrite(pszBuffer, 1, nBufferSize, fDest);
fclose(fDest);
TraceProgress("File saved");
return TRUE;
}
BOOL CIEPatcherDlg::ReadFileToBuffer(const CString &sFileName, char **ppszBuffer, long *pnBufferSize)
{
CString sProcessing;
sProcessing.Format("Processing file \"%s\"", sFileName);
TraceProgress(sProcessing);
// Allocate a memory buffer to slurp up the whole file
struct _stat srcStat;
_stat(sFileName, &srcStat);
char *pszBuffer = new char[srcStat.st_size / sizeof(char)];
if (pszBuffer == NULL)
{
TraceProgress("Error: Could not allocate buffer for file");
return FALSE;
}
FILE *fSrc = fopen(sFileName, "rb");
if (fSrc == NULL)
{
TraceProgress("Error: Could not open file");
delete []pszBuffer;
return FALSE;
}
size_t sizeSrc = srcStat.st_size;
size_t sizeRead = 0;
// Dumb but effective
sizeRead = fread(pszBuffer, 1, sizeSrc, fSrc);
fclose(fSrc);
if (sizeRead != sizeSrc)
{
TraceProgress("Error: Could not read all of file");
delete []pszBuffer;
return FALSE;
}
*ppszBuffer = pszBuffer;
*pnBufferSize = sizeRead;
return TRUE;
}
PatchStatus CIEPatcherDlg::ScanBuffer(char *pszBuffer, long nBufferSize, BOOL bApplyPatch)
{
if (nBufferSize < sizeof(CLSID))
{
return psNotPatchable;
}
TraceProgress("Scanning for IE...");
BOOL bPatchApplied = FALSE;
PatchStatus ps = psUnknownStatus;
// Scan through buffer, one byte at a time doing a memcmp
for (size_t i = 0; i < nBufferSize - sizeof(CLSID); i++)
{
if (memcmp(&pszBuffer[i], &CLSID_MozillaBrowser, sizeof(CLSID)) == 0)
{
TraceProgress("Found CLSID_MozillaBrowser");
if (ps == psUnknownStatus)
{
ps = psAlreadyPatched;
}
}
else if (memcmp(&pszBuffer[i], &CLSID_WebBrowser_V1, sizeof(CLSID)) == 0)
{
TraceProgress("Found CLSID_WebBrowser_V1");
if (ps == psUnknownStatus)
{
ps = psPatchable;
}
if (bApplyPatch)
{
TraceProgress("Patching with CLSID_MozillaBrowser");
memcpy(&pszBuffer[i], &CLSID_MozillaBrowser, sizeof(CLSID));
bPatchApplied = TRUE;
}
}
else if (memcmp(&pszBuffer[i], &CLSID_WebBrowser, sizeof(CLSID)) == 0)
{
TraceProgress("Found CLSID_WebBrowser");
if (ps == psUnknownStatus)
{
ps = psPatchable;
}
if (bApplyPatch)
{
TraceProgress("Patching with CLSID_MozillaBrowser");
memcpy(&pszBuffer[i], &CLSID_MozillaBrowser, sizeof(CLSID));
TraceProgress("Patching with CLSID_MozillaBrowser");
bPatchApplied = TRUE;
}
}
else if (memcmp(&pszBuffer[i], &IID_IWebBrowser, sizeof(CLSID)) == 0)
{
TraceProgress("Found IID_IWebBrowser");
if (ps == psUnknownStatus)
{
ps = psPatchable;
}
}
else if (memcmp(&pszBuffer[i], &CLSID_InternetExplorer, sizeof(CLSID)) == 0)
{
TraceProgress("Warning: Found CLSID_InternetExplorer, patching might not work");
if (ps == psUnknownStatus)
{
ps = psMayBePatchable;
}
}
else if (memcmp(&pszBuffer[i], &IID_IWebBrowser2, sizeof(CLSID)) == 0)
{
TraceProgress("Found IID_IWebBrowser2");
if (ps == psUnknownStatus)
{
ps = psPatchable;
}
}
else if (memcmp(&pszBuffer[i], &IID_IWebBrowserApp, sizeof(CLSID)) == 0)
{
TraceProgress("Found IID_IWebBrowserApp");
if (ps == psUnknownStatus)
{
ps = psPatchable;
}
}
}
if (ps == psUnknownStatus)
{
ps = psNotPatchable;
}
if (bApplyPatch)
{
ps = (bPatchApplied) ? psAlreadyPatched : psNotPatchable;
}
TraceProgress("Scan completed");
return ps;
}
BOOL CIEPatcherDlg::PatchFile(const CString & sFileFrom, const CString & sFileTo, PatchStatus *pPatchStatus)
{
if (sFileTo.IsEmpty())
{
return FALSE;
}
if (sFileTo == sFileFrom)
{
TraceProgress("Warning: Patching disabled for safety reasons, source and destination names must differ");
return FALSE;
}
char *pszBuffer = NULL;
long nBufferSize = 0;
if (!ReadFileToBuffer(sFileFrom, &pszBuffer, &nBufferSize))
{
return FALSE;
}
// Scan and patch the buffer
*pPatchStatus = ScanBuffer(pszBuffer, nBufferSize, TRUE);
if (*pPatchStatus == psNotPatchable)
{
TraceProgress("Error: Nothing was found to patch");
}
else
{
// Write out the patch file
WriteBufferToFile(sFileTo, pszBuffer, nBufferSize);
}
delete []pszBuffer;
return FALSE;
}
void CIEPatcherDlg::TraceProgress(const CString &sProgress)
{
// TODO
}
void CIEPatcherDlg::AddFileToList(const CString & sFile)
{
CSingleLock sl(&m_csQueuedFileDataList, TRUE);
int nIndex = m_cFileList.GetItemCount();
m_cFileList.InsertItem(nIndex, sFile, IMG_UNKNOWNSTATUS);
QueuedFileData *pData = new QueuedFileData;
pData->ps = psUnknownStatus;
pData->sFileName = sFile;
pData->sPatchedFileName = sFile;
m_cQueuedFileDataList.Add(pData);
UpdateFileStatus(nIndex, pData->ps);
}
void CIEPatcherDlg::UpdateFileStatus(int nFileIndex, const CString &sFile, PatchStatus ps)
{
CString sStatus;
int nIconStatus = -1;
switch (ps)
{
case psFileError:
sStatus = _T("File error");
break;
case psNotPatchable:
sStatus = _T("Nothing to patch");
nIconStatus = IMG_DOESNTCONTAINIE;
break;
case psPatchable:
sStatus = _T("Patchable");
nIconStatus = IMG_CONTAINSIE;
break;
case psMayBePatchable:
sStatus = _T("Maybe patchable");
nIconStatus = IMG_CONTAINSIE;
break;
case psAlreadyPatched:
sStatus = _T("Already patched");
nIconStatus = IMG_CONTAINSMOZILLA;
break;
case psUnknownStatus:
sStatus = _T("Status pending");
nIconStatus = IMG_UNKNOWNSTATUS;
break;
case psPatchPending:
sStatus = _T("Patch pending");
break;
default:
sStatus = _T("*** ERROR ***");
break;
}
if (nIconStatus != -1)
{
m_cFileList.SetItem(nFileIndex, -1, LVIF_IMAGE, NULL, nIconStatus, 0, 0, 0);
}
m_cFileList.SetItemText(nFileIndex, ITEM_PATCHSTATUS, sStatus);
}
void CIEPatcherDlg::UpdateFileStatus(const CString &sFile, PatchStatus ps)
{
CSingleLock sl(&m_csQueuedFileDataList, TRUE);
for (int n = 0; n < m_cQueuedFileDataList.GetSize(); n++)
{
if (m_cQueuedFileDataList[n]->sFileName == sFile)
{
UpdateFileStatus(n, sFile, ps);
m_cQueuedFileDataList[n]->ps = ps;
return;
}
}
}
BOOL CIEPatcherDlg::GetPendingFileToScan(CString & sFileToScan)
{
CSingleLock sl(&m_csQueuedFileDataList, TRUE);
for (int n = 0; n < m_cQueuedFileDataList.GetSize(); n++)
{
if (m_cQueuedFileDataList[n]->ps == psUnknownStatus)
{
sFileToScan = m_cQueuedFileDataList[n]->sFileName;
return TRUE;
}
}
return FALSE;
}
BOOL CIEPatcherDlg::GetPendingFileToPatch(CString & sFileToPatch)
{
CSingleLock sl(&m_csQueuedFileDataList, TRUE);
for (int n = 0; n < m_cQueuedFileDataList.GetSize(); n++)
{
if (m_cQueuedFileDataList[n]->ps == psPatchPending)
{
sFileToPatch = m_cQueuedFileDataList[n]->sFileName;
return TRUE;
}
}
return FALSE;
}

View File

@ -1,105 +0,0 @@
// IEPatcherDlg.h : header file
//
#if !defined(AFX_IEPATCHERDLG_H__A603167C_3B36_11D2_B44D_00600819607E__INCLUDED_)
#define AFX_IEPATCHERDLG_H__A603167C_3B36_11D2_B44D_00600819607E__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
class CIEPatcherDlgAutoProxy;
enum PatchStatus
{
psFileError,
psUnknownStatus,
psPatchPending,
psNotPatchable,
psPatchable,
psMayBePatchable,
psAlreadyPatched
};
struct QueuedFileData
{
CString sFileName;
CString sPatchedFileName;
PatchStatus ps;
};
#define WM_UPDATEFILESTATUS WM_USER+1
/////////////////////////////////////////////////////////////////////////////
// CIEPatcherDlg dialog
class CIEPatcherDlg : public CDialog
{
DECLARE_DYNAMIC(CIEPatcherDlg);
friend class CIEPatcherDlgAutoProxy;
// Construction
public:
void AddFileToList(const CString &sFile);
BOOL GetPendingFileToScan(CString &sFileToScan);
BOOL GetPendingFileToPatch(CString &sFileToPatch);
static PatchStatus ScanFile(const CString &sFileName);
static PatchStatus ScanBuffer(char *pszBuffer, long nBufferSize, BOOL bApplyPatches);
static BOOL PatchFile(const CString & sFileFrom, const CString & sFileTo, PatchStatus *pPatchStatus);
static BOOL WriteBufferToFile(const CString &sFileName, char *pszBuffer, long nBufferSize);
static BOOL ReadFileToBuffer(const CString &sFileName, char **ppszBuffer, long *pnBufferSize);
static void TraceProgress(const CString &sProgress);
void UpdateFileStatus(const CString &sFile, PatchStatus ps);
void UpdateFileStatus(int nFileIndex, const CString &sFile, PatchStatus ps);
CIEPatcherDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CIEPatcherDlg();
CImageList m_cImageList;
CArray<QueuedFileData *, QueuedFileData *> m_cQueuedFileDataList;
CCriticalSection m_csQueuedFileDataList;
// Dialog Data
//{{AFX_DATA(CIEPatcherDlg)
enum { IDD = IDD_IEPATCHER_DIALOG };
CButton m_btnPatch;
CListCtrl m_cFileList;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CIEPatcherDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CIEPatcherDlgAutoProxy* m_pAutoProxy;
HICON m_hIcon;
BOOL CanExit();
// Generated message map functions
//{{AFX_MSG(CIEPatcherDlg)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnClose();
afx_msg void OnScan();
afx_msg void OnClickFilelist(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnPatch();
//}}AFX_MSG
afx_msg LONG OnUpdateFileStatus(WPARAM, LPARAM);
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IEPATCHERDLG_H__A603167C_3B36_11D2_B44D_00600819607E__INCLUDED_)

View File

@ -1,110 +0,0 @@
// ScanForFilesDlg.cpp : implementation file
//
#include "stdafx.h"
#include "IEPatcher.h"
#include "ScanForFilesDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CScanForFilesDlg dialog
CScanForFilesDlg::CScanForFilesDlg(CWnd* pParent /*=NULL*/)
: CDialog(CScanForFilesDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CScanForFilesDlg)
m_sFilePattern = _T("");
//}}AFX_DATA_INIT
}
void CScanForFilesDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CScanForFilesDlg)
DDX_Text(pDX, IDC_FILEPATTERN, m_sFilePattern);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CScanForFilesDlg, CDialog)
//{{AFX_MSG_MAP(CScanForFilesDlg)
ON_BN_CLICKED(IDC_SELECTFILE, OnSelectFile)
ON_BN_CLICKED(IDC_SELECTFOLDER, OnSelectFolder)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScanForFilesDlg message handlers
void CScanForFilesDlg::OnOK()
{
UpdateData();
CDialog::OnOK();
}
void CScanForFilesDlg::OnSelectFile()
{
CFileDialog dlg(TRUE, NULL, _T("*.*"));
if (dlg.DoModal() == IDOK)
{
m_sFilePattern = dlg.GetPathName();
UpdateData(FALSE);
}
}
void CScanForFilesDlg::OnSelectFolder()
{
BROWSEINFO bi;
TCHAR szFolder[MAX_PATH + 1];
memset(szFolder, 0, sizeof(szFolder));
memset(&bi, 0, sizeof(bi));
bi.hwndOwner = GetSafeHwnd();
bi.pidlRoot = NULL;
bi.pszDisplayName = szFolder;
bi.lpszTitle = _T("Pick a folder to scan");
// Open the folder browser dialog
LPITEMIDLIST pItemList = SHBrowseForFolder(&bi);
if (pItemList)
{
IMalloc *pShellAllocator = NULL;
SHGetMalloc(&pShellAllocator);
if (pShellAllocator)
{
char szPath[MAX_PATH + 1];
if (SHGetPathFromIDList(pItemList, szPath))
{
// Chop off the end path seperator
int nPathSize = strlen(szPath);
if (nPathSize > 0)
{
if (szPath[nPathSize - 1] == '\\')
{
szPath[nPathSize - 1] = '\0';
}
}
// Form the file pattern
USES_CONVERSION;
m_sFilePattern.Format(_T("%s\\*.*"), A2T(szPath));
UpdateData(FALSE);
}
pShellAllocator->Free(pItemList);
pShellAllocator->Release();
}
}
}

View File

@ -1,48 +0,0 @@
#if !defined(AFX_SCANFORFILESDLG_H__2CAAFC02_6C47_11D2_A1F5_000000000000__INCLUDED_)
#define AFX_SCANFORFILESDLG_H__2CAAFC02_6C47_11D2_A1F5_000000000000__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ScanForFilesDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CScanForFilesDlg dialog
class CScanForFilesDlg : public CDialog
{
// Construction
public:
CScanForFilesDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CScanForFilesDlg)
enum { IDD = IDD_SCANFORFILES };
CString m_sFilePattern;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CScanForFilesDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CScanForFilesDlg)
virtual void OnOK();
afx_msg void OnSelectFile();
afx_msg void OnSelectFolder();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCANFORFILESDLG_H__2CAAFC02_6C47_11D2_A1F5_000000000000__INCLUDED_)

View File

@ -1,46 +0,0 @@
// ScannerThread.cpp : implementation file
//
#include "stdafx.h"
#include "iepatcher.h"
#include "ScannerThread.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CScannerThread
IMPLEMENT_DYNCREATE(CScannerThread, CWinThread)
CScannerThread::CScannerThread()
{
}
CScannerThread::~CScannerThread()
{
}
BOOL CScannerThread::InitInstance()
{
m_cScannerWnd.Create(AfxRegisterWndClass(0), _T("Scanner"), 0L, CRect(0, 0, 0, 0), AfxGetMainWnd(), 1);
return TRUE;
}
int CScannerThread::ExitInstance()
{
// TODO: perform any per-thread cleanup here
return CWinThread::ExitInstance();
}
BEGIN_MESSAGE_MAP(CScannerThread, CWinThread)
//{{AFX_MSG_MAP(CScannerThread)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScannerThread message handlers

View File

@ -1,54 +0,0 @@
#if !defined(AFX_SCANNERTHREAD_H__2CAAFC04_6C47_11D2_A1F5_000000000000__INCLUDED_)
#define AFX_SCANNERTHREAD_H__2CAAFC04_6C47_11D2_A1F5_000000000000__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ScannerThread.h : header file
//
#include "ScannerWnd.h"
/////////////////////////////////////////////////////////////////////////////
// CScannerThread thread
class CScannerThread : public CWinThread
{
DECLARE_DYNCREATE(CScannerThread)
protected:
CScannerThread(); // protected constructor used by dynamic creation
// Attributes
public:
CScannerWnd m_cScannerWnd;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CScannerThread)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CScannerThread();
// Generated message map functions
//{{AFX_MSG(CScannerThread)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCANNERTHREAD_H__2CAAFC04_6C47_11D2_A1F5_000000000000__INCLUDED_)

View File

@ -1,82 +0,0 @@
// ScannerWnd.cpp : implementation file
//
#include "stdafx.h"
#include "iepatcher.h"
#include "ScannerWnd.h"
#include "IEPatcherDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CScannerWnd
CScannerWnd::CScannerWnd()
{
}
CScannerWnd::~CScannerWnd()
{
}
BEGIN_MESSAGE_MAP(CScannerWnd, CWnd)
//{{AFX_MSG_MAP(CScannerWnd)
ON_WM_TIMER()
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScannerWnd message handlers
int CScannerWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
SetTimer(1, 500, NULL);
return 0;
}
void CScannerWnd::OnTimer(UINT nIDEvent)
{
CIEPatcherDlg * pDlg = ((CIEPatcherApp *) AfxGetApp())->m_pIEPatcherDlg;
if (pDlg)
{
CString sFileToProcess;
if (pDlg->GetPendingFileToScan(sFileToProcess))
{
PatchStatus ps = CIEPatcherDlg::ScanFile(sFileToProcess);
AfxGetMainWnd()->SendMessage(WM_UPDATEFILESTATUS, (WPARAM) ps, (LPARAM) (const TCHAR *) sFileToProcess);
}
else if (pDlg->GetPendingFileToPatch(sFileToProcess))
{
TCHAR szDrive[_MAX_DRIVE];
TCHAR szDir[_MAX_DIR];
TCHAR szFile[_MAX_FNAME];
TCHAR szExt[_MAX_EXT];
_tsplitpath(sFileToProcess, szDrive, szDir, szFile, szExt);
CString sFileOut;
TCHAR szPath[_MAX_PATH];
sFileOut.Format(_T("moz_%s"), szFile);
_tmakepath(szPath, szDrive, szDir, sFileOut, szExt);
PatchStatus ps;
CIEPatcherDlg::PatchFile(sFileToProcess, szPath, &ps);
AfxGetMainWnd()->SendMessage(WM_UPDATEFILESTATUS, (WPARAM) ps, (LPARAM) (const TCHAR *) sFileToProcess);
}
}
CWnd::OnTimer(nIDEvent);
}

View File

@ -1,48 +0,0 @@
#if !defined(AFX_SCANNERWND_H__2CAAFC05_6C47_11D2_A1F5_000000000000__INCLUDED_)
#define AFX_SCANNERWND_H__2CAAFC05_6C47_11D2_A1F5_000000000000__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ScannerWnd.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CScannerWnd window
class CScannerWnd : public CWnd
{
// Construction
public:
CScannerWnd();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CScannerWnd)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CScannerWnd();
// Generated message map functions
protected:
//{{AFX_MSG(CScannerWnd)
afx_msg void OnTimer(UINT nIDEvent);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCANNERWND_H__2CAAFC05_6C47_11D2_A1F5_000000000000__INCLUDED_)

View File

@ -1,6 +0,0 @@
// stdafx.cpp : source file that includes just the standard includes
// IEPatcher.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View File

@ -1,42 +0,0 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__A6031681_3B36_11D2_B44D_00600819607E__INCLUDED_)
#define AFX_STDAFX_H__A6031681_3B36_11D2_B44D_00600819607E__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC OLE automation classes
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxtempl.h>
#include <afxmt.h>
#include <afxpriv.h>
#include <shlobj.h>
// This macro is the same as IMPLEMENT_OLECREATE, except it passes TRUE
// for the bMultiInstance parameter to the COleObjectFactory constructor.
// We want a separate instance of this application to be launched for
// each OLE automation proxy object requested by automation controllers.
#ifndef IMPLEMENT_OLECREATE2
#define IMPLEMENT_OLECREATE2(class_name, external_name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
AFX_DATADEF COleObjectFactory class_name::factory(class_name::guid, \
RUNTIME_CLASS(class_name), TRUE, _T(external_name)); \
const AFX_DATADEF GUID class_name::guid = \
{ l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } };
#endif // IMPLEMENT_OLECREATE2
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__A6031681_3B36_11D2_B44D_00600819607E__INCLUDED_)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,13 +0,0 @@
//
// IEPATCHER.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

View File

@ -1,35 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by IEPatcher.rc
//
#define IDP_OLE_INIT_FAILED 100
#define IDD_IEPATCHER_DIALOG 102
#define IDR_MAINFRAME 128
#define IDI_CONTAINSIE 129
#define IDI_DOESNTCONTAINIE 130
#define IDI_CONTAINSMOZILLA 131
#define IDD_SCANFORFILES 132
#define IDI_UNKNOWNSTATUS 133
#define IDC_FILENAME 1000
#define IDC_SCAN 1001
#define IDC_PROGRESS 1002
#define IDC_PATCHFILE 1003
#define IDC_DESTINATION_FILENAME 1004
#define IDC_PICKSOURCE 1005
#define IDC_PICKDESTINATION 1006
#define IDC_FILELIST 1007
#define IDC_PATCH 1008
#define IDC_FILEPATTERN 1009
#define IDC_SELECTFILE 1011
#define IDC_SELECTFOLDER 1012
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 134
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1012
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif