| | WoW Memory Editing WoW Memory Editing for learning purposes only.
This section is more advanced than others on MMOwned Read the section specific rules, infractions will be given out if u break them!That is including the expectations! - If you don't meet them then don't post |  | 
12-09-2008
|  | Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep) | | | Join Date: Nov 2008
Posts: 76
Reputation: 1 | | | C# pointers to function does anyone know if I can point to function in C# (not delegates), like in C++?
I've googled it and all I can found is about delegates.
I want to cast an address into a pointer of a function. | Donate to remove ads, get your "DONATOR title, and get access to the MMOwned community's elite Shoutbawx. 
12-09-2008
|  | Kynox's sister's pimp Legendary User | | | Join Date: Apr 2006 Location: ntdll.dll
Posts: 4,180
Nominated 63 Times in 4 Posts  TOTM/W Award(s): 1 Reputation: 1085 Points: 55,512, Level: 35 | Level up: 14%, 3,188 Points needed |     | | | It doesn't work that way. Your C# code isn't in the processes address space so you have to allocate memory and call functions via a new thread. | 
12-09-2008
|  | MMOwned WebDev Legendary User | | | Join Date: Jan 2008
Posts: 1,915
Nominated 5 Times in 1 Post Reputation: 1029 Points: 22,671, Level: 21 | Level up: 17%, 1,329 Points needed |     | | | You can't do that with C#. You can however, write a small stub in C++ to point that function to your managed code. (Though, at that point, it's probably easier just to go fully C++)
This would require you to load the CLR from the target process, and then load your managed code. | 
12-10-2008
|  | Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep) | | | Join Date: Nov 2008
Posts: 76
Reputation: 1 | | | thx it's the same as what I thought | 
12-10-2008
|  | Kynox's sister's pimp Legendary User | | | Join Date: Apr 2006 Location: ntdll.dll
Posts: 4,180
Nominated 63 Times in 4 Posts  TOTM/W Award(s): 1 Reputation: 1085 Points: 55,512, Level: 35 | Level up: 14%, 3,188 Points needed |     | | | Oh I misread. He basically wants detours in C#? Yeah, not gonna happen. | 
12-10-2008
|  | Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep) | | | Join Date: Nov 2008
Posts: 76
Reputation: 1 | | | I guess I'll have to manage something with both C# and C++ | 
12-10-2008
|  | Kynox's sister's pimp Legendary User | | | Join Date: Apr 2006 Location: ntdll.dll
Posts: 4,180
Nominated 63 Times in 4 Posts  TOTM/W Award(s): 1 Reputation: 1085 Points: 55,512, Level: 35 | Level up: 14%, 3,188 Points needed |     | | | Or just do it in all C++ and save yourself a bunch of hassle. | 
12-10-2008
|  | Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep) | | | Join Date: Nov 2008
Posts: 76
Reputation: 1 | | | yeah, maybe...
I'll have to rewrite some of the BlackMagic's features into C++.
EDIT: btw should I open any specific type of project in C++ for the bot and the injected dll or just a normal empty project?
Last edited by Shamun; 12-10-2008 at 05:10 PM.
| 
12-10-2008
|  | Kynox's sister's pimp Legendary User | | | Join Date: Apr 2006 Location: ntdll.dll
Posts: 4,180
Nominated 63 Times in 4 Posts  TOTM/W Award(s): 1 Reputation: 1085 Points: 55,512, Level: 35 | Level up: 14%, 3,188 Points needed |     | | | Errr, you don't have to rewrite any of BlackMagic. The whole point of BlackMagic is its working around a lot of limitations imposed by the language. Once you're using native code and inside your targets address space all those limitations are gone. | 
12-10-2008
|  | Contributor | | | Join Date: May 2008
Posts: 387
Reputation: 87 Level up: 2%, 494 Points needed |    | | Quote:
Originally Posted by Cypher Errr, you don't have to rewrite any of BlackMagic. The whole point of BlackMagic is its working around a lot of limitations imposed by the language. Once you're using native code and inside your targets address space all those limitations are gone. | ^this
The only reason I even bothered with writing the BlackMagic library is I'm, for no particular reason, currently dedicated to C#. I can't explain it. Maybe it's because I never bothered to learn about creating dialog windows in unmanaged code, maybe it's because I'm an idiot. If you want ease of use from a bot standpoint--i.e. want to easily be able to call things in-process, etc.--write it in C++. Period. | 
12-10-2008
| | Sergeant | | | Join Date: Jun 2008
Posts: 41
Reputation: 36 Level up: 36%, 320 Points needed | | | Quote:
Originally Posted by Cypher It doesn't work that way. Your C# code isn't in the processes address space so you have to allocate memory and call functions via a new thread. | :: throws up facepalm collection and makes a run for it :: | 
12-10-2008
|  | Kynox's sister's pimp Legendary User | | | Join Date: Apr 2006 Location: ntdll.dll
Posts: 4,180
Nominated 63 Times in 4 Posts  TOTM/W Award(s): 1 Reputation: 1085 Points: 55,512, Level: 35 | Level up: 14%, 3,188 Points needed |     | | Quote:
Originally Posted by Hyru :: throws up facepalm collection and makes a run for it :: | Unless you're looking for a ban I suggest you do one of the following:
1. Stop posting.
2. Actually contribute in your posts.
3. GTFO. | 
12-10-2008
|  | Warden's Mediator Legendary User | | | Join Date: Dec 2006 Location: Raping your Stack
Posts: 773
Nominated 2 Times in 1 Post Reputation: 797 Points: 28,091, Level: 24 | Level up: 53%, 809 Points needed |     | | Quote:
yeah, maybe...
I'll have to rewrite some
| I actually lol'd. | 
12-10-2008
|  | Kynox's sister's pimp Legendary User | | | Join Date: Apr 2006 Location: ntdll.dll
Posts: 4,180
Nominated 63 Times in 4 Posts  TOTM/W Award(s): 1 Reputation: 1085 Points: 55,512, Level: 35 | Level up: 14%, 3,188 Points needed |     | | Quote:
Originally Posted by kynox I actually lol'd. | Get on MSN you fuc.kstick. | 
12-11-2008
|  | Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep) | | | Join Date: Nov 2008
Posts: 76
Reputation: 1 | | | Thanks for the help I got your point... |  |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -4. The time now is 08:52 PM. |