Showing posts from June, 2015

8086 program code for snake game

org 100hjmp starts_size equ 7snake dw s_size dup(0)tail dw ?left equ 4bhright equ 4dhup equ 48hdown equ 50hcur_dir db rightwait_time dw 0start:mov ah, 1mov ch, 2bhmov cl, 0bhint 10hgame_loop:mov al, 0mov ah, 05hint 10hmov dx, snake[0]mov ah, 02hint 10hmov al, '*'mov ah, 09hmov bl, 0ehmov cx, 1int 10hmov ax, snake[s_size * 2 - 2]mov tail, axcall move_snakemov dx, tailmov ah, 02hint 10hmov al, ' 'mov ah, 09hmov bl, 0ehmov cx, 1int 10hcheck_for_key:mov ah, 01hint 16hjz no_keymov ah, 00hint 16hcmp al, 1bhje stop_gamemov cur_dir, ahno_key:mov ah, 00hint 1ahcmp dx, wait_timejb check_for_keyadd dx, 4mov wait_time, dxjmp game_loopstop_game:mov ah, 1mov ch, 0bhmov cl, 0bhint 10hretmove_snake proc nearmov ax, 40hmov es, ax mov di, s_

Use of Software Reverse Engineering

Finding malicious code: Many virus and malware detection techniques use reverse engineering to understand how abhorrent code is structured and functions. Through Reversing, recognizable patterns emerge that can be used as signatures to drive economical detectors and code scanners. Discovering unexpected flaws and faults: Even the well-designed system can have holes that result from the nature of our “forward engineering” development techniques. Reverse engineering can help identify flaws and faults before they become mission-critical software failures. Finding the use of others’ code :   In supporting the cognizant use of intellectual property, it is important to understand where protected code or techniques are used in applications. Reverse engineering techniques can be used to detect the presence or absence of software elements of concern. Finding the use of shareware and open source code where it was not intended to be used. In the opposite of the infringing code concern, if a pro

Difference between Dynamic programming and Greedy approach

    In Greedy approach consider greedy choice property, we can make whatever choice seems best at the moment and then solve the sub-problems that arise later. The choice made by a greedy algorithm may depend on choices made so far but not on future choices or all the solutions to the sub-problem. It iteratively makes one greedy choice after another, reducing each given problem into a smaller one. In other words, a greedy algorithm never reconsiders its choices. This is the main difference from dynamic programming, which is exhaustive and is guaranteed to find the solution . After every stage, dynamic programming makes decisions based on all the decisions made in the previous stage, and may reconsider the previous stage’s algorithmic path to solution. For example, let’s say that you have to get from point A to point B as fast as possible, in a given city, during rush hour. A dynamic programming algorithm will look into the entire traffic report, looking into all possible combinations o

Run C program on Android Device - C Programming Tutorial

In this c programming tutorial we are going to see How To run C programs on your android phone you need “ Terminal IDE ” android app installed on your phone. Click here to install this app from play store . Once you have installed Terminal IDE , open it and now will see six buttons there on screen, from those buttons choose Install System , and then scroll down check the checkbox Overwrite ALL and then click Install System . By doing this some basic C / binary system files get installed in your phone (in applications private memory) Next Step is to install gcc on your phone; it will take up to 70MB memory on your phone, to install gcc , go to the main options in app then terminal screen will be opened, type install_gcc on terminal and hit enter from your android keyboard now gcc is installed on your mobile. To test it type cd   ~/system/src/c_examples/chello/ on terminal and hit enter , this will switch the current working directory of terminal to ~/system/src/c_examples/chello/.