Hi,
In my current project I have VS solution which includes some .c file and some .asm file.
I moved some global variables from .c file in a secure section by defining
#pragma section("SECURE",read,write)
#pragma data_seg("SECURE")
__declspec(allocate("SECURE"))
char buffer[MAX_SIZE]
In .asm file there are some variables which I want to move to this SECURE section.
I want to know how to create a new data section named "SECURE" in .asm file and how to move a variable in that section.
Thanks & Regards,
Sukrut
Not sure about VS but with MASM you would do this
SECURE segment public ;might not need public
myvar dd 4
SECURE ends
Thanks for the reply sinsi,
It is not working with VS.
sgSeg segment public read write 'BSS'
gvStart dd ?
sgSeg ends
Works but only for 4096 bytes. Beyond that, I can see the memory in Olly but get an access violation.
Any trick to force a bigger segment?
Dim macro name__,n
SECURE SEGMENT PUBLIC BYTE 'BSS'
IFB <n>
name__ DB ?
ELSE
name__ DB n dup(?)
ENDIF
SECURE ENDS
endm
DimD macro name__
SECURE SEGMENT PUBLIC BYTE 'BSS'
name__ DD ?
SECURE ENDS
endm
DimW macro name__
SECURE SEGMENT PUBLIC BYTE 'BSS'
name__ DW ?
SECURE ENDS
endm
Dim s,8192
Dim s2,4096
DimW ww
DimD bb
Quote from: jj2007 on November 04, 2016, 11:37:29 PM
Works but only for 4096 bytes. Beyond that, I can see the memory in Olly but get an access violation.
Any trick to force a bigger segment?
it works fine
Thanks, will test it :icon14: