Foros del Web » Programación para mayores de 30 ;) » Programación General »

Modificar Propiedades del Sistema

Estas en el tema de Modificar Propiedades del Sistema en el foro de Programación General en Foros del Web. Hola, necesito modificar la solapa general de propiedades de sistema ( ram/ cpu etc ... ) se que se puede hacer con delphi pero no ...
  #1 (permalink)  
Antiguo 03/07/2010, 20:45
 
Fecha de Ingreso: julio-2010
Mensajes: 1
Antigüedad: 13 años, 8 meses
Puntos: 0
Modificar Propiedades del Sistema

Hola, necesito modificar la solapa general de propiedades de sistema ( ram/ cpu etc ... ) se que se puede hacer con delphi pero no se como... lo yo quiero por ejemplo es borrar todo lo que dice hay y modificarlo a mi gusto, por ejemplo yo tengo 2 gb de ram .. y lo que quiero es poner que tengo 6 gb se entiende ? lo mismo con el procesador... si hay alguien que sabe como hacerlo porfavor que me ayude .. desde ya muchas gracias.

PD: Aca dejo un codigo que puede que les sirva para hacerlo .. es de un usuario en clubdelphi que dice que multiplica los valores de la ram que aparecen.. por ejemplo si yo tengo 1 gb me va a aparecer que tengo 2 lo que yo quiero es que me aparezca que tengo 6 gb y tambien cambiar la info del procesador ( modelo y ghz )

[code=delphi]library Injection;

uses
Windows, Sysutils, Messages, Psapi, CommCtrl;

type
TShared = record
Hook: HHooK;
AttachCount: Integer;
end;
PShared = ^TShared;

PItem = ^TItem;
TItem = record
hWnd: HWND;
WndProc: Pointer;
Next: PItem;
end;

var
Mutex, Mem: THandle;
Shared: PShared;
Injected: Boolean;
HandleList: PItem;

function FindWindowProc(hWnd: HWND; Item: PItem): Pointer;
begin
if Item <> nil then
begin
if Item.hWnd = hWnd then
Result:= Item.WndProc
else
Result:= FindWindowProc(hWnd,Item.Next);
end else
Result:= nil;
end;

function WindowProc(hWnd: HWND; Msg: UINT; WParam: WPARAM; LParam: LPARAM):
LRESULT; stdcall;
var
Str: String;
begin
if (Msg = WM_SETTEXT) then
begin
Str:= String(PChar(LParam));
Str:= StringReplace(Str,'1,00 GB','2,00 GB',[rfReplaceAll,rfIgnoreCase]);
Str:= StringReplace(Str,'512 MB','1,00 GB',[rfReplaceAll,rfIgnoreCase]);
LParam:= Longint(PChar(Str));
end;
Result:= CallWindowProc(FindWindowProc(hWnd,HandleList),hWn d,Msg,WParam,lParam);
end;

procedure HookWindow(hWnd: HWND);
var
Item: PItem;
begin
if FindWindowProc(hWnd, HandleList) = nil then
begin
GetMem(Item,Sizeof(TItem));
Item.hWnd:= hWnd;
Item.Next:= HandleList;
Item.WndProc:= Pointer(SetWindowLong(hWnd,GWL_WNDPROC,LongInt(@Wi ndowProc)));
HandleList:= Item;
end;
end;

function CallWndProc(Code: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT;
stdcall;
var
ClassName: array[0..16] of Char;
begin
if Code = HC_ACTION then
if Injected then
begin
FillChar(ClassName,Sizeof(ClassName),0);
if GetClassName(PCWPStruct(lParam).hwnd,@ClassName,Si zeof(ClassName)-1) > 0 then
if StrIComp(ClassName,'Link Window') = 0 then
begin
HookWindow(PCWPStruct(lParam).hwnd);
end;
end;
Result := CallNextHookEx(Shared^.Hook, Code, wParam, lParam);
end;

procedure StartHook; stdcall;
begin
if Shared <> nil then
begin
WaitForSingleObject(Mutex, INFINITE);
try
with Shared^ do
begin
if Hook = 0 then
Hook := SetWindowsHookEx(WH_CALLWNDPROC, @CallWndProc, HInstance, 0);
end;
finally
ReleaseMutex(Mutex);
end;
end;
end;

procedure StopHook; stdcall;
begin
if Shared <> nil then
begin
WaitForSingleObject(Mutex, INFINITE);
try
with Shared^ do
begin
if Hook <> 0 then
begin
UnhookWindowsHookEx(Hook);
Hook := 0;
end;
end;
finally
ReleaseMutex(Mutex);
end;
end;
end;

procedure Inject;
var
Process: THandle;
ModName: array[0..MAX_PATH] of Char;
Target: array[0..MAX_PATH] of Char;
begin
Injected:= FALSE;
Process := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, FALSE,
GetCurrentProcessId);
if Process <> 0 then
begin
if GetModuleFileNameEx(Process, 0, ModName,sizeof(ModName)-1) > 0 then
begin
FillChar(Target,Sizeof(Target),#0);
GetSystemDirectory(@Target,Sizeof(Target)-1);
StrLCat(Target,'\rundll32.exe',Sizeof(Target)-1);
OutputDebugString(Target);
if StrIComp(Target,ModName) = 0 then
begin
// Un pequeño pitido nos avisa de que no hemos infiltrado
Windows.Beep(500,100);
HandleList:= nil;
Injected:= TRUE;
end;
end;
CloseHandle(Process);
end;
end;

procedure Attach; stdcall;
var
isNew: boolean;
begin
Mutex := CreateMutex(nil, True, '{92366DA1-4F66-472D-BE12-65F0993F62AC}');
try
Mem := CreateFileMapping($FFFFFFFF, nil, PAGE_READWRITE, 0, SizeOf(TShared),
'{D1A38D62-9FAB-4298-A358-579D2D286E40}');
isNew := GetLastError() = 0;
if Mem <> 0 then
Shared := MapViewOfFile(Mem, FILE_MAP_WRITE, 0, 0, 0)
else
Shared := nil;
if Shared <> nil then
if isNew then
with Shared^ do
begin
Hook := 0;
AttachCount := 1;
end
else
inc(Shared^.AttachCount);
finally
ReleaseMutex(Mutex);
end;
// Aqui viene la inyeccion
Inject;
end;

procedure UnHookWindows(Item: PItem);
begin
if Item <> nil then
begin
UnHookWindows(Item.Next);
SetWindowLong(Item.hWnd,GWL_WNDPROC,LongInt(Item.W ndProc));
FreeMem(Item);
end;
end;

procedure Detach; stdcall;
begin
WaitForSingleObject(Mutex, INFINITE);
try
if (Shared <> nil) then
dec(Shared^.AttachCount);
finally
ReleaseMutex(Mutex);
end;
if (Shared <> nil) then
if Shared^.AttachCount <= 0 then
begin
StopHook;
UnmapViewOfFile(Shared);
CloseHandle(Mem);
CloseHandle(Mutex);
end;
if Injected then
UnHookWindows(HandleList);
end;

procedure DLLEntryPoint(Reason: integer);
begin
case Reason of
Dll_Process_Detach: Detach;
Dll_Process_Attach: Attach;
end;
end;

exports
StartHook,
StopHook;

begin
Attach;
DLLProc:= @DLLEntryPoint;
end.[/code]

Etiquetas: api, delphi, modificar, programacion, propiedades, windows, sitemap
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:58.