PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : [Request] Mousefix nach Anir/Aions Art für Win7 x64 möglich


qu3x^
2010-10-22, 04:10:21
Hallo ihrs ich schreib hier so rein weil ich selbst keinen Plan vom Coden habe, und ich auf eure Hilfe angewiesen bin.
Der folgende Code wurde für den besten Mousefix für Windows XP verwendet und stamm ursprünglich von einem User aus den Razerblueprints-Forum (anir bzw aion).
Der User selbst ist nicht mehr zu kontaktieren weil verschollen, nicht mehr aktiv, kA. Nun sind fast 4 Jahre vergangen ohne einen annähernd so guten Mousefix.
Viele setzten auf Registrytweaks, jedoch musste ich feststellen das nie das selbe Mausfeeling wie unter XP aufgetreten ist.
Zudem hatte er als einziger das Talent die WindowsXP Mausbeschleunigung komplett zu deaktivieren und ein Mausfeeling wie unter Windows 2000 schaffen.

Nun frage ich euch ob jemand in der Lage ist diesen Code auf Windows 7 32/64 lauffähig zu bekommen,
bzw die nötigen Anpassungen vor zu nehmen um das Tool brauchbar zu machen um den gewünschten Effekt zu erziehlen.




{
==============================================================================
Copyright (C) 2006 anir (anir<AT>k.ro)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
==============================================================================
}

uses
Windows,
ImageHlp;

const
Caption: PAnsiChar = 'Windows Mouse Acceleration Fix';
Tmp: String = 'tmp';
Sys: String = 'sys';

var
Stat1, Stat2: ShortString;
TmpHdl: THandle;
FilStr: String;
FilSiz, TmpLwd: Longword;
BinSeq: packed Array [0..5242879] of Byte;

procedure ChkWoW64;
type
TIsWoW64 = function(hProcess: THandle; Wow64Process: PBOOL): LongBool; stdcall;
TDisWoW64FSRed = function(OldValue: Pointer): LongBool; stdcall;
var
IsWoW64: TIsWoW64;
DisWoW64FSRed: TDisWoW64FSRed;
WoW64Prc: Boolean;
Begin
BinSeq[5242879] := 0;
TmpHdl := GetModuleHandleA('kernel32.dll');
If TmpHdl = 0
then
Exit;
@IsWoW64 := GetProcAddress(TmpHdl, 'IsWow64Process');
If @IsWoW64 = Nil
then
Begin
BinSeq[5242879] := 2;
Exit;
end;
If not IsWoW64(GetCurrentProcess, @WoW64Prc)
then
Exit;
If not WoW64Prc
then
Begin
BinSeq[5242879] := 2;
Exit;
end;
@DisWoW64FSRed := GetProcAddress(TmpHdl, 'Wow64DisableWow64FsRedirection');
If @DisWoW64FSRed = Nil
then
Exit;
If DisWoW64FSRed(@TmpLwd)
then
BinSeq[5242879] := 1;
end;

function GetWin32k: String;
var
Bfr: Array [0..MAX_PATH] of Char;
Begin
If GetSystemDirectoryA(@Bfr[0], Succ(MAX_PATH)) > 0
then
Result := PAnsiChar(@Bfr[0]) + '\win32k.';
end;

procedure ClsDel;
Begin
CloseHandle(TmpHdl);
DeleteFileA(PAnsiChar(FilStr + Tmp));
end;

procedure FilPtr;
Begin
ClsDel;
MessageBoxA(0, 'Could not set file pointer!', Caption, 16);
end;

procedure VldSeq;
Begin
ClsDel;
MessageBoxA(0, 'Could not find a valid sequence!', Caption, 16);
end;

procedure ChkVer;
var
VerInf: OSVersionInfo;
Begin
BinSeq[5242879] := 0;
VerInf.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
If not GetVersionEx(VerInf)
then
Exit;
If (VerInf.dwMinorVersion = 0)
and (VerInf.dwMajorVersion = 5)
then
BinSeq[5242879] := 1
else
BinSeq[5242879] := 2;
end;

function SetNPtchd(Bin: Byte): Boolean;
Begin
Result := True;
Stat1 := 'EN';
Stat2 := 'dis';
BinSeq[5242879] := Bin;
end;

function SetPtchd(Bin: Byte): Boolean;
Begin
Result := True;
Stat1 := 'DIS';
Stat2 := 'en';
BinSeq[5242879] := Bin;
end;

function FndSeq50: Boolean;
Begin
Result := False;
Repeat
If (BinSeq[TmpLwd] = $00)
and (BinSeq[TmpLwd + 12] = $16)
and (BinSeq[TmpLwd + 7] = $A0)
and (BinSeq[TmpLwd + 1] = $00)
and (BinSeq[TmpLwd + 10] = $53)
and (BinSeq[TmpLwd + 8] = $00)
and (BinSeq[TmpLwd + 2] = $83)
and (BinSeq[TmpLwd + 9] = $57)
and (BinSeq[TmpLwd + 3] = $3D)
then
Begin
TmpLwd := TmpLwd + 11;
Case BinSeq[TmpLwd]
of
$74: Result := SetNPtchd($73);
$73: Result := SetPtchd($74);
end;
Break;
end
else
Inc(TmpLwd);
until
TmpLwd > FilSiz - 12;
end;

function FndSeq51: Boolean;
Begin
Result := False;
Repeat
If (BinSeq[TmpLwd] = $00)
and (BinSeq[TmpLwd + 10] = $57)
and (BinSeq[TmpLwd + 5] = $1D)
and (BinSeq[TmpLwd + 1] = $53)
and (BinSeq[TmpLwd + 9] = $BF)
and (BinSeq[TmpLwd + 4] = $39)
and (BinSeq[TmpLwd + 2] = $33)
and (BinSeq[TmpLwd + 3] = $DB)
then
Begin
If BinSeq[TmpLwd + 11] = $0F
then
Begin
TmpLwd := TmpLwd + 12;
Case BinSeq[TmpLwd]
of
$84: Result := SetNPtchd($83);
$83: Result := SetPtchd($84);
end;
end
else
Begin
TmpLwd := TmpLwd + 11;
Case BinSeq[TmpLwd]
of
$74: Result := SetNPtchd($73);
$73: Result := SetPtchd($74);
end;
end;
Break;
end
else
Inc(TmpLwd);
until
TmpLwd > FilSiz - 12;
end;

function FndSeq64: Boolean;
Begin
Result := False;
Repeat
If (BinSeq[TmpLwd] = $00)
and (BinSeq[TmpLwd + 11] = $0F)
and (BinSeq[TmpLwd + 4] = $83)
and (BinSeq[TmpLwd + 1] = $00)
and (BinSeq[TmpLwd + 10] = $00)
and (BinSeq[TmpLwd + 5] = $3D)
and (BinSeq[TmpLwd + 2] = $00)
and (BinSeq[TmpLwd + 9] = $00)
and (BinSeq[TmpLwd + 3] = $C3)
then
Begin
TmpLwd := TmpLwd + 12;
Case BinSeq[TmpLwd]
of
$84: Result := SetNPtchd($83);
$83: Result := SetPtchd($84);
end;
Break;
end
else
Inc(TmpLwd);
until
TmpLwd > FilSiz - 12;
end;

function FixCRC: Boolean;
var
pMapView: Pointer;
pDOSH: PImageDOSHeader;
pNTH: PImageNTHeaders;
Begin
Result := False;
TmpHdl := CreateFileMappingA(TmpHdl, Nil, PAGE_READWRITE, 0, 0, Nil);
If TmpHdl = 0
then
Exit;
pMapView := MapViewOfFile(TmpHdl, FILE_MAP_WRITE, 0, 0, 0);
If pMapView = Nil
then
Exit;
pDOSH := PImageDOSHeader(pMapView);
pNTH := PImageNTHeaders(pDOSH._lfanew + Integer(pDOSH));
If (pDOSH.e_magic <> IMAGE_DOS_SIGNATURE)
or (pNTH.Signature <> IMAGE_NT_SIGNATURE)
then
Exit;
If (CheckSumMappedFile(pMapView, FilSiz, @TmpLwd, @pNTH.OptionalHeader.CheckSum) <> Nil)
and (CheckSumMappedFile(pMapView, FilSiz, @TmpLwd, @FilSiz) <> Nil)
then
{$BOOLEVAL ON} // long-circuit evaluation
Result := (TmpLwd = FilSiz) and UnmapViewOfFile(pMapView) and CloseHandle(TmpHdl);
{$BOOLEVAL OFF} // short-circuit evaluation
end;

