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: 6136

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 28,220 total registered users.


Recently Created Topics
Reverse Engineering ...
Jan/23
Career: DoD Agency I...
Jan/22
"Disappearing&q...
Jan/17
Career: Software Sec...
Jan/11
Where is the call st...
Jan/07
IDA Pro 6.1 Breakpoi...
Jan/01
How to create data s...
Dec/30
can i search all mod...
Dec/23
IDA symbol table exp...
Dec/20
An anti-attach trick
Dec/17


Recent Forum Posts
Reverse Engineering ...
NirIzr
"Disappearing&q...
NirIzr
Reverse Engineering ...
charlie
"Disappearing&q...
charlie
An anti-attach trick
Bass
An anti-attach trick
waleeda...
An anti-attach trick
Bass
An anti-attach trick
waleeda...
An anti-attach trick
Bass
Looking for value in...
NirIzr


Recent Blog Entries
waleedassar
Feb/06
OllyDbg v1.10 And Hardware ...

waleedassar
Jan/31
Yet Another Anti-Debug Trick

RolfRolles
Jan/22
Finding Bugs in VMs with a ...

waleedassar
Jan/13
An OllyDbg Bug Disables Sof...

waleedassar
Jan/01
Another OllyDbg Anti-Debug ...

More ...


Recent Blog Comments
NirIzr on:
Feb/05
Yet Another Anti-Debug Trick

trolotou on:
Feb/05
Doudoune Moncler -Pennies F...

waleedassar on:
Feb/01
Yet Another Anti-Debug Trick

NirIzr on:
Jan/31
Yet Another Anti-Debug Trick

jackchen on:
Jan/10
nike mercurial vapor iii

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit