Author Topic: h2incX  (Read 2483 times)

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 349
  • ObjAsm32 + ObjAsm64 = ObjAsm
    • ObjAsm
Re: h2incX
« Reply #15 on: September 10, 2018, 05:59:26 AM »
Hi Vortex
This is really weird!
Code: [Select]
UASM v2.46, Jun 23 2018, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.

SimpleWnd.asm: 87 lines, 2 passes, 218 ms, 0 warnings, 0 errors

I had to adjust a few paths on your code and it compiled without drama  :P

I'll look into the error list to see where ML has a problem. I have just recognized some of them. The most obvious is the ML6.15 doesn't know what a SQWORD is...

Biterider

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 349
  • ObjAsm32 + ObjAsm64 = ObjAsm
    • ObjAsm
Re: h2incX
« Reply #16 on: September 10, 2018, 06:21:37 AM »
Hi Vortex
I know what is going on. I'm using the modified UASM version of Habran (see here http://masm32.com/board/index.php?topic=7212.0).
Attached the corrected WinUser.inc file.
Biterider

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 349
  • ObjAsm32 + ObjAsm64 = ObjAsm
    • ObjAsm
Re: h2incX
« Reply #17 on: September 10, 2018, 06:26:20 AM »
Btw, looking a bit closer into WinNT.h  I found
Code: [Select]
typedef struct _SE_TOKEN_USER {
    union {
        TOKEN_USER TokenUser;
        SID_AND_ATTRIBUTES User;
    } DUMMYUNIONNAME;
    union {
        SID Sid;
        BYTE  Buffer[SECURITY_MAX_SID_SIZE];
    } DUMMYUNIONNAME2;
} SE_TOKEN_USER , PSE_TOKEN_USER;

Should not it be like this?

Code: [Select]
... } SE_TOKEN_USER , *PSE_TOKEN_USER;
Biterider

habran

  • Member
  • *****
  • Posts: 1203
    • uasm
Re: h2incX
« Reply #18 on: September 10, 2018, 08:43:27 PM »
You are correct Biterider 8)

You have been doing an excellent job :t
I am looking forward to your final work :biggrin:

Cod-Father

LiaoMi

  • Member
  • ****
  • Posts: 508
Re: h2incX
« Reply #19 on: September 10, 2018, 09:28:03 PM »
Btw, looking a bit closer into WinNT.h  I found
Code: [Select]
typedef struct _SE_TOKEN_USER {
    union {
        TOKEN_USER TokenUser;
        SID_AND_ATTRIBUTES User;
    } DUMMYUNIONNAME;
    union {
        SID Sid;
        BYTE  Buffer[SECURITY_MAX_SID_SIZE];
    } DUMMYUNIONNAME2;
} SE_TOKEN_USER , PSE_TOKEN_USER;

Should not it be like this?

Code: [Select]
... } SE_TOKEN_USER , *PSE_TOKEN_USER;
Biterider

Hi Biterider,

Code: [Select]
;
; Token information class structures
;

TOKEN_USER STRUCT DEFALIGNMASM
User SID_AND_ATTRIBUTES <>
TOKEN_USER ENDS


IFNDEF MIDL_PASS

SE_TOKEN_USER STRUCT DEFALIGNMASM
union DUMMYUNIONNAME
aTokenUser TOKEN_USER <>
User SID_AND_ATTRIBUTES <>
ENDS
union DUMMYUNIONNAME2
Sid SID <>
Buffer BYTE SECURITY_MAX_SID_SIZE dup (?)
ENDS
SE_TOKEN_USER ENDS


PSE_TOKEN_USER EQU <SE_TOKEN_USER>

TOKEN_USER_MAX_SIZE equ < sizeof(TOKEN_USER) + SECURITY_MAX_SID_SIZE>
ENDIF

So its made in sdk from ToutEnMasm  ::)

Vortex

  • Member
  • *****
  • Posts: 1965
Re: h2incX
« Reply #20 on: September 11, 2018, 03:15:39 AM »
Hi Biterider,

According to the MS documentation :

https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ntifs/ns-ntifs-_se_token_user

Code: [Select]
typedef struct _SE_TOKEN_USER {
  union {
    TOKEN_USER         TokenUser;
    SID_AND_ATTRIBUTES User;
  } DUMMYUNIONNAME;
  union {
    SID   Sid;
    UCHAR Buffer[SECURITY_MAX_SID_SIZE];
  } DUMMYUNIONNAME2;
} SE_TOKEN_USER, PSE_TOKEN_USER;

My MinGW setup (ntifs.h ) does not provide this structure. Same result with the header file http://www.acc.umu.se/~bosse/ntifs.h. No any reference to this structure.


Vortex

  • Member
  • *****
  • Posts: 1965
Re: h2incX
« Reply #21 on: September 11, 2018, 03:19:45 AM »
Hi Biterider,

Using the unmodified Uasm release and the header file supplied with the zip file winuser.zip, I managed to assemble the Window example, thanks.

habran

  • Member
  • *****
  • Posts: 1203
    • uasm
Re: h2incX
« Reply #22 on: September 11, 2018, 04:47:30 AM »
I found here this:
Quote
typedef struct _SE_TOKEN_USER {
  union {
    TOKEN_USER         TokenUser;
    SID_AND_ATTRIBUTES User;
  };
  union {
    SID   Sid;
    UCHAR Buffer[SECURITY_MAX_SID_SIZE];
  };
} SE_TOKEN_USER, *PSE_TOKEN_USER;

It must be $MS error because pointers should have asterisks

I would ask them about that.
 
Cod-Father

fearless

  • Member
  • ***
  • Posts: 422
    • LetTheLightIn
Re: h2incX
« Reply #23 on: September 11, 2018, 05:08:58 AM »
Yes looks like an error. I scanned the sdk's and ddk for any reference of usage and it appears PSE_TOKEN_USER isn't used anywhere in any function or other structure - so thats why ms probably didnt notice the typo as PSE_TOKEN_USER is not used anywhere cept at the end of SE_TOKEN_USER structure define, and should be a pointer to that struct.
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI

My Github  Twitter

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 349
  • ObjAsm32 + ObjAsm64 = ObjAsm
    • ObjAsm
Re: h2incX
« Reply #24 on: September 11, 2018, 05:34:45 AM »
Hi Vortex
At least I know I'm not alone  :biggrin:


Biterider