flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Windows > [fasmg] w64g00.asm, a bare-bones Win64 console program

Author
Thread Post new topic Reply to topic
yeohhs



Joined: 19 Jan 2004
Posts: 95
Location: N 5.43564° E 100.3091°

[fasmg] w64g00.asm, a bare-bones Win64 console program


Code:

;===============================================================================
;Program : w64g00
;Version : 0.0.1
;Author  : Yeoh HS
;Date    : 7 January 2018
;Purpose : a bare-bones Win64 console program. 
;fasmg   : i17sx
;===============================================================================
include 'format/format.inc'

format PE64 Console
entry start

section '.text' code readable executable

  start:
        sub     rsp,8*5         
    
        xor    ecxecx                        ; not  push      0
        call    [ExitProcess]

section '.idata' import data readable writeable

  dd 0,0,0,RVA kernel_name,RVA kernel_table
  dd 0,0,0,0,0

  kernel_table:
    ExitProcess dq RVA _ExitProcess
    dq 0
    
  kernel_name db 'Kernel32.dll',0
  
  _ExitProcess dw 0
    db 'ExitProcess',0



_________________
I'm an INTJ aspie.


Last edited by yeohhs on 07 Jan 2018, 12:43; edited 1 time in total
Post 07 Jan 2018, 10:21
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15378
Location: 77256 23rd Street

Instead of "push 0" you should put the value into RCX.

Code:
xor ecx,ecx
call [ExitProcess]

Post 07 Jan 2018, 12:27
View user's profile Send private message Visit poster's website Reply with quote
yeohhs



Joined: 19 Jan 2004
Posts: 95
Location: N 5.43564° E 100.3091°

Very Happy Thanks!

_________________
I'm an INTJ aspie.
Post 07 Jan 2018, 12:39
View user's profile Send private message Visit poster's website 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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2017, Tomasz Grysztar.