Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Combining two into one

Posted on 1999-01-08
14
Medium Priority
?
194 Views
Last Modified: 2010-04-06

Hi all,

  I am wroking on a project, which is about to control some devices using PC com port.  But the real part of the project was already done  This part has a good Interface which has a look similiar to the device front panell, and this part also manages the controlling of device(capable of sending the commands, and requesting some info from the devices.) So it is good. (This part of the program is an exe  and comes with the device on purchase.)

What I really want to do is that,  write a simple interface  in Delphi, create a form which asks some information to the user and then store this information to a log file and start the controller part. But I want to give one executable file to the user and want to combine these two exes (the one that already in hand and the one that I will write).

So is it posiible to manage this work.
PS. I know one way
I can modify my program in a way, that will make it extract
the controller exe , from a resource to disk and then start it.
But anyway I want to make the program look like as a whole one program, and do not want to involve into file managing stuff(extracting , executing and deleting the extracted portion from HD)
So any suggestion.
0
Comment
Question by:new_x
[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
  • 6
  • 5
  • 2
  • +1
14 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 1355463
Hmmm.
How about that: You could rename the other exe to "device.dll", then it looks like your program does all the work, then just before starting the other exe you could rename it to "device.exe" and afterwards back to "device.dll".

I don't know a better solution than yours or mine. I don't think it is possible (without very hard work), to really combine these two programs into one...  :-(

Regards, Madshi.
0
 
LVL 1

Expert Comment

by:Roadrunner100598
ID: 1355464
Looks like you need a link virus... ;-)

You know - those neat little programs that hook themselfs into the startup code of your program and execute their own code, copied somewhere into your EXE file (probably at the end). Maybe a scheme like this could work for your problem?
0
 
LVL 1

Author Comment

by:new_x
ID: 1355465
Hi everybody,

 Thanx for your replies. For Madshi, thank again for your reply, but this is not exactly what I want to do. ,
For Roadrunner (your username is a cartoon caharacter name , that I really like.) your suggestion sounds that I want to do, but is it possible... and If it is how can I do that.. Thanx

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Expert Comment

by:Matvey
ID: 1355466
Do you mean you have no access to the controller application sources? Is it legal anyway? I'm not Judge Greg, but I can't imagine what pulic it's intended to?

It's not so difficult, but involves assembler, machine code, and a good friend of mine.
0
 
LVL 1

Author Comment

by:new_x
ID: 1355467
Hi
 You right Matvey, it may be not legal. But it is not too bad I think. Anyway the usage of  application  will be very limited and there is no commercial intention.

Regards,

0
 
LVL 20

Expert Comment

by:Madshi
ID: 1355468
I see some problems with that:

(1) You have to know the entry point of the original program.
(2) Perhaps the original program uses absolute addressing. That means you would have to change all the pointers in the code of the original program...  :-(((

Regards, Madshi.
0
 
LVL 1

Expert Comment

by:Roadrunner100598
ID: 1355469
Hello new_x,

I have never tried anything like linking in other code myself, but anyhow I figure it might work like that:

1. Find the entry point (this is available in the 'Schnellansicht' (well what's it in english? mybe 'preview'?) from the context menu of WinNT/95/98.)
2. Write your program as procedure of a DLL - this is to avoide all problems regarding initialization, ressources, etc.
3. Add to the original program a JMP at the entry point to some code at the end of your program.
4. Your code should only
- Load DLL
- Execute your procedure
- Unload DLL
- Execute original code

The code for loading/unloading the DLL you can get by writing it in delphi, and then disassembling it via delphi's integrated debugger.
As you want to do this for one special file only, it is possible to do all the work manually

(On behalf of 'Roadrunner': there is a laserdisc available 'If at first you don't succeed' - 90 minutes of roadrunner vs. coyote - simply brilliant)

Beep, beep

0
 
LVL 1

Author Comment

by:new_x
ID: 1355470
Hi all,

 Thanks again for your comments, I will try to the something based on your oppinions.

Regards,

0
 
LVL 1

Expert Comment

by:Roadrunner100598
ID: 1355471
Tell us about your results somtimes...
0
 
LVL 1

Author Comment

by:new_x
ID: 1355472
Sorry for being quiet so long

I was unable to connect to internet for days, (some long works took my time longer than I expected.). Sorry my friends,

RoadRunner, My first question I could not understand how I can find the entry point. The other steps you listed are clear.


Thanx and sorry again

0
 
LVL 1

Expert Comment

by:Roadrunner100598
ID: 1355473
Hello new_x,

I'm nearly never at home these days, therefore the delay on my line...

I user Windows NT 4.0 (german version) and in this version there is a context menu item called 'Schnellansicht' giving you a preview on some filetypes and additional informations on EXE and DLLs, like the needed DLLs imported functions and THE ENTRY POINT adress. Try EXPLORER.EXE as an example. I don't know the name of the menu item in the english version, but 'quick preview' would be a straight forward translation.

It's in the section 'image optional header' (I checked my delphi programs, they have this header information included).

If you can't find it, please mail again - there is also some API magic that could do the trick, but I need some time to look it up...


Roadrunner
0
 
LVL 1

Author Comment

by:new_x
ID: 1355474
Hi all,

 It is very  nice to speak with you again. I thought that you decided not to write to me.

Ok Road Runner please send your comment as answer, and if you could look the APIs and send  them here, I would also very pleased

Thanx

0
 
LVL 1

Accepted Solution

by:
Roadrunner100598 earned 800 total points
ID: 1355475
Hello new_x,

I'm back on line... I thought the information on entry point would be available via te ShellAPI, but I failed to find it. But playing with a HexViewer and the Preview I found that like in good old DOS times the entry point is insinde the EXE Header.

Look at adress 000000A8 of any EXE file - you find the entry point there (low byte first).

So long,

Roadrunner


0
 
LVL 1

Author Comment

by:new_x
ID: 1355476
Thanx RoadRunner,

  Here the points
Regards,
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

609 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