Arduino in Action.Pdf

Total Page:16

File Type:pdf, Size:1020Kb

Arduino in Action.Pdf IN ACTION Martin Evans Joshua Noble Jordan Hochenbaum MANNING www.it-ebooks.info Arduino in Action www.it-ebooks.info www.it-ebooks.info Arduino in Action MARTIN EVANS JOSHUA NOBLE JORDAN HOCHENBAUM MANNING SHELTER ISLAND www.it-ebooks.info For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 261 Shelter Island, NY 11964 Email: [email protected] ©2013 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Photographs in this book were created by Martin Evans and Jordan Hochenbaum, unless otherwise noted. Illustrations were created by Martin Evans, Joshua Noble, and Jordan Hochenbaum. Fritzing (fritzing.org) was used to create some of the circuit diagrams. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine. Manning Publications Co. Development editor: Cynthia Kane 20 Baldwin Road Copyeditor: Andy Carroll PO Box 261 Proofreader: Katie Tennant Shelter Island, NY 11964 Typesetter: Dennis Dalinnik Cover designer: Marija Tudor ISBN: 9781617290244 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – MAL – 19 18 17 16 15 14 13 www.it-ebooks.info brief contents PART 1 GETTING STARTED . ......................................................1 1 ■ Hello Arduino 3 2 ■ Digital input and output 21 3 ■ Simple projects: input and output 41 PART 2 PUTTING ARDUINO TO WORK ......................................59 4 ■ Extending Arduino 61 5 ■ Arduino in motion 81 6 ■ Object detection 114 7 ■ LCD displays 129 8 ■ Communications 152 9 ■ Game on 188 10 ■ Integrating the Arduino with iOS 216 11 ■ Making wearables 244 12 ■ Adding shields 261 13 ■ Software integration 278 v www.it-ebooks.info www.it-ebooks.info contents preface xv acknowledgments xvii about this book xix about the cover illustration xxii PART 1 GETTING STARTED. ...........................................1 Hello Arduino 3 1 1.1 A brief history of the Arduino 4 1.2 The Arduino hardware 5 Arduino Uno 5 ■ Arduino Duemilanove 5 Arduino Ethernet 6 ■ Arduino Mega 6 Other Arduino boards 7 ■ Attack of the clones 8 Getting an Arduino 9 1.3 Setting up your working environment 10 Software for Arduino 10 ■ Basic hardware setup 10 Your Arduino toolbox 11 1.4 Make something happen! 11 Your first blinking LED 11 ■ Sketch to make an LED blink 12 Connecting everything 12 ■ Uploading and testing 13 vii www.it-ebooks.info viii CONTENTS 1.5 Touring the IDE 14 The main editor 14 ■ Serial monitor 15 ■ Catching errors 16 Process 16 1.6 Anatomy of a sketch 17 A routine called setup 17 ■ The endless loop 18 1.7 Commenting code 18 1.8 Summary 20 Digital input and output 21 2 2.1 Getting started 21 Using a breadboard 22 ■ Circuit diagram 22 Adding the LEDs 24 ■ Connecting the hardware 24 Sketch to flash five LEDs 25 ■ Upload and test 27 2.2 Gaining control 27 Circuit diagram 27 ■ Connections 28 Interrupts butting in 29 ■ Sketch to control the LEDs with a push button 30 ■ Upload and test 32 ■ Time for a break 32 Upload and test 33 2.3 Reaction tester 33 Circuit diagram 33 ■ Connections 33 ■ Sketch to test reaction speed 33 ■ Upload and test 36 2.4 Reactometer: Who really has the fastest reaction time? 37 Sketch to measure reaction speed 37 ■ Upload and test 38 2.5 Summary 39 Simple projects: input and output 41 3 3.1 Time to get analog 42 What’s the difference between analog and digital? 42 Reading a potentiometer 43 ■ Connecting the hardware 43 Sketch to read a potentiometer 44 ■ Upload and test 45 3.2 A piezoelectric transducer 46 The circuit diagram 47 ■ Connecting the hardware 48 Sketch to measure output from a piezoelectric transducer 49 Upload and test 51 ■ Circuit with added speaker 51 Connecting the hardware 51 ■ Sketch to generate a tone 53 Upload and test 53 www.it-ebooks.info CONTENTS ix 3.3 Making a pentatonic or five-tone keyboard 54 Circuit diagram 54 ■ Connecting the hardware 54 Sketch to create a pentatonic keyboard 56 ■ Upload and test 57 3.4 Summary 58 PART 2 PUTTING ARDUINO TO WORK ..........................59 Extending Arduino 61 4 4.1 Extending the Arduino with libraries 62 4.2 Core library 62 4.3 Standard libraries 63 Test-driven development with ArduinoTestSuite 63 Storing values using EEPROM 64 ■ Storing more data with SD 65 ■ Get connected with Ethernet 67 Serial communication with Firmata 68 ■ Displaying data using the LiquidCrystal library 69 ■ Controlling a servo motor 70 ■ Turning a stepper motor 70 Communicating with SPI peripherals 71 Communicating with the two-wire interface 72 Get more serial ports with SoftwareSerial 74 4.4 Contributed libraries 75 Installing a new library 76 4.5 Expanding the Arduino with shields 76 Common shields 77 ■ Gotchas: will it work with my Arduino? 80 4.6 Summary 80 Arduino in motion 81 5 5.1 Getting up to speed with DC motors 82 Stopping and starting 83 ■ Sketch to turn a small DC motor on and off 84 ■ Connecting the hardware 84 Upload and test 86 5.2 Speed control and reverse 87 PWM to the rescue 87 ■ The H-bridge for motor control 89 The L293D dual H driver 90 ■ Connecting the hardware 91 Sketch to control a motor with an L293D 92 Upload and test 93 ■ Changing motor speed 93 Upload and test 94 www.it-ebooks.info x CONTENTS 5.3 Stepper motors: one step at a time 94 Unipolar or bipolar 95 ■ Connecting the hardware 98 Stepper motor library functions 99 ■ Sketch to control a stepper motor 101 ■ Upload and test 101 5.4 Try not to get in a flap with servomotors 102 Controlling a servomotor 102 ■ Servomotor functions and methods 103 ■ Sketch to control a servomotor 104 Connecting the hardware 105 ■ Upload and test 105 5.5 Mighty power comes in small packages with brushless DC motors 106 Why go brushless 106 ■ Gaining control 107 ■ Sketch to control a brushless motor 108 ■ Connecting the hardware 109 Upload and test 110 ■ Reverse 110 ■ Sketch to reverse a brushless motor 110 ■ Connecting the hardware 111 Upload and test 111 5.6 The motor control shield for more motors 112 5.7 Summary 113 Object detection 114 6 6.1 Object detection with ultrasound 115 Choosing an ultrasonic sensor 115 ■ Three wires or four 116 Sketches for ultrasonic object finding 116 ■ Connecting the hardware 118 ■ Upload and test 118 6.2 Infrared for range finding 119 Infrared and ultrasound together 120 ■ The Sharp GP2D12 range finder 121 ■ Nonlinear algorithm for calculating distance 121 ■ Sketch for range finding 122 Connecting the hardware 123 ■ Upload and test 123 6.3 Passive infrared to detect movement 124 Using the Parallax PIR sensor 125 ■ Sketch for infrared motion detection 125 ■ Connecting the hardware 127 Upload and test 128 6.4 Summary 128 LCD displays 129 7 7.1 Introduction to LCDs 130 String variables: String type vs. char type 130 7.2 Parallel character LCDs: the Hitachi HD44780 133 4-bit or 8-bit? 133 ■ Library and functions 133 Circuit diagram 134 ■ Connecting everything up www.it-ebooks.info CONTENTS xi in 4-bit mode 135 ■ Sketch for writing to the Hitachi HD44780 137 ■ Upload and test 138 7.3 Serial LCD weather station 139 Serial vs. parallel LCDs 139 ■ SerLCD library and functions 139 ■ The Maxim IC DS18B20 temperature sensor 141 ■ OneWire and DallasTemperature libraries 141 ■ Circuit diagram 142 ■ Connecting everything up 143 ■ Sketch for an LCD weather station 144 Upload and test 145 7.4 Graphic LCDs: the Samsung KS0108 GLCD 146 Library and functions 146 ■ Circuit diagram 147 Connecting everything up 148 ■ Sketch for drawing to a GLCD 150 ■ Upload and test 151 7.5 Summary 151 Communications 152 8 8.1 Ethernet 153 The Ethernet library 154 ■ Ethernet Shield with SD data card 155 8.2 Arduino web server 156 Setting up the server 156 ■ Sketch for creating a web server 158 Upload and test 159 ■ Troubleshooting 159 8.3 Tweet tweet: talking to Twitter 159 Of Twitter and tokens 160 ■ Libraries and functions 160 Circuit diagram and connecting the hardware 161 ■ Sketch for the Twitter button-press tweeter 161 ■ Upload and test 163 8.4 Wi-Fi 163 Arduino Wifi Shield 164 ■ WiFi library and functions 165 Gestures: wireless accelerometers 167 ■ Connecting the hardware 168 ■ Sketch for Bluetooth communication 168 Upload and test 171 8.5 Bluetooth wireless 171 ArduinoBT 172 ■ Adding Bluetooth 172 Establishing a Bluetooth connection 173 Sketch for Bluetooth communication 174 8.6 Serial peripheral interface (SPI) 175 SPI library 176 ■ SPI devices and digital potentiometers 176 Circuit diagram and connecting the hardware 177 Sketch for a digital LED dimmer 178 www.it-ebooks.info xii CONTENTS 8.7 Data logging 179 Types of memory 180 ■ SD cards and SD library 180 Sketch for an SD card sensor logger 181 8.8 Cosm 182 Sign up for an account
Recommended publications
  • Smart Home Automation with Linux Smart
    CYAN YELLOW MAGENTA BLACK PANTONE 123 C BOOKS FOR PROFESSIONALS BY PROFESSIONALS® THE EXPERT’S VOICE® IN LINUX Companion eBook Available Smart Home Automation with Linux Smart Dear Reader, With this book you will turn your house into a smart and automated home. You will learn how to put together all the hardware and software needed for Automation Home home automation, to control appliances such as your teakettle, CCTV, light switches, and TV. You’ll be taught about the devices you can build, adapt, or Steven Goodwin, Author of hack yourself from existing technology to accomplish these goals. Cross-Platform Game In Smart Home Automation with Linux, you’ll discover the scope and possi- Programming bilities involved in creating a practical digital lifestyle. In the realm of media and Game Developer’s Open media control, for instance, you’ll learn how you can read TV schedules digitally Source Handbook and use them to program video remotely through e-mail, SMS, or a web page. You’ll also learn the techniques for streaming music and video from one machine to another, how to give your home its own Twitter and e-mail accounts for sending automatic status reports, and the ability to remotely control the home Smart Home lights or heating system. Also, Smart Home Automation with Linux describes how you can use speech synthesis and voice recognition systems as a means to converse with your household devices in new, futuristic, ways. Additionally, I’ll also show you how to implement computer-controlled alarm clocks that can speak your daily calendar, news reports, train delays, and local with weather forecasts.
    [Show full text]
  • WORLDSPECIAL REPORT the Tech Behind Bitcoin Has Been Released
    THE INSATIABLE DO YOU NEED THE BLOCK-CHAINING THE MONEY MINES BITCOIN BEAST A BLOCKCHAIN? OF WALL STREET OF MONGOLIA Cryptocurrency’s Find out in seconds A new platform for How watts coming energy crisis with our handy guide trading in the trillions become bitcoins P. 36 P. 38 P. 40 P. 46 FOR THE TECHNOLOGY INSIDER | 10.17 BLOCK- CHAIN WORLD SPECIAL REPORT The tech behind Bitcoin has been released into the wild. Here’s how it’s going to change the landscape P. 24 SUPERMICRO® BigTwin® The IT Industry’s Highest Performing Twin Multi-Node System 2U Multi-Node System Supporting • A Full Range of Processors Up to the highest performing 205 watt CPUs • Maximum Memory 3TB 24 DIMMs per node • All-Flash NVMe 24 All Flash NVMe or Hybrid NVMe/SAS3 drives • Double the I/O Capacity Three PCI-E 3.0 x16 options per node • Supports Intel® Xeon® Scalable Processors Intel Inside®. Powerful Productivity Outside. Learn more at supermicro.com/GPU © Super Micro Computer, Inc. Specifications subject to change without notice. Intel, the Intel logo, Xeon, and Xeon Inside are trademarks or registered trademarks of Intel Corporation in the U.S. and/or other countries. 10.17 Special Report: BLOCKCHAIN WORLD The Blossoming 26 Blockchains: How They 45 Blockchain Lingo Work and Why They’ll Change Your cheat sheet for all things blockchain. of Blockchain the World 24 Enthusiasts The technology behind Bitcoin could touch every 46 Photo Essay: are sure that transaction you ever make. By Morgen E. Peck The Bitcoin Mines of China This Bitcoin operation in Inner Mongolia uses blockchain 36 Feeding the sophisticated semiconductors to turn cheap, dirty technology is Blockchain Beast energy into digital cash.
    [Show full text]
  • A Practitioners Guide to the Forensic Investigation of Xbox 360 Gaming Consoles
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Embry-Riddle Aeronautical University 2011 Annual ADFSL Conference on Digital Forensics, Security and Law Proceedings May 25th, 11:00 AM A Practitioners Guide to the Forensic Investigation of Xbox 360 Gaming Consoles Ashley L. Podhradsky Drexel University Rob D’Ovidio Drexel University Cindy Casey Drexel University Follow this and additional works at: https://commons.erau.edu/adfsl Part of the Computer Engineering Commons, Computer Law Commons, Electrical and Computer Engineering Commons, Forensic Science and Technology Commons, and the Information Security Commons Scholarly Commons Citation Podhradsky, Ashley L.; D’Ovidio, Rob; and Casey, Cindy, "A Practitioners Guide to the Forensic Investigation of Xbox 360 Gaming Consoles" (2011). Annual ADFSL Conference on Digital Forensics, Security and Law. 9. https://commons.erau.edu/adfsl/2011/wednesday/9 This Peer Reviewed Paper is brought to you for free and open access by the Conferences at Scholarly Commons. It has been accepted for inclusion in Annual ADFSL Conference on Digital Forensics, Security and Law by an (c)ADFSL authorized administrator of Scholarly Commons. For more information, please contact [email protected]. ADFSL Conference on Digital Forensics, Security and Law, 2011 A PRACTITIONERS GUIDE TO THE FORENSIC INVESTIGATION OF XBOX 360 GAMING CONSOLES Dr. Ashley L Podhradsky Drexel University Dr. Rob D’Ovidio Drexel University Cindy Casey Drexel University ABSTRACT Given the ubiquitous nature of computing, individuals now have nearly 24-7 access to the internet. People are not just going online through traditional means with a PC anymore, they are now frequently using nontraditional devices such as cell phones, smart phones, and gaming consoles.
    [Show full text]
  • MEADES Phd Thesis
    PLAYING AGAINST THE GRAIN RHETORICS OF COUNTERPLAY IN CONSOLE BASED FIRST-PERSON SHOOTER VIDEOGAMES A thesis submitted for the degree of Doctor of Philosophy By Alan Frederick Meades School of Arts, Brunel University February 2013 1 ABSTRACT Counterplay is a way of playing digital games that opposes the encoded algorithms that define their appropriate use and interaction. Counterplay is often manifested within the social arena as practices such as the creation of incendiary user generated content, grief-play, cheating, glitching, modding, and hacking. It is deemed damaging to normative play values, to the experience of play, and detrimental to the viability of videogames as mainstream entertainment products. Counterplay is often framed through the rhetoric of transgression as pathogen, as a hostile, infectious, threatening act. Those found conducting it are subject to a range of punishments ranging from expulsion from videogames to criminal conviction. Despite the steps taken to manage counterplay, it occurs frequently within contemporary videogames causing significant disruption to play and necessitating costly remedy. This thesis argues that counterplay should be understood as a practice with its own pleasures and justifying rhetorics that problematise the rhetoric of pathogen and attenuate the threat of penalty. Despite the social and economic significance of counterplay upon contemporary videogames, relatively little is known of the practices conducted by counterplayers, their motivations, or the rhetorics that they deploy to justify and contextualise their actions. Through the use of ethnographic approaches, including interview and participant observation, alongside the identification and application of five popular rhetorics of transgression, this study aims to expose the meanings and complexities of contemporary counterplay.
    [Show full text]
  • Textbook's Xbox 360 Firmware Tutorial
    Textbook’s Xbox 360 Firmware Tutorial www.360mods.net Table of Contents Introduction Warnings Cost SATA Compatibility VIA SATA Drive Brand BenQ Samsung Opening The Xbox 360 MS25 or MS28 MS25 Downloading The Firmware iPrep (USB) Xbox 360 and PC Connections Booting From USB Flashing Your Drive (USB) iPrep (NTFS4DOS CD) Xbox 360 and PC Connections Flashing Your Drive (NTFS4DOS CD) iPrep (Floppy) Xbox 360 and PC Connections Flashing Your Drive (Floppy) MS28 Bad Flash Method (solderless) Xbox 360 and PC Connection Flashing VCC Switch Method (requires soldering) Xbox 360 and PC Connection Flashing Updating Firmware Method 1 – Firmware Overwrite Method 2 – The “make” Command Method 3 – Repeat Process Disabling FirmGuard Restoring to Original Firmware Hitachi Opening The Xbox 360 Xbox 360 and PC Connection ModeB Slax CD 2-Wire Trick Connectivity Kits Hotswap ModeB Indicators Detecting The Drive in Windows Version 46/47/59 Drives Installing “CMD Here” Powertoy Downloading The Firmware Restoring The Drive (if previously flashed) Flashing The Drive Version 0078FK Drives Making Backups of Your Xbox 360 Games Using a Kreon Drive Using the Xbox 360 Samsung Drive WxRipper Method Bitsetting to DVD-ROM Burning With IMGBurn Burning With CloneCD Downloads Thanks Introduction The Xbox 360 DVD-ROM drive firmware hack is currently the only modification or hack available for the Xbox 360 that allows you to play properly created backup copies of Xbox 360 games. The firmware hack does NOT allow homebrew programs to run and does NOT bypass region protection. If a video game is locked to a particular region, then it will only play on an Xbox 360 of that same region.
    [Show full text]
  • Smart Home Automation with Linux and Raspberry Pi
    This book was purchased by [email protected] For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them. Contents at a Glance About the Author ................................................................................................................ xv About the Technical Reviewers ........................................................................................ xvii Acknowledgments ............................................................................................................. xix Introduction ....................................................................................................................... xxi ■ Chapter 1: Appliance Control: Making Things Do Stuff .....................................................1 ■ Chapter 2: Appliance Hacking: Converting Existing Technology .....................................53 ■ Chapter 3: Media Systems: Incorporating the TV and the HiFi ........................................87 ■ Chapter 4: Home Is Home: The Physical Practicalities ..................................................123 ■ Chapter 5: Communication: Humans Talk. Computers Talk ...........................................153 ■ Chapter 6: Data Sources: Making Homes Smart ...........................................................189 ■ Chapter 7: Control Hubs: Bringing It All Together ..........................................................217 ■ Chapter 8: Raspberry Pi ................................................................................................275
    [Show full text]
  • A Surveillant Platform Study of Microsoft's Xbox
    Playing Spy Games: a Surveillant Platform Study of Microsoft’s Xbox 360 by Alexander Cybulski A thesis submitted in conformity with the requirements for the degree of Master’s of Information Faculty of Information University of Toronto © Copyright by Alexander Dean Cybulski 2014 Playing Spy Games: A Surveillant Platform Study of Microsoft’s Xbox 360 Alexander Dean Cybulski Master’s of Information Faculty of Information University of Toronto 2014 Abstract This thesis, a platform study of Microsoft's videogame console the Xbox 360, demonstrates how one of the defining traits of the videogame platform's design and architecture is pervasive surveillance of its users. By applying William Bogard’s (1996) theory of surveillant “enclosures,” this thesis will explain how the Xbox 360 uses a panopoly of methods and technologies to watch users and shape their use of the videogame system, forming them as easily governed subjects. In support of this argument, this thesis will examine not only the hardware and software layers of the Xbox 360, but also peripheral hardware and networks including the motion tracking sensor the Kinect and Xbox Live, the videogame console’s online network. Of particular interest to this platform study will be an examination of how each of these layers performs surveillance, and how they collectively perform a project of governance over videogame players. References Bogard, William. (1996). The Simulation of Surveillance: Hypercontrol in Telematic Societies. Cambridge: Cambridge University Press. ii Acknowledgments This thesis sprang from a small class assignment: evaluate a specific technology and critique its privacy impact on users. What began as a class project turned into a thesis, a project which has taken two years to realize.
    [Show full text]
  • Modern Game Console Exploitation
    Modern Game Console Exploitation Eric DeBusschere, Mike McCambridge Abstract The goal of this paper is to provide a high-level, technical summary of the significant ex- ploitations of the Xbox 360 and PlayStation 3. Few academic resources discussing console exploitation exist, especially resources considering the current generation systems, and thus a technical survey of successful exploitations represents a significant contribution to the academic community. The security of both the Xbox 360 and PS3 are discussed, along with the three main Xbox 360 exploits: the King Kong glitch/JTAG exploit, Timing Attack, and the Glitch Attack, as well as the three significant PS3 hacks: Hypervisor Exposure through glitching, PS Jailbreak, and the Root Key Discovery. 1 Introduction Although the successful exploitation of the original Xbox drew considerable media attention and paved the way for sophisticated homebrew software developed by a large community of hackers, pirates, and Linux enthusiasts, modifying or hacking consoles of the current generation has never had the same appeal. Perhaps it is because modern gamers highly value the ability to play online, or the higher degree of technical expertise required to perform current modifications, or maybe the emulators, roms, and homebrew software just cannot compare with contemporary games and entertainment. Whatever the reason, the hacking of current generation consoles has been largely ignored, even in academic communities, despite the fact that modern exploitations are far more complex and interesting, and are mounted against far more sophisticated security systems, than ever before. 2 Modern Console Exploitation 2.1 Security Gaming consoles of the current generation were built from the ground up with security as the foremost concern.
    [Show full text]
  • Outlaw Community Innovations
    A Service of Leibniz-Informationszentrum econstor Wirtschaft Leibniz Information Centre Make Your Publications Visible. zbw for Economics Schulz, Celine; Wagner, Stefan Working Paper Outlaw Community Innovations Discussion Paper, No. 2008-08 Provided in Cooperation with: University of Munich, Munich School of Management Suggested Citation: Schulz, Celine; Wagner, Stefan (2008) : Outlaw Community Innovations, Discussion Paper, No. 2008-08, Ludwig-Maximilians-Universität München, Fakultät für Betriebswirtschaft, München, http://dx.doi.org/10.5282/ubm/epub.4678 This Version is available at: http://hdl.handle.net/10419/104495 Standard-Nutzungsbedingungen: Terms of use: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Documents in EconStor may be saved and copied for your Zwecken und zum Privatgebrauch gespeichert und kopiert werden. personal and scholarly purposes. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle You are not to copy documents for public or commercial Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich purposes, to exhibit the documents publicly, to make them machen, vertreiben oder anderweitig nutzen. publicly available on the internet, or to distribute or otherwise use the documents in public. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, If the documents have been made available under an Open gelten abweichend von diesen Nutzungsbedingungen die in der dort Content Licence (especially Creative
    [Show full text]
  • Building an Xbox 360 Emulator, Part 1: Feasibility/CPU Questions
    Building an Xbox 360 Emulator, part 1: Feasibility/CPU Questions Emulators are complex pieces of software and often push the bounds of what’s possible by nature of having to simulate different architectures and jump through crazy hoops. When talking about the 360 this gets even crazier, as unlike when emulating an SNES the Xbox is a thoroughly modern piece of hardware and in some respects is still more powerful than most mainstream computers. So there’s the first feasibility question: is there a computer powerful enough to emulate an Xbox 360? (sneak peak: I think so) Now assume for a second that a sufficiently fast emulator could be built and all the hardware exists to run it: how would one even know what to emulate? Gaming hardware is almost always completely undocumented and very special-case stuff. There are decades-old systems that are just now being successfully emulated, and some may never be possible! Add to the potential hardware information void all of the system software, usually locked away under super strong NDA, and it looks worse. It’s amazing what a skilled reverse engineer can do, but there are limits to everything. Is there enough information about the Xbox 360 to emulate it? (sneak peak: I think so) Research The Xbox 360 is an embedded system, geared towards gaming and fairly specialized – but at the end of the day it’s derived from the Windows NT kernel and draws with DirectX 9. The hardware is all totally custom (CPU/GPU/memory system/etc), but roughly equivalent to mainstream hardware with a 64-bit PPC chip like those shipped in Macs for awhile and an ATI video chipset not too far removed from a desktop card.
    [Show full text]
  • Investigating Evidence Produced by Online Session Spoofing: the Xbox
    Investigating Evidence Produced by Online Session Spoofing: The Xbox 360 Nicholas Robinson, BCIS A thesis submitted to the faculty of design and creative technologies Auckland University of Technology in partial fulfillment of the requirements for the degree of Master of Forensic Information Technology School of Computer and Mathematical Sciences Auckland, New Zealand 2014 ii Declaration I hereby declare that this submission is my own work and that, to the best of my knowledge and belief, it contains no material previously published or written by another person nor material which to a substantial extent has been accepted for the qualification of any other degree or diploma of a University or other institution of higher learning, except where due acknowledgement is made in the acknowledgements. ........................... Nicholas Robinson iii Abstract Video games and the consoles upon which they are played have become progressively popular in recent times, however the body of work in regards to how they should be handled forensically remains surprisingly lacking. Furthermore, these consoles rely at least in part on a content distribution method known as digital distribution, wherein they offer digital goods and services to the consumer via various forms of digital storefront, as is also becoming quite common amongst the video game playing users of the PC. The protections surrounding these storefronts, beyond the encryptions used for communications and transactions, are typically account-based; this however leaves both the user and the owner of the distribution services open to a type of attack known as session spoofing, wherein an attacker masks their identity using a pre-existing and active ‘session’ of communication between a given service and a victim user.
    [Show full text]
  • Thwarting Control-Flow Attacks with ARM Pointer Authentication Bypass Additional Countermeasures Implemented in Software
    FIPAC: Thwarting Fault- and Software-Induced Control-Flow Attacks with ARM Pointer Authentication Robert Schilling, Pascal Nasahl and Stefan Mangard Graz University of Technology, Graz, Austria [email protected] Abstract. With the improvements of computing technology, more and more applications in the Internet-of-Things, mobile devices, automotive, or industrial areas embed powerful ARM processors into their devices. These systems can be attacked by redirecting the control-flow of a program to bypass critical pieces of code such as privilege checks or signature verifications or to perform other fault attacks on applications, operating systems, or security mechanisms like secure boot. Control-flow hijacks can be performed using classical software vulnerabilities, physical fault attacks, or software-induced fault attacks, such as CLKscrew or Plundervolt. To cope with this threat and to protect the control-flow, dedicated countermeasures are needed. To counteract control-flow hijacks, control-flow integrity (CFI) aims to be a generic solution. However, software-based CFI protection schemes typically either protect against software or fault attacks, but not against both. While hardware-assisted CFI schemes can mitigate both types of attacks, they require extensive hardware modifications. As hardware changes are unrealistic for existing ARM architectures, a wide range of systems remains unprotected and vulnerable to control-flow attacks. In this work, we present FIPAC, an efficient software-based CFI scheme protecting the execution at basic block granularity of upcoming ARM-based devices against software and fault attacks. FIPAC exploits ARM pointer authentication of recent ARMv8.6-A architectures to implement a cryptographically signed control-flow graph. We cryptograph- ically link the correct sequence of executed basic blocks to enforce control-flow integrity at this granularity at runtime.
    [Show full text]