Results 1 to 6 of 6

Thread: strange ollydbg question

  1. #1

    strange ollydbg question

    Hi

    Is there anyway to set current directory for created process when we start a process for debugging?

    Regards
    I should look out my posts,Or JMI will get mad at me! ;)

  2. #2
    Hi,

    I'd suggest to either start the process from the directory you need or use SetCurrentDirectory() to explicitly set it.
    Hope that helps.

  3. #3
    Quote Originally Posted by Darkelf View Post
    Hi,

    I'd suggest to either start the process from the directory you need or use SetCurrentDirectory() to explicitly set it.
    Hope that helps.
    hm....
    I cannot start process in the folder that I need, but for using SetCurrentDirectory, I guess I need to assemble it in my code. is there any simpler way?
    I should look out my posts,Or JMI will get mad at me! ;)

  4. #4
    How about breaking on GetCurrentDirectory (and the like) and edit it on the fly?
    Maybe your program has a commandline switch to set the working directory (that's possible but unlikely). Maybe you can write a script - ODbgScript will happily execute the SetCurrentDirectory stuff for you or...
    Be creative

    Regards
    darkelf

  5. #5
    <script>alert(0)</script> disavowed's Avatar
    Join Date
    Apr 2002
    Posts
    1,281
    Quote Originally Posted by Hero View Post
    hm....
    I cannot start process in the folder that I need, but for using SetCurrentDirectory, I guess I need to assemble it in my code. is there any simpler way?
    If you don't want to assemble in new code, you could launch OllyDbg in OllyDbg, break on CreateProcess(...) in the child OllyDbg, and modify lpCurrentDirectory. Still not ideal

  6. #6
    Quote Originally Posted by disavowed View Post
    If you don't want to assemble in new code, you could launch OllyDbg in OllyDbg, break on CreateProcess(...) in the child OllyDbg, and modify lpCurrentDirectory. Still not ideal
    Hm...problem in here is that you cannot debug created process immediately and you need to attach created process...
    I guess best option right now is to assemble a small code to call SetCurrentDirectory and then recover old code again...
    I wish this option were added to ollydbg v2.0, but it seems it this one is missing. but it is an easy one,but donna if I can add this option with a plugin or not.

    EDIT:
    I solved it using OllyScript.
    Thanks for everyone's help and suggestion.
    Last edited by Hero; August 22nd, 2010 at 15:00.
    I should look out my posts,Or JMI will get mad at me! ;)

Similar Threads

  1. IDA x64 strange error
    By roocoon in forum Tools of Our Trade (TOT) Messageboard
    Replies: 13
    Last Post: February 6th, 2014, 00:48
  2. Replies: 1
    Last Post: May 29th, 2009, 08:13
  3. another newbie question: about ollydbg
    By ppSangchai in forum OllyDbg Support Forums
    Replies: 2
    Last Post: November 9th, 2005, 23:18
  4. A strange question (bytes)
    By Aquatic in forum The Newbie Forum
    Replies: 2
    Last Post: March 14th, 2003, 07:24
  5. Can patch a DLL... strange
    By mozfet in forum Advanced Reversing and Programming
    Replies: 1
    Last Post: January 27th, 2001, 15:40

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
  •