Solved

Maybe I find a bug with madCodeHook

Posted on 2004-04-11
11
328 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
  • 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 64
Communication Between RC4 Delphi <-> PHP 3 113
Delphi XE10 Round Image 2 121
URL for downloading Google Chrome for Win XP 2 152
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now