• Welcome to Valhalla Legends Archive.
 

Need help with VB please

Started by TeEhEiMaN, May 04, 2004, 06:15 PM

Previous topic - Next topic

TeEhEiMaN

I was wondering, if somehow, say I make just a quick program and add a number like 10, and then compile it into a exe. And then be able to make another exe, to open the exe and like change the number 10 to 11, and then save it, and have the numbers changed in the exe.

vb6
Thanks

Falcon[anti-yL]

I have no idea what you just said. Something about version changing I believe?

iago

This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Adron

Yes. But mostly you'd use an ini file or registry key for your settings instead.

Eli_1

No, I think he means something like.

Program #1:

Private Sub Form_Load()
   Dim OOGA as Integer
   OOGA = 10
End Sub


I think he wants to know how to run program #1 with program #2, and change OOGA to 11 (using program #2).

iago

Quote from: Eli_1 on May 07, 2004, 09:47 PM
No, I think he means something like.

Program #1:

Private Sub Form_Load()
   Dim OOGA as Integer
   OOGA = 10
End Sub


I think he wants to know how to run program #1 with program #2, and change OOGA to 11 (using program #2).

Why would he do something silly like that when you could just store it in the registry?
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Adron

Quote from: Eli_1 on May 07, 2004, 09:47 PM
I think he wants to know how to run program #1 with program #2, and change OOGA to 11 (using program #2).

I thought so too. The original question was whether it was possible, and it is. But it's mostly not a very useful thing to do, and so until he tells us more about it, and convinces me that it's really what he needs, I'm not going to go to the effort of writing an example. Reading an ini-file or the registry works better in most cases.

Eli_1

How would you do it? Code injection?

Adron

Quote from: Eli_1 on May 08, 2004, 06:09 PM
How would you do it? Code injection?

Just open the exe, seek to the right location, write the new value. If you're changing from a value that fits in 7 sign-extended bits to a value that requires more storage, you may be in trouble.

The easiest way of doing this yourself generally is to just put an arbitrary, unique, large value in the original source code, and then search for and replace that in the executable whenever you want to generate a new version.


iago

Quote from: Adron on May 09, 2004, 06:38 AM
Quote from: Eli_1 on May 08, 2004, 06:09 PM
How would you do it? Code injection?

Just open the exe, seek to the right location, write the new value. If you're changing from a value that fits in 7 sign-extended bits to a value that requires more storage, you may be in trouble.

The easiest way of doing this yourself generally is to just put an arbitrary, unique, large value in the original source code, and then search for and replace that in the executable whenever you want to generate a new version.



eww, that's a terrible way to do it.  But you're right, I don't really see any other option :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Banana fanna fo fanna

whats wrong with that way?

Adron

That value might happen to appear elsewhere in the program?

SNiFFeR

Quote from: TeEhEiMaN on May 04, 2004, 06:15 PM
I was wondering, if somehow, say I make just a quick program and add a number like 10, and then compile it into a exe. And then be able to make another exe, to open the exe and like change the number 10 to 11, and then save it, and have the numbers changed in the exe.

vb6
Thanks

Are you talking about patching a program?

iago

Quote from: Adron on May 09, 2004, 06:53 PM
That value might happen to appear elsewhere in the program?

It's also slow (compared to remembering an address or something) and not terribly reliable (optimizations), and I'm sure we could find other problems.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


MyndFyre

Quote from: SNiFFeR on May 09, 2004, 08:19 PM
Quote from: TeEhEiMaN on May 04, 2004, 06:15 PM
I was wondering, if somehow, say I make just a quick program and add a number like 10, and then compile it into a exe. And then be able to make another exe, to open the exe and like change the number 10 to 11, and then save it, and have the numbers changed in the exe.

vb6
Thanks

Are you talking about patching a program?

Are we talking about patching stealing a program?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.