Avr 122014
 

In April 2014, MS has updated Windows 8.1 to Windows 8.1 Update 1. (buildlab 6.3.9600.17031 and up).

One feature which was not very much marketed was the Windows Image File Boot also named Wimboot.
You can read more here on MS Web site.

In short, here is what MS says :
Windows image file boot (WIMBoot) lets you set up a PC so that it runs directly from a compressed Windows image file (WIM file).
WIMBoot can significantly reduce the amount of space used by Windows files. This helps you provide more free space to users, and helps you manufacture Windows on PCs with smaller drives.

So lets see how we can use this new feature :

We’ll assume you have already installed your Windows 8.1 (You can download an evaluation version here).

1-Lets make a WINPE out of the Windows 8.1 update 1 iso/dvd (I use QuickPE).

2-Boot onto this Winpe (I use rufus to « burn » the winpe iso onto USB).

3-Capture the installation : dism /capture-image /imagefile:e:\install.Wim /capturedir:c:\ /name:install /wimboot
Note here : e:\ is a second partition on my hard drive

4-Format C drive (so that we start from a fresh drive)

5-Apply our wim file (from step 3) to my C drive : dism /apply-image /imagefile:e:\install.Wim /index:1 /applydir:c:\ /wimboot

Note : after step 5, I had to do a bcdboot X:\windows /s X:\ where X is the partition where you just applied your WIM file.
This applies only if you have one unique boot & system partition which is nowadays rarely the case as Windows always created a hidden/reserved partition for the boot files.

And voila, you should end up with a C drive occupied by only 3GB (when it was about 20GB minimum before step 1).

This should work on X86 or X64 (tested), with a UEFI or MBR (tested) partition, with SSD drive or standard drive (not tested).

Here below a picture showing my final / wimboot setup.

wimboot

 Posted by at 22 h 27 min
Avr 112014
 

In a previous article, we have seen how to make a bootable image using Windows API and MS Virtual Disk.

Now, lets do the same but this time we will manipulate bytes in the Drive Master Boot Record and in the Volume Boot Sector with CloneDisk and ImDisk.

1-Create a raw disk image (here test.img=64 MB)

clonedisk_mi1

 

2-Retrieve file size in sectors (here 131072 = (64MB * 1024KB * 1024B) / 512 sectors)

clonedisk_mi2

 

3-Modify partition table : chs end/start=1023/254/63, sectors before=2048, total sectors=129023 (131072-2048-1)

clonedisk_mi3

 

4-Write NT6 mbr

clonedisk_mi31

 

5-Mount disk image (ImDisk auto detect offset=2048, size of disk=129023)

clonedisk_mi32

 

6-Format to NTFS

clonedisk_mi33

 

7-Change Hidden Sectors in Boot Sector  (since it is incorrectly set to 1)

clonedisk_mi4

8-Boot (in qemu or virtualbox)

 

 

 Posted by at 18 h 56 min
Avr 072014
 

Changes since latest changelog

added : set attributes in a wim image
added : can append datas to a wim file
added : support for dynamic VHD’s
added : detach vhd
modified : moved all virtualdisk functions to a new buttonbar
added : create differencing vhd (i.e a vhd with a parent)
added : open vhd in read only mode
added : expand vhd
added : merge vhd
added : reference file for wim capture and wim apply

2.1.0
added : G4D as bootloader next to nt5/nt6
added : manifest to run with admin rights
added : read offline hal/processor details
added : delete offline currentcontrolset\enum key
removed : dump registry (should be another software)
removed : jvdialogs unit

clonedisk210

 Posted by at 11 h 11 min
Avr 072014
 

Latest changelog

fixed : should detect if a socket is already in use
fixed : messages sent from threads would not always reach the memo box
added : will execute an executable/batch if cmd parameter is present in config.ini
fixed : httpd will handle both non keep-alive (default) and keep-alive http requests
fixed : would create crashes (under certain conditions) if the root path was incorrect
fixed : would not start tftpd if not set in config.ini
added : support for dhcp-relay (Thanks to Stefan Smet)

Discuss it here.
Download here.

tps17

 Posted by at 9 h 57 min
Mar 292014
 

Lately I had cloned a physical XP installation to run it into VirtualBox.

It went fine except for the network drivers.

Rather than looking for the right driver over internet (which can be a painful process sometimes) I decided to use DriverPacks and dpinst from Microsoft.

1-Download the proper driverpack (lan, wlan, storage, etc) for the correct O.S (nt5,nt6,x86,x64).
2-Unzip it to a folder (c:\drivers for exemple).
Note1 : I mounted my disk image offline to inject my files.
Note2 : for a physical machine, best would be to stuff it all on a USB key.
3-And run dpinst from the command line (dpinst /path c:\drivers) OR use my GUI (here) to make it easier.

And voila, all needed drivers will be installed 🙂

dpinst

 Posted by at 18 h 49 min
Mar 232014
 

This is IpTools Version 2.

Version 1 started in 1999 (initially written in VB6, then rewritten in Delphi).
The developpement was very active at first (the first 6 years).
Then life went busy and the tool did not evolve much apart from bug fixes.
Original page for version 1 is here.

I have decided to give it a second chance, first in rewritting completely the interface which was initially build around a network sniffer.
I also removed all screens which I believe were not related to network matters.
Next step is to review all components used and migrate to Delphi XE 32/64 bits.

The tool is now divided in 6 categories (for now) over 50 screens (!) :
-Scan
-Microsoft Services
-System
-Servers
-Clients
-Spoof

Here below some screenshot which should be self explanatory :

iptoolsv2_6

iptoolsv2_5

iptoolsv2_4

iptoolsv2_3

iptoolsv2_2

