Solved

change/edit exe on the fly

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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xampp tool 12 50
factorial example 4 40
Desingning Refactoring existing code 2 24
CSV file parsing thru Java 13 31
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

810 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