<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jeremy Cardona on Medium]]></title>
        <description><![CDATA[Stories by Jeremy Cardona on Medium]]></description>
        <link>https://medium.com/@jeremycardona?source=rss-8a73e9326b1f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SBYywExtGaBhPhil.</url>
            <title>Stories by Jeremy Cardona on Medium</title>
            <link>https://medium.com/@jeremycardona?source=rss-8a73e9326b1f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 07:45:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jeremycardona/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Unintuitive Design]]></title>
            <link>https://medium.com/@jeremycardona/unintuitive-design-226bf3636590?source=rss-8a73e9326b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/226bf3636590</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[challenge]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Jeremy Cardona]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 04:03:11 GMT</pubDate>
            <atom:updated>2026-01-05T04:03:11.617Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR </strong>real intuitive design does not require a manual to understand the product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IeXXBEMwadd8zx1A" /><figcaption>Photo by <a href="https://unsplash.com/@brett_jordan?utm_source=medium&amp;utm_medium=referral">Brett Jordan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>A design is intuitive when the target users understand it’s behavior and effect without user of reason, memorization, experimentation, assistance or training.</blockquote><p>The definition is given in the audible “Intuitive Design” by Everett N. McKay on chapter 2.</p><p>A better explanation for this was given by Don Norman, where he explains good conceptual models. The gap between the user model and the designer model is called the <strong>system image, </strong>Don calls this <em>the combined information available.</em></p><p>To understand what this means we need to visualize the relation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*eyIXL16pOA7gejNegQhO2w.png" /><figcaption>conceptual models diagram</figcaption></figure><ul><li>The designer conceptual model is the conception of the look, feel and operation of a product.</li><li>The system image is what can be derived from physical structure that has been built, aka product. <strong><em>Note</em></strong> that for Norman this includes documentation with a product.</li><li>The user conceptual model is also called “mental models” and they represent the understanding of how things work in peoples mind, and this can also be developed through interaction with the product and system image.</li></ul><p>This gap is the key for good conceptual models. Because the system image is what the user relies on to communicate with the designer. The gap should answer the user all they need to know about a product without any struggle. The system image is responsible for communicating the user what the designer conceptual model is and the designer expects the user conceptual model to be identical to their own.</p><p>This is not easy. What if we tried to create conceptual models that did not require documentation? This is a greater challenge because what information is the user going rely on without explicit information?</p><p>Everett N. McKay <em>might</em> answer this with eight steps to an intuitive design.</p><h3>Design challenges</h3><p>An intuitive design is about not having to learn how to use a product. And to prove that this a design challenge using our practical definition. In short, an intuitive <strong>UI</strong> design is immediately self explanatory to it’s target user. We don’t want the <em>target </em>user to:</p><ul><li>reason</li><li>memorize</li><li>experiment</li><li>seek help</li></ul><p>So for a target user to rely on documentation and a manual implies that the product is not intuitive. (insert emoji here to make it feel like it was AI generated 😜).</p><p>At the same time how can we design intuitive UI without “dumbing down” the target user?</p><h4>Five answer to unintuitive design:</h4><ul><li>Find an example UI you find unintuitive. Based on the definition, prove someone that the design is unintuitive.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7yvR63ecYCjKgxRda7hyfg.png" /><figcaption>canon eos rebel t6</figcaption></figure><p>Cameras like this come with a manual to figure out how to use it. After some time of not using it, I started to have trouble on remembering the basics of how it worked. I did not remember how to set the exposure, the shutter speed, the aperture ISO speed or anything from the manual mode settings. It is because to set the manual capture mode I would need to first press the camera icon (this toggles capture display and menu display) and then the Q inside the box icon (toggles menu). The only way I would have known is with the manual. I still don’t know what most of these buttons abbreviations mean.</p><ul><li>Find an example UI that requires experimentation to use. Consider trial and error. What changes could you make so it doesn’t require experimentation?</li></ul><p>Using the same UI example of my camera. And it is that it requires a lot of experimentation to get good photos in the manual mode. It’s because I don’t know how the capture will look like until I see the processed image. So even if I toggle the capture display it is not an exact ‘copy’ of what I will get.</p><ul><li>Purposely design a light switch for a light bulb to be unintuitive. Explain why it’s unintuitive based on the definition.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*LAUP8knWRQr77lx9Btw_jw.png" /><figcaption>play/pause? on/off?</figcaption></figure><p>It’s unintuitive for me because of the nature of how the buttons are going to work, one is going to enable and the other is going to disable. A better solution would be the a real toggle button (designed for real life) that look and feel like similar to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*VzbUIFeE9Al1AvQP" /><figcaption>toggle buttons</figcaption></figure><ul><li>Think of two apps that allow users to perform similar task but consider one that is intuitive and one that is not. Can you find reasons for the user to use/prefer the unintuitive app?</li></ul><p>Ubuntu Linux vs Window 10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/0*BvZBKcOIRos8Od6v" /><figcaption>ui comparison windows/ubuntu <a href="https://www.youtube.com/watch?v=hoG4TFsobX4">https://www.youtube.com/watch?v=hoG4TFsobX4</a></figcaption></figure><p>This might be controversial example but it really proves that intuitive design is challenge, because what is the target user for the different OS? The distinction I want to focus is app installation. Installation on Windows can be pretty straight forward while on Ubuntu can be sometimes complicated if it cannot be installed via package manager. I’ve struggled before installing Linux apps. It requires memorizing the install command via terminal. I have to seek help to install apps that are not in the official repos. Linux is what I prefer because of open source.</p><ul><li>Is driving a car intuitive?</li></ul><p>No. It requires a license to drive, to get a license we must study for tests. And while we focus only on the road while we are driving, we must reason about traffic signs.</p><h3>What now?</h3><p>Part of me believes that intuitive design is like designing for brain rot, the fast-paced consumption of products and low attention while consuming does not mean that the target user is dumb 🧠. It’s just proof that UI are intuitive 🌀. It’s a new example of good conceptual models, the target user does not require guides or help 🤔.</p><p>sources:</p><p>chapter 1 — the design of everyday things by Don Norman covers what conceptual models are.</p><p>chapter 1,2,3 — audible “Intuitive Design” by Everett N. McKay. Specifically chapter 3 of the audiobook covers the definition and challenges.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=226bf3636590" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to UX design]]></title>
            <link>https://medium.com/@jeremycardona/intro-to-ux-design-ab39ddfb7db4?source=rss-8a73e9326b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab39ddfb7db4</guid>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[ux-design]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[design-thinking]]></category>
            <dc:creator><![CDATA[Jeremy Cardona]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 22:51:21 GMT</pubDate>
            <atom:updated>2025-12-12T22:51:21.456Z</atom:updated>
            <content:encoded><![CDATA[<p>UX designers help making technology easier to understand and more enjoyable to use.</p><p>The phrase “user experience” was first used in the 1990’s by cognitive psychologist <a href="https://en.wikipedia.org/wiki/Don_Norman">Don Norman</a> as technology expanded and evolved.</p><p>The principles of UX stretch all the way back to ancient China the practitioners of Feng Shui believed that the arrangement of physical space could improve their luck, health and happiness. A lot of industries rely in the same ideas. In the tech world, UX mostly focuses on how people use and interact with products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lYN2JVIga7SFhjJp" /><figcaption>Photo by <a href="https://unsplash.com/@eaterscollective?utm_source=medium&amp;utm_medium=referral">Eaters Collective</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Basics of UX Design</h3><p><strong>User experience</strong> — how a person feels about interacting with or experiencing a product.</p><p><strong>Product </strong>— A good, service or feature.</p><p>For a user to have <em>good user experience </em>the product needs to be</p><ul><li>usable — it is easier to use</li><li>equitable —it is useful and marketable to people with diverse abilities and backgrounds</li><li>enjoyable —it delights the user</li><li>useful — it solves the user problems</li></ul><p>So to figure out what makes an user happy we need to make research, more details later. Why is good user user experience so important?</p><p>When people like a product they use it a lot, they recommend it to their friends and more people using the product means better business for the company. When users have a good UX with a product they are more likely to have a positive opinion about the product.</p><h3>What UX designers do</h3><p>We tend to be curious about people and like thinking about how minds work. We enjoy figuring out how people use products. We are empathetic too. They have the ability to understand someone else’s feelings or thoughts in a situation.</p><p>Design is only one small part of what we do and it’s not only about the visuals of a product.</p><ul><li>Interactions — focuses on designing the experience of a product and how it functions. It may answer: what should happen when a user makes this interaction?</li><li>Visuals— focuses on a how a product or technology looks. It may answer: which color and font should we use?</li><li>Motions— focuses on what it feels like for a user to move through a product and design elements that move. It may answer: how do we transition between pages?</li><li>VR/AR — focuses on products that provide users with immersive experiences, without limits of the physical world. It may answer: will this cause motion sickness?</li><li>Research — focuses on studies or interviews that examine how people use a product. It may answer: the problems users are facing.</li><li>Writing — focuses on making the language within a product clearer and intuitive. It may answer: what words can we use to make ideas clear?</li><li>Production— focuses on matching first and final designs in the finished project materials and that assets are ready for the engineering team. It may answer: design specifications, fonts, size and spacing.</li><li>Program managing — ensure that the communication is clear and at the right moment. Focuses on the building process so that it moves smooth from start to finish. It may answer: project goals and plans.</li><li>Engineering — focuses on translating the design into a functional experience. It may answer: how do we implement such design?</li><li>Conversational— focuses on real-world conversational behaviors into the human-computer interaction. It may answer: based on who the users are, what is the ideal language? Think of it like virtual assistant to customer service to chatbots!</li></ul><h3>Design for a good user experience</h3><p>It’s all about predicting user roadblocks and potential design mishaps. <br>Sometimes the meaning of an icon is hard to figure out so we need text. A key task is to map a specific emotion to the experience of using the product. Recognize positive aspects about the product. Norman doors is a typical example on good/bad UX.</p><h4>A little short for the dopamine hit we crave so much:</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVhHQ2nMTY1I%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FVhHQ2nMTY1I%3Fsi%3DEV48QNFRWqQb3cZT&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVhHQ2nMTY1I%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/675fb977cdc6d0921b294be5b13abf7a/href">https://medium.com/media/675fb977cdc6d0921b294be5b13abf7a/href</a></iframe><p>Source and links:</p><p><a href="https://www.coursera.org/learn/foundations-user-experience-design/">https://www.coursera.org/learn/foundations-user-experience-design/</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2QQQtiFwXjU%3Flist%3DPLTZYG7bZ1u6oHnGp4Ib3n0y-CmFQdTW6r&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2QQQtiFwXjU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2QQQtiFwXjU%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a01f6a7113ddd3601d5c3f023e2cf877/href">https://medium.com/media/a01f6a7113ddd3601d5c3f023e2cf877/href</a></iframe><p>More on UX design:</p><p><a href="https://dl.icdst.org/pdfs/files4/4bb8d08a9b309df7d86e62ec4056ceef.pdf">don’t blame me, i found this on google search</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab39ddfb7db4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UX — I don’t really care about the design part.]]></title>
            <link>https://medium.com/@jeremycardona/ux-i-dont-really-care-about-the-design-part-f226b26e0c5c?source=rss-8a73e9326b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f226b26e0c5c</guid>
            <category><![CDATA[empathy]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Jeremy Cardona]]></dc:creator>
            <pubDate>Mon, 01 Dec 2025 00:52:31 GMT</pubDate>
            <atom:updated>2025-12-01T00:52:31.115Z</atom:updated>
            <content:encoded><![CDATA[<h3>UX — I don’t really care about the design part.</h3><h3>Be more empathetic by understanding UX.</h3><p><strong>User experience (UX) </strong>— the feeling we get from things.</p><h4>Lets think about it.</h4><p>Has a <strong><em>song</em></strong> made you feel<strong><em> sad</em></strong>?<br>Has a <strong><em>videogame </em></strong>made you feel<strong><em> goated</em></strong>?</p><h4>Lets think deeply about it. (yes or no)</h4><p>In each case, we might have not experienced those feelings I used as examples. Let’s try thinking about a <em>thing </em>that made us <em>feel</em> an emotion, did the <em>(blank)</em> made us <em>(blank)</em>? That’s basically the experience we had as users that can be answered by a yes or no.</p><h4>Can we be more empathetic by understanding UX?</h4><p>Well, let’s see what Wikipedia has to say about <a href="https://en.wikipedia.org/wiki/User_experience">UX</a>.</p><blockquote><strong>User experience</strong> (<strong>UX</strong>) is how a user interacts with and experiences a <a href="https://en.wikipedia.org/wiki/Product_(business)">product</a>, <a href="https://en.wikipedia.org/wiki/System">system</a>, or <a href="https://en.wikipedia.org/wiki/Service_(business)">service</a>.</blockquote><p>If we look for more we might find the ISO definition that says:</p><blockquote>“user’s perceptions and responses that result from the use and/or anticipated use of a system, product or service”</blockquote><p>Both of these definitions has an emphasis on the user and the psychological phenomena that occur with said *things*.</p><p>If you can’t understand these definitions, take mine as an axiom and the following one.</p><p>Empathy — fitting other people’s shoes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eDckLipq0uWUeEdE" /><figcaption>Photo by <a href="https://unsplash.com/@chrispic?utm_source=medium&amp;utm_medium=referral">Christian Roßwag</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Ok, so can we be more empathetic now?</p><p><strong>YES. </strong>It doesn’t take much effort to be empathetic once you understand that what you are feeling others feel when using the same things. We are practically doing this subconsciously.</p><p>Stop reading but I want to share some thoughts about UX.</p><p>IMO, the real UX is much more than the feeling we get from things. I believe that the real UX is about putting into practice all the psychological knowledge we have. It’s about making people feel good or bad emotions to share with more people. I used the word things to refer to what because I believe that UX tries to communicate the what to that.</p><p>What did you feel when that?</p><p>I want for people to feel the same, not only when relating to things. I say this because it can bring us closer.</p><p>At some point while writing this I felt the need to go into the 10 levels of consciousness which idk, btw. So when I got stuck at thinking deeply² I realized that it would be a topic for another moment. AHAH</p><p>Also, I didn’t want to talk about the design of UX because I think that the best way to say about it it’s with examples we can all relate and honestly I think life has UX embbeded to it which we can all get to be empathetic about.</p><p>Empathizing is part of the design thinking process but that’s not what I mean.</p><p>About UX being subjective, yes. Maybe that’s when we are not completely empathetic with everyone. At this point, I’m not sure and it feels like a shitpost. HAHA</p><p>The design of everyday things by Don Norman changed the way I see UX. I see that a lot of people put effort in learning and working on UX for apps, websites and software. Even thought that is a possibility, I try not to limit the view. Real world solutions might not involve computers at all. That’s the way I see things.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f226b26e0c5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How does the virtual memory map into the RAM?]]></title>
            <link>https://medium.com/@jeremycardona/how-does-the-virtual-memory-map-into-the-ram-651d815778d0?source=rss-8a73e9326b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/651d815778d0</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[kernel]]></category>
            <category><![CDATA[operating-systems]]></category>
            <dc:creator><![CDATA[Jeremy Cardona]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 19:12:46 GMT</pubDate>
            <atom:updated>2024-12-20T19:12:46.996Z</atom:updated>
            <content:encoded><![CDATA[<p>Virtual memory is a foundational concept in modern computing, enabling systems to execute large and multiple applications efficiently, even with limited physical RAM. It creates an abstraction layer that allows each process to operate as if it has access to a vast, contiguous memory space, regardless of the actual physical memory available.</p><p><strong>Understanding Virtual Memory Mapping</strong></p><p>At its core, virtual memory involves mapping virtual addresses used by processes to physical addresses in RAM. This mapping is managed through a combination of hardware and software mechanisms, primarily involving the Memory Management Unit (MMU) and the operating system’s kernel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OGWvy3gevZqzytc1.jpg" /></figure><p><strong>Page Tables and the Role of the Kernel</strong></p><p>The kernel maintains data structures called page tables to handle the translation between virtual and physical addresses. Each process has its own set of page tables, ensuring isolation and security between processes.</p><p>When a process attempts to access a memory address, the MMU consults the page tables to determine the corresponding physical address. If the mapping exists, the access proceeds; if not, a page fault occurs, prompting the kernel to intervene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/0*m1mWusA19UnZNK6R.jpg" /></figure><p><strong>Handling Page Faults</strong></p><p>A page fault indicates that the required data is not in RAM. The kernel responds by locating the data, which might involve reading from disk (e.g., loading a program’s code) or allocating new physical memory. Once the data is available, the kernel updates the page tables, and the process resumes execution seamlessly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/0*wXSixijg0sJUcKRU.png" /></figure><p><strong>Kernel Space vs. User Space</strong></p><p>The kernel divides the virtual address space into two main regions:</p><ul><li><strong>User Space</strong>: Allocated for user-mode applications.</li><li><strong>Kernel Space</strong>: Reserved for the operating system’s core functions.</li></ul><p>This separation ensures that user processes cannot directly access or modify kernel memory, maintaining system stability and security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/0*xnvUbwyJIlQkIwew.png" /></figure><p><strong>Efficient Memory Utilization</strong></p><p>Virtual memory allows the system to use physical RAM more efficiently through techniques like demand paging and swapping. Demand paging loads memory pages only when they are needed, reducing unnecessary memory usage. Swapping moves inactive pages to disk storage, freeing up RAM for active processes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=651d815778d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring the /proc Filesystem: Understanding /proc/maps and /proc/mem]]></title>
            <link>https://medium.com/@jeremycardona/exploring-the-proc-filesystem-understanding-proc-maps-and-proc-mem-26a3d20c971d?source=rss-8a73e9326b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/26a3d20c971d</guid>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Jeremy Cardona]]></dc:creator>
            <pubDate>Fri, 20 Dec 2024 18:40:18 GMT</pubDate>
            <atom:updated>2024-12-20T18:40:18.301Z</atom:updated>
            <content:encoded><![CDATA[<p>The /proc filesystem is a pseudo-filesystem in Linux that provides an interface to kernel data structures. One of its most intriguing uses is accessing process-related information, particularly virtual memory mappings. In this post, we&#39;ll dive into /proc/maps and /proc/mem, explain their significance, and show you how to parse /proc/maps to read virtual memory.</p><p>Follow along to replicate in 5 steps on your Linux machine!</p><h4>What is /proc/maps?</h4><p>/proc/[pid]/maps shows the memory layout of a process identified by [pid]. It lists all memory regions of the process, such as loaded libraries, the heap, the stack, and more.</p><p>Each line in /proc/1/maps looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DsLRwKTcKGs55We5F4izyw.png" /></figure><ul><li>address: The memory range (start-end) of the mapping.</li><li>perms: Permissions (r = read, w = write, x = execute, p = private, s = shared).</li><li>offset: The offset in the file or memory-mapped object.</li><li>dev: Device (major:minor).</li><li>inode: File inode number.</li><li>pathname: The mapped file, if any.</li></ul><h4>What is /proc/mem?</h4><p>/proc/[pid]/mem represents the complete memory space of a process, allowing raw access to its virtual memory. To use it effectively, you need to parse /proc/[pid]/maps to understand which regions to read from.</p><h3>Parsing /proc/maps and Reading Virtual Memory</h3><p>Here’s how you can parse /proc/[pid]/maps and use it to inspect a process’s memory via /proc/[pid]/mem.</p><h4>Step 1: Find the PID of the Target Process</h4><p>Start by identifying the process you want to inspect. Use the ps command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e1kKlxIzSPo_QqYV5sjkeg.png" /></figure><p>In my example I used the name of a executable program “./main”</p><h4>Step 2: View /proc/[pid]/maps</h4><p>Inspect the memory mappings of the process:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iVW7wKNyF509Tw06XCYLTg.png" /></figure><h4>Step 3: Parse /proc/[pid]/maps with Python</h4><p>Create a Python script to parse the file and extract regions with specific permissions, such as rw (read-write):</p><pre>pid = &lt;target_pid&gt;<br>maps_file = f&quot;/proc/{pid}/maps&quot;<br>with open(maps_file, &quot;r&quot;) as maps:<br> for line in maps:<br> parts = line.split()<br> address_range, perms, pathname = parts[0], parts[1], parts[-1] if len(parts) &gt; 5 else &#39;&#39;<br> print(f&quot;Address Range: {address_range}, Permissions: {perms}, Pathname: {pathname}&quot;)</pre><p>The output will be something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J1FsD-_2a2V2g7DTsYmIiw.png" /></figure><h4>Step 4: Access Virtual Memory via /proc/[pid]/mem</h4><p>Add functionality to read a specific memory region:</p><pre>import os<br><br>pid = &lt;target_pid&gt;<br>maps_file = f&quot;/proc/{pid}/maps&quot;<br>mem_file = f&quot;/proc/{pid}/mem&quot;<br><br>with open(maps_file, &quot;r&quot;) as maps, open(mem_file, &quot;rb&quot;) as mem:<br>    for line in maps:<br>        parts = line.split()<br>        address_range, perms = parts[0], parts[1]<br>        if &#39;r&#39; in perms:  # Only read regions with read permissions<br>            start, end = (int(addr, 16) for addr in address_range.split(&#39;-&#39;))<br>            mem.seek(start)<br>            data = mem.read(end - start)<br>            print(f&quot;Data from {hex(start)}-{hex(end)}: {data[:16]}&quot;)</pre><p>Data read from target_pid:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JSFcQ-ykApqvx0OzsXfyVw.png" /></figure><h4>Step 5: Experiment</h4><p>To safely experiment with these concepts, create a simple process that allocates memory and fills it with known data.</p><h3>Conclusion</h3><p>Parsing /proc/maps and reading virtual memory provides deep insights into process behavior. By following these steps, you can replicate the exploration on your machine</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26a3d20c971d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[C compiling process and examples]]></title>
            <link>https://medium.com/@jeremycardona/c-compiling-process-and-examples-286e92dd0ab4?source=rss-8a73e9326b1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/286e92dd0ab4</guid>
            <category><![CDATA[imperative-programming]]></category>
            <category><![CDATA[c-programming-language]]></category>
            <category><![CDATA[compiled-language]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[compiling]]></category>
            <dc:creator><![CDATA[Jeremy Cardona]]></dc:creator>
            <pubDate>Sat, 14 Oct 2023 19:51:12 GMT</pubDate>
            <atom:updated>2023-10-14T19:51:12.570Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BEb4IC3l-3vxUzuo" /><figcaption>Photo by <a href="https://unsplash.com/@jdsimcoe?utm_source=medium&amp;utm_medium=referral">Jonathan Simcoe</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Brief description of C</h3><p>C programming language is a general-purpose, imperative and categorized as a compiled language. C has been ranked among the top used programming languages and it is widely used currently.</p><h3>C is a compiled programming language</h3><p>Simply explained, a compiled language is one that has to be translated to binary (machine code) by a compiler. What this means is that in order to execute programs we have to do a few simple steps before accomplishing our goal. Hence, once we have a c file that contains c code (source code) we can make use of a compiler such as “gcc” to create programs.</p><h3>Imperative programming paradigm</h3><p>Imperative is an adjective given to a statement that demands, offers advice, commands or gives instructions. A paradigm is a model that sets a standard way of something. Using these two definitions we can describe C as a language that uses statements to give instructions in a specific model. C statements are functions that might return a value.</p><p><strong><em>programming paradigms: </em></strong><a href="https://media.geeksforgeeks.org/wp-content/uploads/1-344.png">https://media.geeksforgeeks.org/wp-content/uploads/1-344.png</a></p><h3>How to compile source code in c?</h3><p>For the sake of simplicity, we will use a program that outputs a character array to the console.</p><p>First, we create a file named: hello-world.c</p><p><strong>It’s important to have the .c extension for the file, otherwise the compilation won’t work.</strong></p><p>Now, we write the following c code:</p><pre>#include &lt;stdio.h&gt;<br>/**<br> * main - entry point<br> *<br> * Return: Success<br> *<br> * Description: Output Hello, World to the console.<br> */<br>int main(void)<br>{<br>   printf(&quot;Hello, World!&quot;);<br>   return (0);<br>}</pre><p>The first line is a library import that contains standard input/output functions that will allow us to output to the console.</p><p>The following lines enclosed by /* */ are comments, the purpose of this is to document, the computer ignores comments, comments are only useful for the programmer.</p><p>The rest of the source code contains our main function, this statement tells the program where it’s going to start. Int is a data type that tells the function that it will return an integer, in our case 0 (meaning success). The main function will take no arguments, we do this by writing void inside the function parameters. The block contained inside the curly braces {} will do two things: print the string argument in the printf function, return 0. <strong>Note that they both end with a semicolon ;.</strong></p><p>Great! So now how do we make this a program?</p><p>Assuming that we have gcc compiler installed in our computer we can do this by writing a command.</p><pre>gcc hello-world.c</pre><p>This command will give us an executable file named “a.out”. Now we can run this program with a command such a:</p><pre>./a.out</pre><p>As we can see, this created our first program.</p><h3>What happens when we do gcc to our source code?</h3><p>This simple command will preprocess, compile, assemble and link. Hence, the compilation process is composed by sub-steps.</p><p><em>Preprocessing</em>: this step eliminates all comments and macros from the file, also its going to write the header files to the source file.</p><p><em>Compilation: </em>this preprocessed file is going to be compiled, here the source changes to assembly code.</p><p><em>Assembly: t</em>he assembler is going to take these instructions and translate them to binary code (machine language).</p><p><em>Linking: </em>This step creates an executable of the binaries.</p><p>Each of these steps can be done separately by gcc if we give it options. gcc --help command explains:</p><pre>-E                       Preprocess only; do not compile, assemble or link.<br>-S                       Compile only; do not assemble or link.<br>-c                       Compile and assemble, but do not link.</pre><p>If we only wanted to compile a source file we would do the following:</p><pre>gcc -S hello-world.c</pre><p>The result of this will be assembly code in hello-world.s.</p><h3>Conclusion</h3><p>C is a popular programming language, it enables us to create programs. Programs are the result of the compilation of source files written in C.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=286e92dd0ab4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>