News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Process32FirstW problem

Started by ragdog, September 23, 2012, 07:45:24 PM

Previous topic - Next topic

ragdog

Yes Jochen i know my first address was look in olly

But why make this crippled Unicode

Ok i know i can use GetModuleFileNameExW and i have  the correct filename
but i  think is must work with Module32FirstW  ::)

qWord

you may try GetModuleFileNameEx:

include \masm32\include\Psapi.inc
includelib \masm32\lib\Psapi.lib
...
start:
invoke SetConsoleOutputCP,1251 ; maybe not needed on you computer?
...
LOCAL wsz[MAX_PATH]:WCHAR
...
invoke GetModuleFileNameExW,hProcess,ModuleInformation.hModule,ADDR wsz,LENGTHOF wsz
MREAL macros - when you need floating point arithmetic while assembling!

ragdog

Quoteyou may try GetModuleFileNameEx:

I have say
QuoteOk i know i can use GetModuleFileNameExW and i have  the correct filename

I wonder why Module32FirstW not fill the structur for

szModule WCHAR MAX_MODULE_NAME32+1 dup (?)
szExePath WCHAR MAX_PATH dup (?)
MODULEENTRY32W ENDS


or Process32FirstW

szExeFile WCHAR MAX_PATH dup (?)
PROCESSENTRY32W ENDS


for get the Filename or Exe Path

Current use i in my code


  ; ---icon + Path---
mov     eax,ProcessInformation.th32ProcessID
                 invoke  OpenProcess,PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, FALSE,eax
                 mov ebx,eax
                invoke GetModuleFileNameExW,ebx,NULL,addr buffer,256