<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-917955238935714832</id><updated>2026-02-09T05:00:25.629-08:00</updated><category term="ctf"/><category term="pwn"/><category term="capture the flag"/><category term="reverse engineering"/><category term="setgid"/><category term="assembly"/><category term="env"/><category term="exploit"/><category term="gdb"/><category term="heap"/><category term="pipe redirection"/><category term="stack buffer overflow"/><category term="use after free"/><title type='text'>NexusDroid</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nexusdroid.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/917955238935714832/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://nexusdroid.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>DP</name><uri>http://www.blogger.com/profile/05100193468791944878</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-917955238935714832.post-4868314453420418825</id><published>2016-09-06T07:25:00.000-07:00</published><updated>2016-09-06T07:25:58.961-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ctf"/><category scheme="http://www.blogger.com/atom/ns#" term="exploit"/><category scheme="http://www.blogger.com/atom/ns#" term="heap"/><category scheme="http://www.blogger.com/atom/ns#" term="pwn"/><category scheme="http://www.blogger.com/atom/ns#" term="reverse engineering"/><category scheme="http://www.blogger.com/atom/ns#" term="use after free"/><title type='text'>IceCTF : Stage 3 Drumpf Hotels writeup</title><content type='html'>&lt;h4 style=&quot;color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; font-weight: bolder; line-height: 1.4; margin: 1.12em 0px; padding: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Site:&amp;nbsp;https://icec.tf/&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style=&quot;color: #333333; font-family: &amp;quot;Helvetica Neue Light&amp;quot;, HelveticaNeue-Light, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; font-weight: bolder; line-height: 1.4; margin: 1.12em 0px; padding: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Challenge:&lt;/span&gt;&lt;/h4&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: rgba(0 , 0 , 0 , 0.870588); font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 15px; line-height: 22.5px;&quot;&gt;Drumpf Hotels - Making security great again! Donald Drumpf decided to move his hotel operations online. Since he isn&#39;t very fond of foreigners coding for him, he dediced to code the platform with his own tiny hands.&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #f9f2f4; border-radius: 4px; box-sizing: inherit; color: #c7254e; font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace; font-size: 13.5px; padding: 2px 4px;&quot;&gt;nc drumpf.vuln.icec.tf 6502&lt;/code&gt;&lt;span style=&quot;background-color: white; color: rgba(0 , 0 , 0 , 0.870588); font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 15px; line-height: 22.5px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://play.icec.tf/problem-static/drumpf_eb9f02ed8dfc8aed3e311f4bc7aea372a403f184ccd568828eb0a99b3559a50c&quot; style=&quot;-webkit-tap-highlight-color: transparent; background-color: white; box-sizing: inherit; color: #039be5; font-family: Roboto, sans-serif; font-size: 15px; line-height: 22.5px; text-decoration: none;&quot;&gt;download file&lt;/a&gt;&lt;span style=&quot;background-color: white; color: rgba(0 , 0 , 0 , 0.870588); font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 15px; line-height: 22.5px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: rgba(0 , 0 , 0 , 0.870588); font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 15px; line-height: 22.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: rgba(0 , 0 , 0 , 0.870588); font-family: &amp;quot;roboto&amp;quot; , sans-serif; font-size: 15px; line-height: 22.5px;&quot;&gt;Writeup:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I use netcat to connect to the challenge running on port 6502 and see it is a room booking system.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBM8AYBWyndytaIR_o3bIXmty8j7pZZsk-l5JPwhpTTVL1U6oso47ALoa_Wx6FZYtnJPCokeSUti4MMxM4pSAv__83ZbTCP9dnMo9weZ1yhrO3jyhM99I0etpFut-W6uj2Gs_P-wGiDODi/s1600/drumpf.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBM8AYBWyndytaIR_o3bIXmty8j7pZZsk-l5JPwhpTTVL1U6oso47ALoa_Wx6FZYtnJPCokeSUti4MMxM4pSAv__83ZbTCP9dnMo9weZ1yhrO3jyhM99I0etpFut-W6uj2Gs_P-wGiDODi/s640/drumpf.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
I downloaded the binary from the download link and analyzed it in gdb. The first step is to disassemble the main function and see what functions are called. It has print_logo, print_menu, book_suite, book_room, delete_booking and print_booking which corresponds to the logo, menu and options provided to the user when connected to this service.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;(gdb) disass main&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;Dump of assembler code for function main:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048ace &amp;lt;+0&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;push &amp;nbsp; %ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048acf &amp;lt;+1&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048ad1 &amp;lt;+3&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;and &amp;nbsp; &amp;nbsp;$0xfffffff0,%esp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048ad4 &amp;lt;+6&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;sub &amp;nbsp; &amp;nbsp;$0x20,%esp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048ad7 &amp;lt;+9&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%gs:0x14,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048add &amp;lt;+15&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x1c(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048ae1 &amp;lt;+19&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048ae3 &amp;lt;+21&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80486c1 &amp;lt;print_logo&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048ae8 &amp;lt;+26&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80486fe &amp;lt;print_menu&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048aed &amp;lt;+31&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b060,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048af2 &amp;lt;+36&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x8(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048af6 &amp;lt;+40&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x4,0x4(%esp) &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048afe &amp;lt;+48&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;lea &amp;nbsp; &amp;nbsp;0x18(%esp),%eax &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b02 &amp;lt;+52&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b05 &amp;lt;+55&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484c0 &amp;lt;fgets@plt&amp;gt;--&amp;gt;read 4 bytes from stdin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b0a &amp;lt;+60&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;lea &amp;nbsp; &amp;nbsp;0x18(%esp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b0e &amp;lt;+64&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b11 &amp;lt;+67&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048530 &amp;lt;atoi@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b16 &amp;lt;+72&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;cmp &amp;nbsp; &amp;nbsp;$0x5,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b19 &amp;lt;+75&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ja &amp;nbsp; &amp;nbsp; 0x8048b6d &amp;lt;main+159&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b1b &amp;lt;+77&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x8049754(,%eax,4),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b22 &amp;lt;+84&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jmp &amp;nbsp; &amp;nbsp;*%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b24 &amp;lt;+86&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x804873b &amp;lt;book_suite&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b29 &amp;lt;+91&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jmp &amp;nbsp; &amp;nbsp;0x8048b8b &amp;lt;main+189&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b2b &amp;lt;+93&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048820 &amp;lt;book_room&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b30 &amp;lt;+98&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jmp &amp;nbsp; &amp;nbsp;0x8048b8b &amp;lt;main+189&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b32 &amp;lt;+100&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80488f6 &amp;lt;delete_booking&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b37 &amp;lt;+105&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jmp &amp;nbsp; &amp;nbsp;0x8048b8b &amp;lt;main+189&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b39 &amp;lt;+107&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80489a5 &amp;lt;print_booking&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b3e &amp;lt;+112&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jmp &amp;nbsp; &amp;nbsp;0x8048b8b &amp;lt;main+189&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b40 &amp;lt;+114&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x8049725,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b47 &amp;lt;+121&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484f0 &amp;lt;puts@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b4c &amp;lt;+126&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b51 &amp;lt;+131&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b54 &amp;lt;+134&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b59 &amp;lt;+139&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;$0x0,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b5e &amp;lt;+144&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x1c(%esp),%edx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b62 &amp;lt;+148&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%gs:0x14,%edx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b69 &amp;lt;+155&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;je &amp;nbsp; &amp;nbsp; 0x8048b95 &amp;lt;main+199&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b6b &amp;lt;+157&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jmp &amp;nbsp; &amp;nbsp;0x8048b90 &amp;lt;main+194&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b6d &amp;lt;+159&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x8049741,(%esp) &amp;nbsp; &amp;nbsp;--&amp;gt; &quot;Invalid choice!&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b74 &amp;lt;+166&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484f0 &amp;lt;puts@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b79 &amp;lt;+171&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b7e &amp;lt;+176&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b81 &amp;lt;+179&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b86 &amp;lt;+184&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jmp &amp;nbsp; &amp;nbsp;0x8048ae8 &amp;lt;main+26&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b8b &amp;lt;+189&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jmp &amp;nbsp; &amp;nbsp;0x8048ae8 &amp;lt;main+26&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b90 &amp;lt;+194&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484d0 &amp;lt;__stack_chk_fail@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b95 &amp;lt;+199&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;leave &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048b96 &amp;lt;+200&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ret &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;End of assembler dump.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
There is one function flag() at 0x0804863d in the program that never gets called in the program flow and all it does is open and print the output of the ./flag.txt file. I need to find a way to make the program call this function to reveal the flag.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;(gdb) disass flag&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;Dump of assembler code for function flag:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804863d &amp;lt;+0&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;push &amp;nbsp; %ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804863e &amp;lt;+1&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048640 &amp;lt;+3&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;sub &amp;nbsp; &amp;nbsp;$0x128,%esp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048646 &amp;lt;+9&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%gs:0x14,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804864c &amp;lt;+15&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,-0xc(%ebp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804864f &amp;lt;+18&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048651 &amp;lt;+20&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x0,0x4(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048659 &amp;lt;+28&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x8048c30,(%esp) --&amp;gt;&amp;nbsp;&quot;./flag.txt&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048660 &amp;lt;+35&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048510 &amp;lt;open@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048665 &amp;lt;+40&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,-0x110(%ebp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804866b &amp;lt;+46&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x100,0x8(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048673 &amp;lt;+54&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;lea &amp;nbsp; &amp;nbsp;-0x10c(%ebp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048679 &amp;lt;+60&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x4(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804867d &amp;lt;+64&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;-0x110(%ebp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048683 &amp;lt;+70&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048686 &amp;lt;+73&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048480 &amp;lt;read@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804868b &amp;lt;+78&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;lea &amp;nbsp; &amp;nbsp;-0x10c(%ebp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048691 &amp;lt;+84&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x4(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048695 &amp;lt;+88&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x8048c3b,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804869c &amp;lt;+95&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048490 &amp;lt;printf@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080486a1 &amp;lt;+100&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080486a6 &amp;lt;+105&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080486a9 &amp;lt;+108&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080486ba &amp;lt;+125&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484d0 &amp;lt;__stack_chk_fail@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080486bf &amp;lt;+130&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;leave &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080486c0 &amp;lt;+131&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ret &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;End of assembler dump.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;(gdb)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Let&#39;s see what the other functions does. Disassembling book_suite function, I can see 264 bytes is allocated in heap memory. First 4 bytes to store the address of print_name function, 256 bytes for name and 4 bytes for suite number.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;Dump of assembler code for function book_suite:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804873b &amp;lt;+0&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;push &amp;nbsp; %ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804873c &amp;lt;+1&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804873e &amp;lt;+3&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;push &amp;nbsp; %ebx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804873f &amp;lt;+4&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;sub &amp;nbsp; &amp;nbsp;$0x34,%esp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048742 &amp;lt;+7&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%gs:0x14,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048748 &amp;lt;+13&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,-0xc(%ebp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804874b &amp;lt;+16&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804874d &amp;lt;+18&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x108,(%esp) &amp;nbsp; --&amp;gt;Allocate 264 bytes in heap memory&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048754 &amp;lt;+25&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484e0 &amp;lt;malloc@plt&amp;gt; --&amp;gt; return ptr to memory in eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048759 &amp;lt;+30&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x804b088 &amp;nbsp;--&amp;gt; assign ptr to variable suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804875e &amp;lt;+35&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x8049688,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048765 &amp;lt;+42&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048490 &amp;lt;printf@plt&amp;gt; --&amp;gt; print &quot;Name:&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804876a &amp;lt;+47&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804876f &amp;lt;+52&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048772 &amp;lt;+55&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048777 &amp;lt;+60&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b060,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804877c &amp;lt;+65&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%edx &amp;nbsp;--&amp;gt; variable suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048782 &amp;lt;+71&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;add &amp;nbsp; &amp;nbsp;$0x4,%edx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048785 &amp;lt;+74&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x8(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048789 &amp;lt;+78&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x100,0x4(%esp)--&amp;gt; length 0x100(256 bytes)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048791 &amp;lt;+86&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%edx,(%esp) &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048794 &amp;lt;+89&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484c0 &amp;lt;fgets@plt&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: xx-small;&quot;&gt;--&amp;gt; read from stdin, store name at address suite+4, length 0x100(256 bytes)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048799 &amp;lt;+94&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%eax &amp;nbsp;--&amp;gt; var suite into eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804879e &amp;lt;+99&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x8048a84,(%eax)--&amp;gt; store address of print_name function(0x8048a84) into memory location at suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487a4 &amp;lt;+105&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x804968f,(%esp) &amp;nbsp; &amp;nbsp; --&amp;gt;&quot;Suite number:&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487ab &amp;lt;+112&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048490 &amp;lt;printf@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487b0 &amp;lt;+117&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487b5 &amp;lt;+122&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487b8 &amp;lt;+125&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487bd &amp;lt;+130&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b060,%eax &amp;nbsp; --&amp;gt;stdin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487c2 &amp;lt;+135&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x8(%esp) &amp;nbsp; --&amp;gt;push stdin stream&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487c6 &amp;lt;+139&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x10,0x4(%esp) &amp;nbsp;--&amp;gt;read only 16bytes from stdin. *Cannot stack overflow*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487ce &amp;lt;+147&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;lea &amp;nbsp; &amp;nbsp;-0x1c(%ebp),%eax --&amp;gt;store in stack starting at $ebp-0x1c (28bytes away from base of stack)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487d1 &amp;lt;+150&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487d4 &amp;lt;+153&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484c0 &amp;lt;fgets@plt&amp;gt; --&amp;gt; get suite number from stdin and store in stack&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487d9 &amp;lt;+158&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%ebx &amp;nbsp; --&amp;gt; pointer suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487df &amp;lt;+164&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;lea &amp;nbsp; &amp;nbsp;-0x1c(%ebp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487e2 &amp;lt;+167&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp) &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487e5 &amp;lt;+170&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048530 &amp;lt;atoi@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487ea &amp;lt;+175&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x104(%ebx)--&amp;gt; save integer result into &amp;nbsp;suite+0x104&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487f0 &amp;lt;+181&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x804969e,(%esp) &amp;nbsp;--&amp;gt; &quot;Booked a suite!&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487f7 &amp;lt;+188&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484f0 &amp;lt;puts@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080487fc &amp;lt;+193&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048801 &amp;lt;+198&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048804 &amp;lt;+201&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048809 &amp;lt;+206&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;-0xc(%ebp),%eax &amp;nbsp;--&amp;gt;Stack canary&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804880c &amp;lt;+209&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%gs:0x14,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048813 &amp;lt;+216&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;je &amp;nbsp; &amp;nbsp; 0x804881a &amp;lt;book_suite+223&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048815 &amp;lt;+218&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484d0 &amp;lt;__stack_chk_fail@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804881a &amp;lt;+223&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;add &amp;nbsp; &amp;nbsp;$0x34,%esp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804881d &amp;lt;+226&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pop &amp;nbsp; &amp;nbsp;%ebx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804881e &amp;lt;+227&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pop &amp;nbsp; &amp;nbsp;%ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804881f &amp;lt;+228&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ret &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;End of assembler dump.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here&#39;s the structure of suite in memory. Note the address of print_name function is stored in the first 4 bytes at address of pointer suite.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;(gdb) x/100wx suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c008:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;0x08048a84(func)&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x62626262&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000a62&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c018:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c028:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c038:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c048:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c058:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c068:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c078:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c088:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c098:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0a8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0b8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0c8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0d8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0e8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0f8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c108:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;0x0804863d(int)&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00020ef1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c118:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c128:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c138:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c148:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c158:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c168:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c178:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c188:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Next, I look at the book_room function. It allocates 260 bytes of memory, read 256 bytes of name and 16 bytes for room number.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;(gdb) disass book_room&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;Dump of assembler code for function book_room:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048820 &amp;lt;+0&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;push &amp;nbsp; %ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048821 &amp;lt;+1&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048823 &amp;lt;+3&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;push &amp;nbsp; %ebx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048824 &amp;lt;+4&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;sub &amp;nbsp; &amp;nbsp;$0x34,%esp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048827 &amp;lt;+7&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%gs:0x14,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804882d &amp;lt;+13&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,-0xc(%ebp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048830 &amp;lt;+16&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048832 &amp;lt;+18&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x104,(%esp) &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048839 &amp;lt;+25&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484e0 &amp;lt;malloc@plt&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: xx-small;&quot;&gt;--&amp;gt; allocate 260 bytes in heap&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804883e &amp;lt;+30&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x804b08c &amp;nbsp;--&amp;gt; save pointer to variable room&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048843 &amp;lt;+35&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x8049688,(%esp) --&amp;gt; &quot;Name: &quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804884a &amp;lt;+42&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048490 &amp;lt;printf@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804884f &amp;lt;+47&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048854 &amp;lt;+52&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048857 &amp;lt;+55&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804885c &amp;lt;+60&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b060,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048861 &amp;lt;+65&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b08c,%edx --&amp;gt; variable room&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048867 &amp;lt;+71&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;add &amp;nbsp; &amp;nbsp;$0x4,%edx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804886a &amp;lt;+74&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x8(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804886e &amp;lt;+78&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x100,0x4(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048876 &amp;lt;+86&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%edx,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048879 &amp;lt;+89&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484c0 &amp;lt;fgets@plt&amp;gt; --&amp;gt; read from stdin, store name at address room+4, length 0x100(256 bytes)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804887e &amp;lt;+94&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x80496ae,(%esp) &amp;nbsp;--&amp;gt; &quot;Room Number: &quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048885 &amp;lt;+101&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048490 &amp;lt;printf@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804888a &amp;lt;+106&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804888f &amp;lt;+111&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048892 &amp;lt;+114&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048897 &amp;lt;+119&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b060,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804889c &amp;lt;+124&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x8(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488a0 &amp;lt;+128&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x10,0x4(%esp) &amp;nbsp;--&amp;gt; read 16 bytes&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488a8 &amp;lt;+136&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;lea &amp;nbsp; &amp;nbsp;-0x1c(%ebp),%eax&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488ab &amp;lt;+139&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488ae &amp;lt;+142&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484c0 &amp;lt;fgets@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488b3 &amp;lt;+147&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b08c,%ebx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488b9 &amp;lt;+153&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;lea &amp;nbsp; &amp;nbsp;-0x1c(%ebp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488bc &amp;lt;+156&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488bf &amp;lt;+159&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048530 &amp;lt;atoi@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488c4 &amp;lt;+164&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%ebx) &amp;nbsp;--&amp;gt; save room number into address room&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488c6 &amp;lt;+166&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x80496bc,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488cd &amp;lt;+173&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484f0 &amp;lt;puts@plt&amp;gt; &quot;Booked a room!&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488d2 &amp;lt;+178&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488d7 &amp;lt;+183&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488da &amp;lt;+186&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488df &amp;lt;+191&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;-0xc(%ebp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488e2 &amp;lt;+194&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%gs:0x14,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488e9 &amp;lt;+201&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;je &amp;nbsp; &amp;nbsp; 0x80488f0 &amp;lt;book_room+208&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488eb &amp;lt;+203&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484d0 &amp;lt;__stack_chk_fail@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488f0 &amp;lt;+208&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;add &amp;nbsp; &amp;nbsp;$0x34,%esp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488f3 &amp;lt;+211&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pop &amp;nbsp; &amp;nbsp;%ebx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488f4 &amp;lt;+212&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pop &amp;nbsp; &amp;nbsp;%ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488f5 &amp;lt;+213&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ret &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;End of assembler dump.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;(gdb)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here&#39;s the structure of room in memory. The first 4 bytes is the room number that the user entered.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;(gdb) x/100wx room&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c008:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;0x00000001(int)&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x61616161&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000a61&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c018:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c028:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c038:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c048:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c058:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c068:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c078:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c088:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c098:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0a8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0b8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0c8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0d8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0e8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c0f8:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c108:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00020ef9&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c118:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c128:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c138:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c148:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c158:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c168:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c178:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;0x804c188:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;0x00000000&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The print_booking function would call the print_name function address stored at the first 4 bytes at address of pointer suite.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;(gdb) disass print_booking&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;Dump of assembler code for function print_booking:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489a5 &amp;lt;+0&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;push &amp;nbsp; %ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489a6 &amp;lt;+1&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489a8 &amp;lt;+3&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;sub &amp;nbsp; &amp;nbsp;$0x28,%esp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489ab &amp;lt;+6&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%gs:0x14,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489b1 &amp;lt;+12&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,-0xc(%ebp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489b4 &amp;lt;+15&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489b6 &amp;lt;+17&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%eax &amp;nbsp;--&amp;gt; pointer suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489bb &amp;lt;+22&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;test &amp;nbsp; %eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489bd &amp;lt;+24&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jne &amp;nbsp; &amp;nbsp;0x80489e6 &amp;lt;print_booking+65&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489bf &amp;lt;+26&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b08c,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489c4 &amp;lt;+31&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;test &amp;nbsp; %eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489c6 &amp;lt;+33&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jne &amp;nbsp; &amp;nbsp;0x80489e6 &amp;lt;print_booking+65&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489c8 &amp;lt;+35&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x80496cb,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489cf &amp;lt;+42&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048490 &amp;lt;printf@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489d4 &amp;lt;+47&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489d9 &amp;lt;+52&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489dc &amp;lt;+55&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489e1 &amp;lt;+60&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jmp &amp;nbsp; &amp;nbsp;0x8048a71 &amp;lt;print_booking+204&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489e6 &amp;lt;+65&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%eax --&amp;gt; pointer suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489eb &amp;lt;+70&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;test &amp;nbsp; %eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489ed &amp;lt;+72&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;je &amp;nbsp; &amp;nbsp; 0x8048a2c &amp;lt;print_booking+135&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489ef &amp;lt;+74&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489f4 &amp;lt;+79&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;(%eax),%eax --&amp;gt;address of print_name function in suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489f6 &amp;lt;+81&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%edx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489fc &amp;lt;+87&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;add &amp;nbsp; &amp;nbsp;$0x4,%edx&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489ff &amp;lt;+90&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%edx,(%esp) --&amp;gt; location of string for suite name&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a02 &amp;lt;+93&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; *%eax --&amp;gt; call print_name function giving it location of suite name **Need to overwrite value of print_name function in suite with address of function flag()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a04 &amp;lt;+95&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a09 &amp;lt;+100&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x104(%eax),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a0f &amp;lt;+106&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x4(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a13 &amp;lt;+110&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x804970a,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a1a &amp;lt;+117&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048490 &amp;lt;printf@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a1f &amp;lt;+122&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a24 &amp;lt;+127&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a27 &amp;lt;+130&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a2c &amp;lt;+135&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b08c,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a31 &amp;lt;+140&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;test &amp;nbsp; %eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a33 &amp;lt;+142&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;je &amp;nbsp; &amp;nbsp; 0x8048a71 &amp;lt;print_booking+204&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a35 &amp;lt;+144&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b08c,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a3a &amp;lt;+149&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;add &amp;nbsp; &amp;nbsp;$0x4,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a3d &amp;lt;+152&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x4(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a41 &amp;lt;+156&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x804971c,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a48 &amp;lt;+163&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048490 &amp;lt;printf@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a4d &amp;lt;+168&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b08c,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a52 &amp;lt;+173&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;(%eax),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a54 &amp;lt;+175&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,0x4(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a58 &amp;lt;+179&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x804970a,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a5f &amp;lt;+186&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048490 &amp;lt;printf@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a64 &amp;lt;+191&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a69 &amp;lt;+196&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a6c &amp;lt;+199&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a71 &amp;lt;+204&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;-0xc(%ebp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a74 &amp;lt;+207&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%gs:0x14,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a7b &amp;lt;+214&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;je &amp;nbsp; &amp;nbsp; 0x8048a82 &amp;lt;print_booking+221&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a7d &amp;lt;+216&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484d0 &amp;lt;__stack_chk_fail@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a82 &amp;lt;+221&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;leave &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048a83 &amp;lt;+222&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ret &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;End of assembler dump.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;(gdb) &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Disassembling the delete_booking function, I see that after free is called to deallocate the memory located at pointers suite and room, they&#39;re not set to null and when print_booking is subsequently called, the deleted bookings are still printed out. This program has use after free vulnerability.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;(gdb) disass delete_booking&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;Dump of assembler code for function delete_booking:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488f6 &amp;lt;+0&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;push &amp;nbsp; %ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488f7 &amp;lt;+1&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%esp,%ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488f9 &amp;lt;+3&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;sub &amp;nbsp; &amp;nbsp;$0x28,%esp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080488fc &amp;lt;+6&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%gs:0x14,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048902 &amp;lt;+12&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,-0xc(%ebp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048905 &amp;lt;+15&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048907 &amp;lt;+17&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%eax --&amp;gt; pointer suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804890c &amp;lt;+22&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;test &amp;nbsp; %eax,%eax &amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804890e &amp;lt;+24&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jne &amp;nbsp; &amp;nbsp;0x8048934 &amp;lt;delete_booking+62&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048910 &amp;lt;+26&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b08c,%eax --&amp;gt; pointer room&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048915 &amp;lt;+31&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;test &amp;nbsp; %eax,%eax &amp;nbsp; &amp;nbsp; &amp;nbsp;--&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048917 &amp;lt;+33&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jne &amp;nbsp; &amp;nbsp;0x8048934 &amp;lt;delete_booking+62&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048919 &amp;lt;+35&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x80496cb,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048920 &amp;lt;+42&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x8048490 &amp;lt;printf@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048925 &amp;lt;+47&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804892a &amp;lt;+52&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804892d &amp;lt;+55&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048932 &amp;lt;+60&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jmp &amp;nbsp; &amp;nbsp;0x8048992 &amp;lt;delete_booking+156&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048934 &amp;lt;+62&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%eax --&amp;gt; pointer suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048939 &amp;lt;+67&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;test &amp;nbsp; %eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804893b &amp;lt;+69&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;je &amp;nbsp; &amp;nbsp; 0x8048963 &amp;lt;delete_booking+109&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804893d &amp;lt;+71&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b088,%eax &amp;nbsp;--&amp;gt; pointer to suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048942 &amp;lt;+76&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048945 &amp;lt;+79&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484b0 &amp;lt;free@plt&amp;gt; --&amp;gt; free the memory allocated to pointer suite&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804894a &amp;lt;+84&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x80496dd,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048951 &amp;lt;+91&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484f0 &amp;lt;puts@plt&amp;gt; --&amp;gt; &quot;Suite booking deleted!&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048956 &amp;lt;+96&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804895b &amp;lt;+101&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804895e &amp;lt;+104&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048963 &amp;lt;+109&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b08c,%eax --&amp;gt; pointer room&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048968 &amp;lt;+114&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;test &amp;nbsp; %eax,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804896a &amp;lt;+116&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;je &amp;nbsp; &amp;nbsp; 0x8048992 &amp;lt;delete_booking+156&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804896c &amp;lt;+118&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b08c,%eax --&amp;gt; pointer to room&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048971 &amp;lt;+123&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048974 &amp;lt;+126&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484b0 &amp;lt;free@plt&amp;gt; --&amp;gt; free the memory allocated to pointer room&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048979 &amp;lt;+131&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;movl &amp;nbsp; $0x80496f4,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048980 &amp;lt;+138&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484f0 &amp;lt;puts@plt&amp;gt; --&amp;gt; &quot;Room booking deleted!&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048985 &amp;lt;+143&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;0x804b080,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804898a &amp;lt;+148&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;%eax,(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804898d &amp;lt;+151&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484a0 &amp;lt;fflush@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048992 &amp;lt;+156&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;mov &amp;nbsp; &amp;nbsp;-0xc(%ebp),%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x08048995 &amp;lt;+159&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;xor &amp;nbsp; &amp;nbsp;%gs:0x14,%eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804899c &amp;lt;+166&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;je &amp;nbsp; &amp;nbsp; 0x80489a3 &amp;lt;delete_booking+173&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x0804899e &amp;lt;+168&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;call &amp;nbsp; 0x80484d0 &amp;lt;__stack_chk_fail@plt&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489a3 &amp;lt;+173&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;leave &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;0x080489a4 &amp;lt;+174&amp;gt;:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ret &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: xx-small;&quot;&gt;End of assembler dump.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To exploit this, create a suite booking then delete it. Then create a room booking but enter the valu&lt;span style=&quot;font-family: inherit;&quot;&gt;e&amp;nbsp;134514237&lt;/span&gt; which is the integer representation of the address of the flag function&amp;nbsp;&lt;span style=&quot;font-family: inherit;&quot;&gt;0x0804863d. This would cause the memory allocated to suite previously to be allocated to room and now both pointers to suite and room are initialized to the same address, the print_booking function would load the first 4 bytes of address pointer room confusing ith with the print_name function for suite and execute it which will give us the flag value.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBpx62tPxwd3PdfjmP0TdQICMk5cTcRDM7rO9yL-9XhMPYPkp3lx4nACddRMsYvYCWt3aKCTZfZG7GSugmEvn1tqfMaiBX5gWS8MyxjxN-O3xQVci8BQn0SpO-8VfYBe8etx9K0E9EHEUJ/s1600/pwned.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBpx62tPxwd3PdfjmP0TdQICMk5cTcRDM7rO9yL-9XhMPYPkp3lx4nACddRMsYvYCWt3aKCTZfZG7GSugmEvn1tqfMaiBX5gWS8MyxjxN-O3xQVci8BQn0SpO-8VfYBe8etx9K0E9EHEUJ/s1600/pwned.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://nexusdroid.blogspot.com/feeds/4868314453420418825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nexusdroid.blogspot.com/2016/09/icectf-stage-3-drumpf-hotels-writeup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/917955238935714832/posts/default/4868314453420418825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/917955238935714832/posts/default/4868314453420418825'/><link rel='alternate' type='text/html' href='http://nexusdroid.blogspot.com/2016/09/icectf-stage-3-drumpf-hotels-writeup.html' title='IceCTF : Stage 3 Drumpf Hotels writeup'/><author><name>DP</name><uri>http://www.blogger.com/profile/05100193468791944878</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBM8AYBWyndytaIR_o3bIXmty8j7pZZsk-l5JPwhpTTVL1U6oso47ALoa_Wx6FZYtnJPCokeSUti4MMxM4pSAv__83ZbTCP9dnMo9weZ1yhrO3jyhM99I0etpFut-W6uj2Gs_P-wGiDODi/s72-c/drumpf.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-917955238935714832.post-7839646060885889591</id><published>2016-08-28T07:38:00.000-07:00</published><updated>2016-08-28T07:38:20.805-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="capture the flag"/><category scheme="http://www.blogger.com/atom/ns#" term="ctf"/><category scheme="http://www.blogger.com/atom/ns#" term="env"/><category scheme="http://www.blogger.com/atom/ns#" term="pwn"/><category scheme="http://www.blogger.com/atom/ns#" term="setgid"/><title type='text'>IceCTF : Stage 2 Demo Writeup</title><content type='html'>&lt;div class=&quot;article-content entry-content&quot; itemprop=&quot;articleBody&quot; style=&quot;background-color: white; clear: both; margin: 10px auto 5px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;h4 style=&quot;color: #333333; font-size: 14px; font-weight: bolder; line-height: 1.4; margin: 1.12em 0px; padding: 0px; position: relative; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;Site:&amp;nbsp;https://icec.tf/&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style=&quot;color: #333333; font-size: 14px; font-weight: bolder; line-height: 1.4; margin: 1.12em 0px; padding: 0px; position: relative; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;Challenge:&lt;/span&gt;&lt;/h4&gt;
&lt;div style=&quot;background-color: white; clear: both; line-height: 1.4; margin: 10px auto 5px; outline: none; padding: 0px; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: large;&quot;&gt;&lt;span style=&quot;line-height: 22.5px; text-align: left;&quot;&gt;I found this awesome premium shell, but my demo version just ran out... can you help me crack it?&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #f9f2f4; border-radius: 4px; box-sizing: inherit; padding: 2px 4px; text-align: left;&quot;&gt;/home/demo/&lt;/code&gt;&lt;span style=&quot;line-height: 22.5px; text-align: left;&quot;&gt;&amp;nbsp;on the shell.&amp;nbsp;(55 points)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 1.4;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h4 style=&quot;color: #333333; font-size: 14px; font-weight: bolder; line-height: 1.4; margin: 1.12em 0px; padding: 0px; position: relative; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;Writeup:&lt;/span&gt;&lt;/h4&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;line-height: 28.56px;&quot;&gt;The challenge folder contains the &quot;demo&quot; program, the source code demo.c, the flag.txt file and a make file. The program is a setgid ELF 32 bit executable.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;span style=&quot;line-height: 28.56px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 1.4;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2zy_hNovRb7JnG0RJ-JtxPBz3IZP46OqbB-Z01trQNs6PNnhTMnsUHfXHQVHI-H2HSg5zbrgHd-vzhY8RH3gmIl0isTveVTwN0laveCd3ymLJP6De-0pcznX8W9IY0lEv8fy1kR1iRBDa/s1600/Files.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2zy_hNovRb7JnG0RJ-JtxPBz3IZP46OqbB-Z01trQNs6PNnhTMnsUHfXHQVHI-H2HSg5zbrgHd-vzhY8RH3gmIl0isTveVTwN0laveCd3ymLJP6De-0pcznX8W9IY0lEv8fy1kR1iRBDa/s640/Files.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #333333; font-size: medium; line-height: 28.56px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #333333; line-height: 1.4;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;line-height: 1.4;&quot;&gt;Let&#39;s look at the source code to see what this program is supposed to do. It contains a function give_shell() which sets the real, effective and saved group id to the group &quot;demo&quot; which this program belongs to, and then executes a system command to start a shell. This function can only be run if there is an environment variable named &quot;_&quot; that contains the string &quot;icesh&quot;.&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihonlUOTElp4znzpM2IDTTxT9OxJoZ8XHagHYasAzWJxyEAWAmAelXwtJBelDv0jYlZWS7e96liR_csAxrQzTDtJCaIqbS6D_Jgc-UEOFP84W0FLEdOgRPenMxbgPtOukDo_TKLbjq2b0z/s1600/democ.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;331&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihonlUOTElp4znzpM2IDTTxT9OxJoZ8XHagHYasAzWJxyEAWAmAelXwtJBelDv0jYlZWS7e96liR_csAxrQzTDtJCaIqbS6D_Jgc-UEOFP84W0FLEdOgRPenMxbgPtOukDo_TKLbjq2b0z/s400/democ.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
Run the demo in a modified environment and specifying the value of &quot;_&quot; to be &quot;icesh&quot; and a shell is returned running as the demo group id which is the same access granted to the flag.txt file. The flag is IceCTF{wH0_WoU1d_3vr_7Ru5t_4rgV}.&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #333333; line-height: 1.4; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6ur7coc-FQHpW2nTrSfh0nWneGqd2EHv4MZCgLxpxcKNQ6LIa7nZPzOfKn62h75hpafDxyiI8xnDN3Ch81snbH-6wE866ATrpdI-4UTL0mkORJ5LDiiCJCSnRyQlmuJMczu3TSIX9cPfz/s1600/icesh.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;146&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6ur7coc-FQHpW2nTrSfh0nWneGqd2EHv4MZCgLxpxcKNQ6LIa7nZPzOfKn62h75hpafDxyiI8xnDN3Ch81snbH-6wE866ATrpdI-4UTL0mkORJ5LDiiCJCSnRyQlmuJMczu3TSIX9cPfz/s400/icesh.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; line-height: 1.4; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/917955238935714832/posts/default/7839646060885889591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/917955238935714832/posts/default/7839646060885889591'/><link rel='alternate' type='text/html' href='http://nexusdroid.blogspot.com/2016/08/icectf-stage-2-demo-writeup.html' title='IceCTF : Stage 2 Demo Writeup'/><author><name>DP</name><uri>http://www.blogger.com/profile/05100193468791944878</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2zy_hNovRb7JnG0RJ-JtxPBz3IZP46OqbB-Z01trQNs6PNnhTMnsUHfXHQVHI-H2HSg5zbrgHd-vzhY8RH3gmIl0isTveVTwN0laveCd3ymLJP6De-0pcznX8W9IY0lEv8fy1kR1iRBDa/s72-c/Files.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-917955238935714832.post-2318095809908543121</id><published>2016-08-24T09:27:00.001-07:00</published><updated>2016-08-24T09:29:10.456-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="assembly"/><category scheme="http://www.blogger.com/atom/ns#" term="capture the flag"/><category scheme="http://www.blogger.com/atom/ns#" term="ctf"/><category scheme="http://www.blogger.com/atom/ns#" term="gdb"/><category scheme="http://www.blogger.com/atom/ns#" term="pipe redirection"/><category scheme="http://www.blogger.com/atom/ns#" term="pwn"/><category scheme="http://www.blogger.com/atom/ns#" term="reverse engineering"/><category scheme="http://www.blogger.com/atom/ns#" term="setgid"/><category scheme="http://www.blogger.com/atom/ns#" term="stack buffer overflow"/><title type='text'>IceCTF : Stage 2 Smashing Profit! Writeup</title><content type='html'>&lt;h4&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Site:&amp;nbsp;https://icec.tf/&lt;/span&gt;&lt;/h4&gt;
&lt;h4&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Challenge:&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Do you think you can make this program jump to somewhere it isn&#39;t supposed to? Where we&#39;re going we don&#39;t need buffers!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;/home/profit/ on the shell. (60 points)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Writeup:&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;The challenge directory contains 3 files. &quot;profit&quot; binary which is a setgid ELF 32-bit LSB executable program, a Makefile and a flag.txt file.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOORvkXvPu3zAChpDHL5XV1UKs3E_E9JN2luWTeM5ZYd59KFRlxCJYhlCjALfcpl19-WWJNAlslo5wBHMdq_UZNJcWVC58260CfXRMkVqrMu0jEpYLWuE0eY9b_BL0vdvIEL-_AdsKHirB/s1600/files.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOORvkXvPu3zAChpDHL5XV1UKs3E_E9JN2luWTeM5ZYd59KFRlxCJYhlCjALfcpl19-WWJNAlslo5wBHMdq_UZNJcWVC58260CfXRMkVqrMu0jEpYLWuE0eY9b_BL0vdvIEL-_AdsKHirB/s1600/files.png&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;The first order of business is to run the program and see how it works. It prints the string &quot;Smashing the stack for fun and...?&quot; and waits for input.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis6Rd0QUZ6Z_Qsix3O4IBl3xZq8JFASJPHEl5mUQe03Bm5vAOJeHRwQg6Jd8D0FRiE4xx3WLva4jtZ6gGJHNxxEnXikZ7emModJt83KRDBJsetdFEkWybSWCxI115GZqGzz204M5iwMwel/s1600/run_profit.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis6Rd0QUZ6Z_Qsix3O4IBl3xZq8JFASJPHEl5mUQe03Bm5vAOJeHRwQg6Jd8D0FRiE4xx3WLva4jtZ6gGJHNxxEnXikZ7emModJt83KRDBJsetdFEkWybSWCxI115GZqGzz204M5iwMwel/s1600/run_profit.png&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Examining the binary using gdb debugger, the first thing I did was to disassemble the main function and see that it calls the function &quot;start&quot; at&amp;nbsp;0x804855e.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOG5sNvpcmZSDPKXdps6QZzT-8jpw9-IsQxsToDB675j9wCvN4V6RY2f3RqFVut7UWYNbxL8EEOkaGkaJMdaMHvnqCggC_hu9ZSSV-PeRC11DPjEtU-uKhqcT8TJ6ivL5Z16X9ZuQttY4I/s1600/disass_main.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOG5sNvpcmZSDPKXdps6QZzT-8jpw9-IsQxsToDB675j9wCvN4V6RY2f3RqFVut7UWYNbxL8EEOkaGkaJMdaMHvnqCggC_hu9ZSSV-PeRC11DPjEtU-uKhqcT8TJ6ivL5Z16X9ZuQttY4I/s1600/disass_main.png&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Doing the same to the &quot;start&quot; function I see that it calls puts which displays the string &quot;Smashing the stack for fun and...?&quot; located at 0x8048660. Then it calls fgets to get input from stdin (0x80498e8) and then return to the main function.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfe-fBZJYi8w0L1Wsg8UKcCQIzgQhua2yP_QJYDD217oROlLGFP1vzznt407JtUMdRhBj5j_OgMSNaWDr-Z2GPzJEqNNdiJdXJvyNwzhpPCrnj70jGkdG-vNMjOju_5bOBRxBokykuWhn8/s1600/disass_start.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfe-fBZJYi8w0L1Wsg8UKcCQIzgQhua2yP_QJYDD217oROlLGFP1vzznt407JtUMdRhBj5j_OgMSNaWDr-Z2GPzJEqNNdiJdXJvyNwzhpPCrnj70jGkdG-vNMjOju_5bOBRxBokykuWhn8/s1600/disass_start.png&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Examining the functions available in this binary, I can see a function named &quot;flag&quot; at 0x0804850b which is not called in the program flow.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIbrDEF6l4ha0qpOdba5Fni8fm2pa1NuO6YqX-HBcAnmUPM571G-ZKVk1swls1N5D5lOT8lyzzNwCwPoKWS62CwvfkoK1cv4UdfgwjrY5B41Y8V-JiLWvLSvcMUvRtxmORoL7hWywsPVvb/s1600/info_func.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIbrDEF6l4ha0qpOdba5Fni8fm2pa1NuO6YqX-HBcAnmUPM571G-ZKVk1swls1N5D5lOT8lyzzNwCwPoKWS62CwvfkoK1cv4UdfgwjrY5B41Y8V-JiLWvLSvcMUvRtxmORoL7hWywsPVvb/s1600/info_func.png&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Disassembling the &quot;flag&quot; function tells me this function is reading the &quot;./flag.txt&quot; and print out the contents.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBCWESDReGvMk7sIbUFMRN2WAbiosXDQGWbNWsVpoWEbe-0T909XA5lUlIt2hNs8Kbk-Hl2ZfxPmxUsc2mc9AAjur7WD0Wup0ipTOGf21KxFswW3nNcAcd62M-as1STowSIXt-MKmy_x_6/s1600/flag_function.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBCWESDReGvMk7sIbUFMRN2WAbiosXDQGWbNWsVpoWEbe-0T909XA5lUlIt2hNs8Kbk-Hl2ZfxPmxUsc2mc9AAjur7WD0Wup0ipTOGf21KxFswW3nNcAcd62M-as1STowSIXt-MKmy_x_6/s1600/flag_function.png&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;This program suffers from stack buffer overflow in the start function where fgets is told to read 100 characters but only 72 bytes(0x48) of buffer are allocated for storage. I want the program to jump to the flag function so that it can reveal the contents of the flag file. This is done by overwriting the return address in the stack by giving it an input string with 76 characters followed by the address of flag function (0x0804850b) in reverse (little endian). Create a fifo pipe using mkfifo and write the exploit string to it and piping it to the program reveals the flag as IceCTF{who_would_have_thunk?}.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoAzucHWqEQLjMPjSNN-sMhcY76RTw2muDjUbD2YB2hX5SKWeGVzEKKHxzNc3mwKkTuQr7Fbw1_g_JOqtWozqrNOE8HhMotPf5ZnV9o8LdTBNOVtpevnvm0sFTaCgRUDdbLQz8qDFqIMC4/s1600/pwned.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoAzucHWqEQLjMPjSNN-sMhcY76RTw2muDjUbD2YB2hX5SKWeGVzEKKHxzNc3mwKkTuQr7Fbw1_g_JOqtWozqrNOE8HhMotPf5ZnV9o8LdTBNOVtpevnvm0sFTaCgRUDdbLQz8qDFqIMC4/s1600/pwned.png&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/917955238935714832/posts/default/2318095809908543121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/917955238935714832/posts/default/2318095809908543121'/><link rel='alternate' type='text/html' href='http://nexusdroid.blogspot.com/2016/08/icectf-stage-2-smashing-profit-writeup.html' title='IceCTF : Stage 2 Smashing Profit! Writeup'/><author><name>DP</name><uri>http://www.blogger.com/profile/05100193468791944878</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOORvkXvPu3zAChpDHL5XV1UKs3E_E9JN2luWTeM5ZYd59KFRlxCJYhlCjALfcpl19-WWJNAlslo5wBHMdq_UZNJcWVC58260CfXRMkVqrMu0jEpYLWuE0eY9b_BL0vdvIEL-_AdsKHirB/s72-c/files.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-917955238935714832.post-1574921595036883324</id><published>2013-05-01T23:36:00.000-07:00</published><updated>2013-05-01T23:36:20.046-07:00</updated><title type='text'>Android Continuous Integration using Jenkins (Part 1) Installing on RedHat distributions</title><content type='html'>&lt;style type=&quot;text/css&quot;&gt;
body
{
font-family:&quot;Times New Roman&quot;;
font-size:12px;
}

p
{

}

.subheading
{
font-family:&quot;Arial&quot;;
font-size:16px;
text-align:&quot;Left&quot;;
}

.code
{
font-family:serif;
font-size:14px;
background:black;
color:Lime;
}

table
{
border-collapse:collapse;
}

table, td, th
{
border:1px solid black;
}

td
{
padding:3px;
}

ul.nostyle
{
list-style-type:none;
}

&lt;/style&gt;

&lt;span style=&quot;font-family: inherit;&quot;&gt;This is part of a series of tutorial on setting up Jenkins Continuous Integration (CI) server &amp;nbsp;to build and test Android applications.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span&gt;Part 1 - Installing Jenkins CI (on RedHat distributions)&lt;/span&gt;&lt;/h2&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;As root, execute the commands below. These are commands to get the Jenkins repository information, the package signature and installing Jenkins on the server.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ul class=&quot;nostyle&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;$ wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;$ rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;$ yum install jenkins&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;After installing, a jenkins user will be created as can be seen in /etc/passwd.&lt;/span&gt;&lt;br /&gt;
&lt;ul class=&quot;nostyle&quot;&gt;
&lt;li&gt;jenkins:x:494:489:Jenkins Continuous Build server:/var/lib/jenkins:/bin/false&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;span class=&quot;subheading&quot;&gt;Configuring Jenkins&lt;/span&gt;&lt;/h4&gt;
With the install, there is a configuration file /etc/sysconfig/jenkins that will be used to start the server with. Some parameters of interest are:&lt;br /&gt;
&lt;br /&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;JENKINS_HOME=&quot;/var/lib/jenkins&quot;&lt;/td&gt;&lt;td class=&quot;table&quot;&gt;continuous integration projects are stored under jobs/ directory during runtime&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;JENKINS_USER=&quot;jenkins&quot;&lt;/td&gt;&lt;td&gt;default user to start the server with. If modified, owner of /var/log/jenkins, /var/lib/jenkins and /var/cache/jenkins must be changed to the newly specified user&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;JENKINS_PORT=&quot;8080&quot;&lt;/td&gt;&lt;td&gt;web browser UI access port for configuration, for example http://localhost:8080. The server&#39;s firewall must be configured to allow remote access to this port if this Jenkins server is going to be used by many developers&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h4&gt;
&lt;span class=&quot;subheading&quot;&gt;Launching&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Jenkins can be launched as a daemon as user jenkins. The installation comes with an init script /etc/init.d/jenkins that allows you to do that. To start the Jenkins server, issue the command below:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ul class=&quot;nostyle&quot;&gt;
&lt;li&gt;$ service jenkins start&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;To start Jenkins everytime the server is rebooted, turn on the service using:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;ul class=&quot;nostyle&quot;&gt;
&lt;li&gt;$ chkconfig jenkins on&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
Once launched, open up the web browser and direct it to your server hostname at port 8080 (http://hostname:8080) and you should see jenkins running.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIs-yMZjVirq4Qpt3RVMcRD6TkfiKAzaqtP6WE66G_3IV8HHSFWT7kTD8lercM5eZEGi1x55qGSAkgE5ar4Ex_D8Z6Vg9BmnR2QijAyEOpYGJlDPeSkGSPEWrspHGNQcvn_vDgP6BrIywd/s1600/Screenshot-Dashboard+%5BJenkins%5D+-+Google+Chrome-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;462&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIs-yMZjVirq4Qpt3RVMcRD6TkfiKAzaqtP6WE66G_3IV8HHSFWT7kTD8lercM5eZEGi1x55qGSAkgE5ar4Ex_D8Z6Vg9BmnR2QijAyEOpYGJlDPeSkGSPEWrspHGNQcvn_vDgP6BrIywd/s640/Screenshot-Dashboard+%5BJenkins%5D+-+Google+Chrome-1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nexusdroid.blogspot.com/feeds/1574921595036883324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nexusdroid.blogspot.com/2013/05/android-continuous-integration-jenkins-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/917955238935714832/posts/default/1574921595036883324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/917955238935714832/posts/default/1574921595036883324'/><link rel='alternate' type='text/html' href='http://nexusdroid.blogspot.com/2013/05/android-continuous-integration-jenkins-part-1.html' title='Android Continuous Integration using Jenkins (Part 1) Installing on RedHat distributions'/><author><name>DP</name><uri>http://www.blogger.com/profile/05100193468791944878</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIs-yMZjVirq4Qpt3RVMcRD6TkfiKAzaqtP6WE66G_3IV8HHSFWT7kTD8lercM5eZEGi1x55qGSAkgE5ar4Ex_D8Z6Vg9BmnR2QijAyEOpYGJlDPeSkGSPEWrspHGNQcvn_vDgP6BrIywd/s72-c/Screenshot-Dashboard+%5BJenkins%5D+-+Google+Chrome-1.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>