flat assembler
Message board for the users of flat assembler.
Index
> Main > Executing Opcodes Goto page Previous 1, 2 |
Author |
|
vid 26 Oct 2006, 21:47
PAGE_READWRITE works because older processors doesn't have implemented page-execute bit. newer ones have, so PAGE_READWRITE won't work anymore
|
|||
26 Oct 2006, 21:47 |
|
Remy Vincent 27 Oct 2006, 11:55
I have done a very clear tutorial for VIRTUALPROTECT() function. It is very hard to be sure that it is working, without some DEBUG INFORMATION... But the DEBUG INFORMATION are there, prooving that the CODE SEGMENT rights ar really existing, they are really changed too, then they are really restored to previous value!!! it is 100% sure because DEBUG INFORMATION is displaying some "ON THE FLY" informations.
;===== FILES: FnSubst1.asm - GPF error when writing to CODE SEGMENT. FnSubst2.asm - Many debugging code. - Writing to CODE SEGMENT works. FnSubst3.asm - Many debugging code. - Writing to CODE SEGMENT works. - Restoring previous bytes inside CODE SEGMENT works too. FnSubst4.asm - No debugging code anymore, so program is shorter. FnSubst5.asm - RETF instruction is used instead of JMP instruction. FnSubst6.asm - Substituing two functions, using two routines making it all!!
|
|||||||||||
27 Oct 2006, 11:55 |
|
Remy Vincent 27 Oct 2006, 11:57
@Vid: SORRY, I have forgotten your last post, so I didn't check if PAGE_READWRITE is working with newer OS... I will check...
|
|||
27 Oct 2006, 11:57 |
|
vid 27 Oct 2006, 13:02
let us know them please
by the way, it's matter of hardware, not OS |
|||
27 Oct 2006, 13:02 |
|
okasvi 29 Oct 2006, 14:23
for me, the bigger msgboxes with info from VirtualQuery()'s were empty too, BaseAddress=0x0 ....
xp sp2 maybe using VirtualQueryEx helps? thought it shouldnt have any other difference than making possible to query vmem of other processes, afaik. |
|||
29 Oct 2006, 14:23 |
|
vid 29 Oct 2006, 16:17
you are not checking returned values
|
|||
29 Oct 2006, 16:17 |
|
f0dder 29 Oct 2006, 18:14
Remy Vincent wrote:
Until you try executing on a processor with NX capabilities... so better use the correct flag, PAGE_EXECUTE_READWRITE. Last edited by f0dder on 29 Oct 2006, 19:57; edited 1 time in total |
|||
29 Oct 2006, 18:14 |
|
Remy Vincent 29 Oct 2006, 19:28
Sorry, but I can't produce a 100 lines DEMO with VIRTUALQUERY()
or even VIRTUALQUERYEX() working with WINXP... It's so frstrating, I am using VirtualQueryEx with {GetCurrentProcess & CloseHandle} , and it's giving me the expected result on my WIN98, but on my WINXP: no way... There are some new "concepts & notions" that are much too hard for me... ALSO VirtualQueryEx with {GetCurrentProcessID} gives me many ZEROS on both W98 and WXP! Thank you anyway for you IDEA of using VirtualQueryEx,... I was just stopping all this kinf of coding |
|||
29 Oct 2006, 19:28 |
|
vid 29 Oct 2006, 19:59
you are not checking returned values
what does the function return? |
|||
29 Oct 2006, 19:59 |
|
Remy Vincent 29 Oct 2006, 22:03
it's because I use the "on the fly" debug function displaying last error, and the last error is often "no error"... sorry not to check permanently the last error...
|
|||
29 Oct 2006, 22:03 |
|
vid 29 Oct 2006, 22:38
you should check for error always in your code, and on error at least display error message
|
|||
29 Oct 2006, 22:38 |
|
Remy Vincent 30 Oct 2006, 12:41
vid wrote: you should check for error always in your code, and on error at least display error message I'm sorry, but if you start checking all errors, in fact you are "debugging the OS" you are using... Instead of learning another function of the OS... How would you store a VirtualQuery() small DEMO program, if you were the creator of a small OS able to handle VirtualQuery() CALL ?? I'am sure that you would do quicly a try, and then in case an error occurs, you would use DEBUG information directly from the OS debug mode tools, instead of adding and adding "return value checking"... That the point: if you add and add returned error checking, in fact you debug the OSwithout any of the usual powerfull tools used to debug an OS!! |
|||
30 Oct 2006, 12:41 |
|
vid 30 Oct 2006, 13:31
oh, sorry. VirtualQuery doesn't return any errors. But others do, like VirtualProtect, and you are not checking these.
by the way: MSDN reference of VirtualQuery() wrote:
|
|||
30 Oct 2006, 13:31 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.