Re: machine code move mem, immediate

new topic     » goto parent     » topic index » view thread      » older message » newer message

Craig Gilbert wrote:
>
>         Does anybody know the hex code for the instruction
>
>         'mov <some mem address>,<some immediate val>'???????
>
Here's the codes:
   {#C7,#04,#00,#00,#00,#00,#FF,#FF,#FF,#FF}--mov dword ptr [0],
#FFFFFFFF
   {#66,#C7,#04,#00,#00,#00,#00,#FF,#FF}--mov word ptr [0], #FFFF
   {#C6,#04,#00,#00,#00,#00,#FF}--mov byte ptr [0], #FF
Just poke your address over the #00's and your immediate over the #FF's,
or build the sequence like
   {#C7,#04} & int_to_bytes(address) & int_to_bytes(immediate)

I hope this works for ya.
--
                   _____         _____         _____
    ________      /\    \       /\    \       /\    \
   /   \    \    /  \____\     /  \____\     /  \____\
  /  _  \____\  /   / ___/_   /   /____/    /   / ___/_
 /  / \  |____|/   / /\____\ /    \    \   /   / /\____\
 \  \_/ /    / \   \/ / ___/_\     \    \  \   \/ / ___/_
  \    /____/   \    / /\    \\/\   \    \  \    / /\    \
   \   \    \    \   \/  \____\  \   \    \  \   \/  \____\
    \   \    \    \      /    /   \   \____\  \      /    /
     \   \____\    \    /    /     \  /    /   \    /    /
      \  /    /     \  /    /       \/____/     \  /    /
       \/____/       \/____/                     \/____/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu