Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 577 Vote(s) - 3.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A simple question.

#1
Just wondering if this would be possible in C++ or if VB was better for it. Say, I have a game where there is a specific .dll in the games directory that it needed to run, and it has a repair application. What I was wondering is would it be possible that when a file with the specific name was added to that directory the program would either remove the .dll and the repair program or corrupt them and make them not able to be run. Would something along these lines be possible?
Reply

#2
Of course it would, C++ is general purpose language, meaning you can do almost anything with it, unless it defies capabilities of the hardware (for example, unless you have a jet engine connected to some interface, C/C++ or any other code won't be able to make your PC fly :lol: ).

Some things might be extremely tedious to achieve, but still technically possible, however what you mentioned shouldn't be a problem at all.
Reply

#3
Quote:(08-03-2011, 11:53 AM)Frooxius Wrote:

[To see links please register here]

Of course it would, C++ is general purpose language, meaning you can do almost anything with it, unless it defies capabilities of the hardware (for example, unless you have a jet engine connected to some interface, C/C++ or any other code won't be able to make your PC fly :lol: ).

Some things might be extremely tedious to achieve, but still technically possible, however what you mentioned shouldn't be a problem at all.

Yeah, I made it. Here is the code:

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


How would I made it where this would only occur if a certain file was there?
Reply

#4
You simply add an condition, that checks for the existence of the file. You can do that by trying to open the file using standard C/C++ library and checking if it fails, like this:

Version that uses new C++ object oriented libraries.

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


Version that uses C-like libraries, but it's still C++, but can be converted to standard C easily (swap <cstdlib> for <stdlib.h> and <cstdio> for <stdio.h> and remove the using namespace declaration)

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


There are also functions (in various libraries and APIs) that are specifically designed for checking if file exists, however these are not part of standard C/C++ library and thus might not work everywhere and are often operating system specific (though you're obviously running on Windows).

Also, it's discouraged to use absolute paths (rather find the path to the specific application (or game in your case) for example by retrieving data from the registry), because if the files are located elsewhere, your code won't work.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through