flat assembler
Message board for the users of flat assembler.

Index > Windows > Reserved Byte to DWord

Author
Thread Post new topic Reply to topic
Nameless



Joined: 30 Apr 2010
Posts: 95
Nameless
i have my data in a reserved byte as '-kill 1235', i cant convert this to DWord so i can use it with TerminateProcess API :S

thats what i managed so far
Code:
 lpBuffer dw ?
 recvBuf  rb 1024


 mov    dword [lpBuffer], recvBuf+6   
 invoke OpenProcess, PROCESS_TERMINATE, FALSE, addr lpBuffer
 invoke TerminateProcess, eax, 0 
 invoke CloseHandle
    


i hope im not abusing the board with my stupid questions Embarassed
Post 01 May 2010, 06:33
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
You need to convert the string "1235" to a proper number using something like StrToInt (http://msdn.microsoft.com/en-us/library/bb773446(VS.85).aspx)

Code:
invoke StrToInt,recvBuf+6 ; points to "1235"
invoke OpenProcess,PROCESS_TERMINATE,FALSE,eax

or eax,eax ; check if eax=NULL
jz @f

push eax ; this is for the CloseHandle call
invoke TerminateProcess,eax,0
invoke CloseHandle
@@:    
Post 01 May 2010, 08:21
View user's profile Send private message Reply with quote
Nameless



Joined: 30 Apr 2010
Posts: 95
Nameless
worked very good
thanks

i had to add StrToInt to win32ax.inc manually, cause im using it and cant redeclare imported data outside it
if it happens that u have a solution for this would be great Very Happy

thanks again, that really helped Very Happy
Post 01 May 2010, 10:01
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
Nameless wrote:
i had to add StrToInt to win32ax.inc manually, cause im using it and cant redeclare imported data outside it
if it happens that u have a solution for this would be great Very Happy
You may look here.
Post 01 May 2010, 10:21
View user's profile Send private message Reply with quote
Nameless



Joined: 30 Apr 2010
Posts: 95
Nameless
thats exactly what i was looking for
thanks man Very Happy
Post 02 May 2010, 02:52
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.