|
makefile:
CC=CL
CCFLAGS=/O1 /link /entry:main /opt:nowin98 kernel32.lib
VssD7Crack.exe: VssD7Crack.cpp
$(CC) VssD7Crack.cpp $(CCFLAGS)
readme.txt:
This is a crack for VssConneXion for Delphi 7 Version 2.2 Build 10.
Usage.
------
1. Place file "VssD7Crack.exe" in to the folder where VssConne&
#120;ion was
installed.
2. Run it.
3. If everything is fine you'll see the newly created file named "VssD7.
bak".
4. Run Delphi 7 and enjoy the power of Visual SourceSafe inside Borland
Delphi 7.
Info.
-----
See file "VssD7chk.pas" to get know how the VssConnexion was protec
ted.
See file "VssD7Crack.cpp" to get know how to code a patcher. To compile
a sample I used MSVC 6.0
VssD7chk.pas:
unit vssd7chk;
interface
uses
SysUtils, Registry, Windows;
//There is a function CheckShareware in the VssD7.dll.
//
//It's called only once like this:
// GetVCXConsts.IsShareware := CheckShareware;
//
//Later VssConnexion many times checks if it runs as shareware, like this:
// if GetVCXConsts.IsShareware then
type
TVCXConsts = class
private
FIsShareware: boolean;
//I don't know what are the remaining fields, but it doesn't matter
for me.
public
property IsShareware: boolean read FIsShareware write FIsShareware;
//I think there is a lot of properties remain unknown
end;
function GetVCXConsts: TVCXConsts;
function CheckShareware: Boolean;
implementation
var
g_VCXConsts: TVCXConsts = nil;
function GetVCXConsts: TVCXConsts;
begin
if g_VCXConsts = nil then
g_VCXConsts := TVCXConsts.Create;
Result := g_VCXConsts;
end;
function CheckShareware: Boolean;
{$IFNDEF CRACKED}
//Original function from CODE:1CE6BCD0 (File:0006B0D0
;) of VssD7.dll
var
regKey: TRegistry;
begin
try
Result := true;
try
regKey := TRegistry.Create(STANDARD_RIGHTS_READ or KEY_QUERY_VALUE or KEY_
SET_VALUE or KEY_CREATE_SUB_KEY or KEY_ENUMERATE_SUB_KEYS or KEY_NOTIFY);
try
regKey.RootKey := HKEY_CLASSES_ROOT;
if regKey.OpenKey('CLSID\{24FD5193-AB84-11D2-A0E
7-00104B243179' + IntToStr(GetCurrentProcessId) +
39;}', false) then
try
if regKey.ReadString('') = 'Shell.Ext' then
Result := false
finally
regKey.CloseKey;
regKey.DeleteKey('CLSID\{24FD5193-AB84-11D2-A0
E7-00104B243179' + IntToStr(GetCurrentProcessId) + &
#39;}')
end;
finally
regKey.Free;
end;
except
Result := true;
end;
finally
end;
end;
{$ELSE}
//Cracked version of CheckShareware
begin
Result := false;
end;
{$ENDIF}
end.
VssD7Crack.cpp:
#include <windows.h>
#define DLL_NAME "VssD7.dll"
#define BACK_UP "VssD7.bak"
#define SIZE_OF_DLL 840192
#define OFFSET 0x6B0D0
#define SIGNATURE_SIZE 64
#define SIGNATURE "\x55\x8B\xEC\x33\xC9\x5
1\x51\x51\x51\x51\x51\x5
49;\x53\x56\x57\x33\xC0\x55\x68\x3F\
xBE\xE6\x1C\x64\xFF\x30\x64\x8
57;\x20\xC6\x45\xFF\x01\x33\xC
8;\x55\x68\x16\xBE\xE6\x1C\x64\x
FF\x30\x64\x89\x20\xB9\x1F\
20;00\x02\x00\xB2\x01\xA
9;\xBC\x09\xE7\x1C\xE8\x68\x78\
120;F9\xFF"
#define NEW_SIGNATURE "\x66\x33\xC0\xC3"
// NEW_SIGNATURE:
// xor eax,eax
// ret
#define NEW_SIGNATURE_SIZE 4
int memcmp(char *p1, char *p2, int count)
{
while(*p1++ == *p2++)
{
count--;
if(!count) break;
}
return count;
}
void main(void)
{
HANDLE hFile = CreateFile(DLL_NAME, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_ARCHIVE, NULL);
if(INVALID_HANDLE_VALUE != hFile)
{
if(SIZE_OF_DLL == SetFilePointer(hFile, 0, NULL, FILE_END))
{
SetFilePointer(hFile, OFFSET, NULL, FILE_BEGIN);
DWORD dwBytes;
CHAR pBytes[SIGNATURE_SIZE];
ReadFile(hFile, pBytes, SIGNATURE_SIZE, &dwBytes, NULL);
if(!memcmp(pBytes, SIGNATURE, SIGNATURE_SIZE))
{
if(CopyFile(DLL_NAME, BACK_UP, FALSE))
{
SetFilePointer(hFile, OFFSET, NULL, FILE_BEGIN);
WriteFile(hFile, NEW_SIGNATURE, NEW_SIGNATURE_SIZE, &dwBytes, NULL);
}
}
}
CloseHandle(hFile);
}
}
|