Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to

existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile

and so much more. This message will be removed once you have signed in.

Active Hackers

The best community of active hackers. This community has been working in hacking for more than 10 years.

 

Hacker Forum

Hacker from all countries join this community to share their knowledge and their hacking tools

    Hacking Tools

    You can find thousands of tools shared by hackers. RAT's, Bot's, Crypters FUD, Stealers, Binders, Ransomware, Mallware, Virus, Cracked Accounts, Configs, Guides, Videos and many other things.

      PRIV8

      Become a Priv8 user and access all parts of the forum without restrictions and without limit of download. It only costs 100 dollars, and it will last you for a lifetime.

      Read Rules

      In this community we follow and respect rules, and they are the same for everyone, regardless of the user's rank. Read the rules well not to be prohibited.

      Sign in to follow this  
      top10

      SelfPath[MASM]

      Recommended Posts

      [LENGUAJE=ASM].386

       

      .model flat,stdcall

      option casemap:none

      include \masm32\include\windows.inc

      include \masm32\include\kernel32.inc ; Needed for GetModuleFileName

      includelib \masm32\lib\kernel32.lib ; Library for Kernel32

      include \masm32\include\user32.inc ; Needed For MessageBox

      includelib \masm32\lib\user32.lib ; Library for User32

       

      .data ;Data Section

      MsgBoxCaption db File Location,0 ; Caption Used In MessageBox

      MsgBoxText db This file is located in.,0 ; Text String

      mPath byte 256 dup (0) ; Variable in which EXE Path will be stored

       

      .code ; This Is The Section Where The Actual Code Is

      start:

       

      invoke GetModuleFileName, 0, offset mPath, 256 ; Invokes GetModuleFileName and stores address in variable mPath

       

      invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK ; MessageBox Displaying The String MsgBoxText

      invoke MessageBox, NULL, addr mPath, addr MsgBoxCaption, MB_OK ; MessageBox Displaying the actual Executeable Location

      invoke ExitProcess, NULL ; Closes The Application Properly Without Errors

      end start[/LENGUAJE]

       

      Credits DeadlyVermilion

      Share this post


      Link to post
      Share on other sites
      Guest
      This topic is now closed to further replies.
      Sign in to follow this