I was wondering if it is possible to create a windows SAM file. I already tried using chntpw but it seems like it only works under a Redhat based linux, ie I was able to blank/change a Windows 7 64bit box on Fedora with chntpw 0.99.5 but I couldn't get it done using Backtrack 5, Ubuntu or Kali. I know I can recover the password with tools like ophcrack or just using pwdump or sth like that to get the NTLM hashes and then decypt it using bruteforce or rainbow attacks, but I want to know if it is possible to just replace the hash in the SAM file (with physical access to the box using a live os), in another words I just want to know how chntpw works and how to do what it does manually. any help is appreciated...
please note that my problem isn't replacing the password I know several ways to do that, as I said in the title I want to know if it is possible to generate a SAM file from NTLM hashes, I want to know how these NTLM hashes are stored in the SAM file. I don't want any tools, if anything I want a tool that does the reverse of what pwdump does , ie take the hashes and store it to the SAM file (with live cd of course).