Solved

Maybe I find a bug with madCodeHook

Posted on 2004-04-11
11
311 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
Comment Utility
Which one is crashing? The process which is calling CreateProcessEx? Or the newly created process?
0
 

Author Comment

by:xmichen
Comment Utility
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
Comment Utility
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
 

Author Comment

by:xmichen
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

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

Expert Comment

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

Author Comment

by:xmichen
Comment Utility
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
Comment Utility
I'm not sure what it is. At least I don't get that crash on my 98 PC.
0
 

Author Comment

by:xmichen
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

14 Experts available now in Live!

Get 1:1 Help Now