Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» ~=?{The future is here, TastyExploit officially open to the public}?=~
Tue Mar 02, 2010 11:00 pm by Dami

» My first aa script
Tue Mar 02, 2010 7:00 am by wafflemaster

» the real story behind Maverin
Tue Mar 02, 2010 1:33 am by SoundOfDeat

» Random spam
Mon Mar 01, 2010 11:52 pm by Danny1994

» [Request] EMS v56 Exe
Mon Mar 01, 2010 12:39 am by Dami

» [Blacklist] NX-Trading Blacklist.
Mon Mar 01, 2010 12:38 am by Danny1994

» I have a question regarding the meso farmer
Sat Feb 27, 2010 10:30 pm by Dami

» What are you listening to now?
Sat Feb 27, 2010 7:57 pm by Noname111111

» Video(s) Of The Day
Sat Feb 27, 2010 7:37 pm by Noname111111

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
free forum
 



Help with some C#

View previous topic View next topic Go down

Help with some C#

Post by Wallz on Fri Oct 02, 2009 4:53 am

Basically I have built a bot for EMS and I am trying to add a UA (one like the one on Kitterz Source) but I have had some troubles. Here is what I have so far...

Code:
        private void UATimer_Tick(object sender, EventArgs e)
        {
            int OldXPos;

            if (Hacks.ReadPointer(attkbase, attkoffset) >= 3)
            {
                OldXPos = Hacks.ReadPointer(charpid, xoffset);
                while (Hacks.ReadPointer(attkbase, attkoffset) >= 3)
                {

                    OldXPos = OldXPos - 15;

                    byte bytex = Convert.ToByte(OldXPos);
                    byte[] NewXPos = { bytex };

                    Hacks.GetMaplestory();
                    Memory.WriteToPointer(charpid, xoffset, 4, NewXPos);
                }

            }
        }

All of the Pointers and Offsets are fine, the Memory.WriteToPointer works fine as s I use it to fix hp and mp. I think the problem is the taking away 15 from the integer and converting that back to an byte array so I can write it. Can anyone help me get this to work? I then plan to add a wall check to stop it abing I just need this to work first

This is C# if anyone is wondering

Regards Wallz.

Wallz
Bronze Member
Bronze Member

Posts : 104
Join date : 2009-08-15

Back to top Go down

Re: Help with some C#

Post by Guest on Sun Oct 04, 2009 11:23 pm

Code:
OldXPos = OldXPos - 15;

this doesnt make sense, since oldxpos is oldxpos

x=x-15 huh never, this is math not coding

Guest
Guest


Back to top Go down

Re: Help with some C#

Post by Wallz on Mon Oct 05, 2009 1:14 am

Yeah it does work x = (x-15) works when I put a break point in it. This is because X is only assigned the nex value when the side right of the '=' has been completed, so really this reads as newxpos = oldxpos - 15; all it is doing is overiting the variable.

Wallz
Bronze Member
Bronze Member

Posts : 104
Join date : 2009-08-15

Back to top Go down

Re: Help with some C#

Post by Dami on Mon Oct 05, 2009 1:42 am

use "OldXPos -= 15;"
avatar
Dami
Dragon
Dragon

Posts : 1414
Join date : 2009-08-10
Age : 28
Location : Finland

Back to top Go down

Re: Help with some C#

Post by Guest on Tue Oct 06, 2009 12:24 am

so it still doesnt make sense u code it like that

like damien said u could do that

x - 15

smarter huh?

Guest
Guest


Back to top Go down

Re: Help with some C#

Post by Wallz on Tue Oct 06, 2009 12:26 am

yeah, still doesn't work, I am probably going to make a c++ dll and import the function.

Wallz
Bronze Member
Bronze Member

Posts : 104
Join date : 2009-08-15

Back to top Go down

Re: Help with some C#

Post by Dami on Tue Oct 06, 2009 4:50 pm

nazgul1444 wrote:so it still doesnt make sense u code it like that

like damien said u could do that

x - 15

smarter huh?

well if he would do "OldXPos = -15;"
it would just change the value to -15.


Last edited by Dami on Sat Oct 17, 2009 7:11 am; edited 1 time in total
avatar
Dami
Dragon
Dragon

Posts : 1414
Join date : 2009-08-10
Age : 28
Location : Finland

Back to top Go down

Re: Help with some C#

Post by Wallz on Tue Oct 06, 2009 10:41 pm

Anyone know any good tuts on how to make a C++ dll so I can use it in C#

Wallz
Bronze Member
Bronze Member

Posts : 104
Join date : 2009-08-15

Back to top Go down

Re: Help with some C#

Post by Guest on Wed Oct 07, 2009 9:03 pm

Dami wrote:
nazgul1444 wrote:so it still doesnt make sense u code it like that

like damien said u could do that

x - 15

smarter huh?

well if he would do "OldXPos = -15;"
it would just change the value to -15.

ofc i ment -=, but it was coded so idc

it was as example

@wallz u could use profect->dll?

Guest
Guest


Back to top Go down

Re: Help with some C#

Post by Wallz on Wed Oct 07, 2009 10:28 pm

I was messing a round yesterday and I found that to write a dll in C++ to get it to work, I would have to inject the dll then call it from inside of the process, so it would be easier to just code it all on c++. But I think I am just going to keep trying with C#

Another problem I found when I was messing around in C# is that I can only write to memory if the buffer is a byte array and when I convert a negative integer into hex - into a byte array - the hex is something like FFFFF732(not actual) and when this is in a byte array this isn't the actual value I want to write

Wallz
Bronze Member
Bronze Member

Posts : 104
Join date : 2009-08-15

Back to top Go down

Re: Help with some C#

Post by Guest on Thu Oct 08, 2009 3:13 am

Lol its possible, indeed.

if we got X = PostsOnForum, and Y = 20

and we say (X = X - Y), then its actually a possibility.
its actually another way of saying: "Posts on this forum is now, what it is atm - 20"

If u dont understand, u might consider begin to learn programming, b4 teasing ppl about stuff u dont know anything about.

Guest
Guest


Back to top Go down

Re: Help with some C#

Post by Wallz on Thu Oct 08, 2009 3:16 am

Figured it out now, thanks for the help everyone

Wallz
Bronze Member
Bronze Member

Posts : 104
Join date : 2009-08-15

Back to top Go down

Re: Help with some C#

Post by Guest on Thu Oct 08, 2009 3:18 am

np, but its actually easy to make. lol.

You should make another integer called something else, ex "Catch"

Then u say;
Catch = OldXPos;
OldXPos = Catch - 15;

just example.

Guest
Guest


Back to top Go down

Re: Help with some C#

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum