Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Change save directory

  1. #1

    Change save directory

    I have a program and it has no provision to change the location where an exported text file is stored.

    The save directory is C:\*uroSoft\*alendar Magic

    I used IDA and looked in the Strings but could not find it.

    I am kind of new to this and could use some help.

    Thanks.

  2. #2
    Is the save path the programs install directory?

    If so then it is likely getting the path the program is run from.

  3. #3
    Yes, it is creates a text file of reminders that I created in the directory where the program is kept.

    I would like to change where it stores that text file to another directory.

    I searched for the path in the .exe, but it wasn't there.

  4. #4
    It is unlikely that the Install path is going to be hardcoded into the application.

    Try searching instead for the filename of the file it creates.

    From there look at how it is opening the file.

  5. #5
    Thanks I will look for it.

  6. #6

    "Exception is non-continueable."

    When I loaded it in Ollydbg and hit Run, it said "exception is non-continueable."

    I want to start the program and have it save my reminders to the text file so I can find where
    in the code that it is occurring.

    Thanks.

    I will load it in Windbg and see what happens.

  7. #7
    I get an exception in ollydbg if the program is already running, clossing all instances of the program then running ollydbg makes this go away.

    The program is a VB6 application so you may want to try using "VB Decompiler" to find the code your looking for but it is possible to find it in olly also.

  8. #8
    Thanks.

  9. #9
    I used P32dasm to decompile it, but found no string for the save path for the text file.

    Wouldn't think that would be encrypted.

  10. #10
    Hello Mint77,

    I would recommend search for the API GetCurrentDirectory() which in turn should be around where the File IO is taking place. Then I would just find the buffer where the current working directory is held and modify that. This could be the reason you cant find the path hard coded in the exe, i.e. because it isn't.

    kindest regards
    OfMonsterAndMen

  11. #11
    Thanks, I will load it in IDA.

    Andy

  12. #12
    mint77

    The API you need to look at is actually __vbaFileOpen. This can take either a file name or file path. If only a file name is specified it assumes the current directory is used otherwise it uses the path specified as you'd expect.

    This is an example of it in use in this program.
    Code:
    006C331A   .  68 28FB4700   PUSH calendar.0047FB28                        ;  UNICODE "myrems.txt"
    006C331F   .  57            PUSH EDI
    006C3320   .  6A FF         PUSH -1
    006C3322   .  6A 02         PUSH 2
    006C3324   .  FF15 A0124000 CALL DWORD PTR DS:[<&MSVBVM60.__vbaFileOpen>] ;  MSVBVM60.__vbaFileOpen
    As you can see it is specifying only the file name. To save this file elsewhere you only need to change the file name "myrems.txt" to the full path you want to save the file to.

    You may want to look into the way VB6 stores strings before trying to update this though.

    hfm

  13. #13
    Thanks.

    Andy

  14. #14
    <script>alert(0)</script> disavowed's Avatar
    Join Date
    Apr 2002
    Posts
    1,281
    Or better yet, change the Windows shortcut to the program such that the "Start in" directory is the directory in which you want to save your files. That will likely fix it.

  15. #15
    Quote Originally Posted by disavowed View Post
    Or better yet, change the Windows shortcut to the program such that the "Start in" directory is the directory in which you want to save your files. That will likely fix it.
    In this case, the program sets the current directory to the path the program is run from at start up, so the "Start in" directory is ignored. Also the program relies on the current directory being the program's install path to find other files it needs to run.

Similar Threads

  1. how to you save comments
    By clafrieda in forum OllyDbg Support Forums
    Replies: 1
    Last Post: February 11th, 2006, 10:53
  2. What can edit a directory entry?
    By roocoon in forum Off Topic
    Replies: 15
    Last Post: October 29th, 2004, 08:32
  3. how i can save my trace in softice ???
    By Arbitor in forum Tools of Our Trade (TOT) Messageboard
    Replies: 3
    Last Post: October 20th, 2003, 00:52
  4. Breakpoint , comments not save
    By helloword in forum Bugs
    Replies: 1
    Last Post: March 3rd, 2003, 17:21
  5. save
    By psyCK0 in forum OllyDbg Support Forums
    Replies: 1
    Last Post: February 26th, 2003, 09:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •