Skip to main content
gamedev.net
🔒 Locked

Inline assembly

Started by Freaker13 Nov 18, 2003 at 6:55 AM 0 replies 400+ views
Original Post
Freaker13
Freaker13
Hi all, i want to use inline assembly in visual studio. When i use win api i get the message:unhandled exception : Privileged instruction this is my code:
__asm
{
     //set normal file attr

     lea   eax,outputName
     push  80h
     push  eax
     call  SetFileAttributes
}

thx in advance
   [/code] 





<SPAN CLASS=editedby>[edited by - Freaker13 on November 18, 2003 7:57:59 AM]</SPAN>
Jan Wassenberg
Jan Wassenberg
Win32 APIs are in DLLs => you need to indirect call through your IAT.
call dword ptr [SetFileAttributes]
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.