Autor Beitrag
Sauger Chris
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 228

Win XP, Linux SuSE 9.2
Delphi 4,Delphi 7 Ent.
BeitragVerfasst: So 24.12.06 13:54 
moin

und zwar hab ich ein prob. mit WriteBinaryData

diesen wert '00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 43 00 48 00 01 00 00 00 60 00 EA 00 01 00 00 00 60 00 EA 00 01 00 00 00 60 00 EA 00 00'

soll er mir in die registery schreiben

aber mit dem code schreib er mir zwar was aber das stimmt nicht mit dem wert den er schreiben soll ein

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var
  reg: TRegistry;
  Daten:variant;
begin

Daten := '00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 43 00 48 00 01 00 00 00 60 00 EA 00 01 00 00 00 60 00 EA 00 01 00 00 00 60 00 EA 00 00';

reg := TRegistry.Create;
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.OpenKey('SYSTEM\ControlSet001\Services\'+ ParamStr(1),true);
reg.WriteBinaryData('FailureActions' , Daten,sizeof(Daten));


so muß es aus sehen

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
REG_Binary 
00 00 00 00 00 00 00 00 ........
00 00 00 00 03 00 00 00 ........
43 00 48 00 01 00 00 00 C.H.....
60 00 EA 00 01 00 00 00 `ê......
60 00 EA 00 01 00 00 00 `ê......
60 00 EA 00 00          `ê..



danke für eure hilfe
und frohe weihnachten

mfg sauger chris

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt und Code-Tags eingefügt
Moderiert von user profile iconNarses: Topic aus Sonstiges (Delphi) verschoben am Sa 12.07.2008 um 17:12
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 24.12.06 14:06 
Wandel erstmal deinen String in wirkliche Binärdaten um. Danach kannst Du diese dann in die Registry schreiben.

ausblenden Delphi-Quelltext
1:
2:
3:
var BinData: array of Byte;
//Daten nach Binär wandeln ...
reg.WriteBinaryData('FailureActions' , BinData[0],Length(BinData));

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Sauger Chris Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 228

Win XP, Linux SuSE 9.2
Delphi 4,Delphi 7 Ent.
BeitragVerfasst: So 24.12.06 14:13 
ok

ausblenden Delphi-Quelltext
1:
BinData := $0000000000000000000000000300000043004800010000006000EA00010000006000EA00010000006000EA0000;					


dann kommt ne fehler meldung

Erzeugen
[Fehler] bearbeiten.dpr(20): Integerkonstante zu lang
[Fehler] bearbeiten.dpr(20): Inkompatible Typen: 'Int64' und 'dynamic array'

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 24.12.06 14:23 
Dann speicher mal deine Binärdaten Byteweise in das Byte-Array rein ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Sauger Chris Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 228

Win XP, Linux SuSE 9.2
Delphi 4,Delphi 7 Ent.
BeitragVerfasst: So 24.12.06 14:39 
ich bedanke mich hat geklappt :-)

danke
uranop
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 149

Win XP, Win 7, Slackware 11, FreeBSD
D6E, php
BeitragVerfasst: Sa 12.07.08 01:54 
es mag an der etwas fruehen stunde liegen ...
neehm ich habe nun schon bissl versucht meinen wert in seine bytes zu zerlegen ...
immer wieder an fehlern gescheitert wie
incompatible sting - dynamic data
integer - dynamic data


kann mir einer bitte auffe sprünge helfen ?

ausgangs punkt wie vorher
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
begin
  regist:=TRegistry.Create;
  data := $10001000000100000000000000000000;

  try
    regist.RootKey:=HKEY_LOCAL_MACHINE; 
    regist.OpenKey('SOFTWARE\Microsoft\Internet Explorer',true);
    regist.writebinarydata('Extensions',data[0],Length(data));
  finally
    regist.Free;
  end;
end;


Danke im Vorraus

Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Sa 12.07.08 01:56 
1. Neue Thema
2. Zitat: Dann speicher mal deine Binärdaten Byteweise in das Byte-Array rein ... <-- Umsetzen, wenn nicht geht neuen Quellcode posten.
3. Benutz die Delphi TAGs hier im Forum..