.code section

Everything else that doesn't fall into one of the other PB categories.
frederic
User
User
Posts: 56
Joined: Thu Jan 05, 2006 11:22 pm

.code section

Post by frederic »

Hello,
How to do to make .code section writeable in purebasic ??
by default this section is executable & readable

frederic
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Code: Select all

VirtualProtect_(?StartAddress, Length, #PAGE_WRITECOPY, @oldProtect)
And, to restore non-writeability:

Code: Select all

VirtualProtect_(?StartAddress, Length, #PAGE_EXECUTE, @oldProtect)
Last edited by El_Choni on Sun Feb 26, 2006 1:02 am, edited 1 time in total.
El_Choni
frederic
User
User
Posts: 56
Joined: Thu Jan 05, 2006 11:22 pm

Post by frederic »

thanks it works perfectly :)
Post Reply