Andreik Posted July 1, 2014 Share Posted July 1, 2014 (edited) Does someone worked with Stg* functions to extract embedded file from ole streams? I want to call StgCreateStorageEx but any time it fails. I would appreciate any good direction to work with those functions. This is what I tried but I get STG_E_INVALIDFLAG erorr. #include <WinAPI.au3> #include <Array.au3> Global Const $STGM_READ = 0x00000000 Global Const $STGM_SHARE_EXCLUSIVE = 0x00000010 Global Const $STGM_CREATE = 0x00001000 Global Const $STGFMT_ANY = 4 Local $tObject = DllStructCreate("ptr") $avCall = DllCall("ole32.dll","long","StgCreateStorageEx","wstr","ole.bin","dword",$STGM_READ,"dword",$STGFMT_ANY,"dword",0,"ptr",Null,"ptr",Null,"struct*",_WinAPI_GUIDFromString('{0000000B-0000-0000-C000-000000000046}'),"ptr",DllStructGetPtr($tObject)) If $avCall[0] <> 0 Then ConsoleWrite(Hex($avCall[0]) & @CRLF) ole.zip Edited July 1, 2014 by Andreik Link to comment Share on other sites More sharing options...
LarsJ Posted July 1, 2014 Share Posted July 1, 2014 In the remarks for StgCreateStorageEx you can read the following: "This function cannot be used to open an existing file; use the StgOpenStorageEx function instead."If you use these valuesGlobal Const $STGM_READ = 0x00001000+0x00000010+0x00000002 Global Const $STGFMT_ANY = 0your code will create a new ole.bin (remove an existing file before you run the code). Andreik 1 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Andreik Posted July 1, 2014 Author Share Posted July 1, 2014 Thank you. This is a good start in my task. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now