View previous topic :: View next topic |
Author |
Message |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Mon Feb 28, 2011 10:11 am Post subject: FIXED another bugs for reading and writing unicode strings. |
|
|
FIXED another bugs with CE6.0 for reading and writing unicode strings.
The lazarus using UTF8, so we can change it to ANSIstring, following me.
open memoryrecordunit.pas file.
add unit LCLProc
Code: | change currentValue type to ansistring;
currentValue:ansistring;
procedure TMemoryRecord.SetValue(v: string; isFreezer: boolean);
...
currentValue:=utf8toansi(v);
...
vtString:
begin
if extra.stringData.unicode then
i:=UTF8Length(v)
else
i:=length(currentvalue);
//x contains the max length in characters for the string
if extra.stringData.length<i then
begin
extra.stringData.length:=i;
freemem(buf);
bufsize:=getbytesize;
getmem(buf, bufsize);
end;
x:=bufsize;
if extra.stringData.unicode then
x:=bufsize div 2; //each character is 2 bytes so only half the size is available
if Extra.stringData.ZeroTerminate then
x:=min(i+1,x) //also copy the zero terminator
else
x:=min(i,x);
tempsw:= currentvalue;
//copy the string to the buffer
for i:=0 to x-1 do
begin
if extra.stringData.unicode then
begin
wc[i]:=pwidechar(tempsw)[i];
end
else
begin
c[i]:=pchar(currentValue)[i];
end;
end;
if extra.stringData.unicode then
bufsize:=x*2 //two times the number of characters
else
bufsize:=x;
end;
-
function TMemoryRecord.GetValue: string;
var
awc:ansistring;
.....
vtString:
begin
pba[bufsize-1]:=0;
if Extra.stringData.unicode then
begin
pba[bufsize-2]:=0;
awc:=wc;
result:=ansitoutf8(awc);
end
else
result:=ansitoutf8(c);
end; |
test for chinese system.
Last edited by maplecheck on Sun Mar 06, 2011 8:28 am; edited 3 times in total |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Mon Feb 28, 2011 11:26 am Post subject: |
|
|
works fine for unicode strings when I use them (even copy/pasting from website or posts), but it seems people that natively use unicode seem to have a problem yes. (Perhaps some kind if IME is interfering)
See if you can fix it
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Mon Feb 28, 2011 11:45 am Post subject: |
|
|
but I don't know how to fix it.
and the function CreateRemoteAPC also can't works fine.
I check in typepopup.pas, lose "MemoryRecord.Extra.stringData.unicode:=cbunicode.checked;" ???
Code: |
procedure TTypeForm.Button1Click(Sender: TObject);
var bit,bitl: Byte;
err: integer;
ct: TCustomType;
wasNotAOB: boolean;
begin
err:=0;
bitl:=0;
wasNotAOB:=MemoryRecord.Vartype<>vtByteArray;
case Vartype.ItemIndex of
0: MemoryRecord.VarType:=vtBinary;
1: MemoryRecord.Vartype:=vtByte;
2: MemoryRecord.Vartype:=vtWord;
3: MemoryRecord.Vartype:=vtDword;
4: MemoryRecord.Vartype:=vtQword;
5: MemoryRecord.Vartype:=vtSingle;
6: MemoryRecord.VarType:=vtDouble;
7: MemoryRecord.Vartype:=vtString;
8: MemoryRecord.VarType:=vtByteArray;
else
begin
if Vartype.ItemIndex<>-1 then
begin
ct:=TCustomType(vartype.Items.Objects[Vartype.ItemIndex]);
if ct<>nil then
begin
MemoryRecord.VarType:=vtCustom;
MemoryRecord.CustomTypeName:=ct.name;
end;
end;
end;
end;
err:=0;
if Vartype.ItemIndex<7 then
begin
if RadioButton1.checked then bit:=0 else
if RadioButton2.checked then bit:=1 else
if RadioButton3.checked then Bit:=2 else
if RadioButton4.checked then Bit:=3 else
if RadioButton5.checked then Bit:=4 else
if RadioButton6.checked then Bit:=5 else
if RadioButton7.checked then Bit:=6 else
Bit:=7;
end
else
val(edit1.Text,bit,err);
if vartype.ItemIndex=0 then
val(edit2.Text,bitl,err);
if err>0 then
raise exception.create('Invalid length');
if memoryrecord.vartype=vtBinary then
begin
MemoryRecord.Extra.bitData.Bit:=bit;
MemoryRecord.Extra.bitData.bitlength:=bitl;
end;
if memoryrecord.vartype=vtString then
MemoryRecord.Extra.stringData.length:=bit;
if memoryrecord.vartype=vtByteArray then
begin
MemoryRecord.Extra.byteData.bytelength:=bit;
if wasNotAOB then //it wasn't an aob before, set the hexadecimal value
MemoryRecord.showAsHex:=true;
end;
modalresult:=mryes;
end;
|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Mon Feb 28, 2011 11:54 am Post subject: |
|
|
That's another bug. That's just setting of the unicode checkbox. (and already fix in the svn). The unicode problem people talk about is that it sometimes messes up special characters
you should check memoryrecordunit.pas at the xml parts
remoteapc was just a proof of concept and never worked 100% (which is why I never used it)
But if you want to use it, after running that code you MUST send an unused thread message to the affected thread from usermode to wake it up else it will not run the apc routine
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Mon Feb 28, 2011 12:22 pm Post subject: |
|
|
thank you, I have been fixed the unicode strings bugs.
the CreateRemoteAPC, I can works fine in my old UCE, but I forgot how to fix it.
|
|
Back to top |
|
 |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Mon Feb 28, 2011 10:10 pm Post subject: |
|
|
I check the code, why the same code, my old ce can works fine, the 6.0 can't work?
"you MUST send an unused thread message "
you means call "PostThreadMessage(x,wm_paint,0,0); "?
I add a sleep(100), maybe can run thread, but is error run
|
|
Back to top |
|
 |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Sun Mar 06, 2011 2:38 am Post subject: |
|
|
..
Last edited by maplecheck on Sun Mar 06, 2011 8:15 am; edited 1 time in total |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Sun Mar 06, 2011 7:02 am Post subject: |
|
|
Thanks, you tested this and it works ?
If so, could you also try the same on the description and comments part of the cheat table and test that? Or is that already working in the current svn?
http://cheatengine.org/mantis/view.php?id=249
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Sun Mar 06, 2011 7:44 am Post subject: |
|
|
there is a bit bug, i'm try to fixed now, please wait.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Sun Mar 06, 2011 8:00 am Post subject: |
|
|
also, if you just change currentvalue to type widestring and change "SetValue" and add in a tempsa: ansistring;
and then change he stringwrite routine to:
Code: |
tempsw:=currentvalue;
tempsa:=currentvalue;
//copy the string to the buffer
for i:=0 to x-1 do
begin
if extra.stringData.unicode then
begin
wc[i]:=pwidechar(tempsw)[i];
end
else
begin
c[i]:=pchar(tempsa)[i];
end;
end;
|
does that have any effect ?
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Sun Mar 06, 2011 8:20 am Post subject: |
|
|
I have been update the code that see top posts.
and I have tested works fine.
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Sun Mar 06, 2011 10:09 am Post subject: |
|
|
does changing currentvalue to widestring have the same effect ?
When i use the ansi<->utf8 method I can not copy/paste chinese characters as text anymore. They then show up as ??
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
maplecheck Expert Cheater
Reputation: 0
Joined: 22 Jan 2006 Posts: 139
|
Posted: Sun Mar 06, 2011 10:54 am Post subject: |
|
|
does changing currentvalue to widestring have the same effect ?
yes, also can don't changing ansistring, but must add this code
Code: | if extra.stringData.unicode then
i:=UTF8Length(v)
else
i:=length(currentvalue); |
When i use the ansi<->utf8 method I can not copy/paste chinese characters as text anymore. They then show up as ??
I can work fine with copy/paste chinese characters as text.
can you give me a picture that you do?
another method, don't change currentvalue to ansistring.
Code: | vtString:
begin
tempsa:=utf8toansi(v);
if extra.stringData.unicode then
i:=UTF8Length(v)
else
i:=length(tempsa);
//x contains the max length in characters for the string
if extra.stringData.length<i then
begin
extra.stringData.length:=i;
freemem(buf);
bufsize:=getbytesize;
getmem(buf, bufsize);
end;
x:=bufsize;
if extra.stringData.unicode then
x:=bufsize div 2; //each character is 2 bytes so only half the size is available
if Extra.stringData.ZeroTerminate then
x:=min(i+1,x) //also copy the zero terminator
else
x:=min(i,x);
tempsw:= tempsa;
//copy the string to the buffer
for i:=0 to x-1 do
begin
if extra.stringData.unicode then
begin
wc[i]:=pwidechar(tempsw)[i];
end
else
begin
c[i]:=pchar(tempsa)[i];
end;
end; |
|
|
Back to top |
|
 |
idonkey How do I cheat?
Reputation: 0
Joined: 31 Jan 2009 Posts: 1
|
|
Back to top |
|
 |
frank_mascarado How do I cheat?
Reputation: 0
Joined: 03 Jun 2007 Posts: 5
|
Posted: Thu Mar 31, 2011 2:48 pm Post subject: |
|
|
._.
Description: |
|
Filesize: |
201.46 KB |
Viewed: |
23594 Time(s) |

|
_________________
3haat eng1ne 6.0 Rev 1725
img96.imageshack.us/img96/6062/asdryz.jpg |
|
Back to top |
|
 |
|