Full credit goes to our good community friend “dmz” from 7200emu.hacki forum.
He was able to write a patch that automates the process of extracting the kernel and initrd of version 8.4(2).
This really saves us all from the burden of finding the right offset location of the header not mentioning all the necessary patches that needs to be done to be able to run the asa with as much features as possible.
DISCLAIMER: All the information provided in this post are for self-education purposes only. Use it at your own risk.
I’m using ubuntu 10.10-64 bit , but you can use any Linux or Unix distros that you have, as the patch doesn’t need any special package to run.
1. Prepare your asa842-k8.bin image. You can get one from cisco website using your cco account.
2. Get the script (( repack.v4.sh )) unpack the file and make it executable.
bash-4.1# tar xvf repack.v4.sh.tar
bash-4.1# chmod +x repack.v4.sh
3. Run the script with a privilege user:
bash-4.1# sudo ./repack.v4.sh asa842-k8.bin
Repack script version: 4
Detected syslinux/cdrtools – ISO will be created
1359344+0 records in
1359344+0 records out
1359344 bytes (1.4 MB) copied, 4.88292 s, 278 kB/s
23697936+0 records in
23697936+0 records out
23697936 bytes (24 MB) copied, 83.464 s, 284 kB/s
gzip: /home/asa842-initrd-original.gz: decompression OK, trailing garbage ignored
Setting input-charset to ‘ISO-8859-1’ from locale.
Size of boot image is 4 sectors -> No emulation
21.04% done, estimate finish Mon Jan 06 08:54:54 2011
42.00% done, estimate finish Mon Jan 06 08:54:54 2011
63.00% done, estimate finish Mon Jan 06 08:54:54 2011
84.03% done, estimate finish Mon Jan 06 08:54:54 2011
Total translation table size: 2048
Total rockridge attributes bytes: 0
Total directory bytes: 2048
Path table size(bytes): 26
Max brk space used 21000
23814 extents written (46 MB)
4. This will give you three files:
5. And that’s pretty much it. You can now import the kernel (asa842-vmlinuz) and ram disk file (asa842-initrd.gz) to gns3. Don’t forget to add the ‘-icount auto‘ to qemu options as this will help us to bypass the divizion by zero exception error and allows us to do a reload in our qemu-emulated asa.
Thanks to my Friends
dmz , chicany , twopacket