Autor Beitrag
Hendi48
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mi 09.05.07 17:50 
Hi,
ich hab mal wieder eine Frage:
Ich möchte, dass man in dem Settings Fenster von einem Programm in ein Edit einen Pfad einträgt, und dieser dann im Hauptfenster in einem Speedbutton verwendet wird. Erstmal muss ich aber überhaupt speichern was in dem Edit steht, und das würde ich gerne in die Registry. Also ich hab jetzt diesen code hier:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
  //save to the registry
  reg:=Tregistry.Create;
  try
    Reg.RootKey := HKEY_CURRENT_USER;
    if Reg.OpenKey('\Software\Cheat Engine',true) then
    begin

      //write the settings
      reg.WriteBool('Undo',cbshowundo.checked);
      reg.WriteBool('Advanced',cbShowAdvanced.checked);
      reg.WriteBool('SeperateThread',checkThread.checked);
      reg.WriteInteger('ScanThreadpriority',combothreadpriority.itemindex);
      reg.WriteInteger('Buffersize',bufsize);
      reg.WriteInteger('Maxresults',newmax);
      reg.WriteBool('UseDebugRegs',rbDebugRegisters.checked);
      reg.writebool('Show Disassembler',cbShowDisassembler.checked);
      reg.WriteBool('Center on popup',cbCenterOnPopup.checked);
      reg.WriteInteger('Update interval',updateinterval);
      reg.WriteInteger('Freeze interval',freezeinterval);
      reg.writebool('Show values as signed',cbShowAsSigned.checked);
      reg.writebool('Handle binarys as decimals',cbBinariesAsDecimal.checked);
      reg.WriteInteger('Network Update Interval',Networkupdateinterval);
      reg.WriteBool('Show debugger options',cbShowDebugOptions.checked);
      reg.WriteBool('Replace incomplete opcodes with NOPS',replacewithnops.checked);
      reg.WriteBool('Ask for replace with NOPS',askforreplacewithnops.checked);
      reg.WriteBool('Use Anti-debugdetection',checkbox1.checked);
      reg.WriteBool('Handle unhandled breakpoints',cbhandlebreakpoints.Checked);
      reg.WriteBool('Fastscan on by default',cbFastscan.checked);

      reg.WriteBool('Hardware breakpoints',rbDebugAsBreakpoint.checked);
      reg.WriteBool('Update Foundaddress list',cbUpdatefoundList.checked);
      reg.WriteInteger('Update Foundaddress list Interval',foundinterval);

      {$ifndef net}
      mainform.UpdateFoundlisttimer.Interval:=foundinterval;
      {$endif}
      reg.writebool('skip PAGE_NOCACHE',cbSkip_PAGE_NOCACHE.Checked);
      reg.WriteBool('Break when debuging',cbBreakOnAttach.Checked);
      reg.WriteBool('Hide all windows',cbHideAllWindows.checked);
      reg.WriteBool('Really hide all windows',temphideall);


      //save donthidelist
      {$ifndef net}
      setlength(donthidelist,length(tempdonthidelist));
      for i:=0 to length(tempdonthidelist)-1 do
      begin
        donthidelist[i]:=tempdonthidelist[i];
        reg.writestring('Do not hide '+IntToStr(i),tempdonthidelist[i]);
      end;

      //end
      reg.writestring('Do not hide '+IntToStr(length(tempdonthidelist)),'');
      reg.WriteBool('MEM_PRIVATE',cbMemPrivate.checked);
      reg.WriteBool('MEM_IMAGE',cbMemImage.Checked);
      reg.WriteBool('MEM_MAPPED',cbMemMapped.Checked);
      onlyfront:=not temphideall;
      reg.WriteBool('Low Memory Usage',cbLowMemoryUsage.checked);
      reg.writebool('Use Hyperscan if posible',cbEnableHyperscanWhenPossible.checked);

      //check the module list
      if frmModuleSafety<>nil then //modified
      begin
        freemem(modulelist);
        modulelist:=tempmodulelist;
        modulelistsize:=tempmodulelistsize;
        tempmodulelist:=nil;
        denylist:=tempdenylist;
        denylistglobal:=tempdenylistglobal;

        reg.WriteBinaryData('Module List',ModuleList^,modulelistsize);
        reg.writeInteger('modulelistsize',modulelistsize);
        reg.WriteBool('Global Denylist',DenyListGlobal);
        reg.WriteBool('ModuleList as Denylist',DenyList);
      end;


      //check the hotkeys
      if (frmHotkeyConfig<>nil) and (ClickedOK) then
      begin
        //save the hotkeylist
        reg.WriteBinaryData('Show Cheat Engine Hotkey',frmHotkeyConfig.newhotkeys[0][0],10);
        reg.WriteBinaryData('Pause process Hotkey',frmHotkeyConfig.newhotkeys[1][0],10);
        reg.WriteBinaryData('Toggle speedhack Hotkey',frmHotkeyConfig.newhotkeys[2][0],10);


        reg.WriteFloat('Speedhack 1 speed',frmHotkeyConfig.newspeedhackspeed1.speed);
        reg.WriteInteger('Speedhack 1 sleeptime',frmHotkeyConfig.newspeedhackspeed1.sleeptime);
        reg.WriteFloat('Speedhack 2 speed',frmHotkeyConfig.newspeedhackspeed2.speed);
        reg.WriteInteger('Speedhack 2 sleeptime',frmHotkeyConfig.newspeedhackspeed2.sleeptime);
        reg.WriteFloat('Speedhack 3 speed',frmHotkeyConfig.newspeedhackspeed3.speed);
        reg.WriteInteger('Speedhack 3 sleeptime',frmHotkeyConfig.newspeedhackspeed3.sleeptime);
        reg.WriteFloat('Speedhack 4 speed',frmHotkeyConfig.newspeedhackspeed4.speed);
        reg.WriteInteger('Speedhack 4 sleeptime',frmHotkeyConfig.newspeedhackspeed4.sleeptime);
        reg.WriteFloat('Speedhack 5 speed',frmHotkeyConfig.newspeedhackspeed5.speed);
        reg.WriteInteger('Speedhack 5 sleeptime',frmHotkeyConfig.newspeedhackspeed5.sleeptime);

        mainunit2.speedhackspeed1:=frmhotkeyconfig.newspeedhackspeed1;
        mainunit2.speedhackspeed2:=frmhotkeyconfig.newspeedhackspeed2;
        mainunit2.speedhackspeed3:=frmhotkeyconfig.newspeedhackspeed3;
        mainunit2.speedhackspeed4:=frmhotkeyconfig.newspeedhackspeed4;
        mainunit2.speedhackspeed5:=frmhotkeyconfig.newspeedhackspeed5;

        reg.WriteBinaryData('Set Speedhack speed 1 Hotkey',frmHotkeyConfig.newhotkeys[3][0],10);
        reg.WriteBinaryData('Set Speedhack speed 2 Hotkey',frmHotkeyConfig.newhotkeys[4][0],10);
        reg.WriteBinaryData('Set Speedhack speed 3 Hotkey',frmHotkeyConfig.newhotkeys[5][0],10);
        reg.WriteBinaryData('Set Speedhack speed 4 Hotkey',frmHotkeyConfig.newhotkeys[6][0],10);
        reg.WriteBinaryData('Set Speedhack speed 5 Hotkey',frmHotkeyConfig.newhotkeys[7][0],10);

        reg.WriteBinaryData('Increase Speedhack speed',frmHotkeyConfig.newhotkeys[8][0],10);
        reg.WriteFloat('Increase Speedhack delta',frmHotkeyConfig.speedupdelta);

        reg.WriteBinaryData('Decrease Speedhack speed',frmHotkeyConfig.newhotkeys[9][0],10);
        reg.WriteFloat('Decrease Speedhack delta',frmHotkeyConfig.slowdowndelta);

        mainunit2.speedupdelta:=frmhotkeyconfig.speedupdelta;
        mainunit2.slowdowndelta:=frmhotkeyconfig.slowdowndelta;

        reg.WriteBinaryData('Binary Hotkey',frmHotkeyConfig.newhotkeys[10][0],10);
        reg.WriteBinaryData('Byte Hotkey',frmHotkeyConfig.newhotkeys[11][0],10);
        reg.WriteBinaryData('2 Bytes Hotkey',frmHotkeyConfig.newhotkeys[12][0],10);
        reg.WriteBinaryData('4 Bytes Hotkey',frmHotkeyConfig.newhotkeys[13][0],10);
        reg.WriteBinaryData('8 Bytes Hotkey',frmHotkeyConfig.newhotkeys[14][0],10);
        reg.WriteBinaryData('Float Hotkey',frmHotkeyConfig.newhotkeys[15][0],10);
        reg.WriteBinaryData('Double Hotkey',frmHotkeyConfig.newhotkeys[16][0],10);
        reg.WriteBinaryData('Text Hotkey',frmHotkeyConfig.newhotkeys[17][0],10);
        reg.WriteBinaryData('Array of Byte Hotkey',frmHotkeyConfig.newhotkeys[18][0],10);
        reg.WriteBinaryData('New Scan Hotkey',frmHotkeyConfig.newhotkeys[19][0],10);
        reg.WriteBinaryData('New Scan-Exact Value',frmHotkeyConfig.newhotkeys[20][0],10);
        reg.WriteBinaryData('Unknown Initial Value Hotkey',frmHotkeyConfig.newhotkeys[21][0],10);
        reg.WriteBinaryData('Next Scan-Exact Value',frmHotkeyConfig.newhotkeys[22][0],10);
        reg.WriteBinaryData('Increased Value Hotkey',frmHotkeyConfig.newhotkeys[23][0],10);
        reg.WriteBinaryData('Decreased Value Hotkey',frmHotkeyConfig.newhotkeys[24][0],10);
        reg.WriteBinaryData('Changed Value Hotkey',frmHotkeyConfig.newhotkeys[25][0],10);
        reg.WriteBinaryData('Unchanged Value Hotkey',frmHotkeyConfig.newhotkeys[26][0],10);
        reg.WriteBinaryData('Undo Last scan Hotkey',frmHotkeyConfig.newhotkeys[27][0],10);
        reg.WriteBinaryData('Cancel scan Hotkey',frmHotkeyConfig.newhotkeys[28][0],10);


        //apply these hotkey changes
        for i:=0 to 26 do
        begin
          found:=false;

          for j:=0 to length(hotkeythread.hotkeylist)-1 do
          begin
            if (hotkeythread.hotkeylist[j].id=i) and (hotkeythread.hotkeylist[j].handler2) then
            begin
              //found it
              hotkeythread.hotkeylist[j].keys:=frmHotkeyConfig.newhotkeys[i];
              found:=true;
              break;
            end;
          end;

          if not found then //add it
          begin
            j:=length(hotkeythread.hotkeylist);
            setlength(hotkeythread.hotkeylist,j+1);
            hotkeythread.hotkeylist[j].keys:=frmHotkeyConfig.newhotkeys[i];
            hotkeythread.hotkeylist[j].windowtonotify:=mainform.Handle;
            hotkeythread.hotkeylist[j].id:=i;
            hotkeythread.hotkeylist[j].handler2:=true;
          end;

          checkkeycombo(frmHotkeyConfig.newhotkeys[i]);
        end;
      end;


      {$endif}

      reg.WriteBool('StealthOnExecute',cbStealth.Checked);
      reg.WriteBool('Protect CE',cbProtectMe.Checked);

      reg.WriteBool('Undo memory changes',cbUndoMemoryChanges.checked);
      reg.WriteBool('Undo memory changes:Force writable',cbForceUndo.checked);

      reg.WriteBool('Use dbk32 QueryMemoryRegionEx',cbKernelQueryMemoryRegion.checked);
      reg.WriteBool('Use dbk32 ReadWriteProcessMemory',cbKernelReadWriteProcessMemory.checked);
      reg.WriteBool('Use dbk32 OpenProcess',cbKernelOpenProcess.checked);

      reg.WriteBool('Use Processwatcher',cbProcessWatcher.checked);
      reg.WriteBool('Use Kernel Debugger',cbKdebug.checked);

      reg.WriteInteger('Unrandomizer: default value',unrandomizersettings.defaultreturn);
      reg.WriteBool('Unrandomizer: incremental',unrandomizersettings.incremental);
    end;

  finally
    reg.CloseKey;
    reg.free;
  end;


Muss ich für ein Edit dann "reg.WriteString('Maple-Pfad',Edit1.string);" ?


Zuletzt bearbeitet von Hendi48 am Do 10.05.07 15:15, insgesamt 2-mal bearbeitet
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mi 09.05.07 19:08 
Jop.

Muss dann halt in dem Bereich stehen, in dem das Registry-Objekt besteht.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mi 09.05.07 19:52 
nimm lieber eine Ini-Datei und höre bitte auf in der Registry herumzufuschen!

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Hendi48 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mi 09.05.07 20:04 
nein ich will keine ini datei!
Er speichert es jetz zwar in die registry, aber ich hab kein plan wo in dem code die Lade-Funktion ist. Er lädt zwar alle Checkbox einstellungen, aber man sieht nur die Speicher Funktion

Edit: Ah ich habs! Die Ladefunktion war inner andern Datei. So, jetzt lädt und speichert es auch den Pfad. Nur wie bekomm ich den jetzt in den SpeedButton?
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mi 09.05.07 20:16 
Spätestens wenn Du die Reg. zerschossen hast und Windoofs nicht mehr will, wirst Du an meine Worte denken. Und ich werde Dein Programm nicht starten und testen, mein Windoofs bleibt ganz!

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Hendi48 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Do 10.05.07 12:21 
Nö, die wird nicht zerschossen. Ich benutze diese Engine schon seit EINEM jahr und noch nie is windoof deswegen putt gegangen :P. Ausserdem is das mit der registy ja jetz geklärt, ich muss das nur irgendwie in den SpeedButton laden. Geht das irgendwie mit
ausblenden Delphi-Quelltext
1:
2:
with formsettingsunit do
//und dann?
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 10.05.07 13:17 
In HKEY_CURRENT_USER\Software\EigenerOrdnerFürDeinProgramm kannst du relativ wenig kaputt machen, denke ich ;) Zumal dieser Teil der Registry nur für den aktuellen User gilt. Als Admin eingeloggt müsstest du derartige Fehler rückgängig machen können - und wenn du dafür den Benutzer löschen musst.
Aber das ist nur MHO... :mrgreen:

Zu deiner Frage: Ich empfehl dir den Delphi Crashkurs von Christian S. bevor du weiter machst.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Hendi48 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Do 10.05.07 13:26 
user profile iconJayEff hat folgendes geschrieben:
In HKEY_CURRENT_USER\Software\EigenerOrdnerFürDeinProgramm kannst du relativ wenig kaputt machen, denke ich ;) Zumal dieser Teil der Registry nur für den aktuellen User gilt. Als Admin eingeloggt müsstest du derartige Fehler rückgängig machen können - und wenn du dafür den Benutzer löschen musst.
Aber das ist nur MHO... :mrgreen:.



eben!

user profile iconJayEff hat folgendes geschrieben:

Zu deiner Frage: Ich empfehl dir den Delphi Crashkurs von Christian S. bevor du weiter machst.

ok ich mach ihn mal

So ich habs jetz hinbekommen! Danke!
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Fr 11.05.07 13:03 
user profile iconHendi48 hat folgendes geschrieben:
So ich habs jetz hinbekommen! Danke!
Markiere doch bitte dieses Thema als erledigt. Das geht ganz einfach, in dem du auf das HIER unter dem letzten Beitrag klickst.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.