Author Topic: Hex values  (Read 3329 times)

Magnum

  • Member
  • *****
  • Posts: 2314
Hex values
« on: December 23, 2012, 07:44:52 AM »
I don't want to run this without making sure.

In the beingdebugged section, are those hex values ?

I know that in tasm a number is assumed to be a decimal if it doesn't
end in h and a binary value I think ended with a b.

Code: [Select]
start:

ASSUME  FS:nothing

call Custom

invoke ExitProcess,0

Custom proc
      PUSH EBP
       MOV EBP,ESP
       ;PUSH ECX
       PUSH EAX
       PUSH ECX
       MOV EAX,DWORD PTR FS:[18]
       MOV EAX,DWORD PTR DS:[EAX+30]
       MOV ECX,DWORD PTR DS:[EAX]
       MOV DWORD PTR SS:[EBP-4],ECX
       ;POP ECX
       POP EAX
       MOV EAX,DWORD PTR SS:[EBP-4]
       SHR EAX,10
       AND EAX,1
;leave
MOV ESP,EBP
       POP EBP

BeingDebugged:
   
mov eax, [fs:0x30]
    mov al, [eax + 0x02]
    and eax, 0x00000001
    ret

   Custom endp

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

jj2007

  • Member
  • *****
  • Posts: 10112
  • Assembler is fun ;-)
    • MasmBasic
Re: Hex values
« Reply #1 on: December 23, 2012, 07:47:53 AM »
0x0001 is hex, but neither Masm nor JWasm understand it.

Magnum

  • Member
  • *****
  • Posts: 2314
Re: Hex values
« Reply #2 on: December 23, 2012, 08:17:58 AM »
 01h works.

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org