<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8714185704977948121</atom:id><lastBuildDate>Sat, 18 Apr 2009 12:58:47 +0000</lastBuildDate><title>Welcome to my blog!</title><description>Read some information here and you will find the important one!!!!</description><link>http://maniarockers.blogspot.com/</link><managingEditor>alternativerockers421@gmail.com (rockers alternative)</managingEditor><generator>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/RockersMania" /><feedburner:info uri="rockersmania" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8714185704977948121.post-3801188149078522773</guid><pubDate>Sat, 18 Apr 2009 05:27:00 +0000</pubDate><atom:updated>2009-04-17T22:27:59.467-07:00</atom:updated><title>Myth about WPA ( How it is done ), Windows Product Activation Technique</title><description>Microsoft's plans to stop people pirating the next version of Windows have suffered a setback.&lt;br /&gt;&lt;br /&gt;A German computer magazine has found weaknesses in the piracy protection system built into Windows XP.&lt;br /&gt;&lt;br /&gt;The weaknesses could mean that in up to 90% of cases users can circumvent the copy protection system.&lt;br /&gt;&lt;br /&gt;But Microsoft said that the protection system would be much stronger and harder to defeat when the final version of XP is released later this year.&lt;br /&gt;&lt;br /&gt;Component count&lt;br /&gt;&lt;br /&gt;In a bid to combat piracy Microsoft is introducing a product activation system into the XP versions of its software. Activating a product involves contacting Microsoft for an identification number that is then combined with the serial numbers of the components inside your computer to create a unique identifier.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;it would be possible to 'activate' nearly 90 percent of home-user machines without Microsoft knowing anything about it&lt;br /&gt;&lt;br /&gt;Mike Hartmann, Tec Channel&lt;br /&gt;Big changes to the hardware in a machine could mean that users have to contact Microsoft for a new identification number to re-activate their software.&lt;br /&gt;&lt;br /&gt;By tying software to individual machines Microsoft hopes to stop its products being run on more machines than they are licensed for.&lt;br /&gt;&lt;br /&gt;But now German computer magazine Tec Channel has analysed the product activation system that is being used in the test, or beta, versions of Windows XP and found that, in many cases, it can be compromised by making simple changes.&lt;br /&gt;&lt;br /&gt;File fiddling&lt;br /&gt;&lt;br /&gt;When Windows XP is first installed and activated it generates a file called wpa.dbl that stores information about the configuration of your machine.&lt;br /&gt;&lt;br /&gt;Changes to any one of the ten components or serial numbers that this file watches are logged. When three changes have been made the wpa.dbl file is deleted forcing the user to contact Microsoft to reactivate the software.&lt;br /&gt;&lt;br /&gt;But Mike Hartmann, a journalist at Tec Channel, has found that the ability of the wpa file to spot piracy can be easily compromised.&lt;br /&gt;&lt;br /&gt;In tests Mr Hartmann installed and activated XP, then saved a version of the wpa file that was generated. He then changed components on the test machine so XP had to be re-activated. However, copying the old version of the wpa file back in the Windows system directory stopped requests for reactivation.&lt;br /&gt;&lt;br /&gt;Piracy problems&lt;br /&gt;&lt;br /&gt;The activation was also compromised when XP was fooled into thinking that a desktop PC was a laptop in a docking station, rather than a self-contained machine. In this configuration some components that wpa watches would be in the docking station rather than the portable computer. XP dutifully ignored any changes made to these components.&lt;br /&gt;&lt;br /&gt;XP activation items&lt;br /&gt;network card address&lt;br /&gt;graphics card ID number&lt;br /&gt;CPU serial number&lt;br /&gt;SCSI host adapter number&lt;br /&gt;IDE controller number&lt;br /&gt;hard disk serial number&lt;br /&gt;CPU type&lt;br /&gt;Ram size&lt;br /&gt;Volume ID&lt;br /&gt;CD-Rom serial number&lt;br /&gt;&lt;br /&gt;In total Mr Hartmann found a way to make the Windows XP activation technology ignore six of the ten components that it monitors. Mr Hartmann said another two can vary in only a small number of ways among all machines making it possible to create a "universal" wpa file that should activate XP on most PCs.&lt;br /&gt;&lt;br /&gt;"With some smart tools that do automatic matching of hardware and activation-files it would be possible to 'activate' nearly 90 percent of home-user machines without Microsoft knowing anything about it," Mr Hartmann told BBC News Online.&lt;br /&gt;&lt;br /&gt;Mr Hartmann expects to see activation file sites springing up on the web that offer wpa files tied to PCs with particular configurations thus ruining Microsoft's chances of cutting piracy.&lt;br /&gt;&lt;br /&gt;"Should Microsoft stick with current version of wpa they will have wasted lots of money for call-center-employees, webservers and the technology itself," he said.&lt;br /&gt;&lt;br /&gt;But a spokeswoman for Microsoft said that the version of the activation system that is in the pre-release versions of Windows XP is weaker than that which will ship with the finished version.&lt;br /&gt;&lt;br /&gt;"The things that have been highlighted as a way of potentially bypassing activation will not be in the final code," said the spokeswoman. "The final code is going to be very different to what we have now."&lt;br /&gt;&lt;br /&gt;"Product activation is not completely fixed in place at this time," she added.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hacking WindowsXP Product Activation&lt;br /&gt;&lt;br /&gt;Basic Issues&lt;br /&gt;&lt;br /&gt;The file wpa.dbl in the directory system32 contains information on the system at the time of the Activation. If more than three hardware components are changed, Windows XP will notice it and delete wpa.dbl. With that the user shall be forced to activate XP anew. You do not get another 30 days of time, though, to activate again (in RC1 it is a fortnight). Instead XP takes the date of the installation as a basis. That means you have to activate immediately to run XP again, if the installation took place 30 days ago.&lt;br /&gt;&lt;br /&gt;Volume serial number of the system volumes (displayed with dir-command)&lt;br /&gt;MAC address of the network card (displayed with netstat -r -n)&lt;br /&gt;Identification string of the CD ROM drive&lt;br /&gt;Identification string of the displays&lt;br /&gt;CPU serial number&lt;br /&gt;Identification string of the system's hard disk&lt;br /&gt;Identification string of the SCSI host adapter&lt;br /&gt;Identification string of the IDE controller&lt;br /&gt;String of the processor model&lt;br /&gt;RAM size&lt;br /&gt;1 = docking station, 0 = without docking station&lt;br /&gt;&lt;br /&gt;First Tests&lt;br /&gt;&lt;br /&gt;For a beginning we first of all saved the file wpa.dbl and then replaced the graphics card and the network card. As expected Windows XP was cooperative, so we could work without any disturbance. The first surprise showed up as we replaced the Celeron with a Pentium III: Suddenly Windows XP wanted to activate anew although we only changed three components.&lt;br /&gt;The answer to the riddle is to be found in the serial number of the processor. Replacing the processor did not only change one but already changed two pieces of hardware information. For us that means to restart the computer and to switch off the serial number in the BIOS. Nonetheless XP insists on the Activation. A glance at wpa.dbl shows the reason why: Apparently XP put the file back in a non-activated condition. We again restart the computer, boot into DOS and copy the saved wpa.dbl back into the system directory of XP. With the next start of XP, the demand for Activation has disappeared. Evidently, wpa.dbl is the central authority to decide whether or not Activation already took place.&lt;br /&gt;&lt;br /&gt;We re-install Windows XP on our computer from the ground up, using the very same product key. Nevertheless, the computer gets another product ID, as the last three digits are generated randomly. Although the product ID changed, Windows can be activated by copying the saved file wpa.dbl into the appropriate directory. Our next try brings an even bigger surprise: The Activation still works although we use a completely new product key for the installation.&lt;br /&gt;&lt;br /&gt;Forged Hardware&lt;br /&gt;&lt;br /&gt;These results kept in the back of our minds we try to activate Windows XP on another computer by copying the file wpa.dbl. First of all we adapt the volume ID of the new computer by means of freeware tools. The command line volumeid c: 3333-3333 changes the corresponding coefficient of the new system: The first component of Microsoft's protection is canceled.&lt;br /&gt;&lt;br /&gt;With some network cards it is possible to adjust the MAC manually by means of the driver. The corresponding option in the register Advanced is called "Network Address" or "Locally administered Network Address".&lt;br /&gt;&lt;br /&gt;So meanwhile we succeeded in switching off two components of the Activation by pretending another network address to the new system. The CPU serial number is switched off anyway, both computers do not have a SCSI host adapter and the memory is of the same size with both of them. With that altogether five sections of the hardware ID are identical.&lt;br /&gt;Six actually, for both computers are not "to be docked". The latter gives us a bold plan...&lt;br /&gt;Notebook of Eight Kilogrammes&lt;br /&gt;&lt;br /&gt;What would happen if we tell the operating system that the computer is a notebook? This option can be toggled in the hardware profile of the device manager.&lt;br /&gt;&lt;br /&gt;Can Microsoft be tricked that easily? Yes it can! After the next restart of the computer the analysis of the installation ID makes clear that suddenly the graphics card and the IDE/SCSI controller are no longer used to calculate the hardware ID.&lt;br /&gt;So only three more differences in the configuration of the hardware remain:&lt;br /&gt;&lt;br /&gt;Identification of the hard disk&lt;br /&gt;Identification of the CPU&lt;br /&gt;Identification of the CD-ROM drive&lt;br /&gt;&lt;br /&gt;Because these three components are allowed to be different without XP insisting on a new Activation, this should be sufficient. So we copy the file wpa.dbl into the system32 directory of the second computer and start Windows XP. In the start menu it still says "Activate Windows". But when you call it up, you get your just reward though:&lt;br /&gt;&lt;br /&gt;Windows XP enlists ten hardware components to calculate the installation ID, but six of them can be canceled without any problems:&lt;br /&gt;&lt;br /&gt;Component To be canceled by&lt;br /&gt;Volume ID Adapted by means of tool&lt;br /&gt;MAC address Tuned by means of driver&lt;br /&gt;Graphics card Switch over to docking station&lt;br /&gt;CPU serial number Switch off in BIOS&lt;br /&gt;SCSI host adapter Switch over to docking station&lt;br /&gt;IDE controller Switch over to docking station&lt;br /&gt;&lt;br /&gt;Important: A LAN does not tolerate two computers with the same MAC address.&lt;br /&gt;&lt;br /&gt;Only four components are working almost effectively:&lt;br /&gt;&lt;br /&gt;Component Size of bit field&lt;br /&gt;&lt;br /&gt;Hard disk 7&lt;br /&gt;CPU type 3&lt;br /&gt;CD ROM 7&lt;br /&gt;RAM size 3&lt;br /&gt;&lt;br /&gt;Two fields are coded with three bits and two with seven bits. Because in each field the coefficient 0 is impossible, 7*7*127*127=790321 possibilities remain for the file wpa.dbl. As only three components are allowed to change from the moment of Activation onwards, you can take the weakest fixed component for a "Universal Activation".&lt;br /&gt;&lt;br /&gt;The CPU type or the RAM size present themselves here as the best solution. It is more than sufficient to only once activate a computer with 128 MBytes of RAM at Microsoft's. With its file wpa.dbl you can then "activate" all other computers of the same memory size.&lt;br /&gt;&lt;br /&gt;Conclusion&lt;br /&gt;&lt;br /&gt;With its technology of Activation Microsoft wants to thwart the user who occasionally copies software. Up to a certain degree this may still work. But by means of the above described steps nearly everybody can activate his own XP merely by getting a corresponding wpa.dbl file. There certainly will exist some web sites in the near future where the user can comfortably download "his"wpa.dbl.&lt;br /&gt;&lt;br /&gt;Should the current procedure of Activation remain, then Microsoft will spend a lot of money like water for technology, web servers and call centers without any considerable success. It would be much more lucrative to drop the Activation and to lower the price for XP.&lt;br /&gt;&lt;br /&gt;Microsoft did not comment on the weak points of the Activation until now. But probably their statement goes as follows: "In its final version WPA will look completely different. We did not implement these steps in the RC1 for only one reason, that is not to annoy the testers."&lt;br /&gt;&lt;br /&gt;But it definitely is a fact that in-between the Release Candidates and the real Release normally only bugs are rectified. May sharp tongues call the WPA itself a bug, in our opinion it is nothing more but an example of bad programming.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Inside Windows Product Activation&lt;br /&gt;&lt;br /&gt;A Fully Licensed Paper&lt;br /&gt;&lt;br /&gt;July 2001&lt;br /&gt;&lt;br /&gt;Fully Licensed GmbH, Rudower Chaussee 29, 12489 Berlin, Germany&lt;br /&gt;&lt;br /&gt;ht*p://www.licenturion.com&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&gt;&gt; INTRODUCTION&lt;br /&gt;&lt;br /&gt;The current public discussion of Windows Product Activation (WPA) is&lt;br /&gt;characterized by uncertainty and speculation. In this paper we supply&lt;br /&gt;the technical details of WPA - as implemented in Windows XP - that&lt;br /&gt;Microsoft should have published long ago.&lt;br /&gt;&lt;br /&gt;While we strongly believe that every software vendor has the right to&lt;br /&gt;enforce the licensing terms governing the use of a piece of licensed&lt;br /&gt;software by technical means, we also do believe that each individual&lt;br /&gt;has the right to detailed knowledge about the full implications of the&lt;br /&gt;employed means and possible limitations imposed by it on software&lt;br /&gt;usage.&lt;br /&gt;&lt;br /&gt;In this paper we answer what we think are currently the two most&lt;br /&gt;important open questions related to Windows Product Activation.&lt;br /&gt;&lt;br /&gt;* Exactly what information is transmitted during activation?&lt;br /&gt;&lt;br /&gt;* How do hardware modifications affect an already activated&lt;br /&gt;installation of Windows XP?&lt;br /&gt;&lt;br /&gt;Our answers to these questions are based on Windows XP Release&lt;br /&gt;Candidate 1 (build 2505). Later builds as well as the final version of&lt;br /&gt;Windows XP might differ from build 2505, e.g. in the employed&lt;br /&gt;cryptographic keys or the layout of some of the data&lt;br /&gt;structures.&lt;br /&gt;&lt;br /&gt;However, beyond such minor modifications we expect Microsoft to cling&lt;br /&gt;to the general architecture of their activation mechanism. Thus, we&lt;br /&gt;are convinced that the answers provided by this paper will still be&lt;br /&gt;useful when the final version of Windows XP ships.&lt;br /&gt;&lt;br /&gt;This paper supplies in-depth technical information about the inner&lt;br /&gt;workings of WPA. Still, the discussion is a little vague at some&lt;br /&gt;points in order not to facilitate the task of an attacker attempting&lt;br /&gt;to circumvent the license enforcement supplied by the activation&lt;br /&gt;mechanism.&lt;br /&gt;&lt;br /&gt;XPDec, a command line utility suitable for verifying the presented&lt;br /&gt;information, can be obtained from http://www.licenturion.com/xp/. It&lt;br /&gt;implements the algorithms presented in this paper. Reading its source&lt;br /&gt;code, which is available from the same location, is highly&lt;br /&gt;recommended.&lt;br /&gt;&lt;br /&gt;We have removed an important cryptographic key from the XPDec source&lt;br /&gt;code. Recompiling the source code will thus fail to produce a working&lt;br /&gt;executable. The XPDec executable on our website, however, contains&lt;br /&gt;this key and is fully functional.&lt;br /&gt;&lt;br /&gt;So, download the source code to learn about the inner workings of WPA,&lt;br /&gt;but obtain the executable to experiment with your installation of&lt;br /&gt;Windows XP.&lt;br /&gt;&lt;br /&gt;We expect the reader to be familiar with the general procedure of&lt;br /&gt;Windows Product Activation.&lt;br /&gt;&lt;br /&gt;&gt;&gt; INSIDE THE INSTALLATION ID&lt;br /&gt;&lt;br /&gt;We focused our research on product activation via telephone. We did&lt;br /&gt;so, because we expected this variant of activation to be the most&lt;br /&gt;straight-forward to analyze.&lt;br /&gt;&lt;br /&gt;The first step in activating Windows XP via telephone is supplying the&lt;br /&gt;call-center agent with the Installation ID displayed by msoobe.exe,&lt;br /&gt;the application that guides a user through the activation process. The&lt;br /&gt;Installation ID is a number consisting of 50 decimal digits that are&lt;br /&gt;divided into groups of six digits each, as in&lt;br /&gt;&lt;br /&gt;002666-077894-484890-114573-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XX&lt;br /&gt;&lt;br /&gt;In this authentic Installation ID we have substituted digits that we&lt;br /&gt;prefer not to disclose by 'X' characters.&lt;br /&gt;&lt;br /&gt;If msoobe.exe is invoked more than once, it provides a different&lt;br /&gt;Installation ID each time.&lt;br /&gt;&lt;br /&gt;In return, the call-center agent provides a Confirmation ID matching&lt;br /&gt;the given Installation ID. Entering the Confirmation ID completes the&lt;br /&gt;activation process.&lt;br /&gt;&lt;br /&gt;Since the Installation ID is the only piece of information revealed&lt;br /&gt;during activation, the above question concerning the information&lt;br /&gt;transmitted during the activation process is equivalent to the&lt;br /&gt;question&lt;br /&gt;&lt;br /&gt;'How is the Installation ID generated?'&lt;br /&gt;&lt;br /&gt;To find an answer to this question, we trace back each digit of the&lt;br /&gt;Installation ID to its origins.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; Check digits&lt;br /&gt;&lt;br /&gt;The rightmost digit in each of the groups is a check digit to guard&lt;br /&gt;against simple errors such as the call center agent's mistyping of one&lt;br /&gt;of the digits read to him or her. The value of the check digit is&lt;br /&gt;calculated by adding the other five digits in the group, adding the&lt;br /&gt;digits at even positions a second time, and dividing the sum by&lt;br /&gt;seven. The remainder of the division is the value of the check&lt;br /&gt;digit. In the above example the check digit for the first group (6) is&lt;br /&gt;calculated as follows.&lt;br /&gt;&lt;br /&gt;1 | 2 | 3 | 4 | 5 &lt;- position&lt;br /&gt;---+---+---+---+---&lt;br /&gt;0 | 0 | 2 | 6 | 6 &lt;- digits&lt;br /&gt;&lt;br /&gt;0 + 0 + 2 + 6 + 6 = 14 (step 1: add all digits)&lt;br /&gt;0 + 6 + 14 = 20 (step 2: add even digits again)&lt;br /&gt;&lt;br /&gt;step 3: division&lt;br /&gt;20 / 7 = 2, remainder is 20 - (2 * 7) = 6&lt;br /&gt;&lt;br /&gt;=&gt; check digit is 6&lt;br /&gt;&lt;br /&gt;Adding the even digits twice is probably intended to guard against the&lt;br /&gt;relatively frequent error of accidentally swapping two digits while&lt;br /&gt;typing, as in 00626 vs. 00266, which yield different check digits.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; Decoding&lt;br /&gt;&lt;br /&gt;Removing the check digits results in a 41-digit decimal number. A&lt;br /&gt;decimal number of this length roughly corresponds to a 136-bit binary&lt;br /&gt;number. In fact, the 41-digit number is just the decimal encoding of&lt;br /&gt;such a 136-bit multi-precision integer, which is stored in little&lt;br /&gt;endian byte order as a byte array. Hence, the above Installation ID&lt;br /&gt;can also be represented as a sequence of 17 bytes as in&lt;br /&gt;&lt;br /&gt;0xXX 0xXX 0xXX 0xXX 0xXX 0xXX 0xXX 0xXX&lt;br /&gt;0x94 0xAA 0x46 0xD6 0x0F 0xBD 0x2C 0xC8&lt;br /&gt;0x00&lt;br /&gt;&lt;br /&gt;In this representation of the above Installation ID 'X' characters&lt;br /&gt;again substitute the digits that we prefer not to disclose. The '0x'&lt;br /&gt;prefix denotes hex notation throughout this paper.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; Decryption&lt;br /&gt;&lt;br /&gt;When decoding arbitrary Installation IDs it can be noticed that the&lt;br /&gt;most significant byte always seems to be 0x00 or 0x01, whereas the&lt;br /&gt;other bytes look random. The reason for this is that the lower 16&lt;br /&gt;bytes of the Installation ID are encrypted, whereas the most&lt;br /&gt;significant byte is kept in plaintext.&lt;br /&gt;&lt;br /&gt;The cryptographic algorithm employed to encrypt the Installation ID is&lt;br /&gt;a proprietary four-round Feistel cipher. Since the block of input&lt;br /&gt;bytes passed to a Feistel cipher is divided into two blocks of equal&lt;br /&gt;size, this class of ciphers is typically applied to input blocks&lt;br /&gt;consisting of an even number of bytes - in this case the lower 16 of&lt;br /&gt;the 17 input bytes. The round function of the cipher is the SHA-1&lt;br /&gt;message digest algorithm keyed with a four-byte sequence.&lt;br /&gt;&lt;br /&gt;Let + denote the concatenation of two byte sequences, ^ the XOR&lt;br /&gt;operation, L and R the left and right eight-byte input half for one&lt;br /&gt;round, L' and R' the output halves of said round, and First-8() a&lt;br /&gt;function that returns the first eight bytes of an SHA-1 message&lt;br /&gt;digest. Then one round of decryption looks as follows.&lt;br /&gt;&lt;br /&gt;L' = R ^ First-8(SHA-1(L + Key))&lt;br /&gt;R' = L&lt;br /&gt;&lt;br /&gt;The result of the decryption is 16 bytes of plaintext, which are -&lt;br /&gt;together with the 17th unencrypted byte - from now on interpreted as&lt;br /&gt;four double words in little endian byte order followed by a single&lt;br /&gt;byte as in&lt;br /&gt;&lt;br /&gt;name | size | offset&lt;br /&gt;-----+-------------+-------&lt;br /&gt;H1 | double word | 0&lt;br /&gt;H2 | double word | 4&lt;br /&gt;P1 | double word | 8&lt;br /&gt;P2 | double word | 12&lt;br /&gt;P3 | byte | 16&lt;br /&gt;&lt;br /&gt;H1 and H2 specify the hardware configuration that the Installation ID&lt;br /&gt;is linked to. P1 and P2 as well as the remaining byte P3 contain the&lt;br /&gt;Product ID associated with the Installation ID.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; Product ID&lt;br /&gt;&lt;br /&gt;The Product ID consists of five groups of decimal digits, as in&lt;br /&gt;&lt;br /&gt;AAAAA-BBB-CCCCCCC-DDEEE&lt;br /&gt;&lt;br /&gt;If you search your registry for a value named 'ProductID', you will&lt;br /&gt;discover the ID that applies to your installation. The 'About' window&lt;br /&gt;of Internet Explorer should also yield your Product ID.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; Decoding&lt;br /&gt;&lt;br /&gt;The mapping between the Product ID in decimal representation and its&lt;br /&gt;binary encoding in the double words P1 and P2 and the byte P3 is&lt;br /&gt;summarized in the following table.&lt;br /&gt;&lt;br /&gt;digits | length | encoding&lt;br /&gt;--------+---------+---------------------------------------&lt;br /&gt;AAAAA | 17 bits | bit 0 to bit 16 of P1&lt;br /&gt;BBB | 10 bits | bit 17 to bit 26 of P1&lt;br /&gt;CCCCCCC | 28 bits | bit 27 to bit 31 of P1 (lower 5 bits)&lt;br /&gt;| | bit 0 to bit 22 of P2 (upper 23 bits)&lt;br /&gt;DDEEE | 17 bits | bit 23 to bit 31 of P2 (lower 9 bits)&lt;br /&gt;| | bit 0 to bit 7 of P3 (upper 8 bits)&lt;br /&gt;&lt;br /&gt;The meaning of each of the five groups of digits is documented in the&lt;br /&gt;next table.&lt;br /&gt;&lt;br /&gt;digits | meaning&lt;br /&gt;--------+-------------------------------------------------&lt;br /&gt;AAAAA | apparently always 55034 (in Windows XP RC1)&lt;br /&gt;BBB | most significant three digits of Raw Product Key&lt;br /&gt;| (see below)&lt;br /&gt;CCCCCCC | least significant six digits of Raw Product Key&lt;br /&gt;| plus check digit (see below)&lt;br /&gt;DD | index of the public key used to verify the&lt;br /&gt;| Product Key (see below)&lt;br /&gt;EEE | random value&lt;br /&gt;&lt;br /&gt;As can be seen, the (Raw) Product Key plays an important role in&lt;br /&gt;generating the Product ID.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; Product Key&lt;br /&gt;&lt;br /&gt;The Raw Product Key is buried inside the Product Key that is printed&lt;br /&gt;on the sticker distributed with each Windows XP CD. It consists of&lt;br /&gt;five alphanumeric strings separated by '-' characters, where each&lt;br /&gt;string is composed of five characters, as in&lt;br /&gt;&lt;br /&gt;FFFFF-GGGGG-HHHHH-JJJJJ-KKKKK&lt;br /&gt;&lt;br /&gt;Each character is one of the following 24 letters and digits:&lt;br /&gt;&lt;br /&gt;B C D F G H J K M P Q R T V W X Y 2 3 4 6 7 8 9&lt;br /&gt;&lt;br /&gt;Very similar to the decimal encoding of the Installation ID the 25&lt;br /&gt;characters of the Product Key form a base-24 encoding of the binary&lt;br /&gt;representation of the Product Key. Decoding the Product Key yields a&lt;br /&gt;multi-precision integer of roughly 115 bits, which is stored - again&lt;br /&gt;in little endian byte order - in an array of 15 bytes. Decoding the&lt;br /&gt;above Product Key results in the following byte sequence.&lt;br /&gt;&lt;br /&gt;0x6F 0xFA 0x95 0x45 0xFC 0x75 0xB5 0x52&lt;br /&gt;0xBB 0xEF 0xB1 0x17 0xDA 0xCD 0x00&lt;br /&gt;&lt;br /&gt;Of these 15 bytes the least significant four bytes contain the Raw&lt;br /&gt;Product Key in little endian byte order. The least significant bit is&lt;br /&gt;removed by shifting this 32-bit value (0x4595FA6F - remember the&lt;br /&gt;little endian byte order) to the left by one bit position, resulting&lt;br /&gt;in a Raw Product Key of 0x22CAFD37, or&lt;br /&gt;&lt;br /&gt;583728439&lt;br /&gt;&lt;br /&gt;in decimal notation.&lt;br /&gt;&lt;br /&gt;The eleven remaining bytes form a digital signature, allowing&lt;br /&gt;verification of the authenticity of the Product Key by means of a&lt;br /&gt;hard-coded public key.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; Product Key -&gt; Product ID&lt;br /&gt;&lt;br /&gt;The three most significant digits, i.e. 583, of the Raw Product Key's&lt;br /&gt;nine-digit decimal representation directly map to the BBB component of&lt;br /&gt;the Product ID described above.&lt;br /&gt;&lt;br /&gt;To obtain the CCCCCCC component, a check digit is appended to the&lt;br /&gt;remaining six digits 728439. The check digit is chosen such that the&lt;br /&gt;sum of all digits - including the check digit - is divisible by&lt;br /&gt;seven. In the given case, the sum of the six digits is&lt;br /&gt;&lt;br /&gt;7 + 2 + 8 + 4 + 3 + 9 = 33&lt;br /&gt;&lt;br /&gt;which results in a check digit of 2, since&lt;br /&gt;&lt;br /&gt;7 + 2 + 8 + 4 + 3 + 9 + 2 = 33 + 2 = 35&lt;br /&gt;&lt;br /&gt;which is divisible by seven. The CCCCCCC component of the Product ID&lt;br /&gt;is therefore 7284392.&lt;br /&gt;&lt;br /&gt;For verifying a Product Key, more than one public key is available. If&lt;br /&gt;verification with the first public key fails, the second is tried,&lt;br /&gt;etc. The DD component of the Product ID specifies which of the public&lt;br /&gt;keys in this sequence was successfully used to verify the Product Key.&lt;br /&gt;&lt;br /&gt;This mechanism might be intended to support several different parties&lt;br /&gt;generating valid Product Keys with different individual private keys.&lt;br /&gt;&lt;br /&gt;However, the different private keys might also represent different&lt;br /&gt;versions of a product. A Product Key for the 'professional' release&lt;br /&gt;could then be signed with a different key than a Product Key for the&lt;br /&gt;'server' release. The DD component would then represent the product&lt;br /&gt;version.&lt;br /&gt;&lt;br /&gt;Finally, a valid Product ID derived from our example Product Key might&lt;br /&gt;be&lt;br /&gt;&lt;br /&gt;55034-583-7284392-00123&lt;br /&gt;&lt;br /&gt;which indicates that the first public key (DD = index = 0) matched and&lt;br /&gt;123 was chosen as the random number EEE.&lt;br /&gt;&lt;br /&gt;The randomly selected EEE component is the reason for msoobe.exe&lt;br /&gt;presenting a different Installation ID at each invocation. Because of&lt;br /&gt;the applied encryption this small change results in a completely&lt;br /&gt;different Installation ID.&lt;br /&gt;&lt;br /&gt;So, the Product ID transmitted during activation will most probably&lt;br /&gt;differ in the last three digits from your Product ID as displayed by&lt;br /&gt;Internet Explorer or as stored in the registry.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; Hardware Information&lt;br /&gt;&lt;br /&gt;As discussed above, the hardware configuration linked to the&lt;br /&gt;Installation ID is represented by the two double words H1 and H2.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; Bit-fields&lt;br /&gt;&lt;br /&gt;For this purpose, the double words are divided into twelve&lt;br /&gt;bit-fields. The relationship between the computer hardware and the&lt;br /&gt;bit-fields is given in the following table.&lt;br /&gt;&lt;br /&gt;double word | offset | length | bit-field value based on&lt;br /&gt;------------+--------+--------+----------------------------&lt;br /&gt;H1 | 0 | 10 | volume serial number string&lt;br /&gt;| | | of system volume&lt;br /&gt;H1 | 10 | 10 | network adapter MAC address&lt;br /&gt;| | | string&lt;br /&gt;H1 | 20 | 7 | CD-ROM drive hardware&lt;br /&gt;| | | identification string&lt;br /&gt;H1 | 27 | 5 | graphics adapter hardware&lt;br /&gt;| | | identification string&lt;br /&gt;H2 | 0 | 3 | unused, set to 001&lt;br /&gt;H2 | 3 | 6 | CPU serial number string&lt;br /&gt;H2 | 9 | 7 | harddrive hardware&lt;br /&gt;| | | identification string&lt;br /&gt;H2 | 16 | 5 | SCSI host adapter hardware&lt;br /&gt;| | | identification string&lt;br /&gt;H2 | 21 | 4 | IDE controller hardware&lt;br /&gt;| | | identification string&lt;br /&gt;H2 | 25 | 3 | processor model string&lt;br /&gt;H2 | 28 | 3 | RAM size&lt;br /&gt;H2 | 31 | 1 | 1 = dockable&lt;br /&gt;| | | 0 = not dockable&lt;br /&gt;&lt;br /&gt;Bit 31 of H2 specifies, whether the bit-fields represent a notebook&lt;br /&gt;computer that supports a docking station. If docking is possible, the&lt;br /&gt;activation mechanism will be more tolerant with respect to future&lt;br /&gt;hardware modifications. Here, the idea is that plugging a notebook&lt;br /&gt;into its docking station possibly results in changes to its hardware&lt;br /&gt;configuration, e.g. a SCSI host adapter built into the docking station&lt;br /&gt;may become available.&lt;br /&gt;&lt;br /&gt;Bits 2 through 0 of H2 are unused and always set to 001.&lt;br /&gt;&lt;br /&gt;If the hardware component corresponding to one of the remaining ten&lt;br /&gt;bit-fields is present, the respective bit-field contains a non-zero&lt;br /&gt;value describing the component. A value of zero marks the hardware&lt;br /&gt;component as not present.&lt;br /&gt;&lt;br /&gt;All hardware components are identified by a hardware identification&lt;br /&gt;string obtained from the registry. Hashing this string provides the&lt;br /&gt;value for the corresponding bit-field.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; Hashing&lt;br /&gt;&lt;br /&gt;The hash result is obtained by feeding the hardware identification&lt;br /&gt;string into the MD5 message digest algorithm and picking the number of&lt;br /&gt;bits required for a bit-field from predetermined locations in the&lt;br /&gt;resulting message digest. Different predetermined locations are used&lt;br /&gt;for different bit-fields. In addition, a hash result of zero is&lt;br /&gt;avoided by calculating&lt;br /&gt;&lt;br /&gt;Hash = (Hash % BitFieldMax) + 1&lt;br /&gt;&lt;br /&gt;where BitFieldMax is the maximal value that may be stored in the&lt;br /&gt;bit-field in question, e.g. 1023 for a 10-bit bit-field, and 'x % y'&lt;br /&gt;denotes the remainder of the division of x by y. This results in&lt;br /&gt;values between 1 and BitFieldMax. The obtained value is then stored in&lt;br /&gt;the respective bit-field.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; RAM bit-field&lt;br /&gt;&lt;br /&gt;The bit-field related to the amount of RAM available to the operating&lt;br /&gt;system is calculated differently. The seven valid values specify the&lt;br /&gt;approximate amount of available RAM as documented in the following&lt;br /&gt;table.&lt;br /&gt;&lt;br /&gt;value | amount of RAM available&lt;br /&gt;------+---------------------------&lt;br /&gt;0 | (bit-field unused)&lt;br /&gt;1 | below 32 MB&lt;br /&gt;2 | between 32 MB and 63 MB&lt;br /&gt;3 | between 64 MB and 127 MB&lt;br /&gt;4 | between 128 MB and 255 MB&lt;br /&gt;5 | between 256 MB and 511 MB&lt;br /&gt;6 | between 512 MB and 1023 MB&lt;br /&gt;7 | above 1023 MB&lt;br /&gt;&lt;br /&gt;It is important to note that the amount of RAM is retrieved by calling&lt;br /&gt;the GlobalMemoryStatus() function, which reports a few hundred&lt;br /&gt;kilobytes less than the amount of RAM physically installed. So, 128 MB&lt;br /&gt;of RAM would typically be classified as "between 64 MB and 127 MB".&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; Real-world example&lt;br /&gt;&lt;br /&gt;Let us have a look at a real-world example. On one of our test systems&lt;br /&gt;the hardware information consists of the following eight bytes.&lt;br /&gt;&lt;br /&gt;0xC5 0x95 0x12 0xAC 0x01 0x6E 0x2C 0x32&lt;br /&gt;&lt;br /&gt;Converting the bytes into H1 and H2, we obtain&lt;br /&gt;&lt;br /&gt;H1 = 0xAC1295C5 and H2 = 0x322C6E01&lt;br /&gt;&lt;br /&gt;Splitting H1 and H2 yields the next table in which we give the value&lt;br /&gt;of each of the bit-fields and the information from which each value is&lt;br /&gt;derived.&lt;br /&gt;&lt;br /&gt;dw &amp; | |&lt;br /&gt;offset | value | derived from&lt;br /&gt;-------+-------+-----------------------------------------------&lt;br /&gt;H1 0 | 0x1C5 | '1234-ABCD'&lt;br /&gt;H1 10 | 0x0A5 | '00C0DF089E44'&lt;br /&gt;H1 20 | 0x37 | 'SCSI\CDROMPLEXTOR_CD-ROM_PX-32TS__1.01'&lt;br /&gt;H1 27 | 0x15 | 'PCI\VEN_102B&amp;DEV_0519&amp;SUBSYS_00000000&amp;REV_01'&lt;br /&gt;H2 0 | 0x1 | (unused, always 0x1)&lt;br /&gt;H2 3 | 0x00 | (CPU serial number not present)&lt;br /&gt;H2 9 | 0x37 | 'SCSI\DISKIBM_____DCAS-34330______S65A'&lt;br /&gt;H2 16 | 0x0C | 'PCI\VEN_9004&amp;DEV_7178&amp;SUBSYS_00000000&amp;REV_03'&lt;br /&gt;H2 21 | 0x1 | 'PCI\VEN_8086&amp;DEV_7111&amp;SUBSYS_00000000&amp;REV_01'&lt;br /&gt;H2 25 | 0x1 | 'GenuineIntel Family 6 Model 3'&lt;br /&gt;H2 28 | 0x3 | (system has 128 MB of RAM)&lt;br /&gt;H2 31 | 0x0 | (system is not dockable)&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; Using XPDec&lt;br /&gt;&lt;br /&gt;XPDec is a utility to be run from the command prompt. It may be&lt;br /&gt;invoked with one of four command line options to carry out one of four&lt;br /&gt;tasks.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; XPDec -i&lt;br /&gt;&lt;br /&gt;This option enables you to access the information hidden in an&lt;br /&gt;Installation ID. It decodes the Installation ID, decrypts it, and&lt;br /&gt;displays the values of the hardware bit-fields as well as the Product&lt;br /&gt;ID of your product. Keep in mind that the last three digits of the&lt;br /&gt;Product ID contained in the Installation ID are randomly selected and&lt;br /&gt;differ from the Product ID displayed by Internet Explorer.&lt;br /&gt;&lt;br /&gt;The only argument needed for the '-i' option is the Installation ID,&lt;br /&gt;as in&lt;br /&gt;&lt;br /&gt;XPDec -i 002666-077894-484890-114573-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XX&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; XPDec -p&lt;br /&gt;&lt;br /&gt;To help you trace the origin of your Product ID, this option decodes a&lt;br /&gt;Product Key and displays the Raw Product Key as it would be used in a&lt;br /&gt;Product ID.&lt;br /&gt;&lt;br /&gt;The only argument needed for the '-p' option is the Product Key, as in&lt;br /&gt;&lt;br /&gt;XPDec -p FFFFF-GGGGG-HHHHH-JJJJJ-KKKKK&lt;br /&gt;&lt;br /&gt;Note that this option does not verify the digital signature of the&lt;br /&gt;Product Key.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; XPDec -v&lt;br /&gt;&lt;br /&gt;This option calculates the hash of a given volume serial number. It&lt;br /&gt;was implemented to illustrate our description of string hashing. First&lt;br /&gt;use '-i' to display the hardware bit-fields. Then use this option to&lt;br /&gt;verify our claims concerning the volume serial number hash.&lt;br /&gt;&lt;br /&gt;The only argument needed for the '-v' option is the volume serial&lt;br /&gt;number of your system volume, as in&lt;br /&gt;&lt;br /&gt;XPDec -v 1234-ABCD&lt;br /&gt;&lt;br /&gt;(The volume serial number is part of the 'dir' command's output.)&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt;&gt; XPDec -m&lt;br /&gt;&lt;br /&gt;This option calculates the network adapter bit-field value&lt;br /&gt;corresponding to the given MAC address. Similar to '-v' this option&lt;br /&gt;was implemented as a proof of concept.&lt;br /&gt;&lt;br /&gt;The only argument needed for the '-m' option is the MAC address of&lt;br /&gt;your network adapter, as in&lt;br /&gt;&lt;br /&gt;XPDec -m 00-C0-DF-08-9E-44&lt;br /&gt;&lt;br /&gt;(Use the 'route print' command to obtain the MAC address of your&lt;br /&gt;network adapter.)&lt;br /&gt;&lt;br /&gt;&gt;&gt; HARDWARE MODIFICATIONS&lt;br /&gt;&lt;br /&gt;When looking at the effects of hardware modifications on an already&lt;br /&gt;activated installation of Windows XP, the file 'wpa.dbl' in the&lt;br /&gt;'system32' directory plays a central role. It is a simple&lt;br /&gt;RC4-encrypted database that stores, among other things like expiration&lt;br /&gt;information and the Confirmation ID of an activated installation,&lt;br /&gt;&lt;br /&gt;a) the bit-field values representing the current hardware&lt;br /&gt;configuration,&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;the bit-field values representing the hardware configuration&lt;br /&gt;at the time of product activation.&lt;br /&gt;&lt;br /&gt;While a) is automatically updated each time the hardware configuration&lt;br /&gt;is modified in order to reflect the changes, remains fixed. Hence,&lt;br /&gt;can be thought of as a snapshot of the hardware configuration at&lt;br /&gt;the time of product activation.&lt;br /&gt;&lt;br /&gt;This snapshot does not exist in the database before product activation&lt;br /&gt;and if we compare the size of 'wpa.dbl' before and after activation,&lt;br /&gt;we will notice an increased file size. This is because the snapshot is&lt;br /&gt;added to the database.&lt;br /&gt;&lt;br /&gt;When judging whether re-activation is necessary, the bit-field values&lt;br /&gt;of a) are compared to the bit-field values of , i.e. the current&lt;br /&gt;hardware configuration is compared to the hardware configuration at&lt;br /&gt;the time of activation.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; Non-dockable computer&lt;br /&gt;&lt;br /&gt;Typically all bit-fields with the exception of the unused field and&lt;br /&gt;the 'dockable' field are compared. If more than three of these ten&lt;br /&gt;bit-fields have changed in a) since product activation, re-activation&lt;br /&gt;is required.&lt;br /&gt;&lt;br /&gt;This means, for example, that in our above real-world example, we&lt;br /&gt;could replace the harddrive and the CD-ROM drive and substantially&lt;br /&gt;upgrade our RAM without having to re-activate our Windows XP&lt;br /&gt;installation.&lt;br /&gt;&lt;br /&gt;However, if we completely re-installed Windows XP, the information in&lt;br /&gt;would be lost and we would have to re-activate our installation,&lt;br /&gt;even if we had not changed our hardware.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; Dockable computer&lt;br /&gt;&lt;br /&gt;If bit 31 of H2 indicates that our computer supports a docking&lt;br /&gt;station, however, only seven of the ten bit-fields mentioned above are&lt;br /&gt;compared. The bit-fields corresponding to the SCSI host adapter, the&lt;br /&gt;IDE controller, and the graphics board are omitted. But again, of&lt;br /&gt;these remaining seven bit-fields, only up to three may change without&lt;br /&gt;requiring re-activation.&lt;br /&gt;&lt;br /&gt;&gt;&gt; CONCLUSIONS&lt;br /&gt;&lt;br /&gt;In this paper we have given a technical overview of Windows Product&lt;br /&gt;Activation as implemented in Windows XP. We have shown what&lt;br /&gt;information the data transmitted during product activation is derived&lt;br /&gt;from and how hardware upgrades affect an already activated&lt;br /&gt;installation.&lt;br /&gt;&lt;br /&gt;Looking at the technical details of WPA, we do not think that it is as&lt;br /&gt;problematic as many people have expected. We think so, because WPA is&lt;br /&gt;tolerant with respect to hardware modifications. In addition, it is&lt;br /&gt;likely that more than one hardware component map to a certain value&lt;br /&gt;for a given bit-field. From the above real-world example we know that&lt;br /&gt;the PX-32TS maps to the value 0x37 = 55. But there are probably many&lt;br /&gt;other CD-ROM drives that map to the same value. Hence, it is&lt;br /&gt;impossible to tell from the bit-field value whether it is a PX-32TS&lt;br /&gt;that we are using or one of the other drives that map to the same&lt;br /&gt;value.&lt;br /&gt;&lt;br /&gt;In contrast to many critics of Windows Product Activation, we think&lt;br /&gt;that WPA does not prevent typical hardware modifications and,&lt;br /&gt;moreover, respects the user's right to privacy.&lt;br /&gt;&lt;br /&gt;&gt;&gt; ABOUT THE AUTHORS&lt;br /&gt;&lt;br /&gt;Fully Licensed GmbH is a start-up company focusing on novel approaches&lt;br /&gt;to online software licensing and distribution. Have a look at their&lt;br /&gt;website at&lt;br /&gt;&lt;br /&gt;http://www.licenturion.com&lt;br /&gt;&lt;br /&gt;for more information.&lt;br /&gt;&lt;br /&gt;Their research branch every now and then analyzes licensing solutions&lt;br /&gt;implemented by other companies.&lt;br /&gt;&lt;br /&gt;&gt;&gt; COPYRIGHT&lt;br /&gt;&lt;br /&gt;Copyright © 2001 Fully Licensed GmbH (www.licenturion.com)&lt;br /&gt;All rights reserved.&lt;br /&gt;&lt;br /&gt;You are free to do whatever you want with this paper. However, you&lt;br /&gt;have to supply the URL of its online version&lt;br /&gt;&lt;br /&gt;http://www.licenturion.com/xp/&lt;br /&gt;&lt;br /&gt;with any work derived from this paper to give credit to its authors.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&lt;br /&gt;&gt;&gt; Frequently asked questions and their answers&lt;br /&gt;&gt;&gt; concerning the Fully Licensed WPA paper&lt;br /&gt;&gt;&gt;&lt;br /&gt;&gt;&gt; Fully Licensed GmbH, July 10, 2001&lt;br /&gt;&gt;&gt;&lt;br /&gt;&lt;br /&gt;&gt;&gt; 1. Was Microsoft involved in the creation of the paper?&lt;br /&gt;&lt;br /&gt;Microsoft was not involved in the creation of the paper in any&lt;br /&gt;way. However, we made a draft version available to Microsoft to give&lt;br /&gt;them a head-start. We consider it to be good etiquette to inform a&lt;br /&gt;vendor of a pending publication related to one his or her products, so&lt;br /&gt;that the vendor is able to prepare an official response.&lt;br /&gt;&lt;br /&gt;&gt;&gt; 2. Why should we believe you?&lt;br /&gt;&lt;br /&gt;We do not expect you to believe us. That's why we have provided our&lt;br /&gt;complete knowledge about WPA and the XPDec utility. Combine both to&lt;br /&gt;verify our claims.&lt;br /&gt;&lt;br /&gt;&gt;&gt; 3. But Thomas Lopatic, one of your managing directors was born in&lt;br /&gt;Unterschleissheim, Germany, which is the town near Munich in&lt;br /&gt;which Microsoft's European headquarters are located.&lt;br /&gt;&lt;br /&gt;This is a nice coincidence. It is in a way understandable - and at the&lt;br /&gt;same time highly amusing to us :-) - that this has given rise to&lt;br /&gt;rumors about the whole paper being a cleverly planned Microsoft&lt;br /&gt;conspiracy.&lt;br /&gt;&lt;br /&gt;Thomas was actually born in Karlsruhe, Germany. However, he was living&lt;br /&gt;in Unterschleissheim from the 1970s - i.e. long before Microsoft moved&lt;br /&gt;there - until recently, when he moved to Berlin. That's why some&lt;br /&gt;records still list Unterschleissheim as the place where he&lt;br /&gt;lives. Incorrectly interpreting these records led to the rumor that&lt;br /&gt;Thomas was born in Unterschleissheim.&lt;br /&gt;&lt;br /&gt;&gt;&gt; 4. Does Microsoft downplay the paper?&lt;br /&gt;&lt;br /&gt;No, most definitely not. The paper really IS harmless. It does not&lt;br /&gt;provide any information that would help a pirate circumvent WPA.&lt;br /&gt;&lt;br /&gt;&gt;&gt; 5. Why did you release details on Windows Product Activation?&lt;br /&gt;&lt;br /&gt;We felt that there is a need for facts in the debate about Windows&lt;br /&gt;Product Activation. Many people suspected that WPA could be abused to&lt;br /&gt;spy on end-users. Our paper, however, shows that insensitive&lt;br /&gt;information is transmitted during product activation. From this, it&lt;br /&gt;can be seen that the facts that we provide really are a necessary&lt;br /&gt;contribution to the ongoing discussion about WPA.&lt;br /&gt;&lt;br /&gt;We think that license enforcement mechanisms will be an important part&lt;br /&gt;of the future of software distribution via the Internet. Thus, we do&lt;br /&gt;think that public discussion of technology of this kind must be free&lt;br /&gt;from bias and it must be based on facts and openness.&lt;br /&gt;&lt;br /&gt;We hope that the information that we provide positively affects the&lt;br /&gt;current debate. The debate is necessary, but it should be based on&lt;br /&gt;facts and full disclosure of information relevant to the privacy&lt;br /&gt;question.&lt;br /&gt;&lt;br /&gt;&gt;&gt; 6. Do you know how to circumvent Windows Product Activation?&lt;br /&gt;&lt;br /&gt;No. We provide insight into which information is transmitted to&lt;br /&gt;Microsoft during activation. Our paper is important to help people&lt;br /&gt;understand the impact of WPA on their work and their privacy. We do&lt;br /&gt;not believe that our paper helps in any way to circumvent the license&lt;br /&gt;enforcement provided by WPA.&lt;br /&gt;&lt;br /&gt;&gt;&gt; 7. Your paper says that Microsoft will err on the user's side.&lt;br /&gt;&lt;br /&gt;What our paper shows is that a) no sensitive information is&lt;br /&gt;transferred to Microsoft and typical hardware upgrades do not&lt;br /&gt;negatively affect an already activated installation of Windows XP.&lt;br /&gt;&lt;br /&gt;But, if you either completely re-install Windows XP or modify your&lt;br /&gt;hardware beyond what is tolerated by product activation, you have to&lt;br /&gt;re-activate Windows XP.&lt;br /&gt;&lt;br /&gt;The important question now is: How often will Microsoft let you&lt;br /&gt;re-activate? Erring on the user's side would mean that they allow you&lt;br /&gt;to re-activate as often as you like, which seems to be what Microsoft&lt;br /&gt;says they will do.&lt;br /&gt;&lt;br /&gt;It is, however, impossible to confirm this policy by means of a&lt;br /&gt;technical analysis.&lt;br /&gt;&lt;br /&gt;&gt;&gt; 8. Why doesn't Microsoft know which hardware I use?&lt;br /&gt;&lt;br /&gt;Let us consider the case of IDE controllers. In the installation ID&lt;br /&gt;transmitted to Microsoft they are represented by a 4-bit value. The 4&lt;br /&gt;bits are obtained by applying the MD5 message digest algorithm to a&lt;br /&gt;string that uniquely identifies the vendor and model of the IDE&lt;br /&gt;controller, e.g.&lt;br /&gt;&lt;br /&gt;'PCI\VEN_8086&amp;DEV_7111&amp;SUBSYS_00000000&amp;REV_01'&lt;br /&gt;&lt;br /&gt;and picking 4 bits from fixed locations in the resulting 128-bit&lt;br /&gt;message digest.&lt;br /&gt;&lt;br /&gt;With 4 bits, we can represent 16 different values at maximum. However,&lt;br /&gt;there are far more than 16 different models of IDE controllers out&lt;br /&gt;there. So, since there are more models than 4-bit values, the above&lt;br /&gt;hashing procedure must yield the same 4 bits for more than one&lt;br /&gt;model. The more models there are, the more models will map to a given&lt;br /&gt;4-bit value.&lt;br /&gt;&lt;br /&gt;In contrast to what Microsoft says, the privacy that WPA provides is&lt;br /&gt;not based on the assumption that it is impossible to invert the&lt;br /&gt;employed message digest algorithm, i.e. MD5. If we used all 128 bits&lt;br /&gt;of the message digest derived from a hardware component's&lt;br /&gt;identification string, this 128-bit value would most probably uniquely&lt;br /&gt;identify the hardware component. If we used 128 bits, each hardware&lt;br /&gt;component on earth would probably map to a different value.&lt;br /&gt;&lt;br /&gt;What an attacker would then do is build a list of all hardware&lt;br /&gt;components on this planet and calculate the corresponding 128-bit&lt;br /&gt;values, which are probably all different. Then finding the hardware&lt;br /&gt;component that corresponds to a certain 128-bit value is just a table&lt;br /&gt;lookup away.&lt;br /&gt;&lt;br /&gt;Privacy is based on the fact that only a few bits of the resulting&lt;br /&gt;128-bit message digest are considered. Obviously this leads to lots of&lt;br /&gt;collisions, i.e. lots of hardware components mapping to a given&lt;br /&gt;value. If there were 160 different models of IDE controllers, we could&lt;br /&gt;on average expect 160 / 16 = 10 models to map to the same 4-bit value.&lt;br /&gt;&lt;br /&gt;Let us, as another example, consider the MAC address of an ethernet&lt;br /&gt;adapter. The discussion is technically not 100% accurate, but it&lt;br /&gt;illustrates the point. The MAC address is a 48-bit value, which means&lt;br /&gt;that it can theoretically be one of 281,474,976,710,656 different&lt;br /&gt;values. However, its 10-bit representation in the Installation ID is&lt;br /&gt;obtained by picking 10 bits from the MD5 hash over an ASCII string&lt;br /&gt;comprised of the 12 hex digits of the 48-bit value. Picking 10 bits&lt;br /&gt;leads to 1,024 different results at maximum.&lt;br /&gt;&lt;br /&gt;So, on average, we expect&lt;br /&gt;&lt;br /&gt;281,474,976,710,656 / 1,024 = 274,877,906,944&lt;br /&gt;&lt;br /&gt;MAC addresses to map to the same 10-bit value. Because of this, nobody&lt;br /&gt;will be able to obtain the actual MAC address from the 10-bit value,&lt;br /&gt;since there are 274,877,906,944 candidate MAC addresses from which the&lt;br /&gt;10-bit value could have been derived.&lt;br /&gt;&lt;br /&gt;It is interesting to see that the bit-field that represents the MAC&lt;br /&gt;address is 10 bits in size, while the bit-field representing the IDE&lt;br /&gt;controller only consists of 4 bits. Microsoft probably have assigned a&lt;br /&gt;longer bit-field to a component if they expect more diversity in the&lt;br /&gt;identification string of this component. The number of different IDE&lt;br /&gt;controller models is smaller by orders of magnitude than the number of&lt;br /&gt;different MAC addresses. So, to produce sufficient collisions, they&lt;br /&gt;decided to use a relatively small bit-field for IDE controllers but&lt;br /&gt;could still afford to chose a 10-bit bit-field in the case of MAC&lt;br /&gt;addresses.&lt;br /&gt;&lt;br /&gt;&gt;&gt; 9. What are the implications of re-activating after hardware&lt;br /&gt;changes?&lt;br /&gt;&lt;br /&gt;This is an interesting issue which is not covered in our paper. We&lt;br /&gt;simply did not think of it. Our mistake. It was brought to our&lt;br /&gt;attention by an article by Greg Falcon on&lt;br /&gt;www.slashdot.org: If you have to re-activate your installation of&lt;br /&gt;Windows XP because of hardware modifications, your new hardware&lt;br /&gt;configuration is embedded in the Installation ID in the form discussed&lt;br /&gt;above. While this does not enable anyone to find out which components&lt;br /&gt;you have, it is trivial to find out which components you have&lt;br /&gt;changed. Just examine which bit-fields have changed their value since&lt;br /&gt;the original activation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------&lt;br /&gt;"Windows XP enlists ten hardware components to calculate the installation&lt;br /&gt;ID, but six of them can be canceled without any problems:&lt;br /&gt;&lt;br /&gt;Volume ID ---------- Adapted by means of tool&lt;br /&gt;MAC address -------- Tuned by means of driver&lt;br /&gt;Graphics card -------Switch over to docking station&lt;br /&gt;CPU serial number - Switch off in BIOS&lt;br /&gt;SCSI host adapter -- Switch over to docking station&lt;br /&gt;IDE controller ------- Switch over to docking station&lt;br /&gt;&lt;br /&gt;Important: A LAN does not tolerate two computers with the same MAC address.&lt;br /&gt;"&lt;br /&gt;-----------------------------------------&lt;br /&gt;(Switching to 'Docking Station' in Device Manager / Performance / File&lt;br /&gt;System settings doesn't mean you actually have a docking station of any kind&lt;br /&gt;so can be used for non-notebook computers that cannot even USE a docking&lt;br /&gt;station!)&lt;br /&gt;&lt;br /&gt;If you want WindowsXP on a network, you're stuck (until someone finds&lt;br /&gt;another route around Activation - juding by the speed of this one, that&lt;br /&gt;won't be long!) But then why would anyone want more than one copy of Windoze&lt;br /&gt;XP on a LAN anyway!&lt;br /&gt;---------------------------------------------&lt;br /&gt;"It is more than sufficient to only once activate a computer with 128 MBytes&lt;br /&gt;of RAM. With its file wpa.dbl you can then "activate" all other computers of&lt;br /&gt;the same memory size." [no matter what other hardware is installed as long&lt;br /&gt;as it's set as a notebook and the volume tag etc is set to match].&lt;br /&gt;&lt;br /&gt;"Can Microsoft be tricked that easily? Yes it can! After the next restart of&lt;br /&gt;the computer [after changing to docking station] the analysis of the&lt;br /&gt;installation ID makes clear that suddenly the graphics card and the IDE/SCSI&lt;br /&gt;controller are no longer used to calculate the hardware ID. In computers&lt;br /&gt;that can be docked, XP ignores the identification of the graphics card, the&lt;br /&gt;SCSI host adapter and the IDE controller.&lt;br /&gt;&lt;br /&gt;So only three more differences in the configuration of the hardware remain:&lt;br /&gt;&lt;br /&gt;Identification of the hard disk&lt;br /&gt;Identification of the CPU&lt;br /&gt;Identification of the CD-ROM drive&lt;br /&gt;&lt;br /&gt;Because these three components are allowed to be different without XP&lt;br /&gt;insisting on a new Activation, this should be sufficient. So we copy the&lt;br /&gt;file wpa.dbl into the system32 directory of the second computer and start&lt;br /&gt;Windows XP. In the start menu it still says "Activate Windows". But when you&lt;br /&gt;call it up, you get your just reward though:&lt;br /&gt;"Windows Product Activation: Windows is already activated. Click OK to&lt;br /&gt;exit."&lt;br /&gt;&lt;br /&gt;"So first of all Tecchannel saved the file then started changing hardware.&lt;br /&gt;Two items OK, but replacing a third - the CPU - triggered the deletion.&lt;br /&gt;Although you'd think the CPU is only one component, it's actually tallied up&lt;br /&gt;as two. Switching off the CPU serial number in the bios and therefore&lt;br /&gt;knocking it down to one doesn't get the earlier wpa.dbl back - this has been&lt;br /&gt;restored in a non-activated state.&lt;br /&gt;&lt;br /&gt;Copy the saved version back? That surely shouldn't work - but it does. Next,&lt;br /&gt;Tecchannel tried a completely new installation using the same product key.&lt;br /&gt;This produces a new product ID, but nevertheless copying the wpa.dbl file&lt;br /&gt;back again works.&lt;br /&gt;&lt;br /&gt;They also use this file on another computer, altering the computer's volume&lt;br /&gt;ID first, which is easily enough done. They can also use forged network&lt;br /&gt;cards MAC addresses, so now they've taken two parts of the hardware ID out&lt;br /&gt;of the picture. Next, use the hardware profile to tell the computer it's a&lt;br /&gt;notebook with a docking station. This works, and tells WPA to stop counting&lt;br /&gt;the IDE/SCSI controller and the graphics card.&lt;br /&gt;&lt;br /&gt;That gets the differences counted down to three, hard disk, CPU and CDROM&lt;br /&gt;ID, which is within the limit, so WPA is effectively toast.&lt;br /&gt;&lt;br /&gt;What does this mean? Tecchannel's investigation shows that, at the very&lt;br /&gt;least, you can use the same wpa.dbl file to activate as many computers as&lt;br /&gt;you like, provided the RAM size is the same. A 'universal' file that didn't&lt;br /&gt;even require the same RAM might be a possibility, but it's more likely that&lt;br /&gt;people will simply swap files to get one appropriate for their hardware. "&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope it enlights some of us to create a unique keygen just to get the confirmation ID generated after putting the Installation ID on the same.&lt;br /&gt;&lt;br /&gt;Enjoy!!&lt;div class="blogger-post-footer"&gt;http://maniarockers.blogspot.com/feeds/posts/default?alt=rss&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/8714185704977948121-3801188149078522773?l=maniarockers.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RockersMania/~4/HG82SKdK37k" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/RockersMania/~3/HG82SKdK37k/myth-about-wpa-how-it-is-done-windows.html</link><author>alternativerockers421@gmail.com (rockers alternative)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://maniarockers.blogspot.com/2009/04/myth-about-wpa-how-it-is-done-windows.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8714185704977948121.post-5825035961596614200</guid><pubDate>Sat, 18 Apr 2009 05:23:00 +0000</pubDate><atom:updated>2009-04-17T22:24:52.061-07:00</atom:updated><title>Membuat MySQL Monitor dengan PHP</title><description>Seluruh dokumen di IlmuKomputer.Com dapat digunakan, dimodifikasi dan
&lt;br /&gt;disebarkan secara bebas untuk tujuan bukan komersial (nonprofit), dengan syarat
&lt;br /&gt;tidak menghapus atau merubah atribut penulis dan pernyataan copyright yang
&lt;br /&gt;disertakan dalam setiap dokumen. Tidak diperbolehkan melakukan penulisan ulang,
&lt;br /&gt;kecuali mendapatkan ijin terlebih dahulu dari IlmuKomputer.Com.
&lt;br /&gt;MySQL adalah salah satu database server yang cukup populer dan tangguh. Sifatnya yang Free
&lt;br /&gt;(GPL) membuat MySQL cepat berkembang dan digunakan banyak server di internet. MySQL
&lt;br /&gt;Monitor sendiri adalah sebuah tool kecil yang menjadi paket dalam server MySQL yang digunakan
&lt;br /&gt;untuk administrasi database. Tool tersebut berjalan pada mode command line. Ikutilah ulasan
&lt;br /&gt;Bondan Muliawan (mail@bondan.net) mengenai cara membuat MySQL Monitor sendiri berbasis
&lt;br /&gt;web menggunakan PHP.
&lt;br /&gt;Pendahuluan
&lt;br /&gt;Menggunakan MySQL Monitor standar bawaan dari paket MySQL sangat membantu administrasi
&lt;br /&gt;dan penggunaan server MySQL, tetapi karena tool tersebut berjalan pada mode command line dan
&lt;br /&gt;tampilan layar dari command line sangat terbatas maka pekerjaan akan menjadi sedikit lebih sulit.
&lt;br /&gt;Banyak pengembang-pengembang software open source yang telah membuat interface berbasis web
&lt;br /&gt;yang dapat digunakan untuk mengadministrasi MySQL, salah satu contohnya adalah phpMyAdmin.
&lt;br /&gt;PhpMyAdmin mempunyai banyak kelebihan yang dapat mempermudah pekerjaan Anda, hal ini
&lt;br /&gt;sangat membantu jika Anda mempunyai server MySQL dalam local komputer. Tetapi bagaimana
&lt;br /&gt;jika Anda ikut dalam layanan web hosting, yang jarang sekali memberikan fasilitas MySQL monitor
&lt;br /&gt;baik yang berbentuk command line maupun yang berbasis web. Apabila hendak memasang
&lt;br /&gt;phpMyAdmin pada hosting tersebut maka akan mengurangi ruang harddisk yang Anda butuhkan
&lt;br /&gt;untuk halaman homepage. Oleh sebab itu dibutuhkan satu interface berbasis web yang berukuran
&lt;br /&gt;kecil yang dapat membantu kerja Anda.
&lt;br /&gt;Dalam tutorial ini akan dibahas mengenai skrip sederhana memakai PHP yang dapat digunakan
&lt;br /&gt;untuk memasukan SQL Query ke server MySQL dan menampilkan hasilnya dalam bentuk web.
&lt;br /&gt;Bentuk tampilan dari script ini tampak seperti:
&lt;br /&gt;Skrip ini masih sangat sederhana, perlu dikembangkan lagi jika anda ingin benar-benar
&lt;br /&gt;menggunakannya. Ada beberapa hal yang perlu diperhatikan sebelum anda menggunakannya yang
&lt;br /&gt;berhubungan dengan keamanan server MySQL:
&lt;br /&gt;1
&lt;br /&gt;
&lt;br /&gt;Tips dan Trik IlmuKomputer.Com
&lt;br /&gt;Copyright © 2003 IlmuKomputer.Com
&lt;br /&gt;1. Dengan menggunakan script ini maka pengguna interface akan dengan leluasa berinteraksi
&lt;br /&gt;dengan server database anda, perhatikan user yang anda masukkan pada $username. Jika
&lt;br /&gt;user tersebut mempunyai akses full maka server MySQL anda sangat terbuka.
&lt;br /&gt;2. Selain itu dengan perintah SQL: SELECT ... INTO OUTFILE berarti pengguna dapat
&lt;br /&gt;memasukkan file ke server hosting Anda. Oleh sebab itu sebaiknya skrip ini diberikan
&lt;br /&gt;password pengaman sebelum mengaksesnya. Tapi dalam tutorial ini tidak dibahas cara
&lt;br /&gt;bagaimana membuat password pengaman tersebut.
&lt;br /&gt;Pemasangan Skrip Pada Server
&lt;br /&gt;Mula-mula buatlah sebuah file yang berisi listing dari MySQL Monitor menggunakan Notepad,
&lt;br /&gt;melalui Start &gt; Program &gt; Accessories &gt; Notepad. Atau anda dapat menggunakan HTML editor
&lt;br /&gt;yang lain sesuai dengan kebiasaan. Ada beberapa variabel yang harus anda rubah nilainya, yaitu:
&lt;br /&gt;$hostname ='localhost'; //Masukkan alamat lokasi server
&lt;br /&gt;$username ='root';//User MySQL yang digunakan
&lt;br /&gt;$password ='password'; // Masukkan password
&lt;br /&gt;Varibel $hostname diisi dengan alamat server MySQL, dapat menggunakan alamat IP atau nama
&lt;br /&gt;dari server, $username adalah user yang digunakan untuk masuk ke MySQL server, perhatikan hak
&lt;br /&gt;akses user tersebut, semakin tinggi maka semakin besar kekuasaan dari MySQL Monitor. User ‘root’
&lt;br /&gt;adalah user dengan hak akses tertinggi dalam MySQL.Varibel $password diisi dengan password dari
&lt;br /&gt;user MySQL. Setelah itu, simpan file tersebut dengan nama mysql.php. Besar file tidak akan lebih
&lt;br /&gt;dari 3Kb.
&lt;br /&gt;File tersebut siap di upload ke server web, ingat anda harus mengupload file mysql.php pada web
&lt;br /&gt;server yang support PHP, contohnya Apache (http://www.apache.org). Untuk ujicoba dapat
&lt;br /&gt;digunakan paket web server yang berjalan under Windows, seperti Appsrv
&lt;br /&gt;(http://appserv.sourceforge.net/) atau PHPTriad (http://http://sourceforge.net/projects/phptriad).
&lt;br /&gt;Keduanya sudah didukung dengan server MySQL. Setelah diupload, cobalah buka menggunakan
&lt;br /&gt;web browser.
&lt;br /&gt;2
&lt;br /&gt;
&lt;br /&gt;Tips dan Trik IlmuKomputer.Com
&lt;br /&gt;Copyright © 2003 IlmuKomputer.Com
&lt;br /&gt;LISTING LENGKAP MYSQL MONITOR (mysql.php);
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;$hostname ='localhost'; //Masukkan alamat lokasi server
&lt;br /&gt;$username ='root';//User MySQL yang digunakan
&lt;br /&gt;$password ='password'; // Masukkan password
&lt;br /&gt;//Membuat koneksi dengan server MySQL
&lt;br /&gt;mysql_connect($hostname,$username,$password);
&lt;br /&gt;?&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;Perintah (SQL Query) untuk database :
&lt;br /&gt;
&lt;br /&gt;$namadatabase
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$perintah_tampil=stripslashes
&lt;br /&gt;(htmlspecialchars("$perintah", ENT_QUOTES));&lt;br /&gt;echo
&lt;br /&gt;:$perintah tampil";&lt;br /&gt;?&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;masukkan perintah &lt;alt-&lt;br /&gt;P&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;echo('
&lt;br /&gt;');
&lt;br /&gt;if ($masukkan)
&lt;br /&gt;{
&lt;br /&gt;if (get_magic_quotes_gpc()) $perintah = stripslashes($perintah);
&lt;br /&gt;echo('
&lt;br /&gt;
&lt;br /&gt;Perintah : '.nl2br($perintah).'
&lt;br /&gt;');
&lt;br /&gt;$result = mysql_db_query($database,$perintah);
&lt;br /&gt;if ($result)
&lt;br /&gt;{
&lt;br /&gt;if (@mysql_num_rows($result))
&lt;br /&gt;{
&lt;br /&gt;?&gt;
&lt;br /&gt;
&lt;br /&gt;Hasil :
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;for ($i=0;$i echo('
&lt;br /&gt;');
&lt;br /&gt;?&gt;
&lt;br /&gt;
&lt;br /&gt;while ($row = mysql_fetch_row($result))
&lt;br /&gt;{
&lt;br /&gt;echo('
&lt;br /&gt;');
&lt;br /&gt;for ($i=0;$i {
&lt;br /&gt;echo(''.mysql_field_name($result,$i).'
&lt;br /&gt;'.$row[$i].'');
&lt;br /&gt;}
&lt;br /&gt;echo('');
&lt;br /&gt;}
&lt;br /&gt;?&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;echo('
&lt;br /&gt;
&lt;br /&gt;Query Berhasil:
&lt;br /&gt;'.mysql_affected_rows().' baris terpengaruh.
&lt;br /&gt;');
&lt;br /&gt;} else
&lt;br /&gt;{
&lt;br /&gt;echo('
&lt;br /&gt;
&lt;br /&gt;Query Berhasil:
&lt;br /&gt;'.mysql_affected_rows().' baris terpengaruh.
&lt;br /&gt;');
&lt;br /&gt;4
&lt;br /&gt;
&lt;br /&gt;Tips dan Trik IlmuKomputer.Com
&lt;br /&gt;Copyright © 2003 IlmuKomputer.Com
&lt;br /&gt;}
&lt;br /&gt;} else
&lt;br /&gt;{
&lt;br /&gt;echo('
&lt;br /&gt;
&lt;br /&gt;Perintah salah: '.mysql_error().'
&lt;br /&gt;');
&lt;br /&gt;}
&lt;br /&gt;}
&lt;br /&gt;?&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;PENJELASAN LISTING
&lt;br /&gt;Pada awal program anda harus men-deklarasikan variabel yang mencatat informasi mengenai server.
&lt;br /&gt;$hostname ='localhost';
&lt;br /&gt;$username ='root';
&lt;br /&gt;$password ='password';
&lt;br /&gt;Lalu membuat hubungan ke server menggunakan perintah:
&lt;br /&gt;mysql_connect($hostname,$username,$password);
&lt;br /&gt;Dengan adanya koneksi ke server MySQL anda dapat melihat nama-nama dari database yang
&lt;br /&gt;tersimpan dalam server dengan perintah:
&lt;br /&gt;$databases = mysql_list_dbs();
&lt;br /&gt;Menyiapkan textarea untuk memasukkan query:
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$perintah_tampil=stripslashes
&lt;br /&gt;(htmlspecialchars("$perintah", ENT_QUOTES));&lt;br /&gt;echo
&lt;br /&gt;:$perintah tampil";&lt;br /&gt;?&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;Perintah PHP ‘stripslashes’ diguna-kan untuk menghilangkan backslash (\) pada perintah yang di
&lt;br /&gt;Post. Sedangkah ‘htmlspecialchars’ ber-fungsi untuk merubah beberapa karakter ke HTML entiti,
&lt;br /&gt;seperti '&amp;amp;' (ampersand) menjadi '&amp;amp;'.
&lt;br /&gt;Kemudian membuat tombol untuk mengirim query:
&lt;br /&gt;masukkan perintah &lt;alt-p&gt;/&gt;
&lt;br /&gt;Untuk menampilkan hasil dari eksekusi query digunakan bantuan tag tabel. Sebelum dibentuk tabel
&lt;br /&gt;query harus dieksekusi terlebih dahulu dengan perintah:
&lt;br /&gt;$result=mysql_db_query($database,$perintah);
&lt;br /&gt;Jika query benar maka $result akan berisi data yang diminta. Untuk menampilkan jumlah kolom
&lt;br /&gt;yang diminta menggunakan perintah:
&lt;br /&gt;for($i=0;$i{...................}
&lt;br /&gt;Sedangkan jumlah baris, mengguna-kan perintah :
&lt;br /&gt;while($row=mysql_fetch_row($result))
&lt;br /&gt;{...................}
&lt;br /&gt;5
&lt;br /&gt;
&lt;br /&gt;Tips dan Trik IlmuKomputer.Com
&lt;br /&gt;Copyright © 2003 IlmuKomputer.Com
&lt;br /&gt;Jumlah baris yang terpengaruh oleh hasil dari query dapat diperoleh dengan perintah
&lt;br /&gt;‘mysql_affected_rows()’, sedangkan untuk menampilkan pesan kesalahan jika query tidak benar
&lt;br /&gt;dapat menggunakan perintah ‘mysql_error()’.
&lt;br /&gt;Selamat mencoba!
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;http://maniarockers.blogspot.com/feeds/posts/default?alt=rss&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/8714185704977948121-5825035961596614200?l=maniarockers.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RockersMania/~4/Ii_fycuPUpY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/RockersMania/~3/Ii_fycuPUpY/membuat-mysql-monitor-dengan-php.html</link><author>alternativerockers421@gmail.com (rockers alternative)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://maniarockers.blogspot.com/2009/04/membuat-mysql-monitor-dengan-php.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8714185704977948121.post-5900206917932413522</guid><pubDate>Fri, 17 Apr 2009 06:37:00 +0000</pubDate><atom:updated>2009-04-16T23:39:11.184-07:00</atom:updated><title>Make Your Pc Faster, Guaranteed</title><description>1. First, run a scandisk or checkdisk. Let Windows fix any errors.&lt;br /&gt;&lt;br /&gt;2. Run a disk cleanup utility...this will flush your temporary internet folder, trash can, temp system files, etc.&lt;br /&gt;&lt;br /&gt;3. Delete any garbage files or data...if possible, run a Duplicate File Finder program.&lt;br /&gt;&lt;br /&gt;4. Run Defrag on all partitions (NOTE: run this after you have deleted all trash and excess files!)&lt;br /&gt;&lt;br /&gt;5. Run a registry cleaner utility and delete or get rid of any orphaned entries in that registry.&lt;br /&gt;&lt;br /&gt;6. Check your exisiting swap file for it's size and location (*will explain location later in the post). If you have alot of ram (i.e. 1 gig and over) set this swap file to something small, like 250 mb. The reason is that this will force Windows to load more into memory, resulting in faster performance (note: some games and applications actually require a certain sized swap file so check your applications performance after making a size adjustment for any error messages.)&lt;br /&gt;&lt;br /&gt;7. Under XP, you can tell Windows to use Classic Style on your desktop, - this will remove the neat single click and internet-style desktop but for lower end systems this will improve performance in other areas, such as gaming and multi-tasking.&lt;br /&gt;&lt;br /&gt;8. Run msconfig and under startup and only keep the programs that are essential to load in the tray icon (and hence stay resident in memory). Uncheck anything else non-essential, like an ATI or Nvidia control panel, Quicktime utility, Real Audio, etc.&lt;br /&gt;&lt;br /&gt;9. Upgrade drivers! Check for the latest BIOS, video, motherboard, sound, etc drivers from the manufacturers. Alot of my friends had chipsets on their motherboard that had advanced disk management capabilities or AGP port settings but the drivers weren't loaded for them so they were never being used. A simple upgrade realized a noticeable difference. For instance, they didn't have the latest driver for their AGP port so it was set to 1x, instead of being used at 4x!&lt;br /&gt;&lt;br /&gt;10. (OK, so this won't speed up your PC but it could save you alot of time and trouble later on!) After making all these improvements, make a working backup! I use Ghost, but for XP users you can also use System Restore...&lt;br /&gt;&lt;br /&gt;-FOR ADVANCED USERS-&lt;br /&gt;&lt;br /&gt;1. Take a look under the hood (for IDE owners). How are your IDE devices configured? If you have more than 1 hard drive, put the master hard drive on the primary IDE channel and the secondary hard drive on the secondary IDE channel (most motherboards have two IDE channels).&lt;br /&gt;&lt;br /&gt;2. Place all CDROM drives, DVD readers etc. on the secondary IDE channel (or SCSI bus, etc). This will reduce I/O contention with your master hard drive which should have your OS and apps installed...&lt;br /&gt;&lt;br /&gt;3. Remember when I mentioned the location of the swap file? OK, if you have 2 hard drives and you have one on the primary IDE channel and the other on the secondary IDE channel, move the swap file to a partition ON THE SECOND hard drive (on the secondary IDE channel). This will greatly improve system performance as the PC can write to the swap file while loading and running OS and system commands without I/O contention on the primary IDE channel!&lt;br /&gt;&lt;br /&gt;4. Take a look under the hood (for SCSI owners) What kind of SCSI do you have? If it's the newer Ultra 160/320 etc cards then guess what? Any devices placed on the same bus will automatically default to the slowest drive on the chain...this means that if you have say, an Ultra 160 SCSI card, and it has an Ultra 160 drive (capable of transferring 160 mb/sec) on the same chain as a SCSI cdrom drive (capable of only 40 mb/sec) then the whole bus slows down to the 40 mb/sec speed...use different chains for the slower devices and maximize those hard drives!&lt;br /&gt;&lt;br /&gt;5. Run a utility like WCPUID and check the settings...is your CPU/front speed bus/AGP port running as fast as they should be? If not, check your drivers and BIOS configuration options. Also, are all of your chipset features enabled? If not, then enable them! (usually done in your BIOS!)&lt;br /&gt;&lt;br /&gt;6. Dig in to the BIOS...check settings like boot order, for example...is it checking the floppy first? Change this! Select your order to reflect the hard drive first, then CD, then floppy for a noticeable boot time improvement. Also disable any non-used on board peripherals...for instance, - does your motherboard come with an on-board NIC card? Guess what, if you don't use that NIC card and it is enabled it will eat up valuable CPU cycles and can be detrimental to your systems' performance. DISABLE THAT MUTHA! Also, see if you can play with memory timing and CPU clock frequencies (NOTE! This is for expert users only!) Set these timings to "Aggressive" and see what happens in your games and apps...Also, check to see what your video aperature is set to. If you have a video card with 128 megs of on-baord memory, your aperature should be set to this amount too. Read the BIOS owner manual for further non-general performance tricks or improvements! Do you have the latest BIOS firmware version?&lt;br /&gt;&lt;br /&gt;7. Under hardware properties, check to see that everything is working properly, and fix any hardware contention issues. You'll see the dreaded yellow exclamation point (!) beside any hardware componenet that is not working correctly.&lt;br /&gt;&lt;br /&gt;8. Evaluate the potential for system/hardware upgrades...usually, the best bang for the buck is adding memory so buy all that you can afford (don't go much above 512 megs for Win 98 or ME). If you have a motherboard with an 8x - capable AGP port but you are using an older 4x video card, consider upgrading to an 8x card. You get the idea here...&lt;br /&gt;&lt;br /&gt;9. Quit using software pigs like Norton system utilities, etc. These place files everywhere and can be a real system resource hog on lower end PCs.&lt;br /&gt;&lt;br /&gt;10. Did I mention to make a good backup? Do it now! Also, while you're at it, run a good virus program with the latest definitions.&lt;br /&gt;&lt;br /&gt;There are more options to make your system faster, such as overclocking, etc. but (just about) everything I've mentioned in this tech post costs you nothing and will result in faster system performance! Good luck and if you have any questions on how to do anything mentioned here, ask a knowledgeable friend or consult a book, - don't mess up something trying to do something you are not sure of!&lt;br /&gt;&lt;br /&gt;Good luck and I'd like to dedicate this post to all of WorldWarez which has given me so much! You're all great, peeps!&lt;div class="blogger-post-footer"&gt;http://maniarockers.blogspot.com/feeds/posts/default?alt=rss&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/8714185704977948121-5900206917932413522?l=maniarockers.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RockersMania/~4/6zEcmu1z7js" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/RockersMania/~3/6zEcmu1z7js/make-your-pc-faster-guaranteed.html</link><author>alternativerockers421@gmail.com (rockers alternative)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://maniarockers.blogspot.com/2009/04/make-your-pc-faster-guaranteed.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8714185704977948121.post-2683401435231598317</guid><pubDate>Fri, 17 Apr 2009 06:35:00 +0000</pubDate><atom:updated>2009-04-16T23:36:31.076-07:00</atom:updated><title>Outsmarting System File Protection</title><description>Tested in Windows 2000 sp2, Windows 2000 sp3 with and without IE6 sp1. Should work fine in XP and XPsp1&lt;br /&gt;&lt;br /&gt;------------------------------&lt;br /&gt;&lt;br /&gt;A lot of people are having troubles with System File Protection (SFP for short). This can be a major pain in the butt unless you know the tricks to it. Having only tweaked Windows 2000 Service Pack 3 I figured out a few things about SFP and replacing files:&lt;br /&gt;&lt;br /&gt;1) TaskManger is your best friend when replacing files in 2k/XP.&lt;br /&gt;When you open task manager you can do just about as much as you can do with Explorer just by going File&gt;NewTask(Run..). From here you can either use the Run Dialog to launch programs one at a time, or select 'Browse' and explore. Using right click menu commands to do the bulk of your work (Copy, Paste, Rename). Problem is often times you can't replace items do to the fact that your browse is making calls to things you want to delete.&lt;br /&gt;&lt;br /&gt;2) CommandLine or Cmd.exe is like that other friend you have that likes to help out.&lt;br /&gt;One plus this has over TaskMan is you don't use the file you are trying to replace. A minus is that it can be a pain if you aren't an experienced DOS user.&lt;br /&gt;&lt;br /&gt;3) Backups are your ace in the hole.&lt;br /&gt;Always back your files up prior to doing anything (sometimes I don't bother and wish I did.). Keep It Simple Stupid applies here. Save yourself a few keystrokes and place your backups in something like C:\back\&lt;br /&gt;&lt;br /&gt;4) SafeMode is the rest of the hand.&lt;br /&gt;Windows2000 and XP (I believe) can both be booted into SafeMode. When your computer is first booting up, after your bios screen but before the Windows is Starting screen (I could be slightly wrong here seeing how I don't know the timing for sure.) you hit F4 or F8 to get the SafeMode menu. Select 'SafeMode with CommandPrompt'. Welcome to "DOS" on 2k/XP. Anything that can't be replaced while Windows is running can be replaced here. (url.dll) Syntax would be Copy c:\url.dll "c:\Program Files\Internet Explorer\" quotations allow you to put spaces in the path (I didn't know this)&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;Here we go. System File Protection, of Sytem File Checker is a neato feature of Windows meant to protect Joe Computeruser's PC from being ruined. When a needed System file is being replaced your File Checker says "Wait a minute this isn't mine." While this can be great in the long run, it's not a positive thing in Windows Hacking. The trick is to replace the files it uses to replace files.&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;1) First up you need to find the file you want to hack and then replace. Start&gt;Search&gt;Files and Folders&gt;dllname. It's good to actually search for the file so you can find out all of the locations of all copies. Let the search finish just in case. If you have installed any service packs you will have probably have copies of the file in:&lt;br /&gt;&lt;br /&gt;\winnt\servicepackfiles\i386\ (Win2k)&lt;br /&gt;\windows\servicepackfiles\i386\ (XP)&lt;br /&gt;&lt;br /&gt;As well as:&lt;br /&gt;&lt;br /&gt;\winnt\system32\dllcache\ (hidden folder in Win2k)&lt;br /&gt;\WINDOWS\system32\dllcache\ (hidden folder in XP)&lt;br /&gt;\winnt\system32\ (win2k)&lt;br /&gt;\windows\system32\ (XP)&lt;br /&gt;&lt;br /&gt;2) Now that you have all of the locations, write them down on paper or your forehead just to be safe (backwards so it shows up in the mirror).&lt;br /&gt;&lt;br /&gt;3) Make a backup (remember K.I.S.S.)&lt;br /&gt;&lt;br /&gt;4) Hack your file and save it c:\ for simplicity.&lt;br /&gt;&lt;br /&gt;5) Open TaskManger (Right click on your taskbar and select TaskManger)&lt;br /&gt;&lt;br /&gt;6) Go to the 'Processes' Tab and find 'Explorer.exe' highlight it and push the 'End Process' button. Say Yeah to the popup.&lt;br /&gt;&lt;br /&gt;7) Go to the first tab in TaskManger and select 'File&gt;NewTask&gt;Run&gt;Browse' from this Window navigate to c:\ and higlight your hacked file. Right clic on it and select 'Copy' (don't Cut it.)&lt;br /&gt;&lt;br /&gt;8) Nagivate to your Windows directory, open the \servicepackfiles\i386\ folder. Paste your hacked file and replace the copy that is in that folder.&lt;br /&gt;&lt;br /&gt;9) Navigate to your respective dllcache folder, paste the file there too.&lt;br /&gt;&lt;br /&gt;10) Replace the normail copy in system32 finally (or wherever it might be).&lt;br /&gt;&lt;br /&gt;11) Reboot. Don't LogOff , Reboot.&lt;br /&gt;&lt;br /&gt;Now chances are this won't go that smoothly. Either the file you want to replace is in use, or your pal and mine SFP will pop-up. It can mess with you in odd ways. I've replaced the servicepackfiles version and the dllcache files, then had SFP grab the normal and replace the other two with it. This can be frustrating. Or maybe the file is in use. This is where the Command Prompt comes into play. If you already replaced the files and rebooted to no change, launch TaskMan again, kill explorer.exe, then go 'File&gt;NewTask&gt;Run&gt;Cmd.exe' Use the DOS commands to try to replace all of the copies of the file in that order using your hacked version in C:\&lt;br /&gt;&lt;br /&gt;This is usually where you get the message from SFP telling you it's alive and kicking. You will get a rather urgent looking pop-up telling you that a file that Windows needs is being replaced by a different file. It will then ask you if you want keep the modified files. Say 'yes'. Next it will prompt you to insert your Windows cd to retrieve a copy of the file it needs. Click 'Cancel'. As a good rule of thumb, when you get this message replace what you need then reboot!&lt;br /&gt;&lt;br /&gt;If your file still isn't changing, boot into SafeMode with CommandLine. Wait for Windows to take it's sweet time loading. Then just type copy c:\file.dll c:\winnt\servicepackfiles\i386\. Rinse and Repeat. Then reboot. This has worked for me 100% of the time, if followed it will work for you as well.&lt;br /&gt;&lt;br /&gt;http://pixelarmy.org&lt;div class="blogger-post-footer"&gt;http://maniarockers.blogspot.com/feeds/posts/default?alt=rss&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/8714185704977948121-2683401435231598317?l=maniarockers.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RockersMania/~4/3JSQhmrrkBM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/RockersMania/~3/3JSQhmrrkBM/outsmarting-system-file-protection.html</link><author>alternativerockers421@gmail.com (rockers alternative)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://maniarockers.blogspot.com/2009/04/outsmarting-system-file-protection.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8714185704977948121.post-3084623079268251437</guid><pubDate>Fri, 17 Apr 2009 02:07:00 +0000</pubDate><atom:updated>2009-04-16T19:16:50.569-07:00</atom:updated><title>Cepat Mahir VB.net</title><description>&lt;div align="justify"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;Seluruh dokumen di IlmuKomputer.Com dapat digunakan, dimodifikasi dandisebarkan secara bebas untuk tujuan bukan komersial (nonprofit), dengan syarattidak menghapus atau merubah atribut penulis dan pernyataan copyright yangdisertakan dalam setiap dokumen. Tidak diperbolehkan melakukan penulisan ulang,kecuali mendapatkan ijin terlebih dahulu dari IlmuKomputer.Com.Bab 1Mengenal .NET Framework1.1 Apa itu .NET ?.NET Platform merupakan satu set kumpulan teknologi yang memungkinkan teknologi Internetditransformasikan ke dalam platform distributed computing dengan skalabilitas dan kompatibilitas tinggi.Secara teknikal, .NET Platform menyediakan konsep pemrograman dengan library dan modul-modulbaru yang konsisten, terlepas dari jenis bahasa pemrograman yang digunakan..NET Platform menyediakan hal-hal berikut bagi para developer :1) Language independent, dengan programming model yang konsisten di semua tier aplikasi yangdibangun.2) Interoperability dan kompatibilitas antar aplikasi.Cepat Mahir Visual Basic .NET1&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.Com3) Kemudahan migrasi dari teknologi yang ada saat ini.4) Dukungan penuh terhadap berbagai teknologi standar yang digunakan dalam platform internet,antara lain HTTP, XML, SOAP dan HTML.Teknologi inti .NET secara umum terdiri dari 4 area pokok :1) .NET Framework.NET Framework adalah teknologi inti yang menyediakan berbagai library untuk digunakanoleh aplikasi di atasnya. Komponen inti .NET Framework adalah Common Language Runtime(CLR) yang menyediakan run time environment untuk aplikasi yang dibangun menggunakanVisual Studio .NET, terlepas dari jenis bahasa pemrogramannya.Dengan adanya CLR tersebut, programmer dapat menikmati consistent object model dalammengakses berbagai komponen library. Dengan demikian penggunaan bahasa pemrogramandalam dunia .NET adalah lebih ke masalah selera atau taste, dan bukan pada kelebihan maupunkekurangan masing-masing bahasa. Mengapa ? Karena semua bahasa pemrograman yangmensupport .NET mengakses library yang sama di dalam .NET Framework, dengan objectmodel yang konsisten, dengan run time file yang sama. Bahasa adalah sekedar skin atau theme,bukan senjata sakti. Bagi seorang .Net Developer, pemahaman terhadap konsep dan objectmodel .NET Framework adalah jauh lebih penting daripada bahasa pemrograman itusendiri.Bagi anda programmer VB6, tentu mengetahui bahwa diperlukan distribusi run time librarykhusus ketika menginstal aplikasi. Demikian pula ketika anda menginstal aplikasi yangdibangun dengan Visual C++ maupun Delphi. Dalam dunia .NET, hal tersebut sudah tidakdiperlukan lagi, selama .NET Framework telah terinstal di komputer sasaran.Untuk informasi lebih detil tentang .NET Framework :&lt;/em&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/netframework"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;http://msdn.microsoft.com/netframework&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://msdn.microsoft.com/netframework/productinfo/topten/default.aspx"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;http://msdn.microsoft.com/netframework/productinfo/topten/default.aspx&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;Cepat Mahir Visual Basic .NET2&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.Com2) .NET Building Block ServicesBuilding block merupakan sekumpulan services yang bersifat programmable, yang dapatdiakses secara offline maupun online. Service tersebut merupakan modul-modul yang terdapatdi suatu komputer, server dalam jaringan, maupun di suatu server di internet.Service ini merupakan suatu idealisasi di masa depan,terdistribusi dengan modul-modul yang tersimpan didiintegrasikan membentuk suatu aplikasi. Konsep inisubscription based software, yang saat ini mulai banyakApplication Service Provider.dimana sebuah aplikasi bersifatberbagai tempat, tetapi dapatmerupakan arah pengembanganberkembang dan dikenal sebagaiService tersebut dapat diakses oleh berbagai platform, asalkan platform tersebut mensupportprotokol SOAP, yang merupakan protokol standar dalam mengakses web service. Peranan XMLsebagai media definisi data menjadi sangat penting dalam hal ini, dan XML juga menjadi pusatperubahan besar dalam platform .NET. Dalam pelajaran selanjutnya, anda akan melihat bahwasemua data dalam .NET selalu direpresentasikan dalam bentuk XML.3) Visual Studio .NETVisual Studio .NET menyediakan tools bagi para developer untuk membangun aplikasi yangberjalan di .Net Framework. VS.Net membawa perubahan besar dalam gaya pemrograman,karena setiap programmer dituntut untuk memahami .NET object model dan Object OrientedProgramming dengan baik, jika tidak ingin menghasilkan aplikasi dengan performa rendah.VS.Net juga semakin mempertipis jarak antara Windows Programmer dengan WebProgrammer. Dunia scripting yang akrab bagi programmer web akan sulit ditemukandalam .NET, karena pemrograman web sudah bersifat full object oriented, dengan fasilitas eventdriven programming sebagaimana layaknya windows programming. Pemrograman web menjadilebih mudah dan menyenangkan bagi para programmer windows, sedangkan anda para veteranscripting language sudah saatnya untuk beralih ke ASP.NET, yang dapat diprogrammenggunakan VB, C#, C++ maupun Phyton dan COBOL sekalipun.Microsoft masih menyediakan Jscript.NET bagi anda para pecandu JavaScript dan JScript,sedangkan versi .Net dari VBScript belum diketahui apakah akan disediakan atau tidak. Paraveteran VB.Script disarankan untuk mempelajari VB, sehingga dapat menggunakan VB.Netuntuk membangun aplikasi web. Bahasa pemrograman yang terdapat di VS.NET adalahVB.NET, C#, C++ .NET, J#, dan Jscript .NET. Dalam masa mendatang akan terus ditambahberbagai bahasa pemrograman lain. Informasi lebih lengkap tentang VS .NET :&lt;/em&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/vstudio"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;http://msdn.microsoft.com/vstudio&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;4) .Net Enterprise ServerBagian ini merupakan sekumpulan server based technology yang digunakan untuk mendukungteknologi .NET, yang mencakup sistem operasi, database, messaging, maupun manajemen e-commerce. Teknologi yang disediakan antara lain adalah Windows 2000 Server, SQL Server,Exchange, ISA Server dan BiZTalk Server.Cepat Mahir Visual Basic .NET3&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.Com1.2 Mengapa .NET ?Ada beberapa alasan yang menguntungkan bila anda mempelajari .NET :Multi LanguageArsitektur .NET bersifat terbuka, sehingga memungkinkan berbagai bahasa pemrograman mengaksesCLR dengan mulus. Banyak kalangan menyebut .NET sebagai “open source” versi Microsoft. Saatini .NET dapat diprogram menggunakan Visual Basic.NET, C++.NET, Visual C#, Jscript, dan J#.Berbagai third Party yang dapat digunakan adalah COBOL, Eiffel, Smalltalk, Perl, Phyton, ML, Pascal,dan Delphi. Para veteran Pascal mungkin tidak pernah bermimpi membuat aplikasi web dengan bahasa“kuno” tersebut, tetapi kehadiran .Net Framework merealisasikan hal tersebut. Untuk informasi lebihlengkap tentang berbagai third party language yang tersedia :&lt;/em&gt;&lt;/span&gt;&lt;a href="http://www.gotdotnet.com/team/lang"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;http://www.gotdotnet.com/team/lang&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;Bagan berikut menjelaskan kedudukan bahasa pemrograman terhadap .NET Framework dengan CLRsebagai intinya.Sekali lagi, semua bahasa tersebut mengakses object model yang sama dalam .NET, sehingga bagi parapetualang tersedia kemungkinan untuk berpindah dari satu bahasa ke bahasa lain dalam satu proyekaplikasi yang sama. .Net menyediakan integrasi bahasa pemrograman dalam satu peroyek aplikasi. Halini membuka kemungkinan kerjasama tim yang lebih baik, walaupun dalam tim tersebut masing-masingmemiliki keahlian bahasa pemrograman yang berbeda.Pada saat tulisan ini dibuat, implementasi .NET di dunia Linux sedang dalam pengembangan.Sebuah proyek dengan title Mono Project sedang berjalan, anda dapat memantau perkembangannya di&lt;/em&gt;&lt;/span&gt;&lt;a href="http://www.go-mono.com/"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;www.go-mono.com&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;. Diharapkan di masa datang, bukan barang aneh apabila developer PHP dapatCepat Mahir Visual Basic .NET4&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.Comdengan mudah mengakses library .NET Framework, sehingga sebuah tim project dapat bekerja denganlebih baik, tanpa ada “diskriminasi” antara PHP, ASP, VB, maupun Pearl.No DLL HellAnda tahu DLL ? Tentu saja, kalo tidak tentu anda bukan seorang programmer. DLL merupakan blokatau modul-modul obyek dari sebuah aplikasi. Peranannya sangat penting, sekaligus memusingkan.Sering terjadi dalam dunia windows, kompatibilitas dan registrasi DLL di masing-masing Workstationmenjadi isu besar dalam deployment aplikasi.Strong Typing dan Type SafetyBila anda pernah menggunakan VB6, pendefinisian tipe data bukanlah sesuatu yang mutlak wajibdilakukan karena VB akan mendefinisikan primitive data type, suatu type default untuk masing-masingangka atau karakter yang terdapat dalam variabel. Hal ini sebenarnya kurang baik karena dapatmemboroskan memory dan merupakan sumber bug. .NET menyediakan strong typing, dimana setiapvariabel wajib didefiniskan scope dan tipe datanya. Demikian pula dengan fasilitas type safety yangsangat bermanfaat untuk membantu dalam coding pemrograman, terutama fasilitas intellisense yangmembimbing pemrogram dalam menentukan property, method, maupun function yang akan dipakai.Cross Platform Possibility.Net menyimpan dan mengirim data dalam bentuk XML yang merupakan format data universal diinternet. Dengan demikian integrasi data antar platform lebih mudah dilakukan, selama platform tersebutmendukung XML. Representasi konsep ini adalah dataset, suatu cache data yang berbentuk XML dandapat diakses dengan mudah. Sebuah data dapat diparsing antar tier aplikasi, baik dari database, middletier, maupun aplikasi klien dalam format XML. Manipulasi format data dalam bentuk XML, .txt,maupun .rtf merupakan sesuatu yang menantang para programmer untuk membuat aplikasi lintasplatform.Code Once, More ApplicationInterface pemrograman bersifat konsisten, dengan object model yang sama pada setiap bahasa yangdigunakan. Suatu object baik berbentuk class, library, maupun web services dapat diakses dengan mudaholeh berbagai aplikasi windows maupun web. Hal ini lebih menghemat waktu para developer, dimanasebuah object dapat dibuat sekaligus untuk aplikasi Web, Windows, dan bahkan console applicationberbasis DOS.1.3 Untuk Apa Belajar VB.NET ?Mengapa VB ? Jawabannya tergantung anda tentunya. VB6 merupakan bahasa terpopuler saat ini, danpara pengguna VB klasik akan lebih mudah berpindah ke VB .NET daripada memilih C++ .NET atauC#. Bila anda memiliki pengalaman dalam Java, maka C# lebih cocok bagi anda.Perpindahan ke VB.NET dapat diandaikan sebagai camp militer untuk para veteran VB6. Mitos selamaini menyebutkan bahwa VB6 merupakan bahasa yang “amburadul”, tidak jelas struktur obyeknya,mendukung Object Oriented tetapi banci, kompatibilitas kurang, dan lain sebagainya. Semua hal tersebutCepat Mahir Visual Basic .NET5&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.Comterjadi sebagai boomerang dari VB6 yang terlalu longgar dalam kaidah pemrograman, sehingga tidaksulit menemukan programmer VB6 yang belum pernah membuat property dalam class modul selamakarirnya.Di sisi lain kelonggaran tersebut telah menumbuhkan VB sebagai bahasa yg mudah dipelajari, danpaling populer saat ini. Sebenarnya selama seorang programmer konsisten dan disiplin dengan kaidahkonsep COM dan OOP, mitos-mitos di atas tidak akan terjadi.VB.NET tampil dengan wajah yang sama sekali berbeda dari VB6 dalam hal kaidah pemrograman,terutama dengan fasilitas strong typing dan code safety. Di samping itu, sifat .NET Framework yangdirancang dengan nuansa OOP juga harus diikuti, sehingga VB.NET dapat dikatakan sebagi full OOPprogramming. Hal tersebut mungkin bukanlah barang baru bagi anda pemakai Java atau C, tetapimerupakan hal baru bagi kebanyakan programmer VB6. Dengan demikian, mempelajari VB.NET berartimeningkatkan skill veteran VB klasik, sejajar pemrogram berbasis OOP lainnya. Link berikutmenyediakan informasi lebih lengkap tentang VB .NET : &lt;/em&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/vbasic"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;http://msdn.microsoft.com/vbasic&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;Cepat Mahir Visual Basic .NET&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComCepat MahirVisual Basic .NETM. Choirul Amri&lt;/em&gt;&lt;/span&gt;&lt;a href="mailto:choirul@bsmdaemon.com"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;choirul@bsmdaemon.com&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;Lisensi Dokumen:Copyright © 2003 IlmuKomputer.ComSeluruh dokumen di IlmuKomputer.Com dapat digunakan, dimodifikasi dandisebarkan secara bebas untuk tujuan bukan komersial (nonprofit), dengan syarattidak menghapus atau merubah atribut penulis dan pernyataan copyright yangdisertakan dalam setiap dokumen. Tidak diperbolehkan melakukan penulisan ulang,kecuali mendapatkan ijin terlebih dahulu dari IlmuKomputer.Com.Bab 2Aplikasi VB.NET Anda YangPertamaPada bagian ini anda akan membuat sebuah aplikasi sederhana menggunakan VB.NET. Meskipunaplikasi yang dibuat sangat sederhana, penulis berusaha untuk mengenalkan anda pada berbagaifeature baru dan tools dasar VB.NET , sehingga dapat digunakan sebagai dasar pemrograman yanglebih kompleks.Skenario yang digunakan dalam bab ini adalah membuat aplikasi sekaligus membahas pengenalanIntegrated Development Environtment (IDE) VB.NET. Aplikasi yang akan dibuat adalah tanyajawab mengenai makanan favorit, dan aplikasi tersebut akan memberikan komentar berdasarkanjenis makanan yang diinput user.2.1 Membuat Project BaruMulailah dengan membuka Visual Studio .NET, maka akan tampil Start Page yang menampilkanbeberapa project terakhir yang anda akses. Pada bagian kiri terdapat beberapa baris hyperlink yangCepat Mahir Visual Basic .NET1&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.Commenghubungkan anda dengan beberapa informasi penting. Beberapa link memerlukan koneksiinternet untuk mengaksesnya, seperti Online Community dan web Hosting.Untuk membuat Project baru pilih New Project untuk menampilkan dialog New Project sepertiberikut :Dalam dialog New Project anda dapat memilih jenis aplikasi yang akan dibuat termasuk bahasapemrograman digunakan. Jenis aplikasi yang dapat dibuat adalah :•Windows Application : adalah aplikasi yang paling umum dibuat, menggunakan interfacewindows. Biasanya Windows Application merupakan interface aplikasi sedangakan logicCepat Mahir Visual Basic .NET2&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.Comaplikasi terdapat di dalam Class Library. Windows Application dapat berisi form, class,XML file, maupun file VB Script dan Jscript.•Class Library : merupakan fondasi dasar untuk membuat komponen yang menjalankanfungsi tertentu. Class merupakan fondasi dasar untuk membentuk obyek dalampemrograman berorientasi obyek. Class Library tidak memiliki interface tertentu sepertiform, tetapi dapat diakses oleh aplikasi lain untuk menjalakan berbagai fungsi yang terdapatdi dalamnya. Class Library dapat disamakan dengan teknologi ActiveX DLL (.dll) danActiveX EXE dalam pemrograman VB6.Windows Control Library : tidak puas dengan built in control yang disediakan VS .NET ?Anda dapat berkreasi membuat kontrol sendiri dan memasukkan berbagai fungsi yang andainginkan di dalam kontrol tersebut. Fasilitas untuk membuat kontrol tersebut adalahWindows Control Library. Kontrol ini sama dengan ActiveX Control (.ocx) dalampemrograman VB6.ASP .NET Web Application : adalah project yang digunakan untuk membuat aplikasi web.Teknologi yang digunakan adalah ASP .NET yang memiliki berbagai kelebihandibandingkan ASP klasik. Perubahan utamanya adalah dapat diprogram menggunakanberbagai bahasa .NET seperti VB, C++, C# maupun J#. ASP .NET juga menyediakanberbagai kontrol yang bersifat event drivent programming sehingga lebih menghemat waktupembuatan aplikasi.ASP .NET Web Service : Web service merupakan salah satu ide utama dalam .NET. Andadapat membuat web service dan meletakkannya di web server untuk diakses berbagaiaplikasi. Sebuah web service dapat diakses oleh aplikasi windows, web, console, maupunmobile device. Web service hampir sama dengan Class Library, perbedaan utamanya adalahweb service tersebut diletakkan di web server sehingga dapat diakses dengan lebih mudahdan tidak terbatas pada aplikasi berbasis windows saja.Console Application : merupakan aplikasi dengan tampilan text mode atau DOS. Aplikasijenis ini biasa digunakan sebagai monitoring service atau remote application dimana sumberdaya komputer dan bandwith sangat terbatas.Windows Service : adalah aplikasi yang berjalan sebagai service di windows, yang di loadbersamaan dengan proses start up windows. Aplikasi ini berjalan di background danbiasanya tidak memiliki interface. Penerapan aplikasi ini misalnya untuk pembuatanscanning antivirus, server FTP, dan remote server.Web Control Library : Hampir sama dengan Windows Control Library tetapi digunakanuntuk aplikasi web.••••••2.2 VB .NET IDEDalam latihan ini anda akan membuat Windows Application sehingga anda harus memilih jenisproject tersebut. Di bagian bawah jendela New Project terdapat dialog untuk menentukan letak fileaplikasi. VB selalu membuat satu direktori untuk menyimpan satu project dengan nama sesuai namaproject tersebut. Berikan nama Latihan 01 untuk project anda dan klik OK untuk melanjutkan.Tampilan Windows Form Designer adalah sebagai berikut :Cepat Mahir Visual Basic .NET3&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComGambar di atas menjelaskan garis besar IDE yang biasa digunakan. Di bagian atas terdapat toolbaryang sudah tidak asing lagi, mencakup berbagai fasilitas editing seperti cut, copy, paste, dan tombolStart. Di bagian kanan terdapat Solution Explorer yang menampilkan berbagai obyek dalam aplikasiseperti form, class dan component.Anda dapat berpindah dari mode View Code ke View Designer atau sebaliknya. View Codemenampilkan coding untuk obyek-obyek dalam aplikasi, sedangkan View Designer menampilkanrepresentasi fisik obyek tersebut.Di bawah Solution Explorer terdapat Properties Window yang berisi properti obyek yang sedangaktif di bagian designer. Anda dapat mengatur properti obyek di bagian ini baik dari segi tampilanmaupun perilaku obyek tersebut dalam aplikasi. Selain menetapkan properti di bagian ini dapat pulamengeset properti secara run time dengan menggunakan coding.Bagian yang sering digunakan adalah Toolbox yang terdapat di sisi kiri, yang pada gambar di atassengaja dihide untuk menghemat tempat. Gambar di bawah menampilkan Toolbox yang berisiberbagai macam obyek untuk ditempatkan di form.Cepat Mahir Visual Basic .NET4&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComToolbox Windows Form berisi obyek untuk mendesain form seperti TextBox, Label, CheckBox, dll.Kontrol yang mungkin paling sering anda gunakan adalah TextBox, Label, dan Button. Anda dapatmengklik ganda atau dengan drag-drop untuk meletakkan suatu kontrol ke form.2.3 Memulai CodingUntuk membuat aplikasi pertama ini letakkan kontrol Label, TextBox, dan Button seperti gambarberikut :Cepat Mahir Visual Basic .NET5&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComSelanjutnya ubahlah properti Text dari TexBox menjadi Vote, dengan mengisikan text tersebut diProperties Window seperti gambar berikut.Untuk mengisikan kode program di button, klik ganda button yang bertuliskan Vote dan tuliskankode berikut :Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.ClickDim Makanan As String = TextBox1.TextIf Makanan = "sate" ThenMessageBox.Show("Enak, tetapi kolestrol tinggi", "Respon", MessageBoxButtons.OK).ToString()ElseIf Makanan = "pecel" ThenMessageBox.Show("Murah dan sehat, :)", "Respon", MessageBoxButtons.OK) .ToString()ElseIf Makanan = "mie ayam" ThenMessageBox.Show("Ini kurang sehat lho", "Respon", MessageBoxButtons.OK) .ToString()ElseMessageBox.Show("Maaf, yang ini No Comment", "Respon", MessageBoxButtons.OK) .ToString()End IfEnd SubKode tersebut akan dieksekusi setiap kali user mengklik Button1 dan VB akan mengealuasi inputdari user yang diletakkan di TextBox1. Event yang ditangkap adalah Button1_Click yang terjadisetiap kali user mengklik tombol tersebut.Selanjutnya klik ganda di ruang kosong Form untuk menampilkan Event Form1_Load dan isikankode berikut :Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.LoadLabel1.Text = "Apa makanan favorit anda ?"End SubCepat Mahir Visual Basic .NET6&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComKode tersebut akan mengeset test di Label1 yang semula blank menjadi bertuliskan "Apa makananfavorit anda ?".Untuk mengetes program tersebut jalankan dengan menekan tombol F5 atau menekan toolbar Start.Masukkan kata “sate” dan tekan tombol Vote. VB akan menampilkan message box dengan pesansesuai yang telah anda masukkan di kode program yaitu "Enak, tetapi kolestrol tinggi". Masukkankata “pecel” dan “soto” lalu lihatlah bagaimana aplikasi tersebut bereaksi.2.4 Bagaimana Cara Kerjanya ?Aplikasi ini menggunakan kontrol alir logika IF…THEN…. Yang sangat umum dijumpai dalamsetiap program. User memasukkan input di TextBoxt yang ditangkap dan dimasukkan ke variabelMakanan bertipe data String.Dim Makanan As String = TextBox1.TextSelanjutnya variabel makanan dievaluasi dan diberikan respon message box sesuai dengan jenismakanan yang dimasukkan.If Makanan = "sate" ThenMessageBox.Show("Enak, tetapi kolestrol tinggi", "Respon", MessageBoxButtons.OK).ToString()VB menampilkan message box menggunakan Class MessageBox dengan argumen yang terdiri daripesan, caption, dan jenis button yang ditampilkan. Apabila jenis makanan ternyata bukan “sate”maka dilanjutkan dengan jenis makanan lainnya yang terdapat di bawah kriteria pertama :ElseIf Makanan = "pecel" ThenMessageBox.Show("Murah dan sehat, :)", "Respon", MessageBoxButtons.OK)Demikian seterusnya sampai struktur IF…THEN… tersebut berakhir.Pada saat anda bekerja dengan kode, fasilitas intellisense sangat membantu untuk mengurangikesalahn coding. Feature ini memunculkan berbagai properti, method, dan function dari suatu classketika anda mengetikkan tanda dot (.).Cepat Mahir Visual Basic .NET7&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComKetika anda memulai baris baru sebuah kode dan ingin mengetikkan obyek built in, anda dapatmenampilkan daftar obyek-obyek tersebut dengan mengetikkan Ctrl+Spasi.2.5 Meningkatkan Kinerja AplikasiAplikasi yang telah anda buat mungkin cukup memadai untuk sebuah program sederhana. Namunsekarang tiba saatnya untuk benar-benar menguji kehandalan aplikasi tersebut.Cobalah memasukkan kata “Sate”, perhatikan bahwa anda harus menggunakan huruf “S” kapital.Apa yang terjadi ? Aplikasi tersebut akan memunculkan pesan sebagai berikut :Cepat Mahir Visual Basic .NET8&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComTentunya anda melihat sesuatu yang ganjil di sini. Pesan yang ditampilkan berbeda dengan pesanuntuk kata “sate” sebagaimana telah dicobakan sebelumnya. Kata “sate” dan “Sate” seharusnyamemiliki makna yang sama, sehingga pesan yang dimunculkan seharusnya sama pula. Tetapiaplikasi tersebut menganggap kedua kata tersebut sebagai sesuatu yang berbeda karena perbedaanpenggunaan huruf kapital. Anda menjumpai bahwa aplikasi tersebut mengandung bug, sebuahlogical bug yang dapat menyesatkan pengguna.Untuk memperbaiki bug tersebut digunakan konversi huruf sehingga aplikasi akan menganggapsemua input yang dimasukkan adalah sama. Semua input akan dikonversi terlebih dahulu menjadihuruf kapital, dan selanjutnya dievaluasi sesuai struktur IF….THEN….Kuncinya adalah dengan mengkonversi semua input di TextBox1 menjadi huruf kapital denganmenggunakan fungsi Ucase.Dim Makanan As String = UCase(TextBox1.Text)Dan selanjutnya anda harus merubah semua string makanan menjadi huruf kapital. Keseluruhankode di event Button1_Click akan menjadi sebagai berikut :Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.ClickDim Makanan As String = UCase(TextBox1.Text)If Makanan = "SATE" ThenMessageBox.Show("Enak, tetapi kolestrol tinggi", "Respon", messageBoxButtons.OK).ToString()ElseIf Makanan = "PECEL" ThenMessageBox.Show("Murah dan sehat, :)", "Respon", MessageBoxButtons.OK).ToString()ElseIf Makanan = "MIE AYAM" ThenMessageBox.Show("Ini kurang sehat lho", "Respon", MessageBoxButtons.OK).ToString()ElseMessageBox.Show("Maaf, yang ini No Comment", "Respon", MessageBoxButtons.OK).ToString()End IfEnd SubCepat Mahir Visual Basic .NET9&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComSekarang cobalah menjalankan kembali aplikasi dengan menekan tombol F5 dan masukkan kata“Sate”, atau “sAte”. Semua akan menghasilkan respon pesan yang sama dengan kata “sate”, karenaVB telah mengkonversi semua input tersebut sebelum dievaluasi dengan pembanding yang telahdibuat dalam huruf kapital. Dengan demikian aplikasi anda tetap “menganalisis” input secara benarmeskipun user melakukan kesalan entri jenis makanannya, terutama dalam hal pemakaian hurufkapital.Bagaimana jika user tidak memasukan input sama sekali dan langsung menekan tombol Vote ?Dalam aplikasi lama anda, responnya adalah “No Commnet”. Anda dapat menampilkan pesan yanglebih bersahabat dengan menambahkan baris kode berikut sebelum struktur IF…THEN….berakhir,yaitu tepat di bawah variabel bernilai “MIE AYAM”ElseIf Makanan = "" ThenMessageBox.Show("Makanan belum diisikan", "Warning", MessageBoxButtons.OK, _MessageBoxIcon.Warning).ToString()Sehingga apabila user tidak memasukkan makanan tertentu maka ditampilkan pesan sebagaiberikut :Cepat Mahir Visual Basic .NETM. Choirul Amri10&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComAnda telah mempelajari bagaimana sebuah aplikasi harusmmempertimbangkan berbagaikemungkinan kesalahan dan variasi input yang dilakukan user. Dengan demikian aplikasi anda akantampak lebih user friendly dan lebih cerdas.Cepat Mahir Visual Basic .NET&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComCepat MahirVisual Basic .NETM. Choirul Amri&lt;/em&gt;&lt;/span&gt;&lt;a href="mailto:choirul@bsmdaemon.com"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;choirul@bsmdaemon.com&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;Lisensi Dokumen:Copyright © 2003 IlmuKomputer.ComSeluruh dokumen di IlmuKomputer.Com dapat digunakan, dimodifikasi dandisebarkan secara bebas untuk tujuan bukan komersial (nonprofit), dengan syarattidak menghapus atau merubah atribut penulis dan pernyataan copyright yangdisertakan dalam setiap dokumen. Tidak diperbolehkan melakukan penulisan ulang,kecuali mendapatkan ijin terlebih dahulu dari IlmuKomputer.Com.Bab 3Bekerja dengan Variabel dan DataSeorang software developer tidak dapat mengelak untuk tidak menggunakan variabel dan data. Mautidak mau anda harus menggunakannya. Pemahaman yang benar tentang variabel baik dalam halscope, lifetime, dan type nya akan sangat berguna untuk melahirkan sebuah aplikasi handal, efisien,dan cepat.Mengapa sebuah variabel harus didefinisikan dan dibuat ? Karena komputer menggunakan memoryuntuk menampung sementara data yang akan diproses. Ketika anda akan melakukan sebuahperhitungan, maka lebih efisien apabila anda membuat variabel-variabel untuk menampung formulaperhitungan tersebut. Anda dapat saja tidak menyimpannya dalam variabel dan langsungmemasukkan nilainya dalam sebuah perhitungan, dan akibatnya komputer harus meminta input daripengguna untuk setiap nilai yang akan dihitung.Cepat Mahir Visual Basic .NET1&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.Com3.1 Penggunaan VariabelUntuk dapat memakai sebuah variabel maka anda harus mendeklarasikannya terlebih dahulu. Dalambahasa VB6 anda dapat saja menggunakan sebuah variabel tanpa membuat deklarasi meskipun haltersebut tidak direkomendasikan dan sangat tidak efisien bagi sebuah aplikasi.Deklarasi VariabelTujuan pendeklarasian variabel adalah agar komputer mengetahui dengan pasti type data yang akandigunakan dalam variabel tersebut serta scopenya. Dengan demikian komputer dapat langsungmengeksekusi sebuah variabel tanpa memeriksa lagi type datanya. Sebuah variabel harus memilikinama, type data, scope, dan value. Berikut adalah contoh deklarasi variabel :DimDimDimDimDimsNama As StringdGajiPokok As DecimaldTunjangan As DecimaldGajiTotal As DecimaldPajak As DecimalsNama = "Anto"dGajiPokok = 600000dTunjangan = 150000Dideklarasikan 5 variabel masing-masing dengan type string (1 variabel) dan decimal (4 variabel).Selanjutnya pada tiap variabel tersebut masing-masing diisikan nilainya. Pengisian nilai variabeltersebut harus sesuai dengan type data yang telah ditetapkan. Misalnya saja anda tidak dapat mengisivariabel dGajiPokok dengan “Anto”, karena variabel tersebut telah didefinisikansebagai decimal yang harus berisi angka dan bukan string.Anda juga dapat mendeklarasikan variabel dan langsung memberikan nilainya pada saat yang samadalam satu baris kode. Teknik ini merupakan feature baru VB .NET.Dim dGajiPokok As Decimal = 600000Selain itu anda juga dapat mendeklarasikan beberapa variabel sekaligus dalam satu baris danmendefinisikan type datanya secara bersamaan.Dim sUmur, sTinggi, sGaji As SingleKetiga variabe tersebut memiliki type data sama yaitu Single. Cara ini memudahkan pendeklarasianvariabel daripada harus mengulang deklarasi dalam tiga baris.Melakukan PerhitunganSelanjutnya anda dapat melakukan perhitungan tertentu dengan menggunakan variabel tersebutsebagai komponen formula sebagai berikut :dGajiTotal = dGajiPokok + dTunjangandPajak = 0.1 * dGajiTotalSegala Sesuatu adalah OBYEK !Salah satu mantra baru dalam .NET programming adalah cara kita memandang terhadap obyek.Segala sesuatu adalah obyek, begitulah pedoman yang harus anda pegang. Dalam teknik VB6 andamengenal konsep Object Oriented Programming (OOP) melalui Class dan konsep COM. Namundalam .NET segala sesuatu merupakan obyek, termasuk variabel juga merupakan obyek.Cepat Mahir Visual Basic .NET2&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComKarenanya suatu varabel juga memiliki berbagai sifat yang diwujudkan dalam property, event, danfunction. Sifat-sifat tersebut dapat diwariskan ke obyek lain, atau suatu variabel dapat mewarisi sifatdari obyek di atasnya.Sebagai contoh anda dapat melakukan perhitungan besarnya dGajiTotal dan dPajak di atas denganmemanfaatkan fasilitas OOP yang terdapat dalam variabel tersebut. Gunakan keyword untukmelakukan perhitungan sebagai berikut:dGajiTotal = dGajiTotal.Add(dGajiPokok, dTunjangan)dPajak = dGajiTotal.Multiply(0.1, dGajiTotal)Anda menggunakan function Add dan Multiply sebagai pengganti perhitungan sebelumnya.Argumen yang digunakan adalah dGajiPokok, dTunjangan dan dGajiTotal.Menampilkan Hasil PerhitunganHasil perhitungan tersebut ditampilkan ke dalam dua buah label sebagai berikut :Label1.Text = "Gaji Total = " &amp;amp; dGajiTotal.ToStringLabel2.Text = "Pajak Anda = " &amp;amp; dPajak.ToStringKeyword ToString yang mengikuti setiap variabel bertujuan untuk mengkonversikan hasilperhitungan yang semula bertype decimal menjadi string.Anda akan melihat bahwa perhitungan yang anda lakukan dengan cara pertama akan sama hasilnyadengan menggunakan cara kedua yang memanfaatkan built in function dalam sebuah variabel.3.2 Ruang Lingkup dan Type VariabelSebuah variabel memiliki ruang lingkup (scope) tertentu, tergantung dengan cara bagaimana variabeltersebut dideklarasikan. Terdapat 3 macam scope suatu varibel :1. Procedure level / local scope2. Module level3. Variabel PublicMasing-masing scope tersebut dapat dijelaskan sebagai berikut :Cepat Mahir Visual Basic .NET3&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComProcedure level / local scopeApabila suatu variabel dideklarasikan dalam suatu prosedur tertentu, maka variabel tersebut hanyadapat diakses dan berlaku untuk prosedur tersebut saja. Perhatikan contoh kode berikut :Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton3.ClickDim sPesan As StringsPesan = "tes Variabel local"MessageBox.Show(sPesan, "Variabel local", MessageBoxButtons.OK, _messageBoxIcon.Information)End SubVariabel sPesan dideklarasikan di dalam prosedur Button3_Click sehingga hanya berlaku di dalamprosedur tersebut saja. sPesan tidak dapat diakses dari luar Button3_Click. Apabila andamenggunakan variabel yang hanya dipakai dalam suatu prosedur tertentu maka sebaiknya andamenggunakan jenis variabel ini.Pengertian prosedur di sini menyangkut function, event, dan properti, sehingga tidak terbatas padaevent saja sebagaimana dicontohkan di atas.Karena variabel ini scope nya lokal untuk prosedur tertentu saja maka nama variabel tersebut hanyaberlaku di dalam prosedur dimana variabel tersebut dideklarasikan. Misalkan anda memiliki functionbernama A dan memiliki variabel bernama sNama. Kemudian anda memiliki sebuah event B danmemiliki variabel bernama sama yaitu sNama. Kedua variabel tersebut tidak akan salingberhubungan dan tetap terpisah nilainya karena dideklarasikan secara lokal di dalam prosedurmasing-masing.Module LevelAnda dapat membuat suatu variabel yang dapat diakes dari prosedur manapun dalam suatu file.Misalkan anda ingin mendeklarasikan suatu string koneksi yang akan dipakai terus menerus didalam suatu module. Maka anda harus mendeklarasikan variabel tersebut di bagian deklarasi modulesebagaimana contoh berikut :Cepat Mahir Visual Basic .NET4&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComTerlihat ada 6 variabel yang dideklarasikan di bagian Declaration sebuah form bernama Form1.Selanjutnya variabel yang dideklarasikan di bagian ini akan dipakai untuk melakukan berbagaiperhitungan di tiap prosedur. Anda dapat membuka source code yang disertakan untuk meneliti lebihjauh bagaimana variabel tersebut dipakai.Anda harus berhati-hati menggunakan variabel jenis ini, karena nilai suatu variabel akan terusberubah mengikuti perlakuan di setiap prosedur yang mengaksesnya. Sebaiknya anda hanyamenggunakannya apabila memang benar-benar diperlukan. Untuk mempermudah menelusuri errordan maintenance aplikasi anda dapat menggunakan variabel dengan scope local.Variabel jenis ini hanya berlaku untuk module dimana variabel tersebut dideklarasikan. Variabel initidak dapat diakses dari module lain meskipun berada dalam sebuah Project aplikasi yang sama.Apabila anda membutuhkan variabel yang dapat diakses dari module lain maka dapat digunakanVariabel Public/GlobalVariabel Public/GlobalCara pendeklarasian variabel jenis ini hampir sama dengan jenis module level dengan menambahkankata Public sebagai pengganti keyword Dim. Variabel ini dapat diakses dari module lain, dan bahkandapat diakses oleh Project lain selama Project tersebut membuat reference ke Project dimanavariabel tersebut dideklarasikan.Misalkan anda memiliki Class yang digunakan untuk membuka dan menutup koneksi database.Maka anda dapat mendefinisikan variabel untuk koneksi sebagai Public sehingga form, Class,maupun Project lain dapat mengakses variabel tersebut dan melakukan koneksi ke database denganmemanfaatkan Class tersebut.Pada contoh deklarasi di atas variabel cn dirubah deklarasinya menjadi code berikut :Public cn As SqlClient.SqlConnectionAnda akan banyak menggunakan variabel jenis ini pada saat mempelajari teknik reference dalammengakses berbagai komponen yang terdapat di VB.NET maupun yang anda buat sendiri.Type Data Pada VariabelSetiap variabel harus dideklarasikan type datanya sehingga VB mengalokasikan sumber daya yanglebih efisien untuk variabel tersebut. Anda harus memahami dengan baik tiap jenis type data dankapan type data tertentu digunakan.Misalnya anda menggunakan type data String untuk menyimpan nama seseorang, dan menggunakanByte untuk menyimpan umurnya. Anda harus memilih type data dengan ukuran dan akurasi palingefisien dan cocok sesuai tujuan anda.Contoh lain bila anda ingin melakukan kalkulasi dengan presisi tinggi, maka dapat digunakan typedata Double, sedangkan untuk menyimpan umur seseorang yang tidak mungkin lebih dari 100 tahunmaka digunakan type Byte.Tabel berikut merupakan daftar type data yang dapat anda gunakan lengkap dengan ukuran danscopenya:Cepat Mahir Visual Basic .NET5&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComTypeDataBooleanByteCharDateDecimalSingleUkuranMemori4128124Nilai DefaultFalse0Char(0)01/01/000112:00:00AM0D0.0Cakupan NilaiTrue atau False0 s/d 2550 s/d 65,535January 1, 1 CE s/dDecember 31, 9999+/- 9,228,162,514,264,337,593,543,950,335 nilai bukan nol terkecil :+/-.00000000000000000000000000013.402823E38 s/d -1.401298E-45 untuk nilainegatif;1.401298E-45 s/d 3.402823E38 untuk nilaipositif1.79769313486231E308 s/d -4.94065645841247E-324 untuk nilainegatif ;4.94065645841247E-324 s/d1.79769313486232E308 untuk nilai positif- 2,147,483,648 s/d 2,147,483,647-32,768 s/d 32,767- 9,223,372,036,854,775,808 s/d9,223,372,036,854,775,807Double80.0IntegerShortLong428000Berdasarkan tabel diatas anda dapat memilih penggunaan type data yang paling sesuai dengankebutuhan dalam sebuah variabel.Prinsip utama yang perlu diperhatikan dalam pemilihan adalah jangan menggunakan tipe data yangyang ukurannya berlebihan dibanding kebutuhan anda. Sesuaikan pula dengan presisi yangdikehendaki dalam aplikasi.Misalnya untuk membuat variabel yang berisi jumlah anak dalam keluarga, anda menggunakan typeInteger. Tentunya ini tidak sesuai karena type Integer berukuran 4 byte dalam memori, sedangkananda tidak memerlukan nilai sampai dengan maksimum 2,147,483,647. Anda dapat menggunakantype data Byte dengan nilai maksimum 255 dan hanya membutuhkan 1 byte memori. Tentunyasesuatu yang wajar apabila jumlah anak dalam keluarga tidak melebihi angka 255.Dua contoh perhitungan berikut menampilkan hasil yang berbeda dari suatu perhitungan yangdiakibatkan penggunaan type data berbeda.Dim sLuas As SingleDim sPanjang As Single = 7.5689782Dim sLebar As Single = 9.568972'Hitung luas dengan tipe data singlesLuas = sPanjang * sLebar'tampilkan di message boxMessageBox.Show(sLuas.ToString, "Hasil dg Type Single", _MessageBoxButtons.OK, MessageBoxIcon.Information)Apabila kode tersebut dieksekusi maka tampil hasil perhitugan sebagai berikut :Cepat Mahir Visual Basic .NET6&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComTetapi apabila variabel sLuas diganti menjadi bertype Double :Dim sLuas As DoubleMaka hasil perhitungannya menjadi sebagai berikut :Perbedaan tersebut terjadi karena type data Single dan Double memiliki tingkat presisi yang berbeda.Contoh tersebut memberikan gambaran kepada anda bagaimana pemilihan suatu variabel menjadisesuatu yang sangat mendasar dalam sebuah aplikasi.Type Data Untuk SemuaTelah dijelaskan dalam bagian pendahuluan kuliah berseri ini bahwa dalam Visual Studio .NETterdapat beberapa bahasa yang mendukung pemrograman .NET. Bahasa tersebut adalah VB, C#,C++, dan J#. Selain itu terdapat pula beberapa third party language yang juga mendukungpemrograman di lingkungan .NET.Karena semua bahasa tersebut mengakses .NET Framework yang sama maka tidak terdapatperbedaan type data dalam tiap-tiap bahasa. Ini berbeda dengan kondisi sebelumnya dimana typedata dalam VB berbeda dengan VC++ dan masing-masing harus dipertimbangkan kompatibilitasnya.Kompatibilitas data dan aplikasi dalam .NET lebih terjamin karena menggunakan library yang samadengan type data sama pula. Ini merupakan kabar gembira bagi sebuah tim pengembang aplikasiyang terdiri dari berbagai programmer dengan keahlian bahasa yang berbeda.Konversi VariabelPada saat tertentu mungkin anda memerlukan konversi dari satu type data ke type lain. VB .NETmenyediakan fungsi CType untuk mengkonversikan variabel. Contoh berikut mengkonversikanvariabel umur yang semula bertipe String menjadi Single.Dim sUmur As String = 5.5Dim bUmur As Single = CType(sUmur, Single)MessageBox.Show(bUmur, "Hasil Konversi", MessageBoxButtons.OK, _MessageBoxIcon.Information)Cepat Mahir Visual Basic .NET7&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.ComInti konversi adalah memasukkan obyek yang akan dikonversi sebagai argumen dari CType danmenentukan variabel tujuan konversinya.System NamespaceDalam .NET sekumpulan kelas library yang memiliki fungsi tertentu disebut dengan namespace.Karena .NET mendukung implementasi konsep OOP maka semua obyek dalam setiap bahasamerupakan turunan dari Namespace tersebut. Type data yang telah dijelaskan sebelumnyasebenarnya diturunkan dari System Namespace, yang merupakan root namespace dalamsistem .NET.Misalnya type data Decimal, ternyata diturunkan dari System Namespace yaitu System.Decimalruntime structure. Demikian pula dengan type data yang lain, selalu diturunkan dari namespaceSystem tersebut.Dengan demikian anda memiliki cara lain dalam mendeklarasikan variabel dan melakukanperhitungan sebagai berikut :Dim dGaji As System.Decimal = 1000000Dim sPajak As System.Decimal = 0.1Dim dGajiTerima As System.Double = dGaji * (1 + sPajak)MessageBox.Show(dGajiTerima.ToString, "Hasil Hitung", _MessageBoxButtons.OK)Mungkin anda bertanya, mengapa pendeklarasian Decimal tetap dapat dibenarkan daripada secaralengkap menyebutkan System.Decimal ? Jawabannya adalah karena VB secara default telahmenyertakan namespace System sebagai reference library dalam setiap Project. Karena referencetersebut telah dibuat maka tidak menjadi halangan apabila anda langsung menyebutkan nama typedatanya saja. Konsep ini berlaku untuk semua namespace dalam .NET.Apabila anda perhatikan menu Solution Explorer maka terlihat beberapa namespace telahdireferensikan secara default, yaitu System, System.Data, System.Drawing, dan seterusnya.Anda dapat menambahkan refrensi tersebut sesuai dengan kebuthan dan jenis library yang akandiakses. Pada bab-bab selanjutnya anda akan mempelajari fungsi apa saja yang tersedia dalam setiapnamespace dan bagaimana cara penggunaannya.Cepat Mahir Visual Basic .NET8&lt;br /&gt;Kuliah Berseri IlmuKomputer.ComCopyright © 2003 IlmuKomputer.Com3.3 ConstantApabila sebuah variabel selalu memiliki nilai tetap dan tidak berubah-ubah di sepanjang aplikasimaka lebih baik bila anda mendefinisikannya sebagai constant. Misalnya dalam sebuah aplikasimatematika yang memiliki variabel phi, dimana phi bernilai 3.14 yang digunakan dalam perhitunganluas lingkaran dan volume tabung.Menetapkan sebuah variabel tetap sebagai constant memiliki keuntungan karena constant dieksekusilebih cepat daripada variabel. Ini berarti peningkatan performa aplikasi yang dibangun.Deklarasi constant sama dengan deklarasi variabel, dengan menambahkan keyword Constant didepan nama variabel.Const phi As single = 3.14Dim sRadius As single = 20Dim sKeliling As single'melakukan perhitungan dengan constantsKeliling = 2 * phi * sRadiusSemua jenis type data, scope, dan tata cara deklarasi yang berlaku pada variabel berlaku pula untukconstant. Perbedaanya adalah apabila variabel dapat berubah-ubah nilainya, sedangkan constantselalu bernilai tetap.Cepat Mahir Visual Basic .NET&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;http://maniarockers.blogspot.com/feeds/posts/default?alt=rss&lt;img width='1' height='1' src='http://res1.blogblog.com/tracker/8714185704977948121-3084623079268251437?l=maniarockers.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RockersMania/~4/ALmGY-DWwYI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/RockersMania/~3/ALmGY-DWwYI/seluruh-dokumen-di-ilmukomputer.html</link><author>alternativerockers421@gmail.com (rockers alternative)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://maniarockers.blogspot.com/2009/04/seluruh-dokumen-di-ilmukomputer.html</feedburner:origLink></item></channel></rss>

