flat assembler
Message board for the users of flat assembler.

Index > Windows > struct LPSHELLEXECUTEINFO

Author
Thread Post new topic Reply to topic
semiono



Joined: 31 Aug 2007
Posts: 176
Location: section '.code' executable
semiono
Quote:
typedef struct _SHELLEXECUTEINFO {
DWORD cbSize; // dw ?
ULONG fMask; // What??? Very Happy
HWND hwnd; // dd ?
LPCTSTR lpVerb; // NULL, edit, etc.
LPCTSTR lpFile; // null terminated aka db 'la-la',0
LPCTSTR lpParameters; // OK!
LPCTSTR lpDirectory; // NULL, etc.
int nShow; // SW_SHOW
HINSTANCE hInstApp; // dd ?
LPVOID lpIDList; // Shocked
LPCTSTR lpClass; // GUID Rolling Eyes
HKEY hkeyClass; // ...
DWORD dwHotKey; // NULL ?
union {
HANDLE hIcon;
HANDLE hMonitor;
} DUMMYUNIONNAME;
// Who is this? Razz ???
HANDLE hProcess;
} SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO;


Please, example it for me? Embarassed
Symply i need ShellExecuteEx with delay for terminate a console application...

_________________
Memory=8388608
Post 09 Sep 2010, 12:51
View user's profile Send private message ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17671
Location: In your JS exploiting you and your system
revolution
Everything is a dword sized value
Post 09 Sep 2010, 12:54
View user's profile Send private message Visit poster's website Reply with quote
semiono



Joined: 31 Aug 2007
Posts: 176
Location: section '.code' executable
semiono
very formidably function labyrinth...
i see some examples in a web with regiser manipulation with is the structure
i'm hands up!
Smile
Post 09 Sep 2010, 20:58
View user's profile Send private message ICQ Number Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3050
Location: vpcmipstrm
bitRAKE
Code:
struc SHELLEXECUTEINFO {
  .:
  .cbSize       dd ?
  .fMask        dd ?
  .hwnd         dd ?
  .lpVerb       dd ?
  .lpFile       dd ?
  .lpParameters dd ?
  .lpDirectory  dd ?
  .nShow        dd ?
  .hInstApp     dd ?
  .lpIDList     dd ?
  .lpClass      dd ?
  .hkeyClass    dd ?
  .dwHotKey     dd ?
  label .hIcon dword
  .hMonitor     dd ?
  .hProcess     dd ?
  .. = $ - .
}    
...and slightly different for PE64 - all the handles and pointers become DQ's? Also, .nShow probably has a dword following it for padding.
Post 10 Sep 2010, 07:03
View user's profile Send private message Visit poster's website Reply with quote
semiono



Joined: 31 Aug 2007
Posts: 176
Location: section '.code' executable
semiono
link
What is different of fasm ?

Code:
LOCAL sei:SHELLEXECUTEINFO
    
    INVOKE RtlZeroMemory, ADDR sei, SIZEOF sei
    mov sei.cbSize, SIZEOF SHELLEXECUTEINFO
    mov eax, hWnd
    mov sei.hwnd, eax
    mov sei.fMask, SEE_MASK_FLAG_DDEWAIT OR SEE_MASK_FLAG_NO_UI
    mov eax, CTXT("runas")
    mov sei.lpVerb, eax
    mov eax, pFilename
    mov sei.lpFile, eax
    mov eax, pParameters 
    mov sei.lpParameters, eax
    mov sei.nShow, SW_SHOWNORMAL
    INVOKE ShellExecuteEx, ADDR sei
la-la-la-...    


SIZEOF sei - Shocked $-sei ?

I don't need directly this example but i should need somthing about ShellExecuteEx() exampe. Smile
Post 14 Sep 2010, 16:10
View user's profile Send private message ICQ Number Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3050
Location: vpcmipstrm
bitRAKE
Please send money to my paypal account ( bitRAKE _ gmail.com ): I need help buying my next computer. Thank you.
Code:
format PE GUI 4.0
include 'win32ax.inc'

.data

