Segment Limit of 0xFFFFFFFF

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Segment Limit of 0xFFFFFFFF

Post by neon »

Not sure why this one persists. I think I'll just have a C function that will then call start (nevermind I just get an unresolved external on that. Oh well lol.
Hello,

Do you get the unresolved external error on the C function when you performed the above? Or, was it still the NASM function that you called from your C function? Insure that, in the entry point property in your project properties window does NOT include the symbols underscore. ie, if the C function is main(), it should be listed under Linker->Advanced->EntryPoint as just main. Note no underscore nor parenthesis ().

Also, those are indeed GCC specific. To set those options in MSVC:

1. Project Settings->C/C++->Code Generation, set Buffer Security Check to Disabled (you will need this.)
2. C/C++->Preprocessor->Ignore Standard Include Path: Yes (/X)
2. Linker->Input->Ignore All Default Libraries: Yes (/NODEFAULTLIB)
3. Linker->Input->Additional Dependencies: $(NOINHERIT)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
oib111
Member
Member
Posts: 55
Joined: Fri Sep 04, 2009 12:39 am

Re: Segment Limit of 0xFFFFFFFF

Post by oib111 »

I already have all of those set, and I didn't include the underscore when I set the entry point.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Segment Limit of 0xFFFFFFFF

Post by neon »

Hello,

That is fine - I sort of figured they were already set. I will be needing the above questions in my post answered in order to continue assisting you myself.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: Segment Limit of 0xFFFFFFFF

Post by Creature »

oib111 wrote:Aren't those GCC options? I'm using Visual Studio?
You're right, my fault. But usually the VC++ compiler has the same switches but with other names. The point I was trying to make is still: Did you forgot to add some of the necessary flags?
neon wrote:Also, those are indeed GCC specific. To set those options in MSVC:
Thanks for listing the VC++ versions :P.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Segment Limit of 0xFFFFFFFF

Post by neon »

Creature wrote:Thanks for listing the VC++ versions :P.
No problem ;)
Post Reply