Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[help] dll making for injection.. [C#]
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Mar 01, 2008 1:35 pm    Post subject: [help] dll making for injection.. [C#] Reply with quote

so my question is.. i'v create a dll file to inject it to MineSweeper..
the code goes like that

Code:

using System;
using System.Diagnostics;

namespace HackMines
{
    public class Hack
    {
        static void Main(string[] args)
        {
            ProcessMemoryReaderLib.ProcessMemoryReader ProcessReader = new ProcessMemoryReaderLib.ProcessMemoryReader();
            Process[] Mines = Process.GetProcessesByName("Winmine");
            ProcessReader.ReadProcess = Mines[0];
            ProcessReader.OpenProcess();
            byte[] Memory;
            int BytesRead;
            int Value;
            int NewVal;
            int BytesWritten;
            Memory = ProcessReader.ReadProcessMemory((IntPtr)0x01005194, 4, out BytesRead);
            Value = BitConverter.ToInt32(Memory, 0);
            NewVal = 0x64;
            Memory = BitConverter.GetBytes(NewVal);
            ProcessReader.WriteProcessMemory((IntPtr)0x01005194, Memory, out BytesWritten);
        }
    }
}


the problem is when i inject it to minesweeper it doesn't work
i suppose to get 100 mines but nothing's happening :\
is there a special way to write injection dll files or something?
what am i doing wrong Confused

_________________
Stylo
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Mar 01, 2008 2:03 pm    Post subject: Reply with quote

That's not a DLL

Also you don't have to worry about WPM and RPM when you're injected.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Mar 01, 2008 2:18 pm    Post subject: Reply with quote

but when i compile it, it creates a dll file in the debug folder Confused
is there any other way to make a dll?
i'm using Class Library project in visual studio

_________________
Stylo
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Mar 01, 2008 3:05 pm    Post subject: Reply with quote

From what I recall reading, you cannot make "real" DLLs with C#
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Ridor
Newbie cheater
Reputation: 0

Joined: 28 Feb 2008
Posts: 14

PostPosted: Sat Mar 01, 2008 3:07 pm    Post subject: Reply with quote

Wiccaan wrote:
From what I recall reading, you cannot make "real" DLLs with C#


Nope, I'm learning C++ so I can create some kind of wrapper for doing this in C# though. I can't get even my mine sweeper hook working though Sad. My main language is C#

Wiccaan you hang out in any IRC channels, was wondering if you could help me get this vista minesweeper hook working in a real-time chat Smile. I don't like forums, hard to tell if people are still even helping or just abandoned you Smile.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Mar 01, 2008 3:10 pm    Post subject: Reply with quote

Ridor wrote:
Wiccaan wrote:
From what I recall reading, you cannot make "real" DLLs with C#


Nope, I'm learning C++ so I can create some kind of wrapper for doing this in C# though. I can't get even my mine sweeper hook working though Sad. My main language is C#

Wiccaan you hang out in any IRC channels, was wondering if you could help me get this vista minesweeper hook working in a real-time chat Smile. I don't like forums, hard to tell if people are still even helping or just abandoned you Smile.


I own and run an IRCd: irc.ffact.org
You can find me in #extalia or #ffxi

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Mar 01, 2008 10:25 pm    Post subject: Reply with quote

what do u mean by not "real" dll
so how can i create a "real" one ?

_________________
Stylo
Back to top
View user's profile Send private message
Ridor
Newbie cheater
Reputation: 0

Joined: 28 Feb 2008
Posts: 14

PostPosted: Sat Mar 01, 2008 11:46 pm    Post subject: Reply with quote

1qaz wrote:
what do u mean by not "real" dll
so how can i create a "real" one ?


C++
Back to top
View user's profile Send private message
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Sun Mar 02, 2008 4:01 am    Post subject: Reply with quote

I prefer using C for dll's
_________________
Blog

Quote:
Rhys says:
you can be my maid
Rhys says:
ill buy you a french maid outfit
Tyler says:
Sounds good
Rhys says:
ill hold you to that
Back to top
View user's profile Send private message MSN Messenger
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Mar 02, 2008 5:27 am    Post subject: Reply with quote

but why is it so wrong to create dll using C# ??
_________________
Stylo
Back to top
View user's profile Send private message
Ridor
Newbie cheater
Reputation: 0

Joined: 28 Feb 2008
Posts: 14

PostPosted: Sun Mar 02, 2008 6:34 am    Post subject: Reply with quote

1qaz wrote:
but why is it so wrong to create dll using C# ??


Becase you can't create native DLLs in C#, it's just not possible it doesn't matter what you do or how awesome a programmer you are.

"Managed code has no concept of a consistent value for a function pointer because these function pointers are proxies that are built dynamically.
"

There is exactly why.
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Mar 02, 2008 10:52 am    Post subject: Reply with quote

ohh Surprised
can u please tell me what is so special in dll file?
what exactle it's purpose .. can u explain me that? Confused

_________________
Stylo
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Mar 02, 2008 10:58 am    Post subject: Reply with quote

1qaz wrote:
ohh :o
can u please tell me what is so special in dll file?
what exactle it's purpose .. can u explain me that? :?


Basically, it has an entry point.

That's all it really is (I'm pretty sure). It's this hunk of memory that can be loaded into a process for a specific task. For C#, all you have is a class library. That has no entry point, just a namespace(s), with a class(es) inside of it (them).

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Mar 02, 2008 11:38 am    Post subject: Reply with quote

so if i'll create MFC DLL in C++ it'll has an entry point? and it will be a good dll?? Surprised
_________________
Stylo
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Mar 02, 2008 11:43 am    Post subject: Reply with quote

1qaz wrote:
so if i'll create MFC DLL in C++ it'll has an entry point? and it will be a good dll?? Surprised


NOOOOO no MFC.
Bad Bad Bad Bad!

just learn simple C++ Dll

Code:
BOOL WINAPI DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved )
{
        switch( dwReason )
        {
              case DLL_PROCESS_ATTACH:
              case DLL_THREAD_ATTACH:
              case DLL_THREAD_DETACH:
              case DLL_PROCESS_DETACH:
                     break;
        }
        return 0;
}

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites