Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2013, 20:59
BlackWhite BlackWhite is offline
Friend
 
Join Date: Apr 2013
Posts: 80
Rept. Given: 4
Rept. Rcvd 14 Times in 6 Posts
Thanks Given: 12
Thanks Rcvd at 48 Times in 21 Posts
BlackWhite Reputation: 14
Angry Why does drag&drop cause the change of working directory?

Recently, I found a very weird behavior of Windows XP:
When I drag a file to an exe and drop, that exe's working
directory will be automatically changed to
"c:\documents and settings\user name"
in stead of current directory that exe lies in.

If I input that exe's name and its required arguments
at console, the above behavior will not happen.

Does anyone know the reason.

Thanks.
Reply With Quote
  #2  
Old 06-13-2013, 13:47
wilson bibe wilson bibe is offline
VIP
 
Join Date: Nov 2012
Posts: 492
Rept. Given: 489
Rept. Rcvd 439 Times in 180 Posts
Thanks Given: 853
Thanks Rcvd at 176 Times in 112 Posts
wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499
If I understood your question, You can Drag and Drop any compatible files, but without any argumment in the file that you want to Drag, the properties or argummnets to run, are always defined by de Drop exe file when it was compiled, and not by the Drag file.
Regards
Reply With Quote
  #3  
Old 06-13-2013, 15:33
BlackWhite BlackWhite is offline
Friend
 
Join Date: Apr 2013
Posts: 80
Rept. Given: 4
Rept. Rcvd 14 Times in 6 Posts
Thanks Given: 12
Thanks Rcvd at 48 Times in 21 Posts
BlackWhite Reputation: 14
Quote:
Originally Posted by wilson bibe View Post
If I understood your question, You can Drag and Drop any compatible files, but without any argumment in the file that you want to Drag, the properties or argummnets to run, are always defined by de Drop exe file when it was compiled, and not by the Drag file.
Regards
At first, I really wondered that the changing of working directory
was caused by the exe itself.

But I finally found that the changing of working directory was nothing to do
with the exe file, nor with the argument file that I had dragged.

I proved the above conclusion by doing the following experiment:
1. Replace the first byte of that exe's entry point with 0CCh which
stands for int 3.
2. Run SoftICE and command "i3here on" so that it will trap the int 3
instruction
3. Run the exe mentioned above by dragging an argument file to it.
4. When SoftICE stops the exe at its entry point, I input some
instructions at stopped address like this to call GetCurrentDirectory():
sub esp, 100
push esp
push 100
call GetCurrentDirectoryA
int 3
5. After calling GetCurrentDirectory(), I check the returning value and
find that the working directory has been changed to
"c:\documents and settings\user name"
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced IdaPython to change details UI cannot change chants General Discussion 1 07-31-2019 15:46
quick CRC32 hashing tool with drag and drop support destr0 Community Tools 1 05-16-2015 09:28
How to add debug directory to an exe file? jonwil General Discussion 1 08-11-2006 03:05
Relocations Directory arnix General Discussion 3 06-04-2005 15:37


All times are GMT +8. The time now is 23:38.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )