Solved

change/edit exe on the fly

Posted on 2001-09-05
2
407 Views
Last Modified: 2008-02-26
Hi:-


Case 1:

I want to edit exe on the fiy.

Before user downloads a exe, i have to add a "KEY" value in the exe so that when user installs the exe,

that "KEY" value is entered in the registry.

For example,

x.exe is a file.

I will reserve 4 bytes in the exe.

When user clicks on exe to download, i will assign some random number in the 4 bytes of exe as KEY value.

Then user will download that file.

Any one have idea how to do this?

By chaning the exe 4 bytes, the exe can not be invalid. The checksum to be computed again to validate

that exe.


Case 2:
 instead of reserving the 4 bytes, a txt file is already added in the exe with blank data. I will assign
the user KEY value in the txt file.  Now i need not build the exe again. Then user will download the
exe.


NOTE:

1. Current installer for the exe is GHOST installer

2. Exe was built on Windows98 and editing will happen on Linux machine in both cases( it is the JSP
server which starts Download process of user )

Over all, any other solution to the problem:

Change the exe on the fly to add a KEY value for the user before download starts

Advanced thanks
0
Comment
Question by:Ravindra76
2 Comments
 
LVL 1

Accepted Solution

by:
googlyralph earned 200 total points
ID: 6457071
A Random access file, writing known number of bytes, to a known location is what you are after, but im not sure about the check some for the win32 exe. Im fairly sure, that writing data wont prevent the exe from running, as i have "fixed" software by editing it with a hex editor, evan to the point of changing parts of the code section.

Look into RandomAccessFile in the JDK documentation.

(but it works something like this:)

import java.io.*;

final long OFFSET_TO_DATA = 9999;
byte[] data = {293,3,10, 127};

try{
   RandomAccessFile raf = new RandomAccessFile("a.exe", "rw");
   raf.seek(rag.length()-OFFSET_TO_DATA);
   raf.writeBytes(data);
   raf.close();
catch(Exception e){
}

Hope that helps,

GR.
0
 
LVL 7

Author Comment

by:Ravindra76
ID: 6542825
Upcousre my problem is solved with SFX of ZIP-PLUS 2001 in different way. Thanks for the response
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 86
advertisement module in core php 4 145
Groovy:unable to resolve class error 2 69
Cipher Configuration on Apache HTTPD 4 53
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

910 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

22 Experts available now in Live!

Get 1:1 Help Now