function SetPtr: Boolean;
Begin
Result := SetFilePointer(TmpHdl, TmpLwd, Nil, FILE_BEGIN) = TmpLwd;
end;

function AlPRns: Boolean;
var
RegKey: hKey;
Begin
TmpLwd := 1;
Result := (RegOpenKeyExA(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager', 0, KEY_WRITE, RegKey) = ERROR_SUCCESS)
and (RegSetValueExA(RegKey, 'AllowProtectedRenames', 0, REG_DWORD, @TmpLwd, SizeOf(TmpLwd)) = ERROR_SUCCESS)
and (RegCloseKey(RegKey) = ERROR_SUCCESS);
end;

function Restrt: Boolean;
var
TknPvg: TTokenPrivileges;
Begin
Result := False;
If not OpenProcessToken(GetCurrentProcess, TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, TmpHdl)
or not LookupPrivilegeValueA(Nil, 'SeShutdownPrivilege', TknPvg.Privileges[0].LUID)
then
Exit;
TknPvg.PrivilegeCount := 1;
TknPvg.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
If not AdjustTokenPrivileges(TmpHdl, False, TknPvg, 0, Nil, TmpLwd)
then
Exit;
CloseHandle(TmpHdl);
Result := ExitWindowsEx(EWX_REBOOT, 2147614737);
end;

Begin
If (CreateMutexA(Nil, True, Caption) = 0)
or (GetLastError = ERROR_ALREADY_EXISTS)
then
Exit;
ChkWoW64;
If BinSeq[5242879] = 0
then
Begin
MessageBoxA(0, 'Could not check WoW64 presence and/or disable file system redirection!', Caption, 16);
Exit;
end;
FilStr := GetWin32k;
If FilStr = ''
then
Begin
MessageBoxA(0, 'Could not ascertain system directory!', Caption, 16);
Exit;
end;
If not CopyFileA(PAnsiChar(FilStr + Sys), PAnsiChar(FilStr + Tmp), False)
then
Begin
MessageBoxA(0, 'Could not copy file!', Caption, 16);
Exit;
end;
If not SetFileAttributesA(PAnsiChar(FilStr + Tmp), FILE_ATTRIBUTE_NORMAL)
or not SetFileAttributesA(PAnsiChar(FilStr + Sys), FILE_ATTRIBUTE_NORMAL)
then
Begin
DeleteFileA(PAnsiChar(FilStr + Tmp));
MessageBoxA(0, 'Could not set file attributes!', Caption, 16);
Exit;
end;
CloseHandle(TmpHdl);
TmpHdl := CreateFileA(PAnsiChar(FilStr + Tmp), GENERIC_READ or GENERIC_WRITE, FILE_SHARE_READ, Nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
If TmpHdl = INVALID_HANDLE_VALUE
then
Begin
DeleteFileA(PAnsiChar(FilStr + Tmp));
MessageBoxA(0, 'Could not open file!', Caption, 16);
Exit;
end;
FilSiz := GetFileSize(TmpHdl, Nil);
If (FilSiz > 5242879)
or (FilSiz < 1030)
then
Begin
ClsDel;
MessageBoxA(0, 'Could not ascertain valid file size!', Caption, 16);
Exit;
end;
If not ReadFile(TmpHdl, BinSeq, FilSiz, TmpLwd, Nil)
or (TmpLwd <> FilSiz)
then
Begin
ClsDel;
MessageBoxA(0, 'Could not read file into memory!', Caption, 16);
Exit;
end;
TmpLwd := 1016;
If BinSeq[5242879] = 1
then
If not FndSeq64
then
Begin
VldSeq;
Exit;
end
else
If not SetPtr
then
Begin
FilPtr;
Exit;
end
else
else
Begin
ChkVer;
If BinSeq[5242879] = 0
then
Begin
ClsDel;
MessageBoxA(0, 'Could not ascertain OS version!', Caption, 16);
Exit;
end;
If BinSeq[5242879] = 1
then
If not FndSeq50
then
Begin
VldSeq;
Exit;
end
else
If not SetPtr
then
Begin
FilPtr;
Exit;
end
else
else
If not FndSeq51
then
Begin
VldSeq;
Exit;
end
else
If not SetPtr
then
Begin
FilPtr;
Exit;
end;
end;
If MessageBoxA(0, PAnsiChar('Welcome to ' + Caption + '!' + #13#10 + 'This program will disable or reenable mouse acceleration.' + #13#10#13#10 + 'Mouse acceleration is currently ' + Stat1 + 'ABLED.' + #13#10 + 'Do you wish to ' + Stat2 + 'able mouse acceleration?'), Caption, 36) <> IDYES
then
Begin
ClsDel;
Exit;
end;
If not WriteFile(TmpHdl, BinSeq[5242879], 1, TmpLwd, Nil)
or not FixCRC
then
Begin
ClsDel;
MessageBoxA(0, 'Could not patch file!', Caption, 16);
Exit;
end;
If not AlPRns
then
Begin
ClsDel;
MessageBoxA(0, 'Could not set registry value!', Caption, 16);
Exit;
end;
If not MoveFileEx(PAnsiChar(FilStr + Tmp), PAnsiChar(FilStr + Sys), MOVEFILE_DELAY_UNTIL_REBOOT or MOVEFILE_REPLACE_EXISTING)
then
Begin
ClsDel;
MessageBoxA(0, 'Could not set delayed file replacement!', Caption, 16);
Exit;
end;
If MessageBoxA(0, 'Windows has been successfully patched!' + #13#10 + 'You must reboot your computer for the change to take effect.' + #13#10#13#10 + 'Do you wish to restart now?', Caption, 68) <> IDYES
then
Exit;
If not Restrt
then
MessageBoxA(0, 'Could not restart the computer!', Caption, 16);
end.




LG qu3x^

qu3x^
2010-10-25, 13:59:31
Anyone? ;(

Coda
2010-10-25, 14:33:59
Was soll das ganze bitte machen? Man kann unter Windows 7 die Mausbeschleunigung auch so abschalten.

qu3x^
2010-10-25, 23:39:42
Was soll das ganze bitte machen? Man kann unter Windows 7 die Mausbeschleunigung auch so abschalten.

Ich kennen diverse Fixes und wenn ich bzw. Spieler von Mausbeschleunigung sprechen, gibt es einen feinen Unterschied zwischen Mausbeschleunigung und keiner Mausbeschleunigung.

Dieses Tool geschrieben von MarkC sollte die Windows 7 interne Cursor beschleunigung deaktivieren. Laut MS bekommt der Pointer einiges Verschlimmbesserungscurven um das Mausgefühl für den Ottonormalverbraucher weicher erscheinen zu lassen, unabhängig davon ob im Treiber oder Windows Maus Panel beschleunigung deaktivert oder eingeschalten ist. Im MarkC Fix enthalten ist auch ein Mouse MovementRecorder der den Input und Output der Maus tabellarisch wiederspiegelt und grafisch alarm gibt wenn das Input mit dem Output nicht übereinstimmt.

MarkC Fix (http://www.filefront.com/17191014/MarkC_Windows7_MouseFix.zip/)

Jedoch ist das Mausverhalten 100:1 gegenüber dem oben beschrieben Fix.
Wer noch Windows XP (32bit) benutzt soll sich diesen Fix mal zu gute kommen lassen und denn unterschied feststellen.

Anir/Aions Windows XP (32bit) Windows AccelFix (http://razerblueprints.net/index.php/View-document-details/80-AccelFix.html)

Diese Begegnung hatte ich zum ersten mal unter Windows XP gemacht. Wieder wahre Mauskontrolle erlangen.
Ich war sekptisch und dachte an einen weiteren Plazeboeffekt wie manch andere Registry-Tweaks.
Wenn ihr den Unterschied mal selbst in Spielen feststellt, so kannte man ohne diesen Fix nicht mehr am PC Spielen. Dieser Fix hebelt diesen Registry-Eintrag komplett aus:
[HKEY_CURRENT_USER\Control Panel\Mouse]
"SmoothMouseXCurve"
"SmoothMouseYCurve"