Write to an EXE in Delphi - delphi

I am planning to store the license information of my app to the app itself. Is it possible to write to an EXE in Delphi without affecting its logical function? If yes, How? My colleague says that there are only specific parts of the exe that is writable. Is this true?

Why don't you store the license as a resource in your Delphi app rather than hack the EXE?
Example here: http://delphi.about.com/od/objectpascalide/a/embed_resources.htm

Take a look at http://sourceforge.net/projects/tponguard/
You'll find what you want here.

This An In-Depth Look into the Win32 Portable Executable File that will help you. thehackerslibrary.com. File Resource Management Library (.NET) that may work for you.

Create your license variable with start and stop tags. I don't know anything about Delphi programming but in psuedocode it would look like
var license = "$$$$"+"LICENSE DATA"+"$$$$";
You can open the executable in a hex editor and search for the $$$$ part and edit it directly or you can write a program that will overwrite the bit between the tags.

Related

Build a delphi EXE which has no procedure names in it?

For security reasons a customer is asking us if we could build a version of his executable which contains no references to procedure names we use in the code. At first I thought this was relatively easy and could be achieved by not building using Debug Information.
Sadly ... when opening the EXE using a text editor like NotePad, we are still able to see a lot of information if our EXE. Especially procedure names which are public. I thought that without debug information all this would be obfuscated.
Now I'm wondering if there is an easy way to achieve this. Build my EXE which has no references to procedure names.
Any suggestion is welcome.
You can include following compiler directive in units you don't want to emit extended RTTI information, and leave only RTTI for published properties, fields and methods that are usually used by streaming or other RTTI based mechanisms.
{$RTTI EXPLICIT METHODS([vcPublished]) PROPERTIES([vcPublished]) FIELDS([vcPublished])}
However, that will not obfuscate class names and will leave RTL/VCL/FMX RTII information intact.
Any suggestion is welcome.
Embed a web browser in the main form and move all code to a web application. Then launch the web app home page in your Delphi program. Try to use notepad now - and Bingo. :)

is there any way to interpret pascal in Delphi applications

i want my own pascal code to be executed it also have some uses files and other complex functions just like a Delphi code can i do this
Yes:
http://www.remobjects.com/ps.aspx
This component is used in the highly popular Inno Setup installer software.
Delphi Web Script is now under active development again.
Previously it was good; now it is becoming great.
You can download it on Google Code.
--jeroen
Another option, which is useful if you want to support more than just Pascal syntax, would be Fast-Script by the makers of Fast-Report.
There's also paxCompiler
Depends how much pascal you want to interpret. Pascal Script will interpret most stuff but you can't declare classes in a script (You can however import them using script functions). You can't use "uses" clauses either.
If you want to do full on pascal support you're going to have to compile it. You could probably use the FreePascal one providing your app's licensing is compatible (GPL).
TMS has both a scripting engine and a scripting IDE product.

How to Make a exe files with Delphi?

I want to make a "Setup Maker" App with Delphi.
How can I create a exe files?
for example : Delphi Itself Compiler.
Tanks to All.
....NiliDelphi....
if you mean installer program why don't you use Inno Setup
May be you know; it is a free installer program.
I think that you're asking the wrong thing, since installer applications ("setup makers") don't produce/compile new executables. They have 1 already compiled exe file. They just add additional resources/archives/files to it - that's all.
When I read "How to Make a exe files with Delphi?"... I was tempted to answer "press F9"

How do I compress multiple files into a single archive with Delphi

I need to compress multiple files into a single archive using Delphi. I'd prefer to use freeware components or open-source components because I am very very cheap :-)
My primary requirements are:
Possible to encrypt the archive
Can create common archives that can be opened by anyone with a copy of WinZip
Does anyone have suggestions with components that they have used? Please feel free to suggest free as well as commercial components/libraries.
Perhaps DelphiZip is what you are looking for, it seems to support encryption, too, and is WinZip compatible. It is released under LGPL.
KaZip is an open-source ZIP archiver. Here is its description:
KAZIP is fast, simple ZIP archiver and
dearchiver which uses most popular ZIP
format.Inflate - Deflate zip
compression format (no encryption
support and no multidisk
support).KAZip is totaly based on
Delphi VCL - no DLL, ActiveX or other
external libraries.KAZip is totaly
stream oriented so you can deal with
data only in memory without creating
temporary files, etc. If you need to
add zip-unzip functionality to your
application,KAZIP is the right
solution. Additional ZipListView and
ZipTreeView components for easy
visualisation.Functionality:Zip-Unzip
using Inflate-DeflateBZip2 unzipping
trough usage of BZIP2 units from
Edison Mera Menndez.Functions:Adding
Files, Folders, Streams; Selecting,
Deselecting, Checking;Extracting to
files and streams;Delete and Rename
filesCreate, Delete and Rename
foldersTest, RepairMany new properties
and methods, improved speed.A very
complex Zip Browser demo application
is included
It is not compatible with Delphi 2009 yet, but with some minor changes in the source code, you can make it work in Delphi 2009 too. Actually, that's what I did.
Regards
I`m using madZip from madCollection
I'm surprised no-one has mentioned JclCompression yet - it's part of the well-known Jedi Code Library (JCL).
Here's a view of the unit itself : http://jcl.svn.sourceforge.net/viewvc/jcl/trunk/jcl/source/common/JclCompression.pas?view=markup
Note, it's compatible with 7-zip DLL version 4.64 - newer versions might not be backwards-compatible...
I recommend the $69 ZipForge from ComponentAce.
You could use 7zip (LZMA) bindings for Pascal (compatible with Delphi): http://www.birtles.org.uk/programming/
Another Delphi resource to look at would be InnoSetup. The source code is available and with a little work might give you an edge up on what your trying to do. There is an option to create self extracting zip archives which are compatible with WinZip,
My thoughts are not to use the program, but to use his source as a starting point since it is very heavily tested and extremely solid.
There are infozips zip32 and unzip32 dlls. They can be used from Delphi (even from Visual Basic), there are interface units/modules for both. The interface isn't as good as I would have liked it, but it works.

How do you use F1 help in Delphi 2007?

In my application, originally built with Delphi 7, I use the SPHelpIntegration code to enable CHM help via the F1 interface. I figured that this wasn't needed in Delphi 2007, so I removed the units and built my app. I then press F1 and get a message that no help interface is installed. The online help doesn't tell me a lot about what is needed to make F1 help work. Do I have to include a unit or something? Or should I just carry on doing what works?
Add HTMLHelpViewer to your uses clause to handle CHM files. There is an issue in using them is they must exist on the local system (not a network share) to view properly. There is a registry hack to change this behavior, but I have found it easier to just install the help files locally on the system.
Lately rather than CHM files, I used the Adobe OpenPDFParameters API calling conventions to throw them directly into my PDF version of my printed manual jumping to the section based on the current form (I grab the form class name and use it in my named sections). It requires that the workstation has a PDF reader, but who doesn't now days?
Yes, you need to include a help viewer in the uses clause.

Resources