Solved

change/edit exe on the fly

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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 one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

717 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