Solved

Maybe I find a bug with madCodeHook

Posted on 2004-04-11
11
344 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

Industry Leaders: 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!

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 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