iptoolsv2_1

Download it here
Contact me here

 Posted by at 20 h 52 min
Mar 162014
 

I got myself a rotary potentiometer at dx.com and decided to come up with a basic article.

First, lets have a quick look at the below schematic to understand how a potentiometer works.

analogin_potentiometer

 

Now, lets plug it to our arduino and while we are it, lets use its retrieved value (thru analogread) to dim a led (thru analogwrite).

potentiemter_bb

 

Now lets have a look at the arduino sketch

 

byte potPin=0; //Analog 0 connected to the potentiometer
byte LEDPin=6; //Connected to LED on Pin 6
float potValue=0; //Value returned from the potentiometer
float v=0; //voltage (0-5v)

void setup(){
  Serial.begin(9600);
  pinMode(LEDPin, OUTPUT); //Set Pin 6 as an Output
}
 
void loop(){
  
  potValue = analogRead(potPin)/4; //Read the potentiometer, convert it to 0 - 255
  Serial.println(potValue,0);
  v=potValue*5/255; //to calculate the voltage send out on pin6
  Serial.println(v, 2);
  analogWrite(LEDPin, potValue); //Write the converted potentiometer value to LED pin
  delay(100);
}

here we go : rotate your potentiometer and see your led dim in and out

 Posted by at 16 h 53 min
Mar 152014
 

This is a simple GUI to FSCTL_GET_RETRIEVAL_POINTERS Microsoft API.

The idea is to read all clusters belonging to a file, then map these clusters on the logical drive where this file is located, and from there re assemble all clusters and save them to a new destination file.

Thanks to this method, one can save/copy a file which is in use since we « raw » read clusters from a logical drive.

This has been tested with success on \boot\bcd and \windows\system32\config\sam, files which you cannot copy in a « normal » mode.

Beware that using this method, you could end up with a corrupted dump since the file could be modified while you are reading it.

Get it on github here.

extents

 Posted by at 16 h 15 min
Mar 142014
 

In a previous article, I played with an arduino combined with a TI CC1101.

The CC1101 is a great and cheap chip to send datas over the air at frequencies below 1ghz, using different modulations.
You can tweak a great many options which should make this chip work with many other devices.

I had been looking for weeks (months actually…) to use ASK/OOK modulation in order to link it with my chacon temperature/humidity sensors or even with my RFXTRX433 (from RFXCOM).

It seems I finally managed to find the right settings for ASK/OOK : my two devices now talk to each other (@433mhz) using this modulation 🙂

I believe I am still a long way from talking to my chacon or rfxcom devices but still, I made some progress.

Before I forget, here below my settings : it could be helpful for some other geeks out there.

Now if someone out there manage to interface his cc1101 with an ASK/OOK device, please let me know !

/*
# Sync word qualifier mode = 30/32 sync word bits detected
# CRC autoflush = false
# Channel spacing = 199.951172
# Data format = Normal mode
# Data rate = 4.79794
# RX filter BW = 101.562500
# PA ramping = false
# Preamble count = 4
# Whitening = false
# Address config = No address check
# Carrier frequency = 433.919830
# Device address = 0
# TX power = 0
# Manchester enable = true
# CRC enable = true
# Deviation = 25.390625
# Packet length mode = Variable packet length mode. Packet length configured by the first byte after sync word
# Packet length = 255
# Modulation format = ASK/OOK
# Base frequency = 433.919830
# Channel number = 0
*/
void config2()
{
byte PA_TABLE[]= {0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,};

cc1101.writeReg(CC1101_IOCFG0,0x06);
cc1101.writeReg(CC1101_FIFOTHR,0x47);
cc1101.writeReg(CC1101_PKTCTRL0,0x05);
cc1101.writeReg(CC1101_FSCTRL1,0x06);
cc1101.writeReg(CC1101_FREQ2,0x10);
cc1101.writeReg(CC1101_FREQ1,0xB1);
cc1101.writeReg(CC1101_FREQ0,0x3B);
cc1101.writeReg(CC1101_MDMCFG4,0xF5);
cc1101.writeReg(CC1101_MDMCFG3,0x83);
cc1101.writeReg(CC1101_MDMCFG2,0x33);
cc1101.writeReg(CC1101_DEVIATN,0x15);
cc1101.writeReg(CC1101_MCSM0,0x18);
cc1101.writeReg(CC1101_FOCCFG,0x16);
cc1101.writeReg(CC1101_WORCTRL,0xFB);
cc1101.writeReg(CC1101_FREND0,0x11);
cc1101.writeReg(CC1101_FSCAL3,0xE9);
cc1101.writeReg(CC1101_FSCAL2,0x2A);
cc1101.writeReg(CC1101_FSCAL1,0x00);
cc1101.writeReg(CC1101_FSCAL0,0x1F);
cc1101.writeReg(CC1101_TEST2,0x81);
cc1101.writeReg(CC1101_TEST1,0x35);
cc1101.writeReg(CC1101_TEST0,0x09);

//thid 1 is needed otherwise only first packets has data
cc1101.writeReg(0x07,0x00); // packet automation control

//notice the burst mode to write beyong the first position (0) ...
cc1101.writeBurstReg(CC1101_PATABLE,PA_TABLE,8);
}
 Posted by at 19 h 24 min
Mar 142014
 

I recentely got myself a cheap laser tag at dx.com.

I decided to test the following : a laser detector, i.e detect thru a photo resistor (also called light dependent resistor) when my laser beam is interrupted.

First lets have a look at the wiring

LDR_bb

Then lets have a look at the code (change the extension to ino or pde) : laser_detector

And last, lets see it run : see the led going off each time our laser beam gets away from the photo resistor.

 Posted by at 15 h 36 min