Solved

Maybe I find a bug with madCodeHook

Posted on 2004-04-11
11
353 Views
Last Modified: 2010-04-05
Dear Madshi:
                         
      I think maybe I find a little bug in MadCodeHook -> CreateProcessEx()

      When I try use
const ExeFile = './xxx.exe';
          CreateProcessExA(nil, ExeFile,
                    nil, nil, False, 0, nil,
                    PChar(ExtractFileDir(Application.ExeName)),
                    si, pi, 'xxx.dll')
      It allways be crash in windows98/me (2k/xp works fine)
(I tryed CreateProcessEx, and that dll is an empty dll)

      and it works fine in the version before madCollection 2.1.0.1 version (release at 2004-03-08)

      sorry for my poor english....

I can't send this mail to dear@madshi.net so I post it here
Hope you can see this..

Question difficulty must be at least 20 points.
My 20 points....5555..
0
Comment
Question by:xmichen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 10801352
Which one is crashing? The process which is calling CreateProcessEx? Or the newly created process?
0
 

Author Comment

by:xmichen
ID: 10801384
newly created process will crash...
I use createprocess then InjectLibrary It works now

that code works fine before I update my madcodehook to 2.1.0.1 version

and I tried use the empty dll...it still crash,,So I think that's a bug..
0
 
LVL 20

Expert Comment

by:Madshi
ID: 10801732
I can't reproduce it here with the current build ( htttp://madshi.net/madCollectionBeta.exe ). If you can still reproduce it with the build, could you please mail your files to me? I need all the xxx.dll and the xxx.dll and all the sources etc...

Thanks.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:xmichen
ID: 10805918
Maybe I can't test it now..
because I use 2000/xp system in my pc...
that 98 bug is my friend help me tested...
We tried two day....

the source code in the exe file only has one procedure in formcreate...
and the dll file is an empty dll(I has tried the damo dll in madcodehook named HookLoadLibrary.dll, still crash)

Const
  ExeFile = '.\target.exe';

procedure TMainForm.FormCreate(Sender: TObject);
var
  si    :TStartupInfo;
  pi    :TProcessInformation;
begin
  ZeroMemory(@si, sizeOf(si));
  si.cb := sizeOf(si);
  try
    if not CreateProcessA(nil, PAnsiChar(ExeFile),
                    nil, nil, False, 0, nil,
                    PAnsiChar(ExtractFileDir(Application.ExeName)),
                    si, pi) then
    begin
      if MessageBoxA(0, 'can't createprocess!',
                  'error', MB_OK + MB_ICONERROR) = IDOK then
      begin
        Application.Terminate;
        Exit;
      end;
    end;
    InjectLibraryA(pi.hProcess, PAnsiChar(DLLName))
  Except
    MessageBoxA(0, 'failed',
                  'error', MB_OK + MB_ICONERROR);
    Application.Terminate;
    Exit;
  end;
end;
0
 
LVL 20

Expert Comment

by:Madshi
ID: 10806468
What can I say? I can't reproduce it on my 9x PC. Maybe I could reproduce it if you would send me the full files which crashed on your friend's PC. But without being able to reproduce the problem I see no chance to fix it.
0
 

Author Comment

by:xmichen
ID: 10806852
reproduce = rebuild the source code?
sorry for my poor english:(....
0
 
LVL 20

Expert Comment

by:Madshi
ID: 10806971
reproduce means: I need to be able to see the crash on my PC.
0
 

Author Comment

by:xmichen
ID: 10807494
So that you mean that code does not crash in your pc?
then maybe is the target application's program.....

It's my program...sorry for waste your time..
I use InjectLibrary to let it work...

^_*
0
 
LVL 20

Accepted Solution

by:
Madshi earned 20 total points
ID: 10807857
I'm not sure what it is. At least I don't get that crash on my 98 PC.
0
 

Author Comment

by:xmichen
ID: 10811119
Maybe I find why the program crashed..

It looks the file path has unicode char..(We are chinese...)
So the CreateProcessEx doen't work bug CreateProcess worked fine...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question