View previous topic :: View next topic |
Author |
Message |
SlowPoke69 How do I cheat?
Reputation: 0
Joined: 18 Feb 2011 Posts: 7
|
Posted: Tue Mar 01, 2011 5:21 pm Post subject: String to Byte Array |
|
|
Hello, looking for an example in vb.net or c# of how to convert the following string into a byte array to work in WriteProcessMemory. Thank you
Code: |
OPcode = "60"
OPcode &= "A1" & MemFunctions._ResHex(&H9F3E6C)
OPcode &= "68" & MemFunctions._ResHex(MonsterID) ' push mob-id
OPcode &= "8B4820" ' mov ecx, [eax+0x20]
OPcode &= "81C1" & MemFunctions._ResHex(&HEC) ' add ecx, 0xEC
OPcode &= "E8" & MemFunctions._ResHex(&HE4F69CA7) ' Callstring
OPcode &= "61" ' popad
OPcode &= "C3"
|
|
|
Back to top |
|
 |
AhMunRa Grandmaster Cheater Supreme
Reputation: 27
Joined: 06 Aug 2010 Posts: 1117
|
Posted: Tue Mar 01, 2011 10:21 pm Post subject: |
|
|
From http://www.chilkatsoft.com/faq/dotnetstrtobytes.html
Code: |
public static byte[] StrToByteArray(string str)
{
System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();
return encoding.GetBytes(str);
}
|
Just change the encoding to suite your needs.
_________________
<Wiccaan> Bah that was supposed to say 'not saying its dead' lol. Fixing >.> |
|
Back to top |
|
 |
atom0s Moderator
Reputation: 204
Joined: 25 Jan 2006 Posts: 8580 Location: 127.0.0.1
|
Posted: Wed Mar 02, 2011 12:21 am Post subject: |
|
|
AhMunRa wrote: | From http://www.chilkatsoft.com/faq/dotnetstrtobytes.html
Code: |
public static byte[] StrToByteArray(string str)
{
System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();
return encoding.GetBytes(str);
}
|
Just change the encoding to suite your needs. |
Doing this will just convert the text to its Ascii format of a byte array.
Check out this example:
Code: |
public static byte[] StringToByteArray(string hex) {
return Enumerable.Range(0, hex.Length).
Where(x => 0 == x % 2).
Select(x => Convert.ToByte(hex.Substring(x, 2), 16)).
ToArray();
}
|
Credits:
http://stackoverflow.com/questions/321370/convert-hex-string-to-byte-array
_________________
- Retired. |
|
Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Wed Mar 02, 2011 5:50 am Post subject: |
|
|
You want to convert asm to opcode ?
|
|
Back to top |
|
 |
SlowPoke69 How do I cheat?
Reputation: 0
Joined: 18 Feb 2011 Posts: 7
|
Posted: Wed Mar 02, 2011 8:17 am Post subject: |
|
|
Thank you so much for the quick reply!. It works! Yay!
|
|
Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Wed Mar 02, 2011 1:11 pm Post subject: |
|
|
SlowPoke69 wrote: | Thank you so much for the quick reply!. It works! Yay!
 |
you're welcome, CE Team.
|
|
Back to top |
|
 |
Miaurice Newbie cheater
Reputation: 0
Joined: 03 Jul 2009 Posts: 21 Location: Germany
|
Posted: Mon Mar 07, 2011 8:04 am Post subject: |
|
|
I am not able to PM yet, because I'm not a "trusted member", so I have to post it here.
I'm sorry, but this is important for me.
Hey SlowPoke69
I've seen that you posted in my topic, that you also looked for reading float values, and then I was interested in you, and looked through all your posts, and see, that you might need this for a "fog and zoom" hack, in Metin2?
Also you posted this: viewtopic.php?p=5205902
This looks like "Mob-Lock" for me.
Can you tell me, how you make the "Mob-Lock" in .NET ?
And can you tell me, how to reverze the metin2client.bin / metin2.bin to find these opcodes?
Thanks in advance
|
|
Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Tue Mar 08, 2011 12:49 am Post subject: |
|
|
Gabe Newell wrote: | You want to convert asm to opcode ? | You need to write an assembler or use an existing one.
|
|
Back to top |
|
 |
|