SEE_MASK_DEFAULT                = 0x00000000
SEE_MASK_CLASSNAME              = 0x00000001
SEE_MASK_CLASSKEY               = 0x00000003
SEE_MASK_IDLIST                 = 0x00000004
SEE_MASK_INVOKEIDLIST           = 0x0000000C
SEE_MASK_ICON                   = 0x00000010
SEE_MASK_HOTKEY                 = 0x00000020
SEE_MASK_NOCLOSEPROCESS         = 0x00000040
SEE_MASK_CONNECTNETDRV          = 0x00000080
SEE_MASK_NOASYNC                = 0x00000100
SEE_MASK_FLAG_DDEWAIT           = 0x00000100
SEE_MASK_DOENVSUBST             = 0x00000200
SEE_MASK_FLAG_NO_UI             = 0x00000400
SEE_MASK_UNICODE                = 0x00004000
SEE_MASK_NO_CONSOLE             = 0x00008000
SEE_MASK_ASYNCOK                = 0x00100000
SEE_MASK_HMONITOR               = 0x00200000
SEE_MASK_NOZONECHECKS           = 0x00800000
SEE_MASK_NOQUERYCLASSSTORE      = 0x01000000
SEE_MASK_WAITFORINPUTIDLE       = 0x02000000
SEE_MASK_FLAG_LOG_USAGE         = 0x04000000

struc SHELLEXECUTEINFO {
  .:
  .cbSize       dd ?
  .fMask        dd ? 
  .hwnd         dd ? 
  .lpVerb       dd ? 
  .lpFile       dd ? 
  .lpParameters dd ? 
  .lpDirectory  dd ? 
  .nShow        dd ? 
  .hInstApp     dd ? 
  .lpIDList     dd ? 
  .lpClass      dd ? 
  .hkeyClass    dd ? 
  .dwHotKey     dd ? 
  label .hIcon dword 
  .hMonitor     dd ? 
  .hProcess     dd ? 
  .. = $ - . 

  ; Requests the OS to run the executable elevated.
  ; Returns TRUE if successful, or FALSE otherwise.
  ; If FALSE then return error information in edx
  macro .RunElevated hWnd*,pFilename*,pParameters* \{
    \local ..okay
    invoke RtlZeroMemory,.,..
    mov [.cbSize],..
    mov [.hwnd],hWnd
    mov [.fMask],SEE_MASK_FLAG_DDEWAIT or SEE_MASK_FLAG_NO_UI
    mov [.lpVerb],_runas
    mov [.lpFile],pFilename
    mov [.lpParameters],pParameters
    mov [.nShow],SW_SHOWNORMAL
    invoke ShellExecuteEx,.
    test eax,eax
    jnz ..okay
    invoke GetLastError
    mov edx, eax
    xor eax, eax
    ..okay:
  \}
}

  _runas   db 'runas',0
  _notepad db 'notepad.exe',0
  _test    db 'w32.semiono.asm',0

  align 4

  sei SHELLEXECUTEINFO

.code

start:

  sei.RunElevated 0,_notepad,_test

  invoke  ExitProcess,0

.end start    
...you need to post your code because mine is working well. Very Happy
Post 14 Sep 2010, 17:47
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
semiono,

Didn't you notice «..= $ - .» line? sei.. is your SIZEOF SHELLEXECUTEINFO.

Using struct macro instead can be easier (it supports union too and defines sizeof.struct name).
Post 14 Sep 2010, 17:51
View user's profile Send private message Reply with quote
semiono



Joined: 31 Aug 2007
Posts: 176
Location: section '.code' executable
semiono
This is really grand step for me to understand all about ms api to go himself. Very Happy
I don't have job, and not have money because i'm lazzy

bitRAKE, what your computer is last? Cool
if you come we can drink beer

Thanks to all good people! I'm sorrii Very Happy Embarassed
Post 14 Sep 2010, 18:52
View user's profile Send private message ICQ Number Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3050
Location: vpcmipstrm
bitRAKE
Learning assembler and English = not so lazy. Very Happy

Trying to confuse you with this line:
Code:
invoke RtlZeroMemory,.,..    
Laughing (x86 braille)
Post 14 Sep 2010, 19:45
View user's profile Send private message Visit poster's website Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
bitRAKE,

brainfasm? Wink
Post 14 Sep 2010, 20:03
View user's profile Send private message Reply with quote
semiono



Joined: 31 Aug 2007
Posts: 176
Location: section '.code' executable
semiono
i found code in google and copypast it,
i not understand this thing ))
Smile

_________________
Memory=8388608
Post 14 Sep 2010, 20:25
View user's profile Send private message ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.