flat assembler
Message board for the users of flat assembler.

Index > Windows > [HELP] GetCurrentHwProfile

Author
Thread Post new topic Reply to topic
Ianis



Joined: 06 Jan 2011
Posts: 10
Ianis 25 Sep 2011, 18:42
Hello, i would like to know how to get Hardware in Assembly language.
Here is the C functions but i'm not very familiar with this structure.
Code:
#include <windows.h>
#include <stdio.h>

int main()
{
     HW_PROFILE_INFO hwProfileInfo;

  if(GetCurrentHwProfile(&hwProfileInfo) != NULL){
           printf("Hardware GUID: %s\n",         hwProfileInfo.szHwProfileGuid);
                printf("Hardware Profile: %s\n", hwProfileInfo.szHwProfileName);
     }else{
            return 0;
   }

  getchar();
}
    
Post 25 Sep 2011, 18:42
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1403
Location: Piraeus, Greece
Picnic 26 Sep 2011, 09:11
Hi,
Try this

Code:
HW_PROFILE_GUIDLEN = 100
MAX_PROFILE_LEN = 100

struct HW_PROFILE_INFO
       dwDockInfo dd 0
       szHwProfileGuid TCHAR HW_PROFILE_GUIDLEN
       szHwProfileName TCHAR MAX_PROFILE_LEN
ends

hwProfileInfo HW_PROFILE_INFO 
    
Post 26 Sep 2011, 09:11
View user's profile Send private message Visit poster's website Reply with quote
Ianis



Joined: 06 Jan 2011
Posts: 10
Ianis 26 Sep 2011, 14:01
Thanks a lot Picnic, but my question is more like "How to access the structure ? "

invoke GetCurrentHwProfile, hwProfileInfo
cmp eax, 0
jnz .continue
jmp .exit
....
Then how to read hwProfileInfo.szHwProfileGuid now ?
Post 26 Sep 2011, 14:01
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1403
Location: Piraeus, Greece
Picnic 26 Sep 2011, 17:39
The messagebox shows {8c231c40-6499-11e0-b780-806d6172696f} on my pc although have no idea what is this.

Code:
       lea edx, [hwProfileInfo.szHwProfileGuid]
    invoke MessageBox, HWND_DESKTOP, edx, '', 0
    


Last edited by Picnic on 29 Mar 2012, 22:17; edited 2 times in total
Post 26 Sep 2011, 17:39
View user's profile Send private message Visit poster's website Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto 26 Sep 2011, 18:32
Quote:
The messagebox shows {8c231c40-6499-11e0-b780-806d6172696f} on my pc although have no idea what is this.


Globally unique identifier..
Search on Google

_________________
Nil Volentibus Arduum Razz
Post 26 Sep 2011, 18:32
View user's profile Send private message 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.