Log in

View Full Version : Finding call to files on source CD.


BBQmyNUTZ
May 3rd, 2004, 19:27
Hi, everyone... as you can probably guess, I'm a complete and total n00b who just cracked his first program earlier today. I still have barely any understanding of ASM, but I'm trying. ^_^

Anyways, onto my question. The game which I wanted to run without the cd used a simple CD check, which I just bypassed and that works fine. However, the voice files (in .wav format) for the game are not copied to the harddrive during installation, and when the game runs it pops and error message stating they cannot be found.

I tried looking at the usual calls (getdrivetypea, messageboxa) and I can't seem to find anything that will lead me to where the files on the CD are being called to, or how to change it so that it can read from the harddrive.

I'm using OllyDbg for the debugging and patching of the file. Any help would be appreciated in pointing me on the right path, and if any additional information is needed I'll do my best to provide it for you.

Thanks,

Kai

Woodmann
May 3rd, 2004, 20:03
Howdy,

Search an you shall find such info's as:

GetDriveTypeA
GetVolumeInformationA
GetDriveAttributeA
FindFirstFileA
SetCurrentDirectoryA
GetFileSize
CreateFileA
GetDiskFreespaceA
GetFileAttributeA
mciSendCommandA & mciSendStringA (used to check AudioCD)

Woodmann

BBQmyNUTZ
May 3rd, 2004, 20:08
*Update*

Well, I did manage to find a few suspects, as well as the where it is being called from by setting some breakpoints... but I still have absolutely no idea what it's doing or how to get it to do what I want.

Very confusing.

Kai

BBQmyNUTZ
May 3rd, 2004, 20:13
Quote:
[Originally Posted by Woodmann]Howdy,

Search an you shall find such info's as:

GetDriveTypeA
GetVolumeInformationA
GetDriveAttributeA
FindFirstFileA
SetCurrentDirectoryA
GetFileSize
CreateFileA
GetDiskFreespaceA
GetFileAttributeA
mciSendCommandA & mciSendStringA (used to check AudioCD)

Woodmann


Thanks for replying, Woodmann. The modular call which led me to the CD check was GetDriveTypeA, however, when the program looks for the sound files on the cd it doesn't use that call. As stated in my update post, I was able to search around and find where I *believe* is where I need to be (found via a text string search), but the lightbulb hasn't gone off yet to where I can actually understand where I am or what I'm looking at.

BTW, many thanks for the site and the forum. I wouldn't have gotten as far as I have already without some of the tutorials I've read here.

Kai

dELTA
May 5th, 2004, 14:16
Did you install the program from the CD? My guess would be that it has just saved the installation source path somewhere (e.g. a datafile or the registry) and tries to access the files based on this. My first try would be to perform the installation from the start from a second harddisk partition instead (possibly subst:ed if necessary), and see how that goes.

BBQmyNUTZ
May 5th, 2004, 21:47
Quote:
[Originally Posted by dELTA]Did you install the program from the CD? My guess would be that it has just saved the installation source path somewhere (e.g. a datafile or the registry) and tries to access the files based on this. My first try would be to perform the installation from the start from a second harddisk partition instead (possibly subst:ed if necessary), and see how that goes.


I've tried both install methods. The installation itself doesn't copy the files to the harddrive, and the game exe doesn't look for them anywhere but the CD.

Kai

BBQmyNUTZ
May 11th, 2004, 20:44
Quote:
[Originally Posted by BBQmyNUTZ]I've tried both install methods. The installation itself doesn't copy the files to the harddrive, and the game exe doesn't look for them anywhere but the CD.

Kai


Anybody have any ideas? This thing is really annoying me. I've been at it for the past couple of days and I can't get anywhere.

Kai

DaddyJTHC
May 11th, 2004, 23:23
Quote:
[Originally Posted by BBQmyNUTZ]Anybody have any ideas? This thing is really annoying me. I've been at it for the past couple of days and I can't get anywhere.

Kai

I have had a program quite like this, and have found that the calls are not made in the general "X:\voice\wave.wav" format they are most likely refered to in a standard C/C++ define, hence not stored in string reference, there is usually always a secondary file in this instance,

1st
try running filemon to trace where the call is made from, and made to.

2nd
as DELTA said, it can be stored in the reg. regmon will help you there.

3rd, there are many program that can emulate a directory as a cd. hence, copy the cd to a directory and make the program run it as a cd.



hope this helps some.
dj

BBQmyNUTZ
May 12th, 2004, 08:56
Quote:
[Originally Posted by DaddyJTHC]I have had a program quite like this, and have found that the calls are not made in the general "X:\voice\wave.wav" format they are most likely refered to in a standard C/C++ define, hence not stored in string reference, there is usually always a secondary file in this instance,

1st
try running filemon to trace where the call is made from, and made to.

2nd
as DELTA said, it can be stored in the reg. regmon will help you there.

3rd, there are many program that can emulate a directory as a cd. hence, copy the cd to a directory and make the program run it as a cd.



hope this helps some.
dj


Most bizzare thing happened... I changed the cd protection patch a little bit and it now seems to be working. ^_^ Not sure what I did and why it affected the programs ability to read that folder... but I'll take it!

Kai

DaddyJTHC
May 12th, 2004, 12:58
Quote:
[Originally Posted by BBQmyNUTZ]Most bizzare thing happened... I changed the cd protection patch a little bit and it now seems to be working. ^_^ Not sure what I did and why it affected the programs ability to read that folder... but I'll take it!

Kai


I would make it a point to learn what you did, and how it affected this program if you are wanting to learn anything.

Regards
DJ

BBQmyNUTZ
May 12th, 2004, 16:33
Quote:
[Originally Posted by DaddyJTHC]I would make it a point to learn what you did, and how it affected this program if you are wanting to learn anything.

Regards
DJ


Have no idea where to start. I've just been doing alright up to this point by following the calls and jumps, knowing where they're going, and bypassing or omitting as needed. I don't understand ASM, and to be honest, most of the reads I've gone through all assume some level knowledge, which unfortunately I don't possess.

Anyways, onto my next problem child. ^_^

Kai