Mapping binary file failed Delphi RIO10.3.3, Madexcept 5.0.0

delphi package - automated exception handling
jjnoui
Posts: 13
Joined: Sun May 10, 2020 4:16 pm

Mapping binary file failed Delphi RIO10.3.3, Madexcept 5.0.0

Post by jjnoui »

Hello,
I have installed madExcept 5.0.0 to use with Delphi 10.3.3 (community edition)

my choice at the install process was to select :
madBasic,
madExcept 5,
madKernel,
madSecurity and
madShell.

at the end of installation a pop-up window information display :
'madBasic' installed successfully.
'madDisAsm' installed successfully.
'madExcept' installed successfully.
'madKernel' installed successfully.
'madSecurity' installed successfully.
'madShell' installed successfully.


I added in uses clause of myproject.dpr :

madExcept,
madLinkDisAsm,
madListHardware,
madListProcesses,
madListModules,

When i compile myproject I receive the message :

[madExcept Avertissement] Mapping binary file failed (2)

and MadExcept will not fire on error (in my case i do a zero div)

on the same desktop I have Delphi XE5 and in this case MadExcept works well.

I leave the process install of MadExcept without any interferences,
so MadExcept was installed in C:\Program Files (x86)\madCollection

After that :
I uninstall MadExcept,
I delete the madCollection directory, where MadExcept where installed,

I deactivate BitDefender for the time of installation
Also I deactivate my Ethernet Card
I redo the install process and : Same cause, same effect.....

Delpi XE5 works well, not Delphi Rad Studio Rio 10.3.3

to check, I use the following code :

Code: Select all

 
procedure TForm1.plouf1Click(Sender: TObject);
var
	i, j : integer;
begin
	j := 0;
  i := 17 div j; // oops a zero div ......
end;
I reactivate my AV ;-)
and my Ethernet connection ;-))

Thanks if you can help me

Jean-Jacques.
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by madshi »

Does the same problem happen with a brand new (almost empty) test project in Rio?
jjnoui
Posts: 13
Joined: Sun May 10, 2020 4:16 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by jjnoui »

Hi Madshi !
Thanx for your quick answer
I just made the test, see below... but same problem.
I now install Tokio 10.3.3 on my portable and check.
I send you a new response after new test.
Bests regards

Code: Select all

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Déclarations privées }
  public
    { Déclarations publiques }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  i, j : integer;
begin
 i := 0;
 j := 17;
 i := j div i;
end;

end.
jjnoui
Posts: 13
Joined: Sun May 10, 2020 4:16 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by jjnoui »

Good news, on my laptop it works if I compile in debug mode (nothing in release mode, but maybe it's normal?).
I am going now :
1- compare the different paths defined for the environment of Rio
2- if that is not enough I will redo an installation of MadCollection
3- if it doesn't work better I would redo an installation of Rio followed by a new installation of MadCollection.

Of course I will keep you posted on the results.

It may take me more than a day, but I think it is necessary so as not to remain on an interrogation, even a defeat ;-)

thank you,
Jean-Jacques.
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by madshi »

Are you using Delphi or BCB?

The error code suggests that madExceptPatch could not find a file. Not sure why that would happen, though. Could you please double check if your user has read & execute rights to the madCollection root folder (and all sub folders)? Also, I hope you didn't move around any files after the madCollection installer has run through?

One thing you could try is creating an empty file "madExceptWizard.txt" on your desktop, then reproduce the failure message. Then upload the text file somewhere for me to look at.
jjnoui
Posts: 13
Joined: Sun May 10, 2020 4:16 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by jjnoui »

I didn't move around any files after the madCollection installer has run through.

I don't know BCB acronym, I use Embarcadero Rad Studio Rio Delphi 10.3.3 Community Edition.

I collected both madExceptWizard.txt (one from desktop and one from laptop), but I can't attach those files to my post.
Is there another way but without use services from Google nor Microsoft :sorry:
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by madshi »

You could try a free media host such a MediaFire or similar.
jjnoui
Posts: 13
Joined: Sun May 10, 2020 4:16 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by jjnoui »

OK!
You can get files at : http://www.mediafire.com/folder/sc3l3vp ... onu/shared

Have a nice day
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by madshi »

Hmmmm... I'm not sure I understand what's going on here. It seems the EXE file can be opened successfully, but still patching fails with ERROR_FILE_NOT_FOUND.

Can you please try this:

1) Download http://madshi.net/HookProcessCreation.zip .
2) Run "DllInjector32.exe".
3) Click on "user wide" -> "inject dll" -> "HookProcessCreation32.dll".
4) Don't close the DllInjector32 window.
5) Now reproduce the "Mapping binary file failed" error.

This "HookProcessCreation" is really just a demo project. It shows what my API hook library "madCodeHook" can do. However, it can help us analyze this problem further. Basically this demo project shows a MessageBox() every time a 32bit EXE tries to call CreateProcess(). Now in the moment when you reproduce the "Mapping binary file failed" error, a MessageBox should appear showing you the command line the IDE is calling to run "madExceptPatch.exe". Please write down the exact "madExceptPatch.exe" command line.

6) Now open a command line window and manually run the madExceptPatch.exe command line. Does it work or does it fail? It probably fails? If it fails, please check the command line parameters. Do they look correct to you?

Hopefully this will allow us to get nearer to the cause of the problem?
jjnoui
Posts: 13
Joined: Sun May 10, 2020 4:16 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by jjnoui »

I had to fight with my antivirus which did not appreciate much the manipulation of injection of dll, also I had to try it again with several;
but here is the result:

http://www.mediafire.com/file/2rg5jbkws ... e.txt/file

Sorry for the long pathnames, but I use different environments with several languages and several targets.
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by madshi »

There was no call to "madExceptPatch.exe"? There should have been.
jjnoui
Posts: 13
Joined: Sun May 10, 2020 4:16 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by jjnoui »

the trace.txt file was created by copying and pasting all the message lines displayed at the bottom of Rio IDE.
the file C: \ Program Files (x86) \ madCollection \ madExcept \ Tools \ madExceptPatch.exe is present
Was this file called? Was it found?
I did the same operation on my laptop and there too I see no reference to madExceptPatch.exe
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by madshi »

I don't need the trace log from the IDE. Does the HookProcessCreation demo not work for you? It should show a MessageBox for every EXE that is started by a 32bit EXE (e.g. by the IDE).
jjnoui
Posts: 13
Joined: Sun May 10, 2020 4:16 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by jjnoui »

Sorry for the mistake :sorry:

here is copy from cmd mode :

C:\>"C:\Program Files (x86)\madCollection\madExcept\Tools\madExceptPatch.exe" "D:\todel\todel.exe" /dontCheckRtl/RestoreFileTime

File "/dontCheckRtl/RestoreFileTime" not found.
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mapping binary file failed Delphi RIO10.3.3, Madexcept 5

Post by madshi »

No problem at all... :D

There's no space between "/dontCheckRtl/RestoreFileTime"?? There's supposed to be a space in between. Does it work if you add that space?

FWIW, my code looks like this:

Code: Select all

          if not checkIncompleteRtl then
            cmd := cmd + ' /dontCheckRtl';
          if restoreFileTime then
            cmd := cmd + ' /restoreFileTime';
So I don't really see how it's possible that there would be no space in between those 2 options?
Post Reply