Solved

change/edit exe on the fly

Posted on 2001-09-05
2
405 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

705 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

20 Experts available now in Live!

Get 1:1 Help Now