The MASM Forum

General => The Campus => Topic started by: jamesmustain on February 22, 2021, 04:41:39 PM

Title: Looking for programs entry point?
Post by: jamesmustain on February 22, 2021, 04:41:39 PM
#Garbage Dispatcher Edit#
#Removed Full Page Advertisement for Vaccuum Cleaner#
Title: Re: Looking for programs entry point?
Post by: jj2007 on February 22, 2021, 06:51:40 PM
That's easy: mov eax, offset start

What do you need it for?
Title: Re: Looking for programs entry point?
Post by: TouEnMasm on February 22, 2021, 07:04:04 PM

lea eax(rax) ,start (mai,WinMain)  is more secured.
The start adress is dynamically allowed by the linker,the use of offset had good chance to be false.
Title: Re: Looking for programs entry point?
Post by: jj2007 on February 22, 2021, 07:27:19 PM
Quote from: TouEnMasm on February 22, 2021, 07:04:04 PMthe use of offset had good chance to be false.

Interesting, can you post an example?
Title: Re: Looking for programs entry point?
Post by: TimoVJL on February 22, 2021, 07:58:24 PM
https://docs.microsoft.com/en-us/cpp/build/reference/dynamicbase-use-address-space-layout-randomization

Address of entry point is in PE-header.
Title: Re: Looking for programs entry point?
Post by: BogdanOntanu on April 03, 2021, 07:13:42 AM
Quote from: TimoVJL on February 22, 2021, 07:58:24 PM
https://docs.microsoft.com/en-us/cpp/build/reference/dynamicbase-use-address-space-layout-randomization

Address of entry point is in PE-header.

Not really, the offset of _start symbol will ALSO be adjusted by the PE loader IF ASLR is used on a PE :D

So mov eax,offset start
is safe to use with ASLR[/code]
Title: Re: Looking for programs entry point?
Post by: jj2007 on April 03, 2021, 07:23:59 AM
Hi Bogdan, nice to see you :thup:
Title: Re: Looking for programs entry point?
Post by: Gunther on April 03, 2021, 08:01:57 AM
I agree with Jochen: Welcome back Bogdan. We've missed you.

Gunther
Title: Re: Looking for programs entry point?
Post by: six_L on April 03, 2021, 10:08:00 AM
Hi,BogdanOntanu
we are glad to see you are back. :biggrin:
the developer of Sol_OS/Sol_asm, the Steel Soldier.
Title: Re: Looking for programs entry point?
Post by: BogdanOntanu on April 04, 2021, 02:21:00 AM
Hi all,

Thanks for your nice words ;)