flat assembler
Message board for the users of flat assembler.
Index
> Windows > struct LPSHELLEXECUTEINFO |
Author |
|
revolution 09 Sep 2010, 12:54
Everything is a dword sized value
|
|||
09 Sep 2010, 12:54 |
|
semiono 09 Sep 2010, 20:58
very formidably function labyrinth...
i see some examples in a web with regiser manipulation with is the structure i'm hands up! |
|||
09 Sep 2010, 20:58 |
|
bitRAKE 10 Sep 2010, 07:03
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 ? .. = $ - . } |
|||
10 Sep 2010, 07:03 |
|
semiono 14 Sep 2010, 16:10
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 - $-sei ? I don't need directly this example but i should need somthing about ShellExecuteEx() exampe. |
|||
14 Sep 2010, 16:10 |
|
bitRAKE 14 Sep 2010, 17:47
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 |
|||
14 Sep 2010, 17:47 |
|
baldr 14 Sep 2010, 17:51
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). |
|||
14 Sep 2010, 17:51 |
|
semiono 14 Sep 2010, 18:52
This is really grand step for me to understand all about ms api to go himself.
I don't have job, and not have money because i'm lazzy bitRAKE, what your computer is last? if you come we can drink beer Thanks to all good people! I'm sorrii |
|||
14 Sep 2010, 18:52 |
|
bitRAKE 14 Sep 2010, 19:45
Learning assembler and English = not so lazy.
Trying to confuse you with this line: Code: invoke RtlZeroMemory,.,.. |
|||
14 Sep 2010, 19:45 |
|
baldr 14 Sep 2010, 20:03
bitRAKE,
brainfasm? |
|||
14 Sep 2010, 20:03 |
|
semiono 14 Sep 2010, 20:25
i found code in google and copypast it,
i not understand this thing )) _________________ Windows 9, FL Studio 19 |
|||
14 Sep 2010, 20:25 |
|
semiono 16 Aug 2022, 14:18
Code: include '%fasm%/win64ax.inc' section '.code' executable start: sub rsp,8 invoke RtlZeroMemory,sei,MAX_PATH ; b = $ - sei mov [sei.cbSize],MAX_PATH mov [sei.fMask],NULL mov [sei.hwnd],NULL mov [sei.lpVerb],NULL mov [sei.lpFile],a mov [sei.lpParameters],NULL mov [sei.nShow],SW_NORMAL mov [sei.hInstApp],NULL invoke ShellExecuteEx,sei cmp eax,NULL jnz exit invoke MessageBoxTimeout,HWND_DESKTOP,'','',MB_TOPMOST,LANG_NEUTRAL,5000 exit: invoke ExitProcess,NULL section '.data' readable writeable a db 'notepad.exe',NULL b = $ - sei struct SHELLEXECUTEINFO cbSize dd NULL fMask dd NULL hwnd dd NULL lpVerb dd NULL lpFile dd NULL lpParameters dd NULL lpDirectory dd NULL nShow dd NULL hInstApp dd NULL lpIDList dd NULL lpClass dd NULL hkeyClass dd NULL dwHotKey dd NULL label .hIcon dword hMonitor dd NULL hProcess dd NULL ends sei SHELLEXECUTEINFO section '.idata' import readable library kernel32,'KERNEL32.DLL',shell32,'SHELL32.DLL',user32,'USER32.DLL' include '%fasm%/api/kernel32.inc' include '%fasm%/api/shell32.inc' include '%fasm%/api/user32.inc' I'll be back Why my interpretation bitRAKE's code do not work? Fully quiet! RtlZeroMemory - something wrong here. I can't it. b = $ - sei - nothing happen _________________ Windows 9, FL Studio 19 |
|||
16 Aug 2022, 14:18 |
|
bitRAKE 16 Aug 2022, 19:04
When you do 'b = $ - sei', $ is equal to sei.
In 64-bit all the pointers and handles need to be promoted to 64-bit. |
|||
16 Aug 2022, 19:04 |
|
Hrstka 17 Aug 2022, 11:33
For 64-bit you need to make some changes like this:
Code: format PE64 GUI entry start include 'win64a.inc' section '.code' code readable executable start: sub rsp,8 invoke RtlZeroMemory,sei,SEI_SIZE mov [sei.cbSize],SEI_SIZE ; cannot move 64-bit value directly to memory, need to use a register mov rax,a mov [sei.lpFile],rax mov [sei.nShow],SW_SHOWNORMAL invoke ShellExecuteEx,sei cmp rax,NULL jnz exit invoke MessageBoxTimeout,HWND_DESKTOP,message,title,MB_TOPMOST,LANG_NEUTRAL,5000 exit: invoke ExitProcess,NULL section '.data' data readable writeable struc SHELLEXECUTEINFO64 { .cbSize dd ? .fMask dd ? .hwnd dq ? .lpVerb dq ? .lpFile dq ? .lpParameters dq ? .lpDirectory dq ? .nShow dd ?, ? .hInstApp dq ? .lpIDList dq ? .lpClass dq ? .hkeyClass dq ? .dwHotKey dd ?, ? label .hIcon qword .hMonitor dq ? .hProcess dq ? } a db 'notepad.exe',NULL title db 'Error',NULL message db 'Something went wrong',NULL align 16 sei SHELLEXECUTEINFO64 SEI_SIZE = $-sei section '.idata' import data readable writeable library kernel ,'KERNEL32.DLL',\ shell, 'SHELL32.DLL',\ user, 'USER32.DLL' import kernel,\ ExitProcess,'ExitProcess',\ RtlZeroMemory,'RtlZeroMemory' import shell,\ ShellExecuteEx,'ShellExecuteExA' import user,\ MessageBoxTimeout,'MessageBoxTimeoutA' section '.reloc' fixups data readable discardable |
|||
17 Aug 2022, 11:33 |
|
semiono 17 Aug 2022, 19:46
Code: include '%fasm%/win64ax.inc' section '.code' executable start: sub rsp,8 invoke RtlZeroMemory,sei,SEI_SIZE mov [sei.cbSize],SEI_SIZE mov [sei.lpFile],a invoke ShellExecuteEx,sei cmp eax,NULL jnz exit invoke MessageBoxTimeout,HWND_DESKTOP,'','',MB_TOPMOST,LANG_NEUTRAL,1000 exit: invoke ExitProcess,NULL section '.data' readable a db 'calc.exe',NULL section '.data' readable writeable struct SHELLEXECUTEINFO cbSize dd NULL fMask dd NULL hwnd dq NULL lpVerb dq NULL lpFile dq NULL lpParameters dq NULL lpDirectory dq NULL nShow dd NULL,NULL hInstApp dq NULL lpIDList dq NULL lpClass dq NULL hkeyClass dq NULL dwHotKey dd NULL,NULL label .hIcon qword hMonitor dq NULL hProcess dq NULL ends align 16 sei SHELLEXECUTEINFO SEI_SIZE = $ - sei section '.idata' import readable library kernel32,'KERNEL32.DLL',shell32,'SHELL32.DLL',user32,'USER32.DLL' include '%fasm%/api/kernel32.inc' include '%fasm%/api/shell32.inc' include '%fasm%/api/user32.inc' Fully work! Thank you, Hrstka! Quote:
Maybe you right. I move it direct but no problem) My problem has been that SEI_SIZE must follow strong after structure. And sometime ago I meet this like dword/qword but in structure it depend by every personal parameter. nShow dword lpClass quord etc. Thanx! |
|||
17 Aug 2022, 19:46 |
|
semiono 17 Aug 2022, 20:09
Quote:
SEI_SIZE |
|||
17 Aug 2022, 20:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.