"Fossies" - the Fresh Open Source Software Archive

Member "AutoHotkey_L-1.1.33.09/source/lib/win2kcompat.asm" (8 May 2021, 1208 Bytes) of package /windows/misc/AutoHotkey_L-1.1.33.09.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Generic Assembler source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 ; Copyright 2010 Steve Gray aka 'Lexikos'
    2 ;   Permission is granted to use and/or redistribute this code without restriction.
    3 ;
    4 ; Visual C++ 2010 ordinarily creates a dependency on EncodePointer and DecodePointer,
    5 ; which means XP SP2 or later is required to run the executable.  Assembling this file
    6 ; and linking the result into the application prevents this dependency at the expense
    7 ; of any added security those two functions might've provided.
    8 ;
    9 ; Note that there are two alternative approaches:
   10 ;
   11 ;  1) Compile a lib containing the two functions and link that ahead of kernel32.lib.
   12 ;     This requires the use of the /FORCE:MULTIPLE linker option, which is not ideal.
   13 ;
   14 ;  2) Compile a dll containing the two functions and use that.  This doesn't seem to
   15 ;     have the same 'multiply defined symbols' problem as #1, but means that the exe
   16 ;     won't run on *any* OS without a copy of the dll.
   17 ;
   18 .model flat
   19 .code
   20 
   21 ; Override dll import symbols:
   22 __imp__EncodePointer@4 DWORD XxcodePointer
   23 __imp__DecodePointer@4 DWORD XxcodePointer
   24 public __imp__EncodePointer@4
   25 public __imp__DecodePointer@4
   26 
   27 ; Equivalent: PVOID EncodePointer(PVOID Ptr) { return Ptr; }
   28 XxcodePointer:  
   29     mov eax, [esp+4]
   30     ret 4
   31 
   32 end