Valhalla Legends Forums Archive | General Programming | Need help with VB please

AuthorMessageTime
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
May 4, 2004, 11:15 PM
LW-Falcon
I have no idea what you just said. Something about version changing I believe?
May 4, 2004, 11:26 PM
iago
Yes.
May 4, 2004, 11:34 PM
Adron
Yes. But mostly you'd use an ini file or registry key for your settings instead.
May 5, 2004, 12:09 AM
Eli_1
No, I think he means something like.

Program #1:
[code]
Private Sub Form_Load()
Dim OOGA as Integer
OOGA = 10
End Sub[/code]

I think he wants to know how to run program #1 with program #2, and change OOGA to 11 (using program #2).
May 8, 2004, 2:47 AM
iago
[quote author=Eli_1 link=board=5;threadid=6664;start=0#msg59004 date=1083984478]
No, I think he means something like.

Program #1:
[code]
Private Sub Form_Load()
Dim OOGA as Integer
OOGA = 10
End Sub[/code]

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

Why would he do something silly like that when you could just store it in the registry?
May 8, 2004, 8:06 AM
Adron
[quote author=Eli_1 link=board=5;threadid=6664;start=0#msg59004 date=1083984478]
I think he wants to know how to run program #1 with program #2, and change OOGA to 11 (using program #2).
[/quote]

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.
May 8, 2004, 8:26 AM
Eli_1
How would you do it? Code injection?
May 8, 2004, 11:09 PM
Adron
[quote author=Eli_1 link=board=5;threadid=6664;start=0#msg59098 date=1084057785]
How would you do it? Code injection?
[/quote]

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.

May 9, 2004, 11:38 AM
iago
[quote author=Adron link=board=5;threadid=6664;start=0#msg59152 date=1084102710]
[quote author=Eli_1 link=board=5;threadid=6664;start=0#msg59098 date=1084057785]
How would you do it? Code injection?
[/quote]

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.


[/quote]

eww, that's a terrible way to do it. But you're right, I don't really see any other option :)
May 9, 2004, 3:55 PM
St0rm.iD
whats wrong with that way?
May 9, 2004, 7:40 PM
Adron
That value might happen to appear elsewhere in the program?
May 9, 2004, 11:53 PM
SNiFFeR
[quote author=TeEhEiMaN link=board=5;threadid=6664;start=0#msg58532 date=1083712512]
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
[/quote]

Are you talking about patching a program?
May 10, 2004, 1:19 AM
iago
[quote author=Adron link=board=5;threadid=6664;start=0#msg59254 date=1084146812]
That value might happen to appear elsewhere in the program?
[/quote]

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.
May 10, 2004, 12:07 PM
Myndfyr
[quote author=SNiFFeR link=board=5;threadid=6664;start=0#msg59267 date=1084151999]
[quote author=TeEhEiMaN link=board=5;threadid=6664;start=0#msg58532 date=1083712512]
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
[/quote]

Are you talking about patching a program?
[/quote]

Are we talking about [s]patching[/s] stealing a program?
May 10, 2004, 3:57 PM
SNiFFeR
[quote author=Myndfyre link=board=5;threadid=6664;start=0#msg59351 date=1084204628]
Are we talking about [s]patching[/s] stealing a program?
[/quote]

Well he said it was his programs so I guess if the code fell into the wrong hands it'd be considered stealing. But if it was his own programs, then it's patching.
May 10, 2004, 5:11 PM
Grok
[quote author=Myndfyre link=board=5;threadid=6664;start=0#msg59351 date=1084204628]
[quote author=SNiFFeR link=board=5;threadid=6664;start=0#msg59267 date=1084151999]
[quote author=TeEhEiMaN link=board=5;threadid=6664;start=0#msg58532 date=1083712512]
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
[/quote]

Are you talking about patching a program?
[/quote]

Are we talking about [s]patching[/s] stealing a program?
[/quote]

Bleh @ being his judge and jury.
May 10, 2004, 5:28 PM
Myndfyr
Hey -- I didn't judge nor jury anything or anybody. All I did was ask a question. I didn't condemn him nor smite his ruins upon the mountainside. :P
May 10, 2004, 5:42 PM
Adron
[quote author=iago link=board=5;threadid=6664;start=0#msg59328 date=1084190855]
[quote author=Adron link=board=5;threadid=6664;start=0#msg59254 date=1084146812]
That value might happen to appear elsewhere in the program?
[/quote]

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.
[/quote]

True. You're not likely to be doing this frequently anyway because of the trouble of updating self, so speed shouldn't matter much. For optimizations, you have to make sure you don't use the value in any immediate calculation that might be optimized. But I doubt VB would optimize much anyway.
May 10, 2004, 7:41 PM
TeEhEiMaN
Maybe this will be easyer, i wanted to make a trojen, just to test my self and see if i could do it. and also fuck with my freinds =P, but this is where i get stumped. Im gonna need to make a ICQ notify, so How can i make a program taht could open the server.exe and chnage the icq number.

Like on a lot of trojens, the Edit server file, i want to do somehting like that.
May 11, 2004, 4:51 PM
LoRd
[quote author=TeEhEiMaN link=board=5;threadid=6664;start=15#msg59558 date=1084294318]
Maybe this will be easyer, i wanted to make a trojen, just to test my self and see if i could do it. and also fuck with my freinds =P, but this is where i get stumped. Im gonna need to make a ICQ notify, so How can i make a program taht could open the server.exe and chnage the icq number.

Like on a lot of trojens, the Edit server file, i want to do somehting like that.
[/quote]
Trojan editors usally do something similar to what Adron said. They make a variable like "123IP" or something for the IP field which could be easy to spot in hex and then open the server in the server editor, find that string and replace it with the IP inputted by the user.

Btw, ICQ pagers are ew. I suggest finding some other notification method.
May 11, 2004, 5:36 PM
CrAzY
Here is the answer to the first question of this topic's answer.

Every one, you are not being specific anough for whomever needs it. I was the same way when I started out programming VB.

Create a new program making a label and a button. Double click the button and between the blank space put...

[code]
'This will add a number to the previous one each click
Dim a As Integer
a = a + 1
Text1.text = a
[/code]

If you dont change the name of your label that should work when you click the button.
May 12, 2004, 12:05 PM
Adron
[quote author=CrAzY link=board=5;threadid=6664;start=15#msg59752 date=1084363539]
Here is the answer to the first question of this topic's answer.

Every one, you are not being specific anough for whomever needs it. I was the same way when I started out programming VB.

Create a new program making a label and a button. Double click the button and between the blank space put...

[code]
'This will add a number to the previous one each click
Dim a As Integer
a = a + 1
Text1.text = a
[/code]

If you dont change the name of your label that should work when you click the button.
[/quote]

Could you please elaborate on why you think this is the answer to the first question?
May 12, 2004, 12:09 PM
Atom
[quote]
Could you please elaborate on why you think this is the answer to the first question?
[/quote]

Yeah, what the heck that had to do with anything is beyond me. Anyways I will try to explain to you what these guys are talking about. The string that you are trying to make changeable in your exe you need to set to something that wont occur anywhere else in your program. i.e.
[code]
Dim ICQnum as String
ICQnum = "PUTDATNUMBAHEREBIATCH"
[/code]

You then must compile the exe, search for your string in the actual file (most likely with a hex editor), then make a program which rewrites the contents of your exe replacing "PUTDATNUMBAHEREBIATCH" with an actual icq number.

Wow i havent visisted these forums in a long time, happy to put some good cs talk into dummy language.
May 13, 2004, 9:00 PM

Search