using linux to edit windows registry? how?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
realflow100

using linux to edit windows registry? how?

Post by realflow100 »

my operating system is linux and windows xp i tried using the PCregedit but my mouse pointer leaves a trail and everything is all glitchy and invbisible i cant see what im clicking on :( is there some way to do it while im already booted into linux?
i tried chntpw but it doesnt work when i set the key because it wont let me set the values data it says nothing to write from buffer or something??
my windows xp userinit file isnt set to boot and it makes me have endless login log offs? my linux is terribly slow i only use linux for editing my graphics drivers files using hex editor (custom graphics drivers for my windows xp to increase performance and add shader 3.0 support to my old graphics card) all of a sudden my windows xp just decided to derp and stop working right now i cant log in to any account. not even safe mode.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
oobetimer

Re: using linux to edit windows registry? how?

Post by oobetimer »

Not so easy, but here is one way .. :wink:

http://translate.google.fi/translate?sl ... %3D26847.0

Original: http://forum.ubuntu-fi.org/index.php?PH ... ic=26847.0

Code: Select all

#!/bin/bash

# THIS SCRIPT HELPS YOU TO RESTORE WINDOWS XP REGISTRY FROM RESTORE POINT.
# THIS MAY BE USABLE WHEN XP CAN'T BOOT UP AT ALL.

# VARIABLES
WINMNT="/mnt/win_restore"

# FUNCTIONS

function checkRoot
{
if [ $(id -u) != 0 ]; then echo -e "You must have superuser permissions to run this script."
                           echo -e "Please use sudo for example.";
			   exit;
fi 
}
                           

function selectPartition
{
while [ ! -b "$PART" ]
do
  clear
  for i in `find /dev -name '?d?' | grep -v udev | grep -v hdc | grep -v fd` 
  	do
  		parted $i print -s | grep -v ext | grep -v swap \
  		| grep -v extended | grep -v Sector | grep -v Err
  	done

  echo -e "\nPlease select your Windows partition."
  echo "Type a name and number of partition. (NOT just /dev/hda)"
  echo -e "\nFor example:"
  echo -e "/dev/hda1\n"
  echo -e "(Type \"quit\" without quotes if you want to quit.)\n"
  echo -e ">" | head -c1
  read PART
  if [ $PART = "quit" ]; then echo "Quitting...press enter"; read; exit; fi
  
  DEVICE=`echo $PART | head -c8`
done
}

function selectRestorePoint
{
cd "$WINMNT"/System\ Volume\ Information
cd `ls -t | grep _restore | head -n 1`

while [ ! -d "$RP" ]
do
        clear
	echo -e "Here is a list of restore points.\n"
        
        for i in $(ls -d [Rr][Pp]*)
        do
            echo -e "Restore point number:" | tr "\n" " "
            ls -d $i | tail -c+3 | tr "/\n" " ";
            echo -e "   Last modification (YYYY-MM-DD):" | tr "\n" " "; 
            stat -c "%z" $i | head -c10; echo;
        done
        echo -e "\nPlease select restore point and type NUMBER."
        echo "The latest one is not recommended. It may be the damaged one."
        echo -e "(Type \"quit\" without quotes if you want to quit.)\n"
        echo -e ">" | head -c1
        read RPNUM
        if [ $RPNUM = "quit" ]; then unmountPartition; echo "Quitting...press enter"; read; exit; fi
        RP=`find . -iname rp$RPNUM | sed -e 's/\.\///1' | head -n1`
done
}

function selectWIN
{
cd $WINMNT
while [ ! -d "$WINDIR" ]
do
        clear
        ls -d */ | grep w | sed -e 's/\///1'
        ls -d */ | grep W | sed -e 's/\///1'
        echo -e "\nThese are some directories on your partition."
	echo -e "Please select the right Windows directory and type it (case sensitive).\n"
	echo -e "(Type \"quit\" without quotes if you want to quit.)\n"
        echo -e ">" | head -c1
        read WINDIR
        if [ $WINDIR = "quit" ]; then unmountPartition; echo "Quitting...press enter"; read; exit; fi
done
}

function moveBroken
{
echo "Moving damaged registry files to bak-directory..."

mkdir $WINMNT/$WINDIR/bak 2>/dev/null

cd $WINMNT/$WINDIR
system32=`find . -iname 'system32' | tail -c+3`
cd $system32
config=`find . -iname 'config' | tail -c+3`
cd $config

system=`  find . -iname 'system'   | tail -c+3`
software=`find . -iname 'software' | tail -c+3`
sam=`     find . -iname 'sam'      | tail -c+3`
security=`find . -iname 'security' | tail -c+3`
default=` find . -iname 'default'  | tail -c+3`

mv $system   $WINMNT/$WINDIR/bak/$system.bak   2>/dev/null
mv $software $WINMNT/$WINDIR/bak/$software.bak 2>/dev/null
mv $sam      $WINMNT/$WINDIR/bak/$sam.bak      2>/dev/null
mv $security $WINMNT/$WINDIR/bak/$security.bak 2>/dev/null
mv $default  $WINMNT/$WINDIR/bak/$default.bak  2>/dev/null
}

function copyRegistryFromRestorePoint
{
echo "Copying registry files from restore point to your Windows..."
cd "$WINMNT"/System\ Volume\ Information
cd `ls -t | grep _restore | head -n 1`
cd $RP/snapshot
cp _REGISTRY_USER_.DEFAULT    $WINMNT/$WINDIR/$system32/$config/$default
cp _REGISTRY_MACHINE_SYSTEM   $WINMNT/$WINDIR/$system32/$config/$system
cp _REGISTRY_MACHINE_SOFTWARE $WINMNT/$WINDIR/$system32/$config/$software
cp _REGISTRY_MACHINE_SECURITY $WINMNT/$WINDIR/$system32/$config/$security
cp _REGISTRY_MACHINE_SAM      $WINMNT/$WINDIR/$system32/$config/$sam
}

function unmountPartition
{
echo "Unmounting partition..."
cd / 
sleep 2 
umount $WINMNT 2>/dev/null 
rmdir $WINMNT 2>/dev/null
}

function confirm
{  
  clear
  echo -e "You are backuping your Windows registry files from"
  echo -e "C:\\$WINDIR\\system32\\\config"
  echo -e "to\nC:\\$WINDIR\\\bak\nAnd copying older ones from restore point number $RPNUM"
  echo -e "to\nC:\\$WINDIR\\system32\\\config and replacing the original files."
  echo -e "Are you sure? Please answer yes or no.\n"
  echo -e ">" | head -c1
  read SURE
             
  if [ ! $SURE = "yes" ];
  then 
   echo -e "You didn't answer yes, so quitting...press enter"
   read
   exit
  fi
}
                                                            


# MAIN

checkRoot
clear
echo "This small script helps you to restore Windows XP registry from restore point"
echo -e "even if the machine can't boot up.\n"
echo "Please run this from some Linux live-cd booted on broken XP machine."
echo "The script needs a super user permissions so use root user or sudo."
echo "The script is fully free software and written by J.Keranen"
echo -e "Version 0.2\n"
echo "Ready to go, press enter..."
echo -e "(Type \"quit\" without quotes if you want to quit.)\n"
echo -e ">" | head -c1
read Q;

if [ $Q = "quit" ]; then echo "Quitting...press enter"; read; exit; fi

selectPartition

# mounting
echo "Mounting partition..."
 cd /
 mkdir -p $WINMNT
 umount $PART 2>/dev/null
 if [ `fdisk -l $DEVICE | grep $PART | grep NTFS | head -c1` ]
   then
       ntfs-3g $PART $WINMNT
   else
       mount $PART $WINMNT
   fi

selectRestorePoint
selectWIN
confirm
moveBroken
copyRegistryFromRestorePoint
unmountPartition

echo "Done. Hope this helps. You can try to boot Windows now."
echo "Your damaged registry files have moved to" 
echo "C:\\$WINDIR\\bak"

echo "Press enter to exit..."
read
http://pukki.tontut.fi/saato/tc/TC-survival-0.3.iso
realflow100

Re: using linux to edit windows registry? how?

Post by realflow100 »

i dont have any windows restore points i turned windows system restore off right after i installed windows
so i dont have any restore points to even choose from :(
Locked

Return to “Software & Applications”