Re: Data in a 32 bit code section



On May 30, 1:18 pm, Betov <b...@xxxxxxx> wrote:
"r...@xxxxxxxxxx" <r...@xxxxxxxxxx> écrivaitnews:1180546411.068356.169700@xxxxxxxxxxxxxxxxxxxxxxxxxxx:

On May 30, 9:02 am, HandyMan <luke77...@xxxxxxxxx> wrote:
Two questions.
Thanks.

Can Win32 apps have and use data in the code section ?

This is interesting, looks like data in a code segment.
I am looking to put a number there and use it later.

; datacs.asm One example of how to put and use data in the code
section
;
; Help from Paradox,
;
; This code MAY contain Random PE Compression, Anti Siege Engine,
; and IBI(c) Technology :-)
;
; If you besiege a city for a long time while attempting to capture
it,
; you must not chop down its trees,for you may eat fruit from them
and should not cut them down.
; Deuteronomy 20:19
..
include \masm32\include\shlwapi.inc

; 00401000 >/$ 6A 00 PUSH 0 ; /
Style = MB_OK|MB_APPLMODAL
; 00401002 |. 68 21304000 PUSH msgbox.00403021 ; |
Title = "ASM Win NT Shutdown"
; 00401007 |. 68 00304000 PUSH msgbox.00403000 ; |
Text = "Privilege requested NOT granted."
; 0040100C |. 6A 00 PUSH 0 ; |
hOwner = NULL
; 0040100E |. E8 0D000000 CALL <JMP.&user32.MessageBoxA> ;
\MessageBoxA

..CODE

Start:

push 0
call @F ; calls next label
db " ",0 ; address of title of message box
@@: call @F ; calls 2nd label
db " CLICK ME!",0 ; message displayed in message box
@@: push 0 ; not sure
Call MessageBoxA
invoke ExitProcess, 0

END Start

.