flat assembler
Message board for the users of flat assembler.
Index
> Windows > who knows how to terminate the program? |
Author |
|
revolution 05 Jun 2010, 11:37
Code: call [ExitProcess] |
|||
05 Jun 2010, 11:37 |
|
andrr 05 Jun 2010, 11:41
Quote:
that does't work |
|||
05 Jun 2010, 11:41 |
|
revolution 05 Jun 2010, 11:50
Show your whole code please. We can't guess what you have done with only partial code.
|
|||
05 Jun 2010, 11:50 |
|
andrr 05 Jun 2010, 11:54
i want to know how to terminate a program in general
is it any need to post a whole code? Quote:
|
|||
05 Jun 2010, 11:54 |
|
ass0 05 Jun 2010, 12:23
In order to use ExitProcess you need its offset, whether imported static or dynamically from kernel32.dll
_________________ Nombre: Aquiles Castro. Location2: about:robots |
|||
05 Jun 2010, 12:23 |
|
andrr 05 Jun 2010, 12:28
will you write a code pls
Quote:
|
|||
05 Jun 2010, 12:28 |
|
ass0 05 Jun 2010, 12:28
Anyway a quick solution:
replace Code:
include 'win32a.inc'
by Code:
include 'win32ax.inc'
and Code:
push 0
call ExitProcess
by Code: invoke ExitProcess,0 _________________ Nombre: Aquiles Castro. Location2: about:robots |
|||
05 Jun 2010, 12:28 |
|
revolution 05 Jun 2010, 12:40
andrr: See the examples in the "examples" folder in the zip file.
|
|||
05 Jun 2010, 12:40 |
|
mindcooler 05 Jun 2010, 16:17
Code: ret _________________ This is a block of text that can be added to posts you make. |
|||
05 Jun 2010, 16:17 |
|
adroit 06 Jun 2010, 00:07
You could try:
Code: format PE GUI 4.0 include 'win32a.inc' entry start section '.data' data readable writeable ; ........... section '.code' code readable executable start: ; ........... push 0 call [ExitProcess] section '.idata' import data readable writeable library kernel,'KERNEL32.DLL' import kernel, ExitProcess, 'ExitProcess' Or, You could do as ass0 recommended: use include "win32ax.inc", which makes things easier. Code: format PE GUI 4.0 include 'win32ax.inc' entry start .data ; ........... .code start: ; ........... invoke ExitProcess,0 .end start ;There are no needs to import DLLs when using "include 'Win32ax.inc'" |
|||
06 Jun 2010, 00:07 |
|
FrozenKnight 01 Jul 2010, 11:17
i personally prefer the 'TerminateProcess' API for a fast dirty process kill.
|
|||
01 Jul 2010, 11:17 |
|
baldr 01 Jul 2010, 17:14
FrozenKnight wrote: i personally prefer the 'TerminateProcess' API for a fast dirty process kill. ----8<---- MeshNix wrote: …which makes things easier. |
|||
01 Jul 2010, 17:14 |
|
FrozenKnight 02 Jul 2010, 11:31
baldr wrote:
I fail to see how that applies, the only case where i could see something like that applying is if someone were to use the API to terminate a system process. But even then, i don't see any sources linking the race condition to this particular API. The only possible problem i have seen with this is that it doesn't give the process a chance to execute cleanup code. Which when i normally use it i want a hard shutdown of the intended process, not a proper cleanup, usually because the process has frozen or is one of those annoying programs that won't let you close it. |
|||
02 Jul 2010, 11:31 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.