flat assembler
Message board for the users of flat assembler.

Index > Windows > Win 10 not load in VirtualAlloc mem !

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1769
Roman 19 May 2021, 18:22
I am confused !
This work fine on Win 7. But crash on Win 10
Code:
invoke VirtualAlloc,0,1000,MEM_COMMIT,PAGE_READWRITE
mov dword [rax],10   ;this crash on Win 10
    

I check in rax i get address not NULL.
Post 19 May 2021, 18:22
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20302
Location: In your JS exploiting you and your system
revolution 19 May 2021, 18:29
You can use GetLastError to see why it failed, but only if it return null.

Otherwise there is no reason it won't work. You probably have something else in there that you omitted to post which is causing the problem.
Post 19 May 2021, 18:29
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1769
Roman 19 May 2021, 18:37
My mistake.
I found.
This work correct.
invoke VirtualAlloc,0,1000,MEM_COMMIT,PAGE_READWRITE
Post 19 May 2021, 18:37
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 19 May 2021, 19:22
Roman wrote:
Code:
invoke VirtualAlloc,0,1000,MEM_COMMIT,PAGE_READWRITE
mov dword [rax],10   ;this crash on Win 10
    

Roman wrote:
invoke VirtualAlloc,0,1000,MEM_COMMIT,PAGE_READWRITE

Am I the only one who doesn’t see any difference between two versions, except for the line that exposes the (presumably bad) value in rax?
Post 19 May 2021, 19:22
View user's profile Send private message Visit poster's website Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1619
Location: Toronto, Canada
AsmGuru62 25 May 2021, 20:57
I also saw that this is same code.
Also, MSDN recommends to use the combination of flags (MEM_COMMIT or MEM_RESERVE) to access the memory right away.
Post 25 May 2021, 20:57
View user's profile Send private message Send e-mail 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


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.