Hacking [HELP] Converting a String to Hex? (C#)

Dekirai

Well-Known Member
OP
Member
Joined
Jun 21, 2016
Messages
1,050
Trophies
0
XP
2,610
Country
Germany
Hello,

I searched whole google for a solution, but the sad thing is that nothing of it works with gecko together.

What I did is this:

Code:
        private void button3_Click(object sender, RoutedEventArgs e)
        {
            this.tcpGecko.poke32(0x109763F0, 0x73656100);
        }


But I want to use the poke as a Textbox with String.
So for example;
I am doing a Maploader for Wind Waker and I want to load the Map "DmSpot0" so I input "DmSpot0" into the Textbox and its getting converted to Hex so that the game will load the map.

So it should something like this in the end

Code:
        private void button3_Click(object sender, RoutedEventArgs e)
        {
            this.tcpGecko.poke32(0x109763F0, blablablabla(textBox.Text); // Converted String to Hex
        }


DmSpot0 is btw longer than 32 Bits, so do I have to do something special for it, or does it write auto. to the address "109763F4"?

Sources I tried:

http://stackoverflow.com/questions/16999604/convert-string-to-hex-string-in-c-sharp
https://www.easycalculation.com/ascii-hex.php
http://stackoverflow.com/questions/18627304/convert-ascii-in-a-byte-array-to-string
http://stackoverflow.com/questions/15920741/convert-from-string-ascii-to-string-hex
http://string-functions.com/string-hex.aspx
https://dotnet-snippets.de/snippet/string-in-hex-wandeln/59

I'm pretty new into C# so don't blame me please.
 

Dekirai

Well-Known Member
OP
Member
Joined
Jun 21, 2016
Messages
1,050
Trophies
0
XP
2,610
Country
Germany
Code:
            byte[] vals = { 0x01, 0xAA, 0xB1, 0xDC, 0x10, 0xDD };

            string str = BitConverter.ToString(vals);
            Console.WriteLine(str);

            str = BitConverter.ToString(vals).Replace("-", "");
            Console.WriteLine(str);

            /*Output:
              01-AA-B1-DC-10-DD
              01AAB1DC10DD
             */

like the example here

https://msdn.microsoft.com/en-us/library/bb311038.aspx
Yea I already tried this.
Maybe I do something wrong too, but I can't get it to work. :/
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Maximumbeans @ Maximumbeans: butte