; $Id: kLdrA-os2.asm 2886 2006-11-18 15:01:05Z bird $ ;; @file ; ; kLdr - The Dynamic Loader, asm helpers. ; ; Copyright (c) 2006 knut st. osmundsen ; ; ; This file is part of kLdr. ; ; kLdr is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; kLdr is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with kLdr; if not, write to the Free Software ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ; ; segment TEXT32 public align=16 CLASS=CODE use32 ; ; _DLL_InitTerm ; ..start: extern _DLL_InitTerm jmp _DLL_InitTerm ; ; kLdrLoadExe wrapper which loads the bootstrap stack. ; global _kLdrDyldLoadExe _kLdrDyldLoadExe: push ebp mov ebp, esp ; switch stack. ; extern _abStack ; lea esp, [_abStack + 8192 - 4] push dword [ebp + 8 + 20] push dword [ebp + 8 + 16] push dword [ebp + 8 + 12] push dword [ebp + 8 + 8] ; call worker on the new stack. extern _kldrDyldLoadExe call _kldrDyldLoadExe ; we shouldn't return! we_re_not_supposed_to_get_here: int3 int3 jmp short we_re_not_supposed_to_get_here