📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








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

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 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit