flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Control stack error

Author
Thread Post new topic Reply to topic
Fulgurance



Joined: 27 Nov 2017
Posts: 276
Fulgurance 25 Mar 2020, 14:11
Hello, today, i ask me question. I would like to implement program to control the use of the stack when some program use it.

I have tested bad fasm program he pop infinitely the stack. But when i launch it into virtual machine, virtual machine don't crash. What is the way to control stack error ?
Post 25 Mar 2020, 14:11
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20517
Location: In your JS exploiting you and your system
revolution 25 Mar 2020, 14:41
If your OS is using paging then you can use guard pages and reserved pages to monitor the stack growth.
Post 25 Mar 2020, 14:41
View user's profile Send private message Visit poster's website Reply with quote
Fulgurance



Joined: 27 Nov 2017
Posts: 276
Fulgurance 25 Mar 2020, 15:21
It's not my question. I would like to know if processor give flag control when stack encounter an error
Post 25 Mar 2020, 15:21
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20517
Location: In your JS exploiting you and your system
revolution 25 Mar 2020, 15:32
I'm not sure what you are asking. There aren't any flags that are related to the stack.

The only method I am aware of is to set up paging and place guard/reserved pages around the stack memory. Then trap the protection faults to see when the app accesses outside with the stack.
Post 25 Mar 2020, 15:32
View user's profile Send private message Visit poster's website Reply with quote
Fulgurance



Joined: 27 Nov 2017
Posts: 276
Fulgurance 25 Mar 2020, 15:43
Yes, you have understand good Smile

Thanks you for your suggestion, thanks you very much !
Post 25 Mar 2020, 15:43
View user's profile Send private message Reply with quote
Fulgurance



Joined: 27 Nov 2017
Posts: 276
Fulgurance 25 Mar 2020, 16:49
Just another question, what is the max possible size of stack ? 4 bytes ?
Post 25 Mar 2020, 16:49
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20517
Location: In your JS exploiting you and your system
revolution 25 Mar 2020, 17:32
That stack has no specific maximum or minimum. It can be zero bytes up to the entire address space.
Post 25 Mar 2020, 17:32
View user's profile Send private message Visit poster's website 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.