Strangely, the main in my dll is getting executed multiple times and
msvcr71.dll gets injected too. Is this normal?
2012/12/3 s0beit s0b...@myg0t.com:
On Sunday, 2 December 2012 at 22:30:56 UTC, maarten van damme wrote:
Thanks, interesting blog :)
2012/12/2 s0beit s0b...@myg0t.com:
On Monday, 3 December 2012 at 11:08:34 UTC, maarten van damme
wrote:
Strangely, the main in my dll is getting executed multiple
times and
msvcr71.dll gets injected too. Is this normal?
mcvcr71.dll is probably loaded by your library, I don't know if D
uses visual studio dependencies... one
Yes, that was the problem :p
I have no idea about mcvr71, maybe because of std.process but that
isn't that huge a concern
On Sunday, 2 December 2012 at 22:30:56 UTC, maarten van damme
wrote:
Thanks, interesting blog :)
2012/12/2 s0beit s0b...@myg0t.com:
Alright, I was finally able to give it a try:
http://s0beit.me/d/d-module-injector/
I released the source code as well as the binary here if
anyone wants to
Alright, at the end of my long search I have finally concluded
that this is some sort of threading problem.
Any D module loaded in a new thread, from a C/++ application will
crash. The solution, I believe, in this case might be to hijack
the program's main thread and execute your LoadLibrary
On Saturday, 1 December 2012 at 11:24:51 UTC, s0beit wrote:
Alright, at the end of my long search I have finally concluded
that this is some sort of threading problem.
Any D module loaded in a new thread, from a C/++ application
will crash. The solution, I believe, in this case might be to
On Saturday, 1 December 2012 at 12:29:51 UTC, js.mdnq wrote:
On Saturday, 1 December 2012 at 11:24:51 UTC, s0beit wrote:
Alright, at the end of my long search I have finally concluded
that this is some sort of threading problem.
Any D module loaded in a new thread, from a C/++ application
Alright, I was finally able to give it a try:
http://s0beit.me/d/d-module-injector/
I released the source code as well as the binary here if anyone
wants to try. It worked for me in a game I was playing with.
I recently had this problem, and I think I've solved it for now
if anyone is still looking for a fix ... it's really ghetto but
it seems to work for me.
extern (Windows) BOOL DllMain(HMODULE hModule, ULONG ulReason,
LPVOID pvReserved)
{
if(ulReason == DLL_PROCESS_ATTACH)
{
On Tuesday, 27 November 2012 at 01:01:10 UTC, s0beit wrote:
I recently had this problem, and I think I've solved it for now
if anyone is still looking for a fix ... it's really ghetto but
it seems to work for me.
extern (Windows) BOOL DllMain(HMODULE hModule, ULONG ulReason,
LPVOID pvReserved)
Hmm... It's probably confused by multiple threads. You can try to
copy the source for dll_process_attach and insert debugging code
there.
On Monday, 14 May 2012 at 09:53:55 UTC, Kagamin wrote:
Try to make C dll, which loads D dll, and inject the C dll :)
I made a bootstrapper (a c DLL which loads the D Dll) and it
works fine (the D entrypoint get called (a made a msgbox test)
but then the Process freezes after it displayed the
Try to make C dll, which loads D dll, and inject the C dll :)
I found a couple of errors in my code but couldn't get it to work.
On Thursday, 12 April 2012 at 14:43:01 UTC, maarten van damme
wrote:
works and GetLastError() returns 0 in both cases.
Op 12 april 2012 16:13 schreef Kagamin s...@here.lot het
volgende:
#include windows.h
void main()
{
LPTHREAD_START_ROUTINE LoadLibAddy =
(LPTHREAD_START_ROUTINE)**
I tried again with a few other random C dll's stolen around my system and
they all work perfectly. it's only the D dll that gives me trouble.
#include windows.h
void main()
{
LPTHREAD_START_ROUTINE LoadLibAddy =
(LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle(kernel32.dll),
LoadLibraryA);
CreateThread(NULL,0,LoadLibAddy,mydll.dll,0,NULL);
}
?
works and GetLastError() returns 0 in both cases.
Op 12 april 2012 16:13 schreef Kagamin s...@here.lot het volgende:
#include windows.h
void main()
{
LPTHREAD_START_ROUTINE LoadLibAddy = (LPTHREAD_START_ROUTINE)**
GetProcAddress(**GetModuleHandle(kernel32.dll**), LoadLibraryA);
I went ahead and went back to as far as 2.045 and I still couldn't get a
working dll. This would suggest something is wrong with my dll injection
code but I've tested with a few other random dll's and that appears to
work. according to my debugger the problem is an access violation while
executing
On Wednesday, 11 April 2012 at 13:26:23 UTC, maarten van damme
wrote:
I went ahead and went back to as far as 2.045 and I still
couldn't get a
working dll. This would suggest something is wrong with my dll
injection
code but I've tested with a few other random dll's and that
appears to
work
On Wednesday, 11 April 2012 at 13:26:23 UTC, maarten van damme
wrote:
the code I use for injecting is
/**
* injectDLL injects a dll in a given process using the
CreateRemoteThread
function.
*
* arguments:
* HANDLE proc = A HANDLE to the process
* string dllName = A string containting the
I wrote my own injector and this makes the target exe call loadlibrary.
this works on every dll I try to inject apart from dll's written in D
(starting with dmd version 2,054 or something like that).
I'll try with D calling loadlibrary on D dll's this evening.
Hey there, I want to inject a dll which was created in D into a c
Program.
Informations:
DMD vs. 2.058
IDE: MonoDevelop with Mono-D
System: Windows 7 64bit
Program Informations:
32-bit
written in c
The Injector is working for sure, so thats not the Problem.
the Source of the DLL:
import
when I tried the previous dmd compiler (have yet to try the curent one on
this problem) I got the same problems while trying to compile a dll and use
it. I have no clue as to why this is happening. worked in 2.54 I thought
On Tuesday, 27 March 2012 at 20:45:52 UTC, maarten van damme
wrote:
when I tried the previous dmd compiler (have yet to try the
curent one on
this problem) I got the same problems while trying to compile a
dll and use
it. I have no clue as to why this is happening. worked in 2.54
I thought
I
Maybe it's because I have no def file.
Very possible.
Just pass it to dmd like the other files.
Or try the new -shared flag.
On Tuesday, 27 March 2012 at 21:12:59 UTC, Trass3r wrote:
Maybe it's because I have no def file.
Very possible.
Just pass it to dmd like the other files.
Or try the new -shared flag.
I have tried both now (shared and def file linking), but know
it's crashing my App, lol.
I inject it but
I inject it but it returns nothing and the App(where the dll is
injected) is hanging( not responding).
Could you try it maybe?
I would like to know whether it's a Problem with D or with me.
Are dlls without injection working?
On Tuesday, 27 March 2012 at 21:46:23 UTC, Trass3r wrote:
I inject it but it returns nothing and the App(where the dll
is injected) is hanging( not responding).
Could you try it maybe?
I would like to know whether it's a Problem with D or with me.
Are dlls without injection working?
I
I've also injected some dll's and when I recompiled them they seemed to
crash the target program too.
this means that no C program will be able to load a dll written in D :s
the test I compiled was
import std.c.windows.windows;
import core.sys.windows.dll;
__gshared HINSTANCE g_hInst;
extern
Well if I change the DLL_PROCESS_ATTACH case to this:
case DLL_PROCESS_ATTACH:
MessageBoxA(null, Injected!, DLL, MB_OK);
g_hInst = hInstance;
dll_process_attach(hInstance, true);
try
{
*cast(int*)0x12FE6C = 1337;
}
Everything works perfectly if I write the DLL in C++ (and I've
never had any errors with C++ DLL's before that are similar to
this one).
If I remove the cast line and MessageBox()'s in the D version,
then I still get the error.
does it ever go past the cast point? what happens when you try{}catch and
print the error out?
I've injected but with writeprocessmemory.
I've been trying for a while now to inject a DLL written in D
into another process, and I just haven't been able to get it
working.
Here's the code for the DLL:
import std.c.windows.windows;
import core.sys.windows.dll;
__gshared HINSTANCE g_hInst;
extern (Windows)
BOOL DllMain(HINSTANCE
34 matches
Mail list logo