Flag: Tornado! Hurricane!

Blogs >> ReWolf's Blog

Created: Thursday, March 4 2010 13:00.59 CST Modified: Thursday, March 4 2010 13:01.58 CST
Printer Friendly ...
When memory management goes bad...
Author: ReWolf # Views: 3042

Few months ago I've encountered a strange behavior in cmd.exe when I wanted to list some big collection of files and execute some command on every single file. I used for this task 'for' command similar to this:

for /R c:\ %c in (*.*) do echo %c >> cmd_ptc.log

After few hours of processing I get a very disturbing message:

"Not enough storage is available to process this command."

Actually cmd.exe can eat all memory available for the process. I decided to check why it needs such amount of memory and if it will be possible fix it. Below you can find link to the full article and package with the fixed binaries (from Windows Vista SP2):

http://rewolf.pl/stuff/rewolf_cmd_research.pdf - article
http://rewolf.pl/stuff/rewolf_cmd_research.zip - article and binaries

Happy reading !
ReWolf


Blog Comments
bw Posted: Thursday, March 4 2010 13:10.36 CST
– Feb 2009 – discovered problem
– Jul 2009 – researched and patched cmd.exe
– Mar 2010 – finished this paper

damn, you're one, lazy bum :)

GynvaelColdwind Posted: Thursday, March 4 2010 13:37.51 CST
Great paper! I've really enjoyed the way you've explained how you traced and fixed the leak issue :)
It's a perfect paper to show to reverse engineering students and say "please look here... yes, this is how you should do it".
Thanks for sharing ;>

MFox Posted: Thursday, March 4 2010 14:19.49 CST
really detailed.

tnx!

sovietskicpu Posted: Saturday, March 6 2010 12:47.13 CST
Rewolf, great job as usual ;)
GynvaelColdwind, dear friend how are you doing ? :) hope you'll enjoy Dubai hehe..  

petroleum Posted: Saturday, March 6 2010 15:42.41 CST
Thanks rewolf, very interesting!!

GynvaelColdwind Posted: Sunday, March 7 2010 12:07.09 CST
@sovietskicpu
Hey :) Long time no chat my firend (and our last vm-detection related chat was very educating, so I kinda miss new ones ;<) ;>
Any chance seeing you in Dubai? It would be great to meet openrce guys in person ;)

Orr Posted: Monday, March 8 2010 04:45.05 CST
Impressive!  
The scale and the ambition of your work were executed professionally.


frankboldewin Posted: Tuesday, April 6 2010 13:22.18 CDT
thanx dude! very good reading.



Add New Comment
Comment:









There are 20,335 total registered users.


Recently Created Topics
Career: Threat Inte...
Jul/30
Career: Security Res...
Jul/30
Library Debugging Pr...
Jul/29
Pydbg attach Vs load?
Jul/29
IDA and MIPS (emulat...
Jul/27
UK Cyber Security ch...
Jul/26
System Service Descr...
Jul/26
LD_PRELOAD Question
Jul/23
Patching Application...
Jul/22
Contract: Research E...
Jul/19


Recent Forum Posts
Pydbg attach Vs load?
aMIr
LD_PRELOAD Question
monarch
LD_PRELOAD Question
justano...
LD_PRELOAD Question
monarch
Patching Application...
hughhan
Patching Application...
jduck
immunity debugger pl...
Malware...
paimei installation ...
wishi
IDA Pro customization
wishi
how to chnage an ins...
ConsoleFx


Recent Blog Entries
ResearchAviator
Jul/28
Installation procedure for ...

artemblagodarenko
Jul/27
Common function prototype

dennis
Jul/24
Dr. Gadget IDAPython plugin

trufae
Jul/23
radare2 0.5 released

AmrThabet
Jul/21
Pokas x86 Emulator for Gene...

More ...


Recent Blog Comments
omeg on:
Jul/29
Windows 7 syscall list

renzosilv on:
Jul/26
Windows 7 syscall list

renzosilv on:
Jul/26
Windows 7 syscall list

Dreg on:
Jul/21
HiperDrop 0.0.1

djnemo on:
Jul/20
HiperDrop 0.0.1

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit