| View previous topic :: View next topic |
| Author |
Message |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Mon Nov 05, 2007 6:28 am Post subject: |
|
|
ok thanks alot u helped me alot _________________
Stylo |
|
| Back to top |
|
 |
Renkokuken GO Moderator
Reputation: 4
Joined: 22 Oct 2006 Posts: 3249
|
Posted: Mon Nov 05, 2007 6:35 am Post subject: |
|
|
| 1qaz wrote: | | ok thanks alot u helped me alot | MSDN has hints on it as well, good luck. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Nov 05, 2007 6:58 am Post subject: |
|
|
You can do inline ASM in most languages, C/C++ is one of the more common languages to see inline ASM with. VS2005 is a good compiler / IDE if you are looking for one as well. Creating a DLL is easy too. Depending on what you want to make there are certain steps that you need to take for each thing. The main part of any program, including DLLs, is the entry point. In C/C++ the entry point of a DLL will look like:
| Code: | BOOL APIENTRY DllMain( HANDLE, DWORD ul_reason_for_call, LPVOID lpReserved )
{
switch( ul_reason_for_call )
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
} |
From there you would add things that you would need the DLL to do when its first loaded, if anything is done. Or create exported functions that the DLL has that other applications can use.
However, you will also need to read up on calling conventions as there are many different types of them, each having their own purpose and use inside the DLL and outside it in the calling program. The most common convention you will see is __stdcall, as it is required to allow languages like VB to call your exported functions.
Without the __stdcall convention on your exported functions, your exports become "decorated" with the param types and such that VB cannot understand. For example, you can export a function to add two params together, like:
int Add(int a, int b);
When you export it, it will look like:
?Add@@YAHHH@Z
In most cases you can fix this with .DEF files, adding your call to the export list such as:
LIBRARY "YourDLLName"
EXPORTS
Add
In other compilers it's not always the same.
Just some tips and things to look out for. _________________
- Retired. |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Mon Nov 05, 2007 6:59 am Post subject: |
|
|
Since when did the OP mention anything about visual basic interoperability? _________________
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Mon Nov 05, 2007 7:08 am Post subject: |
|
|
| appalsap wrote: | | Since when did the OP mention anything about visual basic interoperability? |
It was just an example... Jeez. |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Mon Nov 05, 2007 7:10 am Post subject: |
|
|
| noz3001 wrote: | | It was just an example... Jeez. |
No, that guide was clearly designed with visual basic in mind, talking about function decoration as if it is a bad thing, and suggesting the OP "fix" modern constructs by taking leaps backwards. _________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Nov 05, 2007 7:11 am Post subject: |
|
|
| appalsap wrote: | | Since when did the OP mention anything about visual basic interoperability? |
Did I say anything about VB specifically? I said "other languages like VB" as it pertained to exporting of functions which is sometihng he/she will be dealing with. If you are going to try to bash me, try reading first. _________________
- Retired. |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Mon Nov 05, 2007 7:14 am Post subject: |
|
|
| Wiccaan wrote: | | appalsap wrote: | | Since when did the OP mention anything about visual basic interoperability? |
Did I say anything about VB specifically? I said "other languages like VB" as it pertained to exporting of functions which is sometihng he/she will be dealing with. If you are going to try to bash me, try reading first. |
| Wiccaan wrote: | ...as it is required to allow languages like VB to call your exported functions.
...Without the ... and such that VB cannot understand. |
_________________
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Mon Nov 05, 2007 7:16 am Post subject: |
|
|
ok i have other question
i made a trainer and i saved it as <name>.dll
and i made a file in C# that waiting for the game and when the game is running it will open trainer
now since its a dll file i need to "inject" it i think and i have no idea how i make the injection at c#
that's what i wrote (btw it's for winmine)
| Code: |
using System;
using System.Diagnostics;
namespace ConsoleApplication6
{
class Class1
{
static void Main(string[] args)
{
Console.WriteLine("waiting for winmine..");
Console.WriteLine("");
start:
Process[] myprocess = Process.GetProcessesByName("winmine");
if (myprocess.Length != 0)
{
goto anotherstart;
}
goto start;
anotherstart:
Console.WriteLine("winmine found");
Process p = new Process();
p.StartInfo.FileName = "Hacks.dll";
p.Start();
}
}
}
|
now i know that the part of "startinfo.filename = "hacks.dll" wont inject it it's just opening the process
so how do i inject this dll file to the game? _________________
Stylo |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Nov 05, 2007 7:23 am Post subject: |
|
|
Use the following API to inject:
- VirtualAllocEx
- WriteProcessMemory
- CreateRemoteThread
- VirtualFreeEx _________________
- Retired. |
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Mon Nov 05, 2007 7:29 am Post subject: |
|
|
| 1qaz wrote: | and how do i use them exectly?  |
Why don't you just google them? _________________
| haxory' wrote: | can't VB do anything??
windows is programmed using VB right? correct me if im wrong.
so all things in windows you have like the start menu is a windows form too. |
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Mon Nov 05, 2007 7:46 am Post subject: |
|
|
it's pretty hard to translate it from C++
:S i can bearly understand is there any chance u help me? _________________
Stylo |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Nov 05, 2007 8:27 am Post subject: |
|
|
| 1qaz wrote: |
it's pretty hard to translate it from C++
:S i can bearly understand is there any chance u help me? |
Like I said, I don't program in C#, I also didn't see any examples of DLL injection with C# via google either. Perhaps you should take on a new language instead of C#. _________________
- Retired. |
|
| Back to top |
|
 |
|