title: Treating an unsigned int address as a pointer and dereferencing it as a byte array
body: <p>So, I have an <code>unsigned int</code> variable with a decimal value address stored on it, let's say <code>unsigned int var = 1232342</code>, what I am trying to do is, without knowing the type of the variable <strong>but</strong> knowing the size of it and the address where it is stored, get the values as a <code>byte array</code>. For example, let's say I have an <code>int var = 20</code> with its address and bytesize. I want to be able to go to that address and return a byte array, in this case <code>[00001100]</code> and the same for <code>char</code> variables and data members of a struct. </p>
  
  <p>A little bit of pseudocode would be something like:</p>
  
  <pre><code>for var.address until var.address = var.address + bytesize
      do 
         byte_array = *var.address
         var.address++ 
  </code></pre>
  
  <p>I am encountering some problems though, I am kind of new to C so I don't know how to treat an unsigned int as an address/pointer. Second, I don't know how to get the actual bytes out of the address, whenever I dereference the address what I get is the actual value of it, but that is if I know the type for the variable.</p>
  
  <p><strong>A little bit of background:</strong> <em>I am working on a tool called Pin which gives me the option to hook into a running process, then I am using the DWARF and ELF info. So I do have access to the virtual memory space I am trying to access</em></p>