<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Little Fighter Empire - Forums - Tutorials]]></title>
		<link>https://lf-empire.de/forum/</link>
		<description><![CDATA[Little Fighter Empire - Forums - https://lf-empire.de/forum]]></description>
		<pubDate>Sat, 14 Nov 2026 06:19:57 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[I feel like writing a tutorial - Taking requests]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=9420</link>
			<pubDate>Wed, 01 Oct 2014 22:18:32 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=284">Som1Lse</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=9420</guid>
			<description><![CDATA[As the title says I feel like writing a tutorial about programming, but I don't have an exact idea of what I want to write about, so I'll be taking requests.<br />
Basically write a post in this thread and I'll pick some and try to write a tutorial on it, so if there is something in programming you find hard to grasp or want to learn about, then now is the time ask.<br />
<br />
Todo-list: <br />
<ol type="1" class="mycode_list"><li>The stack<br />
</li>
<li>Threading<br />
</li>
</ol>
]]></description>
			<content:encoded><![CDATA[As the title says I feel like writing a tutorial about programming, but I don't have an exact idea of what I want to write about, so I'll be taking requests.<br />
Basically write a post in this thread and I'll pick some and try to write a tutorial on it, so if there is something in programming you find hard to grasp or want to learn about, then now is the time ask.<br />
<br />
Todo-list: <br />
<ol type="1" class="mycode_list"><li>The stack<br />
</li>
<li>Threading<br />
</li>
</ol>
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[TUT] Object-Oriented Programming: A Small Opening]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=6813</link>
			<pubDate>Fri, 29 Jul 2011 17:02:05 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=2024">Eddie</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=6813</guid>
			<description><![CDATA[Hello there members of LFE! It's been quite some time since I posted a thread and I believe a decent tutorial, as such I've decided to make a small tutorial on understanding Object-Oriented Programming and some of it's concepts to allow any of you budding programmers to get a little bit of an easier start, especially during Bamboori's current game making competition.<br />
<br />
So, what do you expect to learn from a tutorial such as this?<br />
<br />
You will learn from this tutorial (provided you actually go through it):<br />
- What is Object-Oriented Programming<br />
- Why would Object-Oriented Programming be used<br />
- What popular examples of programming languages use it<br />
- What an Object is<br />
- What a Class is<br />
<br />
Now, in this tutorial you will in time see sections of code. This code is Java because I feel that it is a fairly easy language to understand and won't make you brick it before you've even begun. Later on I will add a post telling you that I have editted the main document of this tutorial to also include C++ or C. This may take a little while longer, but it will be placed there for those of you learning or remembering the C or C++ languages. I have not put any code in straight away so that you may understand the principles without delving too far into programming too quickly.<br />
<br />
So, lets make a start on this tutorial...<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">What is Object-Oriented Programming?</span></span></span><br />
<br />
Programming can be split into two general groups: Procedural and Object-Oriented. Throughout this tutorial I will use "OOP" for Object-Oriented Programming and "PP" for Procedural Programming. The difference between the two is that one focuses on the "objects" that are to be dealt with and the other focuses on the "actions" or "logic".<br />
<br />
As the names suggest, Object-Oriented programming focuses around the "objects" and Procedural focuses on the "actions". In Object-Oriented programming, what you really want to know about is the "object", rather than what is needed to manipulate it.<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">Why would Object-Oriented Programming be used?</span></span></span><br />
<br />
OOP is generally used because it makes the programming that much more manageable. In teams of programmers, each team can work on a specific "object". In PP, it'd be a lot harder to divide the work up into teams and is probably better for a solo effort or person to manage.<br />
<br />
OOP can also be a lot faster to produce programs, this because of the less instances where "inaccuracies" or "errors" may be found in the coding or file, whereas with PP the files are generally a lot longer and therefore have a higher chance of holding these "inaccuracies" or "errors". With OOP you can search for the relevant file and filter through it far more easily than you can PP to find these, because they are that much smaller.<br />
<br />
You will find such things as "Classes" in OOP which you would not in most cases of PP. Classes will only contain data that is relevant to it, and so programs will not have to sift through files that are not responsible for the data or are not meant to be used. This will limit data corruption and can heighten the security of the system. The data is described as "hidden". These "Classes" are also not just reusable by the program that you have created, but by other programs that involve them. This means that you can create something that can be used by multiple different programs, thus saving a large bundle of time.<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">What popular examples of Programming Languages use Object-Oriented Programming?</span></span></span><br />
<br />
Now we're making good progress, and you're about to find some information that will encourage you to learn more OOP. These popular examples use OOP:<br />
- Java<br />
- C++<br />
- Python<br />
- VisualBasic.NET<br />
- Ruby<br />
<br />
What do you know about these programming languages? For starters you should probably know that some of these are what most programmers use today to create brilliant games for your computer. Yes, the games you know and love.<br />
<br />
How many of you have played Minecraft? Did you know that it is entirely coded in Java? And how many of you possess a copy of 3D games such as Mass Effect and Mass Effect 2, particularly on the computer? These games would have been coded in C or C++, much like LITTLE FIGHTER 2!<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">What is an Object?</span></span></span><br />
<br />
Time for us to get into the nitty gritty of the tutorial, the actual important part. If you look around you right now, you will find plenty of objects around you. Tables, chairs, the TV, your computer, all of these are objects.<br />
<br />
Pretty simple right? Now lets dig a little deeper and progress into an object...<br />
<br />
Objects in the real world have something known as a "state" and a "behaviour". I'm now going to use your computer as an example. The "states" your computer might have are; Make, colour, model, style (laptop or desktop), on, off, current brightness, current volume. Now, what "behaviours" does it have? Here are a few examples of behaviours; Turn on, turn off, increase brightness, decrease brightness, increase volume, decrease volume.<br />
<br />
Now look about your environment and list 3 objects, with some of their states and with some of their behaviours. This should help you get to terms with objects.<br />
<br />
In terms of software, these ideas in OOP are exactly the same as in the Real World. They have a state and they also have behaviours. An objects state is stored in "fields" or "variables" (depending on what programming language you use) and it's behaviour in "methods" or "functions" (also depending on what programming language you use). These "methods" or "functions" perform or "operate" on a programs state to change or modify it.<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">What is a Class?</span></span></span><br />
<br />
To sum up classes in a fairly simple and easy to understand word, a class is a "Blueprint" from which objects are created. There are many different variations of the same object in the world, for example bikes. Every bike is made out of the same base components; gears, pedals, wheels, seat and frame.<br />
<br />
Because of the variance of these components between different bikes, your bike (as an object) is an "instance" of the class of bikes. It is just one in a wide variety of bikes.<br />
<br />
Now I'm going to show you a basic example of a Class, without going indepth into the coding of it for now:<br />
<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;JAVA-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="java" style="font-family&#58;monospace;"><span style="color&#58; #000000; font-weight&#58; bold;">class</span> Bike <span style="color&#58; #009900;">&#123;</span>
&nbsp;
       <span style="color&#58; #000066; font-weight&#58; bold;">int</span> gear <span style="color&#58; #339933;">=</span> <span style="color&#58; #cc66cc;">1</span><span style="color&#58; #339933;">;</span>
       <span style="color&#58; #000066; font-weight&#58; bold;">int</span> speed <span style="color&#58; #339933;">=</span> <span style="color&#58; #cc66cc;">0</span><span style="color&#58; #339933;">;</span>
&nbsp;
       <span style="color&#58; #000066; font-weight&#58; bold;">void</span> changeGear<span style="color&#58; #009900;">&#40;</span><span style="color&#58; #000066; font-weight&#58; bold;">int</span> newValue<span style="color&#58; #009900;">&#41;</span> <span style="color&#58; #009900;">&#123;</span>
            gear <span style="color&#58; #339933;">=</span> newValue<span style="color&#58; #339933;">;</span>
       <span style="color&#58; #009900;">&#125;</span>
&nbsp;
       <span style="color&#58; #000066; font-weight&#58; bold;">void</span> speedUp<span style="color&#58; #009900;">&#40;</span><span style="color&#58; #000066; font-weight&#58; bold;">int</span> increment<span style="color&#58; #009900;">&#41;</span> <span style="color&#58; #009900;">&#123;</span>
            speed <span style="color&#58; #339933;">=</span> speed <span style="color&#58; #339933;">+</span> increment<span style="color&#58; #339933;">;</span>   
       <span style="color&#58; #009900;">&#125;</span>
&nbsp;
       <span style="color&#58; #000066; font-weight&#58; bold;">void</span> applyBrakes<span style="color&#58; #009900;">&#40;</span><span style="color&#58; #000066; font-weight&#58; bold;">int</span> decrement<span style="color&#58; #009900;">&#41;</span> <span style="color&#58; #009900;">&#123;</span>
            speed <span style="color&#58; #339933;">=</span> speed <span style="color&#58; #339933;">-</span> decrement<span style="color&#58; #339933;">;</span>
       <span style="color&#58; #009900;">&#125;</span>
&nbsp;
       <span style="color&#58; #000066; font-weight&#58; bold;">void</span> printStates<span style="color&#58; #009900;">&#40;</span><span style="color&#58; #009900;">&#41;</span> <span style="color&#58; #009900;">&#123;</span>
            <a href="http&#58;//www&#46;google&#46;com/search?hl=en&amp;q=allinurl%3Asystem+java&#46;sun&#46;com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color&#58; #003399;">System</span></a>&#46;<span style="color&#58; #006633;">out</span>&#46;<span style="color&#58; #006633;">println</span><span style="color&#58; #009900;">&#40;</span><span style="color&#58; #0000ff;">&quot; speed&#58;&quot;</span><span style="color&#58; #339933;">+</span>speed<span style="color&#58; #339933;">+</span><span style="color&#58; #0000ff;">&quot; gear&#58;&quot;</span><span style="color&#58; #339933;">+</span>gear<span style="color&#58; #009900;">&#41;</span><span style="color&#58; #339933;">;</span>
       <span style="color&#58; #009900;">&#125;</span>
<span style="color&#58; #009900;">&#125;</span></pre></div></div>
		</td></tr></table><br />
<br />
This is a Class. As you can imagine and see, the "speed" and "gear" are the bike's state or variables and the "changeGear", "speedUp" and "applyBrakes" are the behaviours or methods after interaction with the outside world.<br />
<br />
For those of you that understand principles of coding, you will notice there is no 'main' included. You will also understand the reason why, considering it is a Class. However for those of you that don't normally delve into programming, or this is more a first time for you, the 'main' method seen in most programs is of severe importance. It is where the program begins reading the code and also where other methods are stored. As the Class is a "Blueprint" for the bike, it can be used in an application, but isn't needed. The actual "Use" of a bike belongs in a "Class".<br />
<br />
<br />
Well, I told you that this would be a rather small tutorial for me. You won't have to scroll down the page so much and you should have found this tutorial fairly easy to understand.<br />
<br />
You should probably look out for the next tutorial on Object-Oriented Programming that is coming soon. It will cover "inheritance" and then will move you into some basic exercises for OOP in which you can actually write some code yourself. It will then go a fair bit more in-depth into the programming side so you can find what you're looking for within program examples or for personal use in developing programs.<br />
<br />
I hope this tutorial has been a fair bit insightful for you all and managed to break programming down into a lot easier bitesize pieces. Unfortunately this is all for me today, I will post up questions for you to answer and more exercises early on next week (Monday more than likely) and will try to finish up the next tutorial for you all.<br />
<br />
<br />
<br />
Have fun everyone,<br />
<br />
Eddie]]></description>
			<content:encoded><![CDATA[Hello there members of LFE! It's been quite some time since I posted a thread and I believe a decent tutorial, as such I've decided to make a small tutorial on understanding Object-Oriented Programming and some of it's concepts to allow any of you budding programmers to get a little bit of an easier start, especially during Bamboori's current game making competition.<br />
<br />
So, what do you expect to learn from a tutorial such as this?<br />
<br />
You will learn from this tutorial (provided you actually go through it):<br />
- What is Object-Oriented Programming<br />
- Why would Object-Oriented Programming be used<br />
- What popular examples of programming languages use it<br />
- What an Object is<br />
- What a Class is<br />
<br />
Now, in this tutorial you will in time see sections of code. This code is Java because I feel that it is a fairly easy language to understand and won't make you brick it before you've even begun. Later on I will add a post telling you that I have editted the main document of this tutorial to also include C++ or C. This may take a little while longer, but it will be placed there for those of you learning or remembering the C or C++ languages. I have not put any code in straight away so that you may understand the principles without delving too far into programming too quickly.<br />
<br />
So, lets make a start on this tutorial...<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">What is Object-Oriented Programming?</span></span></span><br />
<br />
Programming can be split into two general groups: Procedural and Object-Oriented. Throughout this tutorial I will use "OOP" for Object-Oriented Programming and "PP" for Procedural Programming. The difference between the two is that one focuses on the "objects" that are to be dealt with and the other focuses on the "actions" or "logic".<br />
<br />
As the names suggest, Object-Oriented programming focuses around the "objects" and Procedural focuses on the "actions". In Object-Oriented programming, what you really want to know about is the "object", rather than what is needed to manipulate it.<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">Why would Object-Oriented Programming be used?</span></span></span><br />
<br />
OOP is generally used because it makes the programming that much more manageable. In teams of programmers, each team can work on a specific "object". In PP, it'd be a lot harder to divide the work up into teams and is probably better for a solo effort or person to manage.<br />
<br />
OOP can also be a lot faster to produce programs, this because of the less instances where "inaccuracies" or "errors" may be found in the coding or file, whereas with PP the files are generally a lot longer and therefore have a higher chance of holding these "inaccuracies" or "errors". With OOP you can search for the relevant file and filter through it far more easily than you can PP to find these, because they are that much smaller.<br />
<br />
You will find such things as "Classes" in OOP which you would not in most cases of PP. Classes will only contain data that is relevant to it, and so programs will not have to sift through files that are not responsible for the data or are not meant to be used. This will limit data corruption and can heighten the security of the system. The data is described as "hidden". These "Classes" are also not just reusable by the program that you have created, but by other programs that involve them. This means that you can create something that can be used by multiple different programs, thus saving a large bundle of time.<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">What popular examples of Programming Languages use Object-Oriented Programming?</span></span></span><br />
<br />
Now we're making good progress, and you're about to find some information that will encourage you to learn more OOP. These popular examples use OOP:<br />
- Java<br />
- C++<br />
- Python<br />
- VisualBasic.NET<br />
- Ruby<br />
<br />
What do you know about these programming languages? For starters you should probably know that some of these are what most programmers use today to create brilliant games for your computer. Yes, the games you know and love.<br />
<br />
How many of you have played Minecraft? Did you know that it is entirely coded in Java? And how many of you possess a copy of 3D games such as Mass Effect and Mass Effect 2, particularly on the computer? These games would have been coded in C or C++, much like LITTLE FIGHTER 2!<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">What is an Object?</span></span></span><br />
<br />
Time for us to get into the nitty gritty of the tutorial, the actual important part. If you look around you right now, you will find plenty of objects around you. Tables, chairs, the TV, your computer, all of these are objects.<br />
<br />
Pretty simple right? Now lets dig a little deeper and progress into an object...<br />
<br />
Objects in the real world have something known as a "state" and a "behaviour". I'm now going to use your computer as an example. The "states" your computer might have are; Make, colour, model, style (laptop or desktop), on, off, current brightness, current volume. Now, what "behaviours" does it have? Here are a few examples of behaviours; Turn on, turn off, increase brightness, decrease brightness, increase volume, decrease volume.<br />
<br />
Now look about your environment and list 3 objects, with some of their states and with some of their behaviours. This should help you get to terms with objects.<br />
<br />
In terms of software, these ideas in OOP are exactly the same as in the Real World. They have a state and they also have behaviours. An objects state is stored in "fields" or "variables" (depending on what programming language you use) and it's behaviour in "methods" or "functions" (also depending on what programming language you use). These "methods" or "functions" perform or "operate" on a programs state to change or modify it.<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">What is a Class?</span></span></span><br />
<br />
To sum up classes in a fairly simple and easy to understand word, a class is a "Blueprint" from which objects are created. There are many different variations of the same object in the world, for example bikes. Every bike is made out of the same base components; gears, pedals, wheels, seat and frame.<br />
<br />
Because of the variance of these components between different bikes, your bike (as an object) is an "instance" of the class of bikes. It is just one in a wide variety of bikes.<br />
<br />
Now I'm going to show you a basic example of a Class, without going indepth into the coding of it for now:<br />
<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;JAVA-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="java" style="font-family&#58;monospace;"><span style="color&#58; #000000; font-weight&#58; bold;">class</span> Bike <span style="color&#58; #009900;">&#123;</span>
&nbsp;
       <span style="color&#58; #000066; font-weight&#58; bold;">int</span> gear <span style="color&#58; #339933;">=</span> <span style="color&#58; #cc66cc;">1</span><span style="color&#58; #339933;">;</span>
       <span style="color&#58; #000066; font-weight&#58; bold;">int</span> speed <span style="color&#58; #339933;">=</span> <span style="color&#58; #cc66cc;">0</span><span style="color&#58; #339933;">;</span>
&nbsp;
       <span style="color&#58; #000066; font-weight&#58; bold;">void</span> changeGear<span style="color&#58; #009900;">&#40;</span><span style="color&#58; #000066; font-weight&#58; bold;">int</span> newValue<span style="color&#58; #009900;">&#41;</span> <span style="color&#58; #009900;">&#123;</span>
            gear <span style="color&#58; #339933;">=</span> newValue<span style="color&#58; #339933;">;</span>
       <span style="color&#58; #009900;">&#125;</span>
&nbsp;
       <span style="color&#58; #000066; font-weight&#58; bold;">void</span> speedUp<span style="color&#58; #009900;">&#40;</span><span style="color&#58; #000066; font-weight&#58; bold;">int</span> increment<span style="color&#58; #009900;">&#41;</span> <span style="color&#58; #009900;">&#123;</span>
            speed <span style="color&#58; #339933;">=</span> speed <span style="color&#58; #339933;">+</span> increment<span style="color&#58; #339933;">;</span>   
       <span style="color&#58; #009900;">&#125;</span>
&nbsp;
       <span style="color&#58; #000066; font-weight&#58; bold;">void</span> applyBrakes<span style="color&#58; #009900;">&#40;</span><span style="color&#58; #000066; font-weight&#58; bold;">int</span> decrement<span style="color&#58; #009900;">&#41;</span> <span style="color&#58; #009900;">&#123;</span>
            speed <span style="color&#58; #339933;">=</span> speed <span style="color&#58; #339933;">-</span> decrement<span style="color&#58; #339933;">;</span>
       <span style="color&#58; #009900;">&#125;</span>
&nbsp;
       <span style="color&#58; #000066; font-weight&#58; bold;">void</span> printStates<span style="color&#58; #009900;">&#40;</span><span style="color&#58; #009900;">&#41;</span> <span style="color&#58; #009900;">&#123;</span>
            <a href="http&#58;//www&#46;google&#46;com/search?hl=en&amp;q=allinurl%3Asystem+java&#46;sun&#46;com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color&#58; #003399;">System</span></a>&#46;<span style="color&#58; #006633;">out</span>&#46;<span style="color&#58; #006633;">println</span><span style="color&#58; #009900;">&#40;</span><span style="color&#58; #0000ff;">&quot; speed&#58;&quot;</span><span style="color&#58; #339933;">+</span>speed<span style="color&#58; #339933;">+</span><span style="color&#58; #0000ff;">&quot; gear&#58;&quot;</span><span style="color&#58; #339933;">+</span>gear<span style="color&#58; #009900;">&#41;</span><span style="color&#58; #339933;">;</span>
       <span style="color&#58; #009900;">&#125;</span>
<span style="color&#58; #009900;">&#125;</span></pre></div></div>
		</td></tr></table><br />
<br />
This is a Class. As you can imagine and see, the "speed" and "gear" are the bike's state or variables and the "changeGear", "speedUp" and "applyBrakes" are the behaviours or methods after interaction with the outside world.<br />
<br />
For those of you that understand principles of coding, you will notice there is no 'main' included. You will also understand the reason why, considering it is a Class. However for those of you that don't normally delve into programming, or this is more a first time for you, the 'main' method seen in most programs is of severe importance. It is where the program begins reading the code and also where other methods are stored. As the Class is a "Blueprint" for the bike, it can be used in an application, but isn't needed. The actual "Use" of a bike belongs in a "Class".<br />
<br />
<br />
Well, I told you that this would be a rather small tutorial for me. You won't have to scroll down the page so much and you should have found this tutorial fairly easy to understand.<br />
<br />
You should probably look out for the next tutorial on Object-Oriented Programming that is coming soon. It will cover "inheritance" and then will move you into some basic exercises for OOP in which you can actually write some code yourself. It will then go a fair bit more in-depth into the programming side so you can find what you're looking for within program examples or for personal use in developing programs.<br />
<br />
I hope this tutorial has been a fair bit insightful for you all and managed to break programming down into a lot easier bitesize pieces. Unfortunately this is all for me today, I will post up questions for you to answer and more exercises early on next week (Monday more than likely) and will try to finish up the next tutorial for you all.<br />
<br />
<br />
<br />
Have fun everyone,<br />
<br />
Eddie]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[TUT] Introduction To OllyDbg And How To Find Your Way Around It]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=5334</link>
			<pubDate>Sun, 01 Aug 2010 23:08:54 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=2024">Eddie</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=5334</guid>
			<description><![CDATA[<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Introduction To OllyDbg And How To Find Your Way Around It</span></span></span><br />
<br />
Hello!<br />
Once again guys I am back with another tutorial. This time I'm going to be discussing the program OllyDbg and giving you a brief introduction on how to use it/find your way around it. I will be asking you to install it at some point during this tutorial because it is REQUIRED for you to totally understand the tutorial and it also the program you will use when we start modifying the Little Fighter 2 program. So to start...<br />
<br />
OllyDbg is a 32-bit assembly level analysing debugger. Thats all well and done but what does it mean? Lets start by taking a look at the word debugger. OllyDbg is a debugger that is used for debugging or locating and correcting errors in an executable file, like that of the Little Fighter Program.<br />
<br />
Okay now for the slightly more tricky understanding in my opinion; assembly. Assembly level is the level of coding or programming just before machine code. It is the closest thing to machine code that a human can understand fully and write programs in, otherwise known as a low level language. Does that mean that there is a high level language? Yes, not just one, but lots of them. Examples of high level languages include C, C++ and C# (just to note down all the C's). 32-bit assembly level is Assembly written for programs or computers that can utilise or move memory in 32-bit groups.<br />
<br />
That is all simple yes? So now lets put it all together. OllyDbg is used to analyse and locate or correct errors in 32-bit executable files. Now thats in a whole lot more easy context, we can begin looking at the program.<br />
<br />
So why is OllyDbg important? You're going to be using it (in the majority of cases) more than any other Hex or .exe editing tool when you are looking at the Little Fighter program. So now lets get on to the actual inspection of this program.<br />
<br />
<br />
Download:<br />
<a href="http://OllyDbg.de" target="_blank" rel="noopener" class="mycode_url">http://OllyDbg.de</a><br />
<br />
Download the program from the link given above. You're looking to download OllyDbg110 (not 2.0) which should be in a link on the left hand side of the web page.<br />
<br />
Now once you've downloaded it, extract it to your desktop. Note that you do not need to install the program, you just need to run it. For Vista and Windows 7 users, I suggest right clicking and run as administrator - it gives you a pop up otherwise which you and I would much rather avoid than have to close down every time we open up the program.<br />
<br />
Now once its open you should see either a white screen with four main panels, one of them with Registers written at the top of it or you will see a grey screen. If it's the grey screen then click on "View" and click on "CPU" from the drop down list. Now you should definately see four white panels on the screen stuck together, similar in appearance to this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Numbered Screen (Slightly Large Image Warning) <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/Ollydbg.png" loading="lazy"  alt="[Image: Ollydbg.png]" class="mycode_img" /></div></div>
I have numbered each of the panels that we see infront of us. So I'm going to give a brief look at each of the panels quickly so you can understand what they are:<br />
<br />
1) CPU/Coding Panel -<br />
The largest panel on the screen is the most important panel on the screen. The CPU or Coding Panel is where all of the Assembly code is produced or viewed when you are looking at an executable (.exe) file. In almost all of the Hex/.exe Editing tutorials or works produced by Silva and other Hexidecimal/Debugging experts you will have had to use this section of OllyDbg. This will be true to all the tutorials here to come, you will use this panel most of the time.<br />
<br />
2) Registers Panel -<br />
The Registers Panel is to the right hand side of the CPU/Coding Panel. This panel holds the information on standard registers, flags, section registers and extra information on FPU, MMX, Debugging, etc. As you go through the code it will be obvious to notice that the contents, register values and flags may change. They will not be the same everywhere that you look.<br />
<br />
3) Stack Panel - This panel holds addresses for the program which you can then find in the disassembler/cpu section or in the memory dump section. These addresses can either be given as virtual addresses which identify virtual (non-physical) entities (used in virtual memory and virtual network addresses) or an offset (an integer that indicates the distance of the beginning of an object up to a specific element or point) from a specified or 'direct' address. Each four byte section is displayed as a hexadecimal value, which can then be shown as ASCII or UNICODE or not at all. Some extra comments like those in the CPU/Disassembly panel are also shown.<br />
<br />
4) Memory Dump - This panel is a dump for any memory addresses in the program. Raw data is given alongside these addresses and the data can be displayed in ASCII, UNICODE, etc. The data can then be edited in a similar fashion to the disassembler itself. Each line represents one 32-bit section. Alongside the Disassembler/CPU panel, you will use this panel most.<br />
<br />
<br />
Okay we've now become familiar with the panels we'll start looking at the program a bit more in action. To do this, you're going to need an UNMODIFIED LF2 v2.0a. If you use a different version chances are you may not be able to keep up with what I'm going to do in this tutorial.<br />
<br />
If you haven't already got an unmodified LF2 v2.0a, here is the link to download it:<br />
<a href="http://www.lf2.net/dn_fx.html" target="_blank" rel="noopener" class="mycode_url">http://www.lf2.net/dn_fx.html</a><br />
<br />
Just click the 'download now' button under the picture and it then you'll be directed to a new page where you get a pop up screen for the program download. Once you've downloaded it, install the Little Fighter program.<br />
<br />
<br />
Okay, now in OllyDbg we are going to go to either:<br />
1) Click File ---&gt; Open<br />
2) Press F3<br />
3) Click the Folder Icon<br />
<br />
This will bring you to a small window where at the top it reads:<br />
"Open 32-Bit executable"<br />
<br />
You will now go through to the folder where you installed LF2 v2.0a to, for most of you this will be:<br />
Drive C: ---&gt;  Program Files ---&gt;  LF2_v2.0a<br />
Then click the Lf2.exe icon and click open.<br />
<br />
Your screen should now look like this:<br />
<div class="tborder spoiler"><div class="spoiler_header">Loaded Up Screen <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/Loaded.png" loading="lazy"  alt="[Image: Loaded.png]" class="mycode_img" /></div></div>
As you more than likely cannot see the writing, this is the first four lines you should see in the disassembler/CPU:<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #adadad; font-style&#58; italic;">00445560</span> &gt; &#36; E8 F8040000    <span style="color&#58; #00007f; font-weight&#58; bold;">CALL</span> lf2<span style="color&#58; #339933;">&#46;</span>00445A5D   <span style="color&#58; #666666; font-style&#58; italic;">; This line is highlighted in grey/black</span>
<span style="color&#58; #adadad; font-style&#58; italic;">00445565</span>   <span style="color&#58; #339933;">&#46;</span>&#94;E9 35FDFFFF    <span style="color&#58; #00007f; font-weight&#58; bold;">JMP</span> lf2<span style="color&#58; #339933;">&#46;</span>0044529F
<span style="color&#58; #adadad; font-style&#58; italic;">0044556A</span>  <span style="color&#58; #339933;">/</span>&gt; <span style="color&#58; #0000ff;">55</span>             <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> <span style="color&#58; #00007f;">EBP</span>
<span style="color&#58; #adadad; font-style&#58; italic;">0044556B</span>  |<span style="color&#58; #339933;">&#46;</span> 8BEC           <span style="color&#58; #00007f; font-weight&#58; bold;">MOV</span> <span style="color&#58; #00007f;">EBP</span><span style="color&#58; #339933;">,</span><span style="color&#58; #00007f;">ESP</span></pre></div></div>
		</td></tr></table><br />
<br />
<br />
Now you can probably understand why I showed you the blank OllyDbg window first in this tutorial... it doesn't scare you off. Right now several of you (this happened to me as well) looked at the massive amount of EAX's, MOV's, DWORD's, numbers, etc and this thought ran through your mind or out of your mouth:<br />
"OH MY BLOODY GOD, WHO ON THIS BLOODY PLANET CAN UNDERSTAND THIS!?"<br />
<br />
Fortunately for you, this tutorial will not require us to go in depth into the language or for me to explain it to you. This is going to be a simple moving your way around the program kind of tutorial. So let us continue.<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Running and Restarting</span><br />
For a debugger to find any flaws in the code you need to be able to run the program. Well, this is possibly the easiest task I will ever set you in OllyDbg, so there is no need to worry about your skills, just familiarise yourself with the controls. Test out each of the following methods to run the program to make sure you understand:<br />
<br />
1) Click Debug ---&gt; Run<br />
2) Press F9<br />
3) Click Play Button<br />
<br />
<br />
The Little Fighter program should now have started loading. It should then pop up on your screen or on your task bar. Feel free to click on it and play it, but make sure you can see the Disassembly panel in full when you do. When you're playing it for however long, keep looking at the panel.<br />
<br />
Keep the Little Fighter window up after you've done playing, what special feature did you notice on the OllyDbg? Were you paying enough attention? If you can honestly say you saw absolutely nothing change then you were paying enough attention. Now close down the Little Fighter window. DAMN! The code jumped to some number beginning with 7?<br />
<br />
Well, now we have a choice on how we're going to get back to the start of the code, which is vital if we really want to look throughout the program. So here's what we can do:<br />
<br />
1) Close down the window in OllyDbg by clicking the exit button and reload everything (most time consuming).<br />
2) Click Debug ---&gt; Restart<br />
3) Press Ctrl + F2<br />
<br />
Now if you've done that correctly we're back at our first step, yay us!<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Stepping Over, Stepping Into and Goto Expression</span><br />
Alright, so we've learnt how to run our program and restart it just in case we lose our place. Unfortunately as you might have realised, we're running way too quickly through this code for us to really analyse it and do any work on it. What we really want is a way to go step by step through the code so that we can see what bits we like or don't like, and what bits we want or do not want to modify.<br />
<br />
OllyDbg as a debugger requires the ability to do this for it to be an effective debugger. So that is absolutely perfect, we don't need to keep clicking through the code, we have something that does it for us. However, before we're going to do this, I want you to quickly look at the Registers panel (panel 2 in first image). It should look something like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Registers Panel <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/Registers2.png" loading="lazy"  alt="[Image: Registers2.png]" class="mycode_img" /></div></div>
Note how it says this:<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #00007f;">EDX</span>  <span style="color&#58; #0000ff;">00445560</span>  lf2<span style="color&#58; #339933;">&#46;</span>&lt;ModuleEntryPoint&gt;</pre></div></div>
		</td></tr></table><br />
<br />
That shows you that the command or code:<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #adadad; font-style&#58; italic;">00445560</span> &gt; &#36; E8 F8040000    <span style="color&#58; #00007f; font-weight&#58; bold;">CALL</span> lf2<span style="color&#58; #339933;">&#46;</span>00445A5D</pre></div></div>
		</td></tr></table><br />
<br />
Is the 'Entry Point' of the program. This is where the code is read first when the program is loading up. So that's good news, we never have to hunt down the entry point for the Little Fighter 2 program. Note, that is entry point is not the same for all programs, it is only the entry point for LF2. So before we continue, lets note down the address:<br />
<br />
00445560<br />
<br />
We're going to need to remember that for whe we wish to get back to the Entry Point without restarting. So now lets get back on to the task at hand.<br />
<br />
'Stepping over' is the process of going through code line by line in OllyDbg. It can be done by one of two methods:<br />
<br />
1) Click Debug ---&gt; Step Over  (Slower)<br />
2) Press F8  (Faster)<br />
<br />
So lets quickly 'Step Over' onto the next line of code. We should now be on this:<br />
<br />
[Code=ASM]00445565   .^E9 35FDFFFF    JMP lf2.0044529F[/code]<br />
<br />
Take a look at the Registers Panel again and you'll find that it has changed.<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Registers Panel <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/Registers3.png" loading="lazy"  alt="[Image: Registers3.png]" class="mycode_img" /></div></div>
Note how we can no longer see the &lt;ModuleEntryPoint&gt; and instead see something along the lines of this:<br />
<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #00007f;">EDX</span>  770964F4  ntdll<span style="color&#58; #339933;">&#46;</span>KiFastSystemCallRet</pre></div></div>
		</td></tr></table><br />
<br />
As you step through code the Registers Panel will constantly change its information. But this is just going to be an observation for now, most of the time this will not be relevant to you in your work on modifying the Little Fighter program, so let us continue once more.<br />
<br />
Press F8 again to step over the code to the next point. Damn, we're at a completely different location and none of the code looks the same! This is now the perfect point for me to explain to you a tiny amount about the JMP and CALL commands. Both of them are used to get the computer or machine to read instructions or code elsewhere in the program. So why didn't it change what we saw on the screen when we stepped over the CALL command? Good question. The JMP command is otherwise known as the "Jump" command. What it does is it sends the machine to an address where the machine then continues from there. With the CALL command, the machine is told where it needs to read some code from but it continues to read code after the CALL command. Thus you do not see the jump, it's still reading on from the last point.<br />
<br />
So let's go back to the CALL command at the Entry Point of the program. How are we going to do this? We can do this in two ways, using the address we had before. So I'll show them here:<br />
<br />
1) Right Click ---&gt;  Go to  ---&gt;  Expression  ---&gt;  00445560  ---&gt;  OK<br />
2) Press Ctrl + G  ---&gt;  00445560  ---&gt;  OK<br />
<br />
Of course there are other ways to get back to it, but if you're really interested in a certain code the best option is to note down the address. You can then goto the address as it's shorter to type in and therefore easier to remember.<br />
<br />
Most of you will wonder why we didn't press Ctrl + F like we do in all sorts of programs. Well it is used for finding stuff yes, it's used for searching for commands. Why didn't we use that? Commands are longer to type, and I doubt you would rather keep writing down commands you need to find when you realise that some lines have the same command.. oops. It's much easier to note down the address and goto the expression instead, also a lot less time consuming in most cases.<br />
<br />
We should be back at the Entry Point now. We shall now see what code is being read through the CALL command. To do that we can go about in either of these two methods:<br />
<br />
1) Click Debug  ---&gt;  Step Into<br />
2) Press F7<br />
<br />
After we've done that, you should arrive at a screen like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Stepped Into <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/StepInto1.png" loading="lazy"  alt="[Image: StepInto1.png]" class="mycode_img" /></div></div>
What you've just done is gone into the CALL command and address it tells the computer to read, which low and behold has a whole lot of new commands - YAY! However I am not going to explain what they mean for now, I am going to leave you to play around for a bit. Practise going through the 'Stepping Over', 'Stepping Into' and 'Go to' commands. Once you have done playing around with those commands, move on to the next section of the tutorial.<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Breakpoints</span><br />
Alright, press Ctrl + F2 if you haven't already to get back to the Entry Point of the program. We're now going to delve into the world of Breakpoints. Breakpoints are pauses within a program at certain points mainly for the purposes of debugging. This allows the person inspecting the code or program through the means of debugging to look at and test different bits of the code. It also allows them to inspect register values and other sorts of bits and pieces.<br />
<br />
So what we're going to do in this part of the tutorial is set breakpoints, and give you a general idea of CALL and JMP commands first hand. So lets begin with how to insert breakpoints. There are many different ways to insert them and many different ways in which they function, for this tutorial though I am only going to explain your basic breakpoint. So there are two ways of inserting breakpoints:<br />
<br />
1) Right Click  ---&gt;  Breakpoints  ---&gt;  Toggle<br />
2) Press F2<br />
<br />
So lets start off by 'Stepping into' the CALL command at the Entry Point. Press F7 to go into the CALL command. Now press F2 then F8 two times, followed by F2, and then F8 four more times before F2 again. Your screen should look something like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Breakpoints In CALL <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/BreakpointsInCalling.png" loading="lazy"  alt="[Image: BreakpointsInCalling.png]" class="mycode_img" /></div></div>
As you can see, these little red markings on the address signal for breakpoints. So to prove that the CALL command gets the machine/computer to read these instructions we're going to restart the program using Ctrl + F2. Then we're going to run the program using F9. BAM! The program stopped at the first breakpoint, but didn't we restart the program?<br />
<br />
OllyDbg remembers the breakpoints you put in a program, no matter how many times it has been restarted. So, lets just see what happens when we press F9 again. Once again the program is stopped from being read at the breakpoint. By pressing F9 and running the program again it will stop at our last breakpoint. So... what happens when we press F9 one last time? You guessed it, the program just continues being read as there are no more breakpoints. WOOHOO! As the program is still running, let us remove the breakpoints by clicking on their lines and removing them the same way we added them (press F2).<br />
<br />
Now to show you the difference between CALL and JMP before your very eyes. So let us click on the JMP command line and press F2. This will set the breakpoint on that line. And then we'll click on the line below it and also press F2 to give it a breakpoint.<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Breakpoints Set <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/BreakpointsSetting.png" loading="lazy"  alt="[Image: BreakpointsSetting.png]" class="mycode_img" /></div></div>
<br />
We'll quickly press F8 to get OllyDbg reading the JMP command instead of the CALL command and we'll press F7 to 'Step Into' the JMP command. We'll press F2 to set another breakpoint and then press F8 twice and F2 once more to set the last breakpoint.<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Last Breakpoints <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/LastBreakpoints.png" loading="lazy"  alt="[Image: LastBreakpoints.png]" class="mycode_img" /></div></div>
Now we're going to press Ctrl + F2 to restart the program. Then we will press F9, as expected the program has stopped being read at the JMP command. So what we'll do is press F9 again. The program then stops at PUSH command and then if we press F9 again it stops at the next CALL command. Lets press F9 one more time after this. The program fully loads up... hmm, interesting. Lets click on the two lines after we went into the JMP command and remove the breakpoints. We'll then close down the Little Fighter window that popped up and press Ctrl + F2 to restart the program in OllyDbg.<br />
<br />
Now lets go through it again, press F9. It's stopped at the JMP code as it had done last time. Now lets press F9 again. The Little Fighter window loaded up perfectly! How can this be? As I said before, JMP makes the machine change location of what its reading entirely, it doesn't 'Step Over' the JMP command and so that line isn't accessed. So you're bound to ask: Why on earth have that line there then? If it's not useful what is the point in it?<br />
Answer: Who said there wasn't a point in it? It just isn't involved in the start up of the Little Fighter program window. It may well be useful later on in one of the game modes or during one of the fights where suddenly everything just stops working. Now wouldn't that be a lol?<br />
<br />
Now would be a good time for you to restart the program using Ctrl + F2. After you've done that, click on the lines with breakpoints and remove them by pressing F2. You've now completed the breakpoints section of the tutorial. So let us move on to the next part.<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Comments</span><br />
To make code easier to understand, most people add comments to it. These are generally sections that the machine or computer does not read or take into account when running the program. They're visible only to the reader so that they may understand the code that is going on better.<br />
<br />
I'm going to teach you how to add comments. It's a simple process and will only take up a short section of this tutorial. So please read it. Here is how we'll add a comment:<br />
<br />
1) Right Click  ---&gt;  Comment  ---&gt; Type In "This Is A Comment Example"  ---&gt;  OK<br />
<br />
2) Press ;  ---&gt;  Type In "This Is A Comment Example"  ---&gt;  OK<br />
<br />
<br />
Oh look, our comment appears next to the code, like so:<br />
<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #adadad; font-style&#58; italic;">00445560</span> &gt;   E8 F8040000    <span style="color&#58; #00007f; font-weight&#58; bold;">CALL</span> lf2<span style="color&#58; #339933;">&#46;</span>00445A5D                        <span style="color&#58; #666666; font-style&#58; italic;">;  This Is A Comment Example</span></pre></div></div>
		</td></tr></table><br />
<br />
Now you can add comments to your work. This should make your work slightly easier to read and to understand when you come back to it later.<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Searches</span><br />
You must be really dedicated to making your way towards becoming a Hex Editor/Exe modifier. This hasn't exactly been a short tutorial and you seem to have stuck through all the different sections and more than likely went through all the activities. If you have done so, well done. If you haven't, go back and do it or if you're too lazy - I suggest you stop reading this tutorial. There is no point in doing this if you do not wish to progress any further.<br />
<br />
In this next section, I'm going to keep you up to scratch with using searches in OllyDbg. Yes we have already covered the use of 'Go to' feature, but what if we don't know the address of what we want? Well if we know different details then we can go about it different ways. So I'm going to show you a few of the ways.<br />
<br />
1) Ctrl + F (Search For Command) -<br />
If you know the command you are looking for then this is definately an option for you to search. What you simply have to do is press Ctrl + F or:<br />
<br />
Right Click  ---&gt;  Search For  ---&gt;  Command  ---&gt;  Type It In  ---&gt; Find<br />
<br />
You can then type in the command that you are looking for, for example we're going to type in:<br />
<br />
PUSH EBP<br />
<br />
When you click on the Find button, the next four lines of code at the top of the Disassembly panel should look like this:<br />
<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #adadad; font-style&#58; italic;">004013FB</span>  |<span style="color&#58; #339933;">&#46;</span> <span style="color&#58; #0000ff;">55</span>             <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> <span style="color&#58; #00007f;">EBP</span>
<span style="color&#58; #adadad; font-style&#58; italic;">004013FC</span>  |<span style="color&#58; #339933;">&#46;</span> <span style="color&#58; #0000ff;">57</span>             <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> <span style="color&#58; #00007f;">EDI</span>
<span style="color&#58; #adadad; font-style&#58; italic;">004013FD</span>  |<span style="color&#58; #339933;">&#46;</span> <span style="color&#58; #0000ff;">56</span>             <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> <span style="color&#58; #00007f;">ESI</span>
<span style="color&#58; #adadad; font-style&#58; italic;">004013FE</span>  |<span style="color&#58; #339933;">&#46;</span> FFD1           <span style="color&#58; #00007f; font-weight&#58; bold;">CALL</span> <span style="color&#58; #00007f;">ECX</span></pre></div></div>
		</td></tr></table><br />
<br />
Well done, you've executed your first Command search. Unfortunately what you probably didn't think about before you did this (unless you're TheNave, Silva or other experienced .exe modifiers, or someone with an ounce of common sense) is that there is more than one line that has this command. Great, so lets try doing the command search again.<br />
<br />
By repeating the steps above you find that you are... at exactly the same place? How can this be if there's more than one line with that code? Okay lets move on to finding the rest of them. This is what you're going to do:<br />
<br />
Right Click  ---&gt;  Search For  ---&gt;  All Commands  ---&gt;  Push EBP<br />
<br />
Your OllyDbg screen should now look like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">All Command Full <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/ARGH.png" loading="lazy"  alt="[Image: ARGH.png]" class="mycode_img" /></div></div>
or like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">All Command Mini <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/PUSHEBPARGH.png" loading="lazy"  alt="[Image: PUSHEBPARGH.png]" class="mycode_img" /></div></div>
Either way, you've just taken a quick glimpse into raw hell. You now know why I told you NOT to use the 'Search For -&gt; Command' earlier, it's just far too much hassle for you. You only need to use it when you can use a useful command line, but we'll go into that in other tutorials. For now, just use Ctrl + G (Go to) and type in 00445560 to get back to the entry point.<br />
<br />
<br />
2) Search For: All Intermolecular Calls<br />
Suppose you want to see all the different CALL commands in the program. This is probably a better way of looking at the CALL commands then doing the 'Search For: Command' to look for a CALL. What you do is this:<br />
<br />
Right Click  ---&gt;  Search For  ---&gt;  All Intermolecular Calls<br />
<br />
Similar to with the 'Search For: Command' window that pops up, you should get OllyDbg to look like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Intermolecular Calls Mini <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/IntermodularCouldBe.png" loading="lazy"  alt="[Image: IntermodularCouldBe.png]" class="mycode_img" /></div></div>
Or this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Intermolecular Calls Maxi <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/IntermodularCalls.png" loading="lazy"  alt="[Image: IntermodularCalls.png]" class="mycode_img" /></div></div>
<br />
Feel free to run yourself up and down the list. There are some problems with this method still as some CALL commands may lead you to the same place. This is a lot less frequent than finding the same command over and over again in the 'Search For: Command'. Well I guess it's time to close that window and then once again Ctrl + G to the address 00445560.<br />
<br />
<br />
3) Search For: All Referenced Text Strings<br />
Right, searching for Strings will take you to sections where a certain word or phrase is produced, even an error message. So what we're going to do is find out about this String search.<br />
<br />
Right Click  ---&gt;  Search For  ---&gt;  All Referenced Text Strings<br />
<br />
You should get OllyDbg to look either like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">String Mini <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/StringsMini.png" loading="lazy"  alt="[Image: StringsMini.png]" class="mycode_img" /></div></div>
Or this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">String Maxi <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/strings.png" loading="lazy"  alt="[Image: strings.png]" class="mycode_img" /></div></div>
<br />
Either way, it doesn't matter. Unlike in the other two sections of searching I have shown you, this one we're actually going to do some more in depth searching. So here is what you're going to do:<br />
<br />
Right Click (In The New Window)  ---&gt;  Search For Text  ---&gt;  Tick Checkbox "Entire Scope"  ---&gt;  Type In "hit_Fa"  ---&gt;  Click OK<br />
<br />
You should get a screen that looks like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">hit_Fa Search <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/hit_Fa.png" loading="lazy"  alt="[Image: hit_Fa.png]" class="mycode_img" /></div></div>
<br />
Feeling happy now aren't you? You found something which most of you can understand from your DC work and with very little fuss at all. So lets go find out some more about the code around it! So here's what you're going to do:<br />
<br />
Right Click On The Line ---&gt;  Follow In Disassembler<br />
<br />
You'll then reach a page with coding like this:<br />
<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #adadad; font-style&#58; italic;">0040D353</span>   <span style="color&#58; #339933;">&#46;</span> <span style="color&#58; #0000ff;">68</span> <span style="color&#58; #0000ff;">44804400</span>    <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> lf2<span style="color&#58; #339933;">&#46;</span>00448044                        <span style="color&#58; #666666; font-style&#58; italic;">;  ASCII &quot; hit&#95;Fa&#58; %d&quot;</span>
<span style="color&#58; #adadad; font-style&#58; italic;">0040D358</span>   <span style="color&#58; #339933;">&#46;</span> <span style="color&#58; #0000ff;">56</span>             <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> <span style="color&#58; #00007f;">ESI</span>
<span style="color&#58; #adadad; font-style&#58; italic;">0040D359</span>   <span style="color&#58; #339933;">&#46;</span> FFD7           <span style="color&#58; #00007f; font-weight&#58; bold;">CALL</span> <span style="color&#58; #00007f;">EDI</span>
<span style="color&#58; #adadad; font-style&#58; italic;">0040D35B</span>   <span style="color&#58; #339933;">&#46;</span> 83C4 0C        <span style="color&#58; #00007f; font-weight&#58; bold;">ADD</span> <span style="color&#58; #00007f;">ESP</span><span style="color&#58; #339933;">,</span>0C
<span style="color&#58; #adadad; font-style&#58; italic;">0040D35E</span>   &gt; 8B85 D8070000  <span style="color&#58; #00007f; font-weight&#58; bold;">MOV</span> <span style="color&#58; #00007f;">EAX</span><span style="color&#58; #339933;">,</span><span style="color&#58; #000000; font-weight&#58; bold;">DWORD</span> <span style="color&#58; #000000; font-weight&#58; bold;">PTR</span> <span style="color&#58; #00007f;">SS</span><span style="color&#58; #339933;">&#58;</span><span style="color&#58; #009900; font-weight&#58; bold;">&#91;</span><span style="color&#58; #00007f;">EBP</span><span style="color&#58; #339933;">+</span>7D8<span style="color&#58; #009900; font-weight&#58; bold;">&#93;</span></pre></div></div>
		</td></tr></table><br />
<br />
Wowza. We've learnt to find code related to specific strings. Now, lets see what the line is in the memory dump.<br />
<br />
Right Click The Line  ---&gt;  Follow In Dump<br />
<br />
<br />
Your Memory Dump should now look like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Memory Dump <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/DUMP.png" loading="lazy"  alt="[Image: DUMP.png]" class="mycode_img" /></div></div>
Not something you will find particularly easy to understand. In fact, by the looks of it, that is no use to you at all is it? But I'll give you a slight tip, looking at the first 5 double digit numbers in the Hex Dump (in your Memory Dump) and then look at the second column of the Disassembler from the left along the same line as "hit_Fa". They're exactly the same! Well spotted, that was just an observation though... nothing important to you... well for now most probably.<br />
<br />
That is all I am going to teach you as of searches for now. It is my highest doubt that you will ever need most of the searches, if I am wrong I will simply cover them in a later tutorial. Now on to the final task at hand.<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Modifying</span><br />
Yes the one part of the tutorial that most of you have been waiting for; the chance to modify the Little Fighter program! This is possibly what you've all been thinking about the whole tutorial - why won't he get on with it. Well truth be told, you're not actually going to be modifying anything in this tutorial.<br />
Reader/Pupil/: WHAT!? ARE YOU SERIOUS!?<br />
Me: Yes, deadly.<br />
<br />
If you've been reading through this tutorial as thoroughly as you should have been to get to this point, then it is next to impossible for your mind to really take in too much more information. So I'm only going to outline HOW you would go about modifying, not actually demonstrating any modification to you. If I explained the modification process, it'd mean I'd have to explain some of the code and what it's there for - not going to happen.<br />
<br />
So let us begin the short lesson on modification of the program. Before you do anything towards changing or editing the code - YOU MUST MAKE A BACK UP OF THE .EXE FILE. If you make one mistake in the .exe you will find yourself in a bit of a pickle and your favourite game/program may have to be reinstalled again. If you downloaded it off the internet then deleted the downloadable files - serves you right if you don't make a back up. I suggest making a folder on your desktop named "back up exe's" or "original files".<br />
<br />
Next is the very simple process of how to modify. Here is how you do it (please restart the program using Ctrl + F2 before you try this):<br />
<br />
1) Press Spacebar<br />
2) Right Click (in this case on CALL command)  ---&gt;  Assemble<br />
<br />
You should now have a little screen pop up. In this screen we would normally edit the code that goes into it by typing the instruction and then pressing Assemble. You are not going to do this right now so I suggest pressing Cancel.<br />
<br />
<br />
<br />
We've finally reached the end of this tutorial. Hopefully you have gained a lot through reading this tutorial, it's taken me most of the week to write and then rewrite because I lost it, touch it up so the language was easy to understand, add screenshots and the like. I have to say its been one of my biggest tutorials so far in terms of size if not the biggest.<br />
<br />
In summary, what you should have learned through this tutorial:<br />
- What a Debugger is<br />
- The layout of OllyDbg<br />
- How to add comments<br />
- How to modify (briefly)<br />
- How to search through a program's code<br />
- How to use Go to<br />
- How to insert breakpoints<br />
- How to Step Over and Step Into<br />
- How to Run the program<br />
- Brief introduction to JMP and CALL commands including similarities and differences<br />
- Different types of searches<br />
- How to restart the program within OllyDbg<br />
<br />
I am sorry that I went so in depth with the tutorial, but it is better that way I suppose. If I didn't go in depth in the parts that might have needed it, then you wouldn't have understood it so well. For those of you 'Work Dodgers' you managed to escape narrowly without having to answer questions and for those of you 'Work Lovers' I am sorry I hadn't included any questions, I just didn't deem them necessary as part of the main tutorial.<br />
<br />
Also quite a lot of you were expecting me to do a tutorial involving all the different programs that you may be using when trying to modify Little Fighter programs or other programs. The reason I have done OllyDbg seperately is because it is on a whole other level to the uses that you have with the other programs I'll be showing you. It takes a lot more time to explain in my eyes and so deserves a complete post of its own.<br />
<br />
Okay, most of you are probably asking what tutorials are to come and how long they are going to be. There are quite a lot of tutorials to come and they will all be relatively long, some longer than this one and some shorter. I plan on only passing on the information you need to become proficient with the tools, languages and understanding and no further. I am not going to make you become absolute masters of the coding and programming languages, but I will not just scrape the surface on any of my subjects.<br />
<br />
The tutorials that you can look ahead to:<br />
- Introduction to ResourceHacker and Hex Editors (including Hex Workshop as a main Editor)<br />
- The Basics of Assembly<br />
- The Basics of C++<br />
- Deeper Assembly and C++ Tutorials<br />
- Specific Little Fighter Modifications (eventually involving the addition of new states and Itr's - when I get around to studying the program enough myself)<br />
- Many, many more.<br />
<br />
<br />
So yeah, this will not really be a short term fixture. I intend on keeping these tutorials coming for as long as there are people that may wish to read them or may inhabit this site/forum.<br />
<br />
Now for a few side notes:<br />
<br />
1) If you wish to take this tutorial and put it on another Little Fighter forum or website please come to me for permission to do so. I am not saying this because I feel harsh, I am saying this because I had intended on this tutorial giving people on Little Fighter Empire an upper hand or advantage against the other forums for Little Fighter programs. I also had a very polite young lady ask me through PM if she could take my last tutorial and put it on her school system, of course I gave her permission.<br />
<br />
On the condition that I do give you permission, please state who wrote the tutorial and where it was from. It's only polite and is a good precaution against plaguerism.<br />
<br />
<br />
2) For those of you that are interested, may you please post a reply if you want me to add some questions within the next few days for you to do. If not questions then ask and I will post some activities for you to try out where you can search through code and test your understanding of the tutorial. In general, just give me comments and criticism, it'd be great to improve in my next tutorial and make it more understandable for those of you who read the whole post (hopefully the majority). <br />
<br />
Once again guys thank you for reading, it's been a pleasure to spend a lot of the last week writing this tutorial. And on one last note, based upon somewhat of a Hex Editing/Exe Modifying hero on these forums, Silva said:<br />
'Not enough people read long posts'<br />
Maybe it is a good idea if a lot of us start. If you don't read the length of my posts, most of the time you will not understand what I'm saying and so your replies will be useless.<br />
If I have covered a topic that your reply specifically indicates and shows you haven't read it, I expect other forum members if not myself to simply tell you to 'read the first post'. I'm not trying to be harsh, but it will help you in the long run as most people will eventually tell you.<br />
<br />
<br />
Thank you and I hope this helps,<br />
<br />
Eddie<br />
<br />
P.S - I think I just came up with a decent name instead of 'Unique Member'; Slave Driver. I've probably said it before, but the title fits.]]></description>
			<content:encoded><![CDATA[<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Introduction To OllyDbg And How To Find Your Way Around It</span></span></span><br />
<br />
Hello!<br />
Once again guys I am back with another tutorial. This time I'm going to be discussing the program OllyDbg and giving you a brief introduction on how to use it/find your way around it. I will be asking you to install it at some point during this tutorial because it is REQUIRED for you to totally understand the tutorial and it also the program you will use when we start modifying the Little Fighter 2 program. So to start...<br />
<br />
OllyDbg is a 32-bit assembly level analysing debugger. Thats all well and done but what does it mean? Lets start by taking a look at the word debugger. OllyDbg is a debugger that is used for debugging or locating and correcting errors in an executable file, like that of the Little Fighter Program.<br />
<br />
Okay now for the slightly more tricky understanding in my opinion; assembly. Assembly level is the level of coding or programming just before machine code. It is the closest thing to machine code that a human can understand fully and write programs in, otherwise known as a low level language. Does that mean that there is a high level language? Yes, not just one, but lots of them. Examples of high level languages include C, C++ and C# (just to note down all the C's). 32-bit assembly level is Assembly written for programs or computers that can utilise or move memory in 32-bit groups.<br />
<br />
That is all simple yes? So now lets put it all together. OllyDbg is used to analyse and locate or correct errors in 32-bit executable files. Now thats in a whole lot more easy context, we can begin looking at the program.<br />
<br />
So why is OllyDbg important? You're going to be using it (in the majority of cases) more than any other Hex or .exe editing tool when you are looking at the Little Fighter program. So now lets get on to the actual inspection of this program.<br />
<br />
<br />
Download:<br />
<a href="http://OllyDbg.de" target="_blank" rel="noopener" class="mycode_url">http://OllyDbg.de</a><br />
<br />
Download the program from the link given above. You're looking to download OllyDbg110 (not 2.0) which should be in a link on the left hand side of the web page.<br />
<br />
Now once you've downloaded it, extract it to your desktop. Note that you do not need to install the program, you just need to run it. For Vista and Windows 7 users, I suggest right clicking and run as administrator - it gives you a pop up otherwise which you and I would much rather avoid than have to close down every time we open up the program.<br />
<br />
Now once its open you should see either a white screen with four main panels, one of them with Registers written at the top of it or you will see a grey screen. If it's the grey screen then click on "View" and click on "CPU" from the drop down list. Now you should definately see four white panels on the screen stuck together, similar in appearance to this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Numbered Screen (Slightly Large Image Warning) <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/Ollydbg.png" loading="lazy"  alt="[Image: Ollydbg.png]" class="mycode_img" /></div></div>
I have numbered each of the panels that we see infront of us. So I'm going to give a brief look at each of the panels quickly so you can understand what they are:<br />
<br />
1) CPU/Coding Panel -<br />
The largest panel on the screen is the most important panel on the screen. The CPU or Coding Panel is where all of the Assembly code is produced or viewed when you are looking at an executable (.exe) file. In almost all of the Hex/.exe Editing tutorials or works produced by Silva and other Hexidecimal/Debugging experts you will have had to use this section of OllyDbg. This will be true to all the tutorials here to come, you will use this panel most of the time.<br />
<br />
2) Registers Panel -<br />
The Registers Panel is to the right hand side of the CPU/Coding Panel. This panel holds the information on standard registers, flags, section registers and extra information on FPU, MMX, Debugging, etc. As you go through the code it will be obvious to notice that the contents, register values and flags may change. They will not be the same everywhere that you look.<br />
<br />
3) Stack Panel - This panel holds addresses for the program which you can then find in the disassembler/cpu section or in the memory dump section. These addresses can either be given as virtual addresses which identify virtual (non-physical) entities (used in virtual memory and virtual network addresses) or an offset (an integer that indicates the distance of the beginning of an object up to a specific element or point) from a specified or 'direct' address. Each four byte section is displayed as a hexadecimal value, which can then be shown as ASCII or UNICODE or not at all. Some extra comments like those in the CPU/Disassembly panel are also shown.<br />
<br />
4) Memory Dump - This panel is a dump for any memory addresses in the program. Raw data is given alongside these addresses and the data can be displayed in ASCII, UNICODE, etc. The data can then be edited in a similar fashion to the disassembler itself. Each line represents one 32-bit section. Alongside the Disassembler/CPU panel, you will use this panel most.<br />
<br />
<br />
Okay we've now become familiar with the panels we'll start looking at the program a bit more in action. To do this, you're going to need an UNMODIFIED LF2 v2.0a. If you use a different version chances are you may not be able to keep up with what I'm going to do in this tutorial.<br />
<br />
If you haven't already got an unmodified LF2 v2.0a, here is the link to download it:<br />
<a href="http://www.lf2.net/dn_fx.html" target="_blank" rel="noopener" class="mycode_url">http://www.lf2.net/dn_fx.html</a><br />
<br />
Just click the 'download now' button under the picture and it then you'll be directed to a new page where you get a pop up screen for the program download. Once you've downloaded it, install the Little Fighter program.<br />
<br />
<br />
Okay, now in OllyDbg we are going to go to either:<br />
1) Click File ---&gt; Open<br />
2) Press F3<br />
3) Click the Folder Icon<br />
<br />
This will bring you to a small window where at the top it reads:<br />
"Open 32-Bit executable"<br />
<br />
You will now go through to the folder where you installed LF2 v2.0a to, for most of you this will be:<br />
Drive C: ---&gt;  Program Files ---&gt;  LF2_v2.0a<br />
Then click the Lf2.exe icon and click open.<br />
<br />
Your screen should now look like this:<br />
<div class="tborder spoiler"><div class="spoiler_header">Loaded Up Screen <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/Loaded.png" loading="lazy"  alt="[Image: Loaded.png]" class="mycode_img" /></div></div>
As you more than likely cannot see the writing, this is the first four lines you should see in the disassembler/CPU:<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #adadad; font-style&#58; italic;">00445560</span> &gt; &#36; E8 F8040000    <span style="color&#58; #00007f; font-weight&#58; bold;">CALL</span> lf2<span style="color&#58; #339933;">&#46;</span>00445A5D   <span style="color&#58; #666666; font-style&#58; italic;">; This line is highlighted in grey/black</span>
<span style="color&#58; #adadad; font-style&#58; italic;">00445565</span>   <span style="color&#58; #339933;">&#46;</span>&#94;E9 35FDFFFF    <span style="color&#58; #00007f; font-weight&#58; bold;">JMP</span> lf2<span style="color&#58; #339933;">&#46;</span>0044529F
<span style="color&#58; #adadad; font-style&#58; italic;">0044556A</span>  <span style="color&#58; #339933;">/</span>&gt; <span style="color&#58; #0000ff;">55</span>             <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> <span style="color&#58; #00007f;">EBP</span>
<span style="color&#58; #adadad; font-style&#58; italic;">0044556B</span>  |<span style="color&#58; #339933;">&#46;</span> 8BEC           <span style="color&#58; #00007f; font-weight&#58; bold;">MOV</span> <span style="color&#58; #00007f;">EBP</span><span style="color&#58; #339933;">,</span><span style="color&#58; #00007f;">ESP</span></pre></div></div>
		</td></tr></table><br />
<br />
<br />
Now you can probably understand why I showed you the blank OllyDbg window first in this tutorial... it doesn't scare you off. Right now several of you (this happened to me as well) looked at the massive amount of EAX's, MOV's, DWORD's, numbers, etc and this thought ran through your mind or out of your mouth:<br />
"OH MY BLOODY GOD, WHO ON THIS BLOODY PLANET CAN UNDERSTAND THIS!?"<br />
<br />
Fortunately for you, this tutorial will not require us to go in depth into the language or for me to explain it to you. This is going to be a simple moving your way around the program kind of tutorial. So let us continue.<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Running and Restarting</span><br />
For a debugger to find any flaws in the code you need to be able to run the program. Well, this is possibly the easiest task I will ever set you in OllyDbg, so there is no need to worry about your skills, just familiarise yourself with the controls. Test out each of the following methods to run the program to make sure you understand:<br />
<br />
1) Click Debug ---&gt; Run<br />
2) Press F9<br />
3) Click Play Button<br />
<br />
<br />
The Little Fighter program should now have started loading. It should then pop up on your screen or on your task bar. Feel free to click on it and play it, but make sure you can see the Disassembly panel in full when you do. When you're playing it for however long, keep looking at the panel.<br />
<br />
Keep the Little Fighter window up after you've done playing, what special feature did you notice on the OllyDbg? Were you paying enough attention? If you can honestly say you saw absolutely nothing change then you were paying enough attention. Now close down the Little Fighter window. DAMN! The code jumped to some number beginning with 7?<br />
<br />
Well, now we have a choice on how we're going to get back to the start of the code, which is vital if we really want to look throughout the program. So here's what we can do:<br />
<br />
1) Close down the window in OllyDbg by clicking the exit button and reload everything (most time consuming).<br />
2) Click Debug ---&gt; Restart<br />
3) Press Ctrl + F2<br />
<br />
Now if you've done that correctly we're back at our first step, yay us!<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Stepping Over, Stepping Into and Goto Expression</span><br />
Alright, so we've learnt how to run our program and restart it just in case we lose our place. Unfortunately as you might have realised, we're running way too quickly through this code for us to really analyse it and do any work on it. What we really want is a way to go step by step through the code so that we can see what bits we like or don't like, and what bits we want or do not want to modify.<br />
<br />
OllyDbg as a debugger requires the ability to do this for it to be an effective debugger. So that is absolutely perfect, we don't need to keep clicking through the code, we have something that does it for us. However, before we're going to do this, I want you to quickly look at the Registers panel (panel 2 in first image). It should look something like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Registers Panel <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/Registers2.png" loading="lazy"  alt="[Image: Registers2.png]" class="mycode_img" /></div></div>
Note how it says this:<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #00007f;">EDX</span>  <span style="color&#58; #0000ff;">00445560</span>  lf2<span style="color&#58; #339933;">&#46;</span>&lt;ModuleEntryPoint&gt;</pre></div></div>
		</td></tr></table><br />
<br />
That shows you that the command or code:<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #adadad; font-style&#58; italic;">00445560</span> &gt; &#36; E8 F8040000    <span style="color&#58; #00007f; font-weight&#58; bold;">CALL</span> lf2<span style="color&#58; #339933;">&#46;</span>00445A5D</pre></div></div>
		</td></tr></table><br />
<br />
Is the 'Entry Point' of the program. This is where the code is read first when the program is loading up. So that's good news, we never have to hunt down the entry point for the Little Fighter 2 program. Note, that is entry point is not the same for all programs, it is only the entry point for LF2. So before we continue, lets note down the address:<br />
<br />
00445560<br />
<br />
We're going to need to remember that for whe we wish to get back to the Entry Point without restarting. So now lets get back on to the task at hand.<br />
<br />
'Stepping over' is the process of going through code line by line in OllyDbg. It can be done by one of two methods:<br />
<br />
1) Click Debug ---&gt; Step Over  (Slower)<br />
2) Press F8  (Faster)<br />
<br />
So lets quickly 'Step Over' onto the next line of code. We should now be on this:<br />
<br />
[Code=ASM]00445565   .^E9 35FDFFFF    JMP lf2.0044529F[/code]<br />
<br />
Take a look at the Registers Panel again and you'll find that it has changed.<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Registers Panel <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/Registers3.png" loading="lazy"  alt="[Image: Registers3.png]" class="mycode_img" /></div></div>
Note how we can no longer see the &lt;ModuleEntryPoint&gt; and instead see something along the lines of this:<br />
<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #00007f;">EDX</span>  770964F4  ntdll<span style="color&#58; #339933;">&#46;</span>KiFastSystemCallRet</pre></div></div>
		</td></tr></table><br />
<br />
As you step through code the Registers Panel will constantly change its information. But this is just going to be an observation for now, most of the time this will not be relevant to you in your work on modifying the Little Fighter program, so let us continue once more.<br />
<br />
Press F8 again to step over the code to the next point. Damn, we're at a completely different location and none of the code looks the same! This is now the perfect point for me to explain to you a tiny amount about the JMP and CALL commands. Both of them are used to get the computer or machine to read instructions or code elsewhere in the program. So why didn't it change what we saw on the screen when we stepped over the CALL command? Good question. The JMP command is otherwise known as the "Jump" command. What it does is it sends the machine to an address where the machine then continues from there. With the CALL command, the machine is told where it needs to read some code from but it continues to read code after the CALL command. Thus you do not see the jump, it's still reading on from the last point.<br />
<br />
So let's go back to the CALL command at the Entry Point of the program. How are we going to do this? We can do this in two ways, using the address we had before. So I'll show them here:<br />
<br />
1) Right Click ---&gt;  Go to  ---&gt;  Expression  ---&gt;  00445560  ---&gt;  OK<br />
2) Press Ctrl + G  ---&gt;  00445560  ---&gt;  OK<br />
<br />
Of course there are other ways to get back to it, but if you're really interested in a certain code the best option is to note down the address. You can then goto the address as it's shorter to type in and therefore easier to remember.<br />
<br />
Most of you will wonder why we didn't press Ctrl + F like we do in all sorts of programs. Well it is used for finding stuff yes, it's used for searching for commands. Why didn't we use that? Commands are longer to type, and I doubt you would rather keep writing down commands you need to find when you realise that some lines have the same command.. oops. It's much easier to note down the address and goto the expression instead, also a lot less time consuming in most cases.<br />
<br />
We should be back at the Entry Point now. We shall now see what code is being read through the CALL command. To do that we can go about in either of these two methods:<br />
<br />
1) Click Debug  ---&gt;  Step Into<br />
2) Press F7<br />
<br />
After we've done that, you should arrive at a screen like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Stepped Into <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/StepInto1.png" loading="lazy"  alt="[Image: StepInto1.png]" class="mycode_img" /></div></div>
What you've just done is gone into the CALL command and address it tells the computer to read, which low and behold has a whole lot of new commands - YAY! However I am not going to explain what they mean for now, I am going to leave you to play around for a bit. Practise going through the 'Stepping Over', 'Stepping Into' and 'Go to' commands. Once you have done playing around with those commands, move on to the next section of the tutorial.<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Breakpoints</span><br />
Alright, press Ctrl + F2 if you haven't already to get back to the Entry Point of the program. We're now going to delve into the world of Breakpoints. Breakpoints are pauses within a program at certain points mainly for the purposes of debugging. This allows the person inspecting the code or program through the means of debugging to look at and test different bits of the code. It also allows them to inspect register values and other sorts of bits and pieces.<br />
<br />
So what we're going to do in this part of the tutorial is set breakpoints, and give you a general idea of CALL and JMP commands first hand. So lets begin with how to insert breakpoints. There are many different ways to insert them and many different ways in which they function, for this tutorial though I am only going to explain your basic breakpoint. So there are two ways of inserting breakpoints:<br />
<br />
1) Right Click  ---&gt;  Breakpoints  ---&gt;  Toggle<br />
2) Press F2<br />
<br />
So lets start off by 'Stepping into' the CALL command at the Entry Point. Press F7 to go into the CALL command. Now press F2 then F8 two times, followed by F2, and then F8 four more times before F2 again. Your screen should look something like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Breakpoints In CALL <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/BreakpointsInCalling.png" loading="lazy"  alt="[Image: BreakpointsInCalling.png]" class="mycode_img" /></div></div>
As you can see, these little red markings on the address signal for breakpoints. So to prove that the CALL command gets the machine/computer to read these instructions we're going to restart the program using Ctrl + F2. Then we're going to run the program using F9. BAM! The program stopped at the first breakpoint, but didn't we restart the program?<br />
<br />
OllyDbg remembers the breakpoints you put in a program, no matter how many times it has been restarted. So, lets just see what happens when we press F9 again. Once again the program is stopped from being read at the breakpoint. By pressing F9 and running the program again it will stop at our last breakpoint. So... what happens when we press F9 one last time? You guessed it, the program just continues being read as there are no more breakpoints. WOOHOO! As the program is still running, let us remove the breakpoints by clicking on their lines and removing them the same way we added them (press F2).<br />
<br />
Now to show you the difference between CALL and JMP before your very eyes. So let us click on the JMP command line and press F2. This will set the breakpoint on that line. And then we'll click on the line below it and also press F2 to give it a breakpoint.<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Breakpoints Set <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/BreakpointsSetting.png" loading="lazy"  alt="[Image: BreakpointsSetting.png]" class="mycode_img" /></div></div>
<br />
We'll quickly press F8 to get OllyDbg reading the JMP command instead of the CALL command and we'll press F7 to 'Step Into' the JMP command. We'll press F2 to set another breakpoint and then press F8 twice and F2 once more to set the last breakpoint.<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Last Breakpoints <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/LastBreakpoints.png" loading="lazy"  alt="[Image: LastBreakpoints.png]" class="mycode_img" /></div></div>
Now we're going to press Ctrl + F2 to restart the program. Then we will press F9, as expected the program has stopped being read at the JMP command. So what we'll do is press F9 again. The program then stops at PUSH command and then if we press F9 again it stops at the next CALL command. Lets press F9 one more time after this. The program fully loads up... hmm, interesting. Lets click on the two lines after we went into the JMP command and remove the breakpoints. We'll then close down the Little Fighter window that popped up and press Ctrl + F2 to restart the program in OllyDbg.<br />
<br />
Now lets go through it again, press F9. It's stopped at the JMP code as it had done last time. Now lets press F9 again. The Little Fighter window loaded up perfectly! How can this be? As I said before, JMP makes the machine change location of what its reading entirely, it doesn't 'Step Over' the JMP command and so that line isn't accessed. So you're bound to ask: Why on earth have that line there then? If it's not useful what is the point in it?<br />
Answer: Who said there wasn't a point in it? It just isn't involved in the start up of the Little Fighter program window. It may well be useful later on in one of the game modes or during one of the fights where suddenly everything just stops working. Now wouldn't that be a lol?<br />
<br />
Now would be a good time for you to restart the program using Ctrl + F2. After you've done that, click on the lines with breakpoints and remove them by pressing F2. You've now completed the breakpoints section of the tutorial. So let us move on to the next part.<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Comments</span><br />
To make code easier to understand, most people add comments to it. These are generally sections that the machine or computer does not read or take into account when running the program. They're visible only to the reader so that they may understand the code that is going on better.<br />
<br />
I'm going to teach you how to add comments. It's a simple process and will only take up a short section of this tutorial. So please read it. Here is how we'll add a comment:<br />
<br />
1) Right Click  ---&gt;  Comment  ---&gt; Type In "This Is A Comment Example"  ---&gt;  OK<br />
<br />
2) Press ;  ---&gt;  Type In "This Is A Comment Example"  ---&gt;  OK<br />
<br />
<br />
Oh look, our comment appears next to the code, like so:<br />
<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #adadad; font-style&#58; italic;">00445560</span> &gt;   E8 F8040000    <span style="color&#58; #00007f; font-weight&#58; bold;">CALL</span> lf2<span style="color&#58; #339933;">&#46;</span>00445A5D                        <span style="color&#58; #666666; font-style&#58; italic;">;  This Is A Comment Example</span></pre></div></div>
		</td></tr></table><br />
<br />
Now you can add comments to your work. This should make your work slightly easier to read and to understand when you come back to it later.<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Searches</span><br />
You must be really dedicated to making your way towards becoming a Hex Editor/Exe modifier. This hasn't exactly been a short tutorial and you seem to have stuck through all the different sections and more than likely went through all the activities. If you have done so, well done. If you haven't, go back and do it or if you're too lazy - I suggest you stop reading this tutorial. There is no point in doing this if you do not wish to progress any further.<br />
<br />
In this next section, I'm going to keep you up to scratch with using searches in OllyDbg. Yes we have already covered the use of 'Go to' feature, but what if we don't know the address of what we want? Well if we know different details then we can go about it different ways. So I'm going to show you a few of the ways.<br />
<br />
1) Ctrl + F (Search For Command) -<br />
If you know the command you are looking for then this is definately an option for you to search. What you simply have to do is press Ctrl + F or:<br />
<br />
Right Click  ---&gt;  Search For  ---&gt;  Command  ---&gt;  Type It In  ---&gt; Find<br />
<br />
You can then type in the command that you are looking for, for example we're going to type in:<br />
<br />
PUSH EBP<br />
<br />
When you click on the Find button, the next four lines of code at the top of the Disassembly panel should look like this:<br />
<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #adadad; font-style&#58; italic;">004013FB</span>  |<span style="color&#58; #339933;">&#46;</span> <span style="color&#58; #0000ff;">55</span>             <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> <span style="color&#58; #00007f;">EBP</span>
<span style="color&#58; #adadad; font-style&#58; italic;">004013FC</span>  |<span style="color&#58; #339933;">&#46;</span> <span style="color&#58; #0000ff;">57</span>             <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> <span style="color&#58; #00007f;">EDI</span>
<span style="color&#58; #adadad; font-style&#58; italic;">004013FD</span>  |<span style="color&#58; #339933;">&#46;</span> <span style="color&#58; #0000ff;">56</span>             <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> <span style="color&#58; #00007f;">ESI</span>
<span style="color&#58; #adadad; font-style&#58; italic;">004013FE</span>  |<span style="color&#58; #339933;">&#46;</span> FFD1           <span style="color&#58; #00007f; font-weight&#58; bold;">CALL</span> <span style="color&#58; #00007f;">ECX</span></pre></div></div>
		</td></tr></table><br />
<br />
Well done, you've executed your first Command search. Unfortunately what you probably didn't think about before you did this (unless you're TheNave, Silva or other experienced .exe modifiers, or someone with an ounce of common sense) is that there is more than one line that has this command. Great, so lets try doing the command search again.<br />
<br />
By repeating the steps above you find that you are... at exactly the same place? How can this be if there's more than one line with that code? Okay lets move on to finding the rest of them. This is what you're going to do:<br />
<br />
Right Click  ---&gt;  Search For  ---&gt;  All Commands  ---&gt;  Push EBP<br />
<br />
Your OllyDbg screen should now look like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">All Command Full <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/ARGH.png" loading="lazy"  alt="[Image: ARGH.png]" class="mycode_img" /></div></div>
or like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">All Command Mini <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/PUSHEBPARGH.png" loading="lazy"  alt="[Image: PUSHEBPARGH.png]" class="mycode_img" /></div></div>
Either way, you've just taken a quick glimpse into raw hell. You now know why I told you NOT to use the 'Search For -&gt; Command' earlier, it's just far too much hassle for you. You only need to use it when you can use a useful command line, but we'll go into that in other tutorials. For now, just use Ctrl + G (Go to) and type in 00445560 to get back to the entry point.<br />
<br />
<br />
2) Search For: All Intermolecular Calls<br />
Suppose you want to see all the different CALL commands in the program. This is probably a better way of looking at the CALL commands then doing the 'Search For: Command' to look for a CALL. What you do is this:<br />
<br />
Right Click  ---&gt;  Search For  ---&gt;  All Intermolecular Calls<br />
<br />
Similar to with the 'Search For: Command' window that pops up, you should get OllyDbg to look like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Intermolecular Calls Mini <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/IntermodularCouldBe.png" loading="lazy"  alt="[Image: IntermodularCouldBe.png]" class="mycode_img" /></div></div>
Or this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Intermolecular Calls Maxi <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/IntermodularCalls.png" loading="lazy"  alt="[Image: IntermodularCalls.png]" class="mycode_img" /></div></div>
<br />
Feel free to run yourself up and down the list. There are some problems with this method still as some CALL commands may lead you to the same place. This is a lot less frequent than finding the same command over and over again in the 'Search For: Command'. Well I guess it's time to close that window and then once again Ctrl + G to the address 00445560.<br />
<br />
<br />
3) Search For: All Referenced Text Strings<br />
Right, searching for Strings will take you to sections where a certain word or phrase is produced, even an error message. So what we're going to do is find out about this String search.<br />
<br />
Right Click  ---&gt;  Search For  ---&gt;  All Referenced Text Strings<br />
<br />
You should get OllyDbg to look either like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">String Mini <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/StringsMini.png" loading="lazy"  alt="[Image: StringsMini.png]" class="mycode_img" /></div></div>
Or this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">String Maxi <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/strings.png" loading="lazy"  alt="[Image: strings.png]" class="mycode_img" /></div></div>
<br />
Either way, it doesn't matter. Unlike in the other two sections of searching I have shown you, this one we're actually going to do some more in depth searching. So here is what you're going to do:<br />
<br />
Right Click (In The New Window)  ---&gt;  Search For Text  ---&gt;  Tick Checkbox "Entire Scope"  ---&gt;  Type In "hit_Fa"  ---&gt;  Click OK<br />
<br />
You should get a screen that looks like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">hit_Fa Search <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/hit_Fa.png" loading="lazy"  alt="[Image: hit_Fa.png]" class="mycode_img" /></div></div>
<br />
Feeling happy now aren't you? You found something which most of you can understand from your DC work and with very little fuss at all. So lets go find out some more about the code around it! So here's what you're going to do:<br />
<br />
Right Click On The Line ---&gt;  Follow In Disassembler<br />
<br />
You'll then reach a page with coding like this:<br />
<br />

		<table width='100%' border='0' style='table-layout:fixed;'><tr><td>
		<div class="geshicode_h" style='padding: 5px; background-color: #888888; border: 1px solid #AAAAAA; color: #000000;'>&nbsp;&nbsp;&nbsp;&nbsp;ASM-Code:
			<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB; overflow: auto; height: auto; max-height: 300px'><pre class="asm" style="font-family&#58;monospace;"><span style="color&#58; #adadad; font-style&#58; italic;">0040D353</span>   <span style="color&#58; #339933;">&#46;</span> <span style="color&#58; #0000ff;">68</span> <span style="color&#58; #0000ff;">44804400</span>    <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> lf2<span style="color&#58; #339933;">&#46;</span>00448044                        <span style="color&#58; #666666; font-style&#58; italic;">;  ASCII &quot; hit&#95;Fa&#58; %d&quot;</span>
<span style="color&#58; #adadad; font-style&#58; italic;">0040D358</span>   <span style="color&#58; #339933;">&#46;</span> <span style="color&#58; #0000ff;">56</span>             <span style="color&#58; #00007f; font-weight&#58; bold;">PUSH</span> <span style="color&#58; #00007f;">ESI</span>
<span style="color&#58; #adadad; font-style&#58; italic;">0040D359</span>   <span style="color&#58; #339933;">&#46;</span> FFD7           <span style="color&#58; #00007f; font-weight&#58; bold;">CALL</span> <span style="color&#58; #00007f;">EDI</span>
<span style="color&#58; #adadad; font-style&#58; italic;">0040D35B</span>   <span style="color&#58; #339933;">&#46;</span> 83C4 0C        <span style="color&#58; #00007f; font-weight&#58; bold;">ADD</span> <span style="color&#58; #00007f;">ESP</span><span style="color&#58; #339933;">,</span>0C
<span style="color&#58; #adadad; font-style&#58; italic;">0040D35E</span>   &gt; 8B85 D8070000  <span style="color&#58; #00007f; font-weight&#58; bold;">MOV</span> <span style="color&#58; #00007f;">EAX</span><span style="color&#58; #339933;">,</span><span style="color&#58; #000000; font-weight&#58; bold;">DWORD</span> <span style="color&#58; #000000; font-weight&#58; bold;">PTR</span> <span style="color&#58; #00007f;">SS</span><span style="color&#58; #339933;">&#58;</span><span style="color&#58; #009900; font-weight&#58; bold;">&#91;</span><span style="color&#58; #00007f;">EBP</span><span style="color&#58; #339933;">+</span>7D8<span style="color&#58; #009900; font-weight&#58; bold;">&#93;</span></pre></div></div>
		</td></tr></table><br />
<br />
Wowza. We've learnt to find code related to specific strings. Now, lets see what the line is in the memory dump.<br />
<br />
Right Click The Line  ---&gt;  Follow In Dump<br />
<br />
<br />
Your Memory Dump should now look like this:<br />
<br />
<div class="tborder spoiler"><div class="spoiler_header">Memory Dump <a href="javascript:void(0);" onclick="javascript:if(parentNode.parentNode.getElementsByTagName('div')[1].style.display=='block'){parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.innerHTML='(Click to View)';this.parentNode.className = 'spoiler_header';}else {parentNode.parentNode.getElementsByTagName('div')[1].style.display='block';this.innerHTML='(Click to Hide)';;this.parentNode.className += ' spoiler_header_cornered';}">(Click to View)</a></div><div class="spoiler_body" style="display: none;"><img src="http://i284.photobucket.com/albums/ll1/eabc1804/DUMP.png" loading="lazy"  alt="[Image: DUMP.png]" class="mycode_img" /></div></div>
Not something you will find particularly easy to understand. In fact, by the looks of it, that is no use to you at all is it? But I'll give you a slight tip, looking at the first 5 double digit numbers in the Hex Dump (in your Memory Dump) and then look at the second column of the Disassembler from the left along the same line as "hit_Fa". They're exactly the same! Well spotted, that was just an observation though... nothing important to you... well for now most probably.<br />
<br />
That is all I am going to teach you as of searches for now. It is my highest doubt that you will ever need most of the searches, if I am wrong I will simply cover them in a later tutorial. Now on to the final task at hand.<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Modifying</span><br />
Yes the one part of the tutorial that most of you have been waiting for; the chance to modify the Little Fighter program! This is possibly what you've all been thinking about the whole tutorial - why won't he get on with it. Well truth be told, you're not actually going to be modifying anything in this tutorial.<br />
Reader/Pupil/: WHAT!? ARE YOU SERIOUS!?<br />
Me: Yes, deadly.<br />
<br />
If you've been reading through this tutorial as thoroughly as you should have been to get to this point, then it is next to impossible for your mind to really take in too much more information. So I'm only going to outline HOW you would go about modifying, not actually demonstrating any modification to you. If I explained the modification process, it'd mean I'd have to explain some of the code and what it's there for - not going to happen.<br />
<br />
So let us begin the short lesson on modification of the program. Before you do anything towards changing or editing the code - YOU MUST MAKE A BACK UP OF THE .EXE FILE. If you make one mistake in the .exe you will find yourself in a bit of a pickle and your favourite game/program may have to be reinstalled again. If you downloaded it off the internet then deleted the downloadable files - serves you right if you don't make a back up. I suggest making a folder on your desktop named "back up exe's" or "original files".<br />
<br />
Next is the very simple process of how to modify. Here is how you do it (please restart the program using Ctrl + F2 before you try this):<br />
<br />
1) Press Spacebar<br />
2) Right Click (in this case on CALL command)  ---&gt;  Assemble<br />
<br />
You should now have a little screen pop up. In this screen we would normally edit the code that goes into it by typing the instruction and then pressing Assemble. You are not going to do this right now so I suggest pressing Cancel.<br />
<br />
<br />
<br />
We've finally reached the end of this tutorial. Hopefully you have gained a lot through reading this tutorial, it's taken me most of the week to write and then rewrite because I lost it, touch it up so the language was easy to understand, add screenshots and the like. I have to say its been one of my biggest tutorials so far in terms of size if not the biggest.<br />
<br />
In summary, what you should have learned through this tutorial:<br />
- What a Debugger is<br />
- The layout of OllyDbg<br />
- How to add comments<br />
- How to modify (briefly)<br />
- How to search through a program's code<br />
- How to use Go to<br />
- How to insert breakpoints<br />
- How to Step Over and Step Into<br />
- How to Run the program<br />
- Brief introduction to JMP and CALL commands including similarities and differences<br />
- Different types of searches<br />
- How to restart the program within OllyDbg<br />
<br />
I am sorry that I went so in depth with the tutorial, but it is better that way I suppose. If I didn't go in depth in the parts that might have needed it, then you wouldn't have understood it so well. For those of you 'Work Dodgers' you managed to escape narrowly without having to answer questions and for those of you 'Work Lovers' I am sorry I hadn't included any questions, I just didn't deem them necessary as part of the main tutorial.<br />
<br />
Also quite a lot of you were expecting me to do a tutorial involving all the different programs that you may be using when trying to modify Little Fighter programs or other programs. The reason I have done OllyDbg seperately is because it is on a whole other level to the uses that you have with the other programs I'll be showing you. It takes a lot more time to explain in my eyes and so deserves a complete post of its own.<br />
<br />
Okay, most of you are probably asking what tutorials are to come and how long they are going to be. There are quite a lot of tutorials to come and they will all be relatively long, some longer than this one and some shorter. I plan on only passing on the information you need to become proficient with the tools, languages and understanding and no further. I am not going to make you become absolute masters of the coding and programming languages, but I will not just scrape the surface on any of my subjects.<br />
<br />
The tutorials that you can look ahead to:<br />
- Introduction to ResourceHacker and Hex Editors (including Hex Workshop as a main Editor)<br />
- The Basics of Assembly<br />
- The Basics of C++<br />
- Deeper Assembly and C++ Tutorials<br />
- Specific Little Fighter Modifications (eventually involving the addition of new states and Itr's - when I get around to studying the program enough myself)<br />
- Many, many more.<br />
<br />
<br />
So yeah, this will not really be a short term fixture. I intend on keeping these tutorials coming for as long as there are people that may wish to read them or may inhabit this site/forum.<br />
<br />
Now for a few side notes:<br />
<br />
1) If you wish to take this tutorial and put it on another Little Fighter forum or website please come to me for permission to do so. I am not saying this because I feel harsh, I am saying this because I had intended on this tutorial giving people on Little Fighter Empire an upper hand or advantage against the other forums for Little Fighter programs. I also had a very polite young lady ask me through PM if she could take my last tutorial and put it on her school system, of course I gave her permission.<br />
<br />
On the condition that I do give you permission, please state who wrote the tutorial and where it was from. It's only polite and is a good precaution against plaguerism.<br />
<br />
<br />
2) For those of you that are interested, may you please post a reply if you want me to add some questions within the next few days for you to do. If not questions then ask and I will post some activities for you to try out where you can search through code and test your understanding of the tutorial. In general, just give me comments and criticism, it'd be great to improve in my next tutorial and make it more understandable for those of you who read the whole post (hopefully the majority). <br />
<br />
Once again guys thank you for reading, it's been a pleasure to spend a lot of the last week writing this tutorial. And on one last note, based upon somewhat of a Hex Editing/Exe Modifying hero on these forums, Silva said:<br />
'Not enough people read long posts'<br />
Maybe it is a good idea if a lot of us start. If you don't read the length of my posts, most of the time you will not understand what I'm saying and so your replies will be useless.<br />
If I have covered a topic that your reply specifically indicates and shows you haven't read it, I expect other forum members if not myself to simply tell you to 'read the first post'. I'm not trying to be harsh, but it will help you in the long run as most people will eventually tell you.<br />
<br />
<br />
Thank you and I hope this helps,<br />
<br />
Eddie<br />
<br />
P.S - I think I just came up with a decent name instead of 'Unique Member'; Slave Driver. I've probably said it before, but the title fits.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[TUT] Understanding Computer Numeric Systems]]></title>
			<link>https://lf-empire.de/forum/showthread.php?tid=5287</link>
			<pubDate>Fri, 23 Jul 2010 13:35:31 +0200</pubDate>
			<dc:creator><![CDATA[<a href="https://lf-empire.de/forum/member.php?action=profile&uid=2024">Eddie</a>]]></dc:creator>
			<guid isPermaLink="false">https://lf-empire.de/forum/showthread.php?tid=5287</guid>
			<description><![CDATA[<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">Understanding Computer Numeric Systems</span></span></span><br />
<br />
Note:<br />
The only thing you will need for this tutorial is a bit of thought. You will not need any programs, although you may want to grab a calculator or do the math work in your head. I'll give points where you can do a bit of thinking/explaining to yourself so that you can make sure you understand the work. These will be provided at appropriate points in the tutorial.<br />
<br />
Whenever you write a program you will be using a programming language, whether it is Java, C++, Python, you will be using a programming language. The languages you use are made up of 'characters' or symbols. In everyday language these characters/symbols would be called letters or signs (full stop, comma's, question marks, signs, etc), but for computer talk we will refer to them as characters.<br />
<br />
In almost all cases, the computer would see these characters as jumbled up jargon, no matter how you put them in. Well constructed sentences still mean nothing to the computer if it is trying to run them directly. For the computer to understand what you're trying to tell it to do the characters are converted into numbers for various numeric systems.<br />
<br />
This is where this tutorial is going to come into play. I'm going to teach you a few different numeric systems that the computer uses (decimal, binary and hexadecimal). Let it be known whether you deliberately use them or not in your work, the computer still uses and reads them. The latter two will be the most use to you in terms of modifying Little Fighter 2.<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Decimal</span></span><br />
The Decimal numeric system is the most familiar one to you. This is because you use it in every day life. It makes use of these 10 symbols:<br />
<br />
<blockquote class="mycode_quote"><cite>Decimal Symbols Wrote:</cite>0, 1, 2, 3, 4, 5, 6, 7, 8, 9</blockquote><br />
Each symbol is known as a digit. Multiple digits are capable of being combined in various different ways to produce all sorts of numbers imaginable.<br />
<br />
It is called Decimal as it is based on 10 digits (Dec- in Decimal means 10). Although it is common knowledge how to use the Decimal system I am going to show you anyway, purely for the sake of conversions and later ease through the tutorial.<br />
<br />
So here is I would like you to represent your numbers, given a few as examples (Note * means to multiply by):<br />
<br />
<blockquote class="mycode_quote"><cite>Decimal Examples Wrote:</cite>0 = 0 * 10<sup>0</sup><br />
1 = 1 * 10<sup>0</sup><br />
2 = 2 * 10<sup>0</sup><br />
10 = 1 * 10<sup>1</sup> + 0 * 10<sup>0</sup><br />
20 = 2 * 10<sup>1</sup> + 0 * 10<sup>0</sup><br />
24 = 2 * 10<sup>1</sup> + 4 * 10<sup>0</sup><br />
371 = 3 * 10<sup>2</sup> + 7 * 10<sup>1</sup> + 1 * 10<sup>0</sup><br />
632 = 6 * 10<sup>2</sup> + 3 * 10<sup>1</sup> + 2 * 10<sup>0</sup></blockquote><br />
Now hopefully you've understood those fairly well by looking at the pattern. So I'm going to give some rough explanation. Anything to the power of 0 (<sup>0</sup>) = 1. You will always use 10<sup>0</sup> on the furthest right digit. From the furthest right digit, you will count every digit to the left of it, to find what number to use to the power of. I'm going to use 2835561, 38471, 17 and 9643 as examples here to show you how its done:<br />
<br />
<blockquote class="mycode_quote"><cite>Examples Wrote:</cite>l  6  l  5  l  4  l  3  l  2  l  1  l  0  l<br />
<br />
l  2  l  8  l  3  l  5  l  5  l  6  l  1  l<br />
l  0  l  0  l  3  l  8  l  4  l  7  l  1  l<br />
l  0  l  0  l  0  l  9  l  6  l  4  l  3  l<br />
l  0  l  0  l  0  l  0  l  0  l  1  l  7  l</blockquote><br />
Now you can see how they all line up perfectly. The numbers at the top are your positions or powers for each digit. Thats how you are going to allocate the correct powers when using the equations.<br />
<br />
From the mock table you have also noticed that I put 0's in the entries where no other digit would take it up, but why don't we do that when we write down numbers? It is actually to save time, hassle and in this case confusion. You should not write any 0's infront of your numbers for future reference.<br />
<br />
A faster and possibly more efficient way to find the powers is to do the "n-1" rule. n in this rule is how many digits from the right your digit is at. You then subtract (-) 1 from this to get the power that you will be using. Here's an example, where we'll find the power for the digit 3 in 28367:<br />
<br />
<blockquote class="mycode_quote"><cite>n-1 rule Wrote:</cite>28367 l<br />
3 is 3rd along from the line to the right aka n = 3.<br />
n-1 rule is used.<br />
3 - 1 = 2<br />
So we do 3 * 10<sup>2</sup></blockquote><br />
You start your counting from the line (visible or invisible - however you decide to do it) and go left. Simple right? You should use whichever you find easier out of the table and the "n-1" rule. Soon enough you will be able to do it in your head without even thinking about either of the rules, you'll just know it off by heart. These two methods are just stepping stones to get you on your way.<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) Split apart the numbers 84536, 487 and 14 into their seperate equations.<br />
2) Find what power of 10 the 4's are in 84536, 487 and 14 using "n-1" rule.<br />
3) Find what power of 10 the 2's are in 934218, 87326 and 2918345 using the table rule.</span><br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Binary</span></span><br />
The most fundamental of computer or machine languages is the Binary system. It is known as the Binary system because it utilises a base 2 system (bi- in Binary means 2).<br />
<br />
When a computer deals with a piece of information, it considers it either true or false. If it is considered true then it is given a value of 1, if it is considered false then it is given a value of 0. Hence there are only two symbols in this case that the computer will respond to.<br />
<br />
Now we're going to learn to count in Binary. I'm assuming that when you first read something like 101000111110110010101 you do not have a clue what it's saying. In fact it probably just looks like a bunch of 1's and 0's with no logical pattern, which you may mispronounce and use the Decimal system of counting.<br />
<br />
First of all I'll show you how to represent numbers:<br />
<br />
<blockquote class="mycode_quote"><cite>Binary Representation Wrote:</cite>0 = 0 * 2<sup>0</sup><br />
1 = 1 * 2<sup>0</sup><br />
10 = 1 * 2<sup>1</sup> + 0 * 2<sup>0</sup><br />
11 = 1 * 2<sup>1</sup> + 1 * 2<sup>0</sup><br />
100 = 1 * 2<sup>2</sup> + 0 * 2<sup>1</sup> + 0 * 2<sup>0</sup></blockquote><br />
As you can see it is much the same as representing in Decimals however instead of using the base 10 you will use the base 2.<br />
<br />
Now that you've shown how you can represent the numbers, that means you can count or convert the Binary into Decimal. So here are some examples where we convert 101, 11 and 101010010 from Binary to Decimal:<br />
<br />
<blockquote class="mycode_quote"><cite>Binary To Decimal Wrote:</cite>11 = 1 * 2<sup>1</sup> (1 * 2) + 1 * 2<sup>0</sup> (1 * 1) = 3<br />
101 = 1 * 2<sup>2</sup> (1 * 4) + 0 * 2<sup>1</sup> (0 * 2) + 1 * 2<sup>0</sup> (1 * 1) = 5<br />
101010010 = 1 * 2<sup>8</sup> (1 * 256) + 0 * 2<sup>7</sup> (0 * 128) + 1 * 2<sup>6</sup> (1 * 64) + 0 * 2<sup>5</sup> (0 * 32) + 1 * 2<sup>4</sup> (1 * 16) + 0 * 2<sup>3</sup> (0 * 8) + 0 * 2<sup>2</sup> (0 * 4) + 1 * 2<sup>1</sup> (1 * 2) + 0 * 2<sup>0</sup> (0 * 1) = 338</blockquote><br />
As you can also see, the way that you find powers is the same as that done in Decimals. So if you need your memory refreshed on how to find the powers - go back to the Decimal section to do so, looking at the table method and "n-1" rule.<br />
<br />
Keep refreshing your mind on Binary and Decimal as you move on through this tutorial, they're going to become important as we progress, especially Binary.<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) Split apart the following Binary numbers; 1011, 1011010, 101<br />
2) Convert the following from Binary to Decimal; 1011, 1011010, 101<br />
3) Convert the follow from Decimal to Binary; 6, 132, 24<br />
</span><br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Hexadecimal</span></span><br />
Hexadecimal is the most important numeric system to you in terms of Little Fighter 2. This is because you will need it for when you are Hex or .exe editing the Little Fighter 2 program. So pay close attention to this section when you are reading through this tutorial.<br />
<br />
Hexadecimal makes use of a base 16 system. However all latin languages only make use of 10 digits (0 to 9). To get around this problem, Hexadecimal makes use of the first 6 letters of the alphabet to represent their numbers (A-F). To make this slightly easier on you right now I'm going to convert Hexadecimal to Decimal for the first 16 numbers:<br />
<br />
<blockquote class="mycode_quote"><cite>Hexadecimal to Decimal Wrote:</cite>0 = 0<br />
1 = 1<br />
2 = 2<br />
3 = 3<br />
4 = 4<br />
5 = 5<br />
6 = 6<br />
7 = 7<br />
8 = 8<br />
9 = 9<br />
A = 10<br />
B = 11<br />
C = 12<br />
D = 13<br />
E = 14<br />
F = 15</blockquote><br />
Now we know the conversions of the base digits from Hexadecimal into Decimal, we're going to start representing some numbers in their split up form. So here are some examples:<br />
<br />
<blockquote class="mycode_quote"><cite>Examples Wrote:</cite>9 = 9 * 16<sup>0</sup><br />
C = 12 * 16<sup>0</sup> = 12<br />
3F = 3 * 16<sup>1</sup> (3 * 16) + 15 * 16<sup>0</sup> (15 * 1) = 63<br />
1A1 = 1 * 16<sup>2</sup> (1 * 256) + 10 * 16<sup>1</sup> (10 * 16) + 1 * 16<sup>0</sup> (1 * 1) = 417<br />
FF = 15 * 16<sup>1</sup> (15 * 16) + 15 * 16<sup>0</sup> (15 * 1) = 255</blockquote><br />
As you can see, base 16 is used instead of base 10. Once again the powers are worked out through the use of either the table method or the "n-1" rule. Go back to the Decimal section to refresh your mind on these methods.<br />
<br />
Now to stop any confusion between Hexadecimal and Decimal numbers, when you write then down in pseudo-form (aka not in a Hex editor) you are going to put 0x infront of the number, like so:<br />
<br />
0x2F3A, 0x345492, 0xF12<br />
<br />
As some of you may notice, this is how you would represent them in C# or C++ (the language that the Little Fighter program was created in).<br />
<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) Split apart the following Hexadecimal numbers: 1F, 63C, A7C8<br />
2) Convert the following from Hexadecimal to Decimal: 1F, 63C, A7C8<br />
3) Convert the follow from Decimal to Hexadecimal: 19, 342, 92, 2435<br />
</span><br />
<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Conversions</span></span><br />
This is just going to be a quick section showing the conversions of several numbers from Binary to Decimal to Hexadecimal, in that order. I will then ask you to do a few more questions to convert some more yourselves.<br />
<br />
<blockquote class="mycode_quote"><cite>Conversions Table Wrote:</cite>0 = 0 = 0<br />
1 = 1 = 1<br />
10 = 2 = 2<br />
11 = 3 = 3<br />
100 = 4 = 4<br />
101 = 5 = 5<br />
110 = 6 = 6<br />
111 = 7 = 7<br />
1000 = 8 = 8<br />
1001 = 9 = 9<br />
1010 = 10 = A<br />
1011 = 11 = B<br />
1100 = 12 = C<br />
1101 = 13 = D<br />
1110 = 14 = E<br />
1111 = 15 = F<br />
10000 = 16 = 10<br />
10001 = 17 = 11<br />
10010 = 18 = 12<br />
10011 = 19 = 13<br />
10100 = 20 = 14<br />
10101 = 21 = 15<br />
10110 = 22 = 16<br />
10111 = 23 = 17<br />
11000 = 24 = 18<br />
11001 = 25 = 19<br />
11010 = 26 = 1A<br />
11011 = 27 = 1B<br />
11100 = 28 = 1C<br />
11101 = 29 = 1D<br />
11110 = 30 = 1E<br />
11111 = 31 = 1F</blockquote><br />
Those are the first 32 numbers written in Binary, Decimal and Hexadecimal. This is just to give you a head start for when you progress later on, a bit of a taster should we say.<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) Convert the following from Hexadecimal to Decimal; 48, F1F, AC<br />
2) Convert the following from Decimal to Hexadecimal; 103, 8263, 72<br />
3)Convert the following from Binary to Decimal; 1100010, 11101011, 1000001101101<br />
4) Convert the following from Decimal to Binary; 82, 356, 93<br />
5) Convert the following from Binary to Hexadecimal; 1100010, 11101011, 1000001101101<br />
6) Convert the following from Hexadecimal into Binary; 48, F1F, AC<br />
</span><br />
<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Bits</span></span><br />
Computers use Binary to represent their information, utilising only 1's and 0's. These numbers are otherwise known as Digits, as you would find in the Decimal and Hexadecimal system. These Binary Digits are abbreviated to Bit (<span style="text-decoration: underline;" class="mycode_u">Bi</span>nary Digi<span style="text-decoration: underline;" class="mycode_u">t</span>). As said before they are the most fundamental representation of a machine or computers counting system.<br />
<br />
Bits can only store extremely tiny amounts of information. This means that for your computer to hold any decent or relevant information, the Bits would need to be combined. So I bring you to the Four-Bit Combination Model, which is more effective for the computer to use.<br />
<br />
You treat this as you would Binary when working out the combinations, as each of the four sections on the Four-Bit Combination Model can only store either a 1 or a 0. We will count each bit the same way that we counted each digit in Decimal, the "n-1" rule helps out here, once again starting from right and going left.<br />
<br />
The first or 0 bit on the right hand side of the Four-Bit Combination Model is known as the Low Order (LO) Bit. It is also the least significant Bit. The last or 3 bit, located on the left hand side of the Four-Bit Combination Model is known as the High Order (HO) Bit. It is known as the most significant Bit. However, you will not need to go into this for now, it's just for the purpose of knowledge.<br />
<br />
The Four-Bit Combination Model allows for a variety of different combinations, because of the various placements of 0 or 1 that you can have on each bit. In fact, these are the exact combinations that you could have:<br />
<br />
<blockquote class="mycode_quote"><cite>Bit Combinations Wrote:</cite>0000<br />
0001  <br />
0010  <br />
0011  <br />
0100  <br />
0101  <br />
0110  <br />
0111  <br />
1000  <br />
1001  <br />
1010  <br />
1011  <br />
1100  <br />
1101  <br />
1110  <br />
1111</blockquote><br />
That just so happens to be 16 combinations. Now, why is this relevant to you? These 16 combinations just so happen to be equal to the number of Digits you use in Hexadecimal. Each combination is equal to one specific Digit in Hexadecimal.<br />
<br />
This is why a computer is able to read Hexadecimal. It is far less confusing for the person controlling the computer to write in Hexadecimal as the numbers are not extremely long and the computer can easily convert any Hexadecimal Digit or number into Binary in no time at all.<br />
<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) What is a bit?<br />
2) Why is the Four-Bit Combination Model useful to you?<br />
</span><br />
<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Bytes</span></span><br />
Bytes are actually groups of 8 consecutive bits. The Bits in a Byte are counted in the same way you would the Four-Bit Combination Model and also make use of the HO (High Order) and LO (Low Order) Bits, once again something you don't need to know much about.<br />
<br />
Just as you would in the Four-Bit Combination Model, you can use varying different combinations of 1's and 0's to count in a Byte. The lowest value of which is 00000000 and the highest value would be 11111111.<br />
<br />
I am not going to show you all the different combinations of Bits within a Byte, purely because that would take a long time and I would lose my patience. Instead I am going to tell you how many different combinations you can get and how you can work it out.<br />
<br />
<blockquote class="mycode_quote"><cite>Byte Combinations Wrote:</cite>Using the Base 2 rule:<br />
2<sup>7</sup> + 2<sup>6</sup> + 2<sup>5</sup> + 2<sup>4</sup> + 2<sup>3</sup> + 2<sup>2</sup> + 2<sup>1</sup> + 2<sup>0</sup> =<br />
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1<br />
= 255<br />
<br />
Now, the last Bit can also have a 0 and not just a 1, so we will add 1 more combination to it.<br />
<br />
255 + 1 = 256</blockquote><br />
Now once again I'm going to ask you, why on earth is this important to you? The amount of information stored by a Byte is capable of storing a single character (A, B, C, D..., 1, 2, 3... ?, &gt;, &lt;.... etc) that you may use on your keyboard.<br />
The characters are organised by something all coders or Hexers may have heard of or seen before; ASCII. This stands for the American Standard Code for Information Exchange (Don't ask by the way, I don't know why there is an I instead of an E... it is just there).<br />
ASCII uses only 128 Decimal numbers (7 Bit) to represent symbols or characters counted from 0-127. Which brings you to another question... why on earth would you need to use a Byte or 8 bit combination? Answer; It's the minimum storage area offered by the computer (Intel). So what happens to the last bit? It's used for accents, mathematical symbols, small graphics.. etc.<br />
<br />
Okay so why is this important to you? Sure a Byte can hold the ASCII that you need, but how does that really help with Hex Editing? Well, if by now you hadn't noticed or tested for 2 digits in Hexadecimal, the maximum number produced is 255 in Decimal (0xFF).<br />
<br />
Now if you look at a true Hex Editor like Hex Workshop or OllyDbg you will notice that you get lots of 2 digit combinations of Hex in the Hex area. Thats because a Hex Editor is used to view every single byte that a program has. So of course, the Byte is very important for you to know about, purely for the sake of knowing about it and understanding what you're doing a little better.<br />
<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) What is the maximum number in Decimal that can be stored in a Byte?<br />
2) How many Bits is a Byte made out of?<br />
3) How many combinations of Bits in a Byte can you get?<br />
4) What does ASCII stand for?<br />
5) Why is a Byte useful to you?<br />
</span><br />
<br />
<br />
<br />
Okay, I'm glad to see you stuck with this tutorial till the end, I hope it helps. Remember there will be a lot more tutorials to come from me, this is simply the basics for you to get your head around. Some of you this may have helped, some of you it may not have, some it may have just done an overall recap of something you already knew. <br />
<br />
Now, as for the answers to the questions I will post them up soon. For now if you definately need them, try to google them as I'm sure most of them will be on there.<br />
<br />
If anyone would like to know any more on a certain topic or section of this tutorial, feel free to leave a message on exactly what it is you'd like to learn more about. I'll then try my best to make a more in depth guide for it.<br />
<br />
<br />
Next Tutorial will be:<br />
Learning your way around Hex Editors -<br />
I will be using a variety of different Hex Editors and programs, and displaying with pictures what you need to know to find your way around them and to find code.<br />
<br />
Future Tutorials:<br />
I will be writing small programs which I will then put for download. These programs can then be looked at in the Hex Editors by you. I will then explain how you can convert some of the Hex you see into pseudo code.<br />
I will also explain certain commands and stuff you find in Hex Editors.<br />
Later I will bring in specific Little Fighter related stuff - possibly going into detail about PLATFORMS, new ITR's and generally recovering the work that Silva did, explaining it a bit more idiot friendly though..<br />
<br />
<br />
That's all for now guys, feel free to leave thanks please - would be much appreciated since I've spent since 5 this morning trying to write this guide perfectly and shorten it for you in places where I deemed necessary. I also tried to check the language I used and if anyone wants, point out the grammatical errors or flaws in my English and I will rewrite it.<br />
<br />
Oh yeah, please keep reminding me when you can to stay true to this Hex Teaching Quest. If I don't post up new stuff in days/weeks please Mods and Admins, remind me that I need to!<br />
<br />
<br />
Eddie]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u"><span style="font-size: large;" class="mycode_size">Understanding Computer Numeric Systems</span></span></span><br />
<br />
Note:<br />
The only thing you will need for this tutorial is a bit of thought. You will not need any programs, although you may want to grab a calculator or do the math work in your head. I'll give points where you can do a bit of thinking/explaining to yourself so that you can make sure you understand the work. These will be provided at appropriate points in the tutorial.<br />
<br />
Whenever you write a program you will be using a programming language, whether it is Java, C++, Python, you will be using a programming language. The languages you use are made up of 'characters' or symbols. In everyday language these characters/symbols would be called letters or signs (full stop, comma's, question marks, signs, etc), but for computer talk we will refer to them as characters.<br />
<br />
In almost all cases, the computer would see these characters as jumbled up jargon, no matter how you put them in. Well constructed sentences still mean nothing to the computer if it is trying to run them directly. For the computer to understand what you're trying to tell it to do the characters are converted into numbers for various numeric systems.<br />
<br />
This is where this tutorial is going to come into play. I'm going to teach you a few different numeric systems that the computer uses (decimal, binary and hexadecimal). Let it be known whether you deliberately use them or not in your work, the computer still uses and reads them. The latter two will be the most use to you in terms of modifying Little Fighter 2.<br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Decimal</span></span><br />
The Decimal numeric system is the most familiar one to you. This is because you use it in every day life. It makes use of these 10 symbols:<br />
<br />
<blockquote class="mycode_quote"><cite>Decimal Symbols Wrote:</cite>0, 1, 2, 3, 4, 5, 6, 7, 8, 9</blockquote><br />
Each symbol is known as a digit. Multiple digits are capable of being combined in various different ways to produce all sorts of numbers imaginable.<br />
<br />
It is called Decimal as it is based on 10 digits (Dec- in Decimal means 10). Although it is common knowledge how to use the Decimal system I am going to show you anyway, purely for the sake of conversions and later ease through the tutorial.<br />
<br />
So here is I would like you to represent your numbers, given a few as examples (Note * means to multiply by):<br />
<br />
<blockquote class="mycode_quote"><cite>Decimal Examples Wrote:</cite>0 = 0 * 10<sup>0</sup><br />
1 = 1 * 10<sup>0</sup><br />
2 = 2 * 10<sup>0</sup><br />
10 = 1 * 10<sup>1</sup> + 0 * 10<sup>0</sup><br />
20 = 2 * 10<sup>1</sup> + 0 * 10<sup>0</sup><br />
24 = 2 * 10<sup>1</sup> + 4 * 10<sup>0</sup><br />
371 = 3 * 10<sup>2</sup> + 7 * 10<sup>1</sup> + 1 * 10<sup>0</sup><br />
632 = 6 * 10<sup>2</sup> + 3 * 10<sup>1</sup> + 2 * 10<sup>0</sup></blockquote><br />
Now hopefully you've understood those fairly well by looking at the pattern. So I'm going to give some rough explanation. Anything to the power of 0 (<sup>0</sup>) = 1. You will always use 10<sup>0</sup> on the furthest right digit. From the furthest right digit, you will count every digit to the left of it, to find what number to use to the power of. I'm going to use 2835561, 38471, 17 and 9643 as examples here to show you how its done:<br />
<br />
<blockquote class="mycode_quote"><cite>Examples Wrote:</cite>l  6  l  5  l  4  l  3  l  2  l  1  l  0  l<br />
<br />
l  2  l  8  l  3  l  5  l  5  l  6  l  1  l<br />
l  0  l  0  l  3  l  8  l  4  l  7  l  1  l<br />
l  0  l  0  l  0  l  9  l  6  l  4  l  3  l<br />
l  0  l  0  l  0  l  0  l  0  l  1  l  7  l</blockquote><br />
Now you can see how they all line up perfectly. The numbers at the top are your positions or powers for each digit. Thats how you are going to allocate the correct powers when using the equations.<br />
<br />
From the mock table you have also noticed that I put 0's in the entries where no other digit would take it up, but why don't we do that when we write down numbers? It is actually to save time, hassle and in this case confusion. You should not write any 0's infront of your numbers for future reference.<br />
<br />
A faster and possibly more efficient way to find the powers is to do the "n-1" rule. n in this rule is how many digits from the right your digit is at. You then subtract (-) 1 from this to get the power that you will be using. Here's an example, where we'll find the power for the digit 3 in 28367:<br />
<br />
<blockquote class="mycode_quote"><cite>n-1 rule Wrote:</cite>28367 l<br />
3 is 3rd along from the line to the right aka n = 3.<br />
n-1 rule is used.<br />
3 - 1 = 2<br />
So we do 3 * 10<sup>2</sup></blockquote><br />
You start your counting from the line (visible or invisible - however you decide to do it) and go left. Simple right? You should use whichever you find easier out of the table and the "n-1" rule. Soon enough you will be able to do it in your head without even thinking about either of the rules, you'll just know it off by heart. These two methods are just stepping stones to get you on your way.<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) Split apart the numbers 84536, 487 and 14 into their seperate equations.<br />
2) Find what power of 10 the 4's are in 84536, 487 and 14 using "n-1" rule.<br />
3) Find what power of 10 the 2's are in 934218, 87326 and 2918345 using the table rule.</span><br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Binary</span></span><br />
The most fundamental of computer or machine languages is the Binary system. It is known as the Binary system because it utilises a base 2 system (bi- in Binary means 2).<br />
<br />
When a computer deals with a piece of information, it considers it either true or false. If it is considered true then it is given a value of 1, if it is considered false then it is given a value of 0. Hence there are only two symbols in this case that the computer will respond to.<br />
<br />
Now we're going to learn to count in Binary. I'm assuming that when you first read something like 101000111110110010101 you do not have a clue what it's saying. In fact it probably just looks like a bunch of 1's and 0's with no logical pattern, which you may mispronounce and use the Decimal system of counting.<br />
<br />
First of all I'll show you how to represent numbers:<br />
<br />
<blockquote class="mycode_quote"><cite>Binary Representation Wrote:</cite>0 = 0 * 2<sup>0</sup><br />
1 = 1 * 2<sup>0</sup><br />
10 = 1 * 2<sup>1</sup> + 0 * 2<sup>0</sup><br />
11 = 1 * 2<sup>1</sup> + 1 * 2<sup>0</sup><br />
100 = 1 * 2<sup>2</sup> + 0 * 2<sup>1</sup> + 0 * 2<sup>0</sup></blockquote><br />
As you can see it is much the same as representing in Decimals however instead of using the base 10 you will use the base 2.<br />
<br />
Now that you've shown how you can represent the numbers, that means you can count or convert the Binary into Decimal. So here are some examples where we convert 101, 11 and 101010010 from Binary to Decimal:<br />
<br />
<blockquote class="mycode_quote"><cite>Binary To Decimal Wrote:</cite>11 = 1 * 2<sup>1</sup> (1 * 2) + 1 * 2<sup>0</sup> (1 * 1) = 3<br />
101 = 1 * 2<sup>2</sup> (1 * 4) + 0 * 2<sup>1</sup> (0 * 2) + 1 * 2<sup>0</sup> (1 * 1) = 5<br />
101010010 = 1 * 2<sup>8</sup> (1 * 256) + 0 * 2<sup>7</sup> (0 * 128) + 1 * 2<sup>6</sup> (1 * 64) + 0 * 2<sup>5</sup> (0 * 32) + 1 * 2<sup>4</sup> (1 * 16) + 0 * 2<sup>3</sup> (0 * 8) + 0 * 2<sup>2</sup> (0 * 4) + 1 * 2<sup>1</sup> (1 * 2) + 0 * 2<sup>0</sup> (0 * 1) = 338</blockquote><br />
As you can also see, the way that you find powers is the same as that done in Decimals. So if you need your memory refreshed on how to find the powers - go back to the Decimal section to do so, looking at the table method and "n-1" rule.<br />
<br />
Keep refreshing your mind on Binary and Decimal as you move on through this tutorial, they're going to become important as we progress, especially Binary.<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) Split apart the following Binary numbers; 1011, 1011010, 101<br />
2) Convert the following from Binary to Decimal; 1011, 1011010, 101<br />
3) Convert the follow from Decimal to Binary; 6, 132, 24<br />
</span><br />
<br />
<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="text-decoration: underline;" class="mycode_u">Hexadecimal</span></span><br />
Hexadecimal is the most important numeric system to you in terms of Little Fighter 2. This is because you will need it for when you are Hex or .exe editing the Little Fighter 2 program. So pay close attention to this section when you are reading through this tutorial.<br />
<br />
Hexadecimal makes use of a base 16 system. However all latin languages only make use of 10 digits (0 to 9). To get around this problem, Hexadecimal makes use of the first 6 letters of the alphabet to represent their numbers (A-F). To make this slightly easier on you right now I'm going to convert Hexadecimal to Decimal for the first 16 numbers:<br />
<br />
<blockquote class="mycode_quote"><cite>Hexadecimal to Decimal Wrote:</cite>0 = 0<br />
1 = 1<br />
2 = 2<br />
3 = 3<br />
4 = 4<br />
5 = 5<br />
6 = 6<br />
7 = 7<br />
8 = 8<br />
9 = 9<br />
A = 10<br />
B = 11<br />
C = 12<br />
D = 13<br />
E = 14<br />
F = 15</blockquote><br />
Now we know the conversions of the base digits from Hexadecimal into Decimal, we're going to start representing some numbers in their split up form. So here are some examples:<br />
<br />
<blockquote class="mycode_quote"><cite>Examples Wrote:</cite>9 = 9 * 16<sup>0</sup><br />
C = 12 * 16<sup>0</sup> = 12<br />
3F = 3 * 16<sup>1</sup> (3 * 16) + 15 * 16<sup>0</sup> (15 * 1) = 63<br />
1A1 = 1 * 16<sup>2</sup> (1 * 256) + 10 * 16<sup>1</sup> (10 * 16) + 1 * 16<sup>0</sup> (1 * 1) = 417<br />
FF = 15 * 16<sup>1</sup> (15 * 16) + 15 * 16<sup>0</sup> (15 * 1) = 255</blockquote><br />
As you can see, base 16 is used instead of base 10. Once again the powers are worked out through the use of either the table method or the "n-1" rule. Go back to the Decimal section to refresh your mind on these methods.<br />
<br />
Now to stop any confusion between Hexadecimal and Decimal numbers, when you write then down in pseudo-form (aka not in a Hex editor) you are going to put 0x infront of the number, like so:<br />
<br />
0x2F3A, 0x345492, 0xF12<br />
<br />
As some of you may notice, this is how you would represent them in C# or C++ (the language that the Little Fighter program was created in).<br />
<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) Split apart the following Hexadecimal numbers: 1F, 63C, A7C8<br />
2) Convert the following from Hexadecimal to Decimal: 1F, 63C, A7C8<br />
3) Convert the follow from Decimal to Hexadecimal: 19, 342, 92, 2435<br />
</span><br />
<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Conversions</span></span><br />
This is just going to be a quick section showing the conversions of several numbers from Binary to Decimal to Hexadecimal, in that order. I will then ask you to do a few more questions to convert some more yourselves.<br />
<br />
<blockquote class="mycode_quote"><cite>Conversions Table Wrote:</cite>0 = 0 = 0<br />
1 = 1 = 1<br />
10 = 2 = 2<br />
11 = 3 = 3<br />
100 = 4 = 4<br />
101 = 5 = 5<br />
110 = 6 = 6<br />
111 = 7 = 7<br />
1000 = 8 = 8<br />
1001 = 9 = 9<br />
1010 = 10 = A<br />
1011 = 11 = B<br />
1100 = 12 = C<br />
1101 = 13 = D<br />
1110 = 14 = E<br />
1111 = 15 = F<br />
10000 = 16 = 10<br />
10001 = 17 = 11<br />
10010 = 18 = 12<br />
10011 = 19 = 13<br />
10100 = 20 = 14<br />
10101 = 21 = 15<br />
10110 = 22 = 16<br />
10111 = 23 = 17<br />
11000 = 24 = 18<br />
11001 = 25 = 19<br />
11010 = 26 = 1A<br />
11011 = 27 = 1B<br />
11100 = 28 = 1C<br />
11101 = 29 = 1D<br />
11110 = 30 = 1E<br />
11111 = 31 = 1F</blockquote><br />
Those are the first 32 numbers written in Binary, Decimal and Hexadecimal. This is just to give you a head start for when you progress later on, a bit of a taster should we say.<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) Convert the following from Hexadecimal to Decimal; 48, F1F, AC<br />
2) Convert the following from Decimal to Hexadecimal; 103, 8263, 72<br />
3)Convert the following from Binary to Decimal; 1100010, 11101011, 1000001101101<br />
4) Convert the following from Decimal to Binary; 82, 356, 93<br />
5) Convert the following from Binary to Hexadecimal; 1100010, 11101011, 1000001101101<br />
6) Convert the following from Hexadecimal into Binary; 48, F1F, AC<br />
</span><br />
<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Bits</span></span><br />
Computers use Binary to represent their information, utilising only 1's and 0's. These numbers are otherwise known as Digits, as you would find in the Decimal and Hexadecimal system. These Binary Digits are abbreviated to Bit (<span style="text-decoration: underline;" class="mycode_u">Bi</span>nary Digi<span style="text-decoration: underline;" class="mycode_u">t</span>). As said before they are the most fundamental representation of a machine or computers counting system.<br />
<br />
Bits can only store extremely tiny amounts of information. This means that for your computer to hold any decent or relevant information, the Bits would need to be combined. So I bring you to the Four-Bit Combination Model, which is more effective for the computer to use.<br />
<br />
You treat this as you would Binary when working out the combinations, as each of the four sections on the Four-Bit Combination Model can only store either a 1 or a 0. We will count each bit the same way that we counted each digit in Decimal, the "n-1" rule helps out here, once again starting from right and going left.<br />
<br />
The first or 0 bit on the right hand side of the Four-Bit Combination Model is known as the Low Order (LO) Bit. It is also the least significant Bit. The last or 3 bit, located on the left hand side of the Four-Bit Combination Model is known as the High Order (HO) Bit. It is known as the most significant Bit. However, you will not need to go into this for now, it's just for the purpose of knowledge.<br />
<br />
The Four-Bit Combination Model allows for a variety of different combinations, because of the various placements of 0 or 1 that you can have on each bit. In fact, these are the exact combinations that you could have:<br />
<br />
<blockquote class="mycode_quote"><cite>Bit Combinations Wrote:</cite>0000<br />
0001  <br />
0010  <br />
0011  <br />
0100  <br />
0101  <br />
0110  <br />
0111  <br />
1000  <br />
1001  <br />
1010  <br />
1011  <br />
1100  <br />
1101  <br />
1110  <br />
1111</blockquote><br />
That just so happens to be 16 combinations. Now, why is this relevant to you? These 16 combinations just so happen to be equal to the number of Digits you use in Hexadecimal. Each combination is equal to one specific Digit in Hexadecimal.<br />
<br />
This is why a computer is able to read Hexadecimal. It is far less confusing for the person controlling the computer to write in Hexadecimal as the numbers are not extremely long and the computer can easily convert any Hexadecimal Digit or number into Binary in no time at all.<br />
<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) What is a bit?<br />
2) Why is the Four-Bit Combination Model useful to you?<br />
</span><br />
<br />
<br />
<br />
<span style="text-decoration: underline;" class="mycode_u"><span style="font-weight: bold;" class="mycode_b">Bytes</span></span><br />
Bytes are actually groups of 8 consecutive bits. The Bits in a Byte are counted in the same way you would the Four-Bit Combination Model and also make use of the HO (High Order) and LO (Low Order) Bits, once again something you don't need to know much about.<br />
<br />
Just as you would in the Four-Bit Combination Model, you can use varying different combinations of 1's and 0's to count in a Byte. The lowest value of which is 00000000 and the highest value would be 11111111.<br />
<br />
I am not going to show you all the different combinations of Bits within a Byte, purely because that would take a long time and I would lose my patience. Instead I am going to tell you how many different combinations you can get and how you can work it out.<br />
<br />
<blockquote class="mycode_quote"><cite>Byte Combinations Wrote:</cite>Using the Base 2 rule:<br />
2<sup>7</sup> + 2<sup>6</sup> + 2<sup>5</sup> + 2<sup>4</sup> + 2<sup>3</sup> + 2<sup>2</sup> + 2<sup>1</sup> + 2<sup>0</sup> =<br />
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1<br />
= 255<br />
<br />
Now, the last Bit can also have a 0 and not just a 1, so we will add 1 more combination to it.<br />
<br />
255 + 1 = 256</blockquote><br />
Now once again I'm going to ask you, why on earth is this important to you? The amount of information stored by a Byte is capable of storing a single character (A, B, C, D..., 1, 2, 3... ?, &gt;, &lt;.... etc) that you may use on your keyboard.<br />
The characters are organised by something all coders or Hexers may have heard of or seen before; ASCII. This stands for the American Standard Code for Information Exchange (Don't ask by the way, I don't know why there is an I instead of an E... it is just there).<br />
ASCII uses only 128 Decimal numbers (7 Bit) to represent symbols or characters counted from 0-127. Which brings you to another question... why on earth would you need to use a Byte or 8 bit combination? Answer; It's the minimum storage area offered by the computer (Intel). So what happens to the last bit? It's used for accents, mathematical symbols, small graphics.. etc.<br />
<br />
Okay so why is this important to you? Sure a Byte can hold the ASCII that you need, but how does that really help with Hex Editing? Well, if by now you hadn't noticed or tested for 2 digits in Hexadecimal, the maximum number produced is 255 in Decimal (0xFF).<br />
<br />
Now if you look at a true Hex Editor like Hex Workshop or OllyDbg you will notice that you get lots of 2 digit combinations of Hex in the Hex area. Thats because a Hex Editor is used to view every single byte that a program has. So of course, the Byte is very important for you to know about, purely for the sake of knowing about it and understanding what you're doing a little better.<br />
<br />
<br />
<span style="color: #FF0000;" class="mycode_color"><span style="text-decoration: underline;" class="mycode_u">Questions</span><br />
1) What is the maximum number in Decimal that can be stored in a Byte?<br />
2) How many Bits is a Byte made out of?<br />
3) How many combinations of Bits in a Byte can you get?<br />
4) What does ASCII stand for?<br />
5) Why is a Byte useful to you?<br />
</span><br />
<br />
<br />
<br />
Okay, I'm glad to see you stuck with this tutorial till the end, I hope it helps. Remember there will be a lot more tutorials to come from me, this is simply the basics for you to get your head around. Some of you this may have helped, some of you it may not have, some it may have just done an overall recap of something you already knew. <br />
<br />
Now, as for the answers to the questions I will post them up soon. For now if you definately need them, try to google them as I'm sure most of them will be on there.<br />
<br />
If anyone would like to know any more on a certain topic or section of this tutorial, feel free to leave a message on exactly what it is you'd like to learn more about. I'll then try my best to make a more in depth guide for it.<br />
<br />
<br />
Next Tutorial will be:<br />
Learning your way around Hex Editors -<br />
I will be using a variety of different Hex Editors and programs, and displaying with pictures what you need to know to find your way around them and to find code.<br />
<br />
Future Tutorials:<br />
I will be writing small programs which I will then put for download. These programs can then be looked at in the Hex Editors by you. I will then explain how you can convert some of the Hex you see into pseudo code.<br />
I will also explain certain commands and stuff you find in Hex Editors.<br />
Later I will bring in specific Little Fighter related stuff - possibly going into detail about PLATFORMS, new ITR's and generally recovering the work that Silva did, explaining it a bit more idiot friendly though..<br />
<br />
<br />
That's all for now guys, feel free to leave thanks please - would be much appreciated since I've spent since 5 this morning trying to write this guide perfectly and shorten it for you in places where I deemed necessary. I also tried to check the language I used and if anyone wants, point out the grammatical errors or flaws in my English and I will rewrite it.<br />
<br />
Oh yeah, please keep reminding me when you can to stay true to this Hex Teaching Quest. If I don't post up new stuff in days/weeks please Mods and Admins, remind me that I need to!<br />
<br />
<br />
Eddie]]></content:encoded>
		</item>
	</channel>
</rss>