Page 1 of 2 12 LastLast
Results 1 to 25 of 32

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167

    ParentIDPrefix-

    http://reactos.freedoors.org/Reactos...npmgr/pnpmgr.c

    , , ParentIdPrefix:
    Code:
    ...
     /* 2. Create the ParentIdPrefix value */
       crc32 = RtlComputeCrc32(0,
                               (PUCHAR)DeviceNode->Parent->InstancePath.Buffer,
                               DeviceNode->Parent->InstancePath.Length);
    
       swprintf((PWSTR)ParentIdPrefixInformation->Data, L"%lx&%lx", DeviceNode->Parent->Level, crc32);
       RtlInitUnicodeString(&KeyValue, (PWSTR)ParentIdPrefixInformation->Data);
    ...
    CRC32 . ?

    - Windows HKLM\SYSTEM\MountedDevices --> DosDevices .

    :
    \??\STORAGE#RemovableMedia#7&16f722a4&0&RM#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}
    ParentIDPrefix . USB , .

    7 ParetnIDPrefix (USB) :
    _??_USBSTOR#Disk&Ven_LEXAR&Prod_JD_LIGHT NING_II&Rev_1100#AA04015900000158&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
    USB ParetnIDPrefix, XP/2003, .

    :
    http://www.msfn.org/board/index.php?...c=131770&st=60
    :
    http://scissec.scis.ecu.edu.au/confe...Windows_XP.pdf

    cdob ReactOS, XP/2003.
    Last edited by ilko; 16th June 2009 at 00:32.

  2. #2
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    . ParentIDPrefix, XP/2003, , ? , , . , .
    , , DEVICE_NODE:
    http://www.nirsoft.net/kernel_struct...VICE_NODE.html
    InstancePath ( ), WinObj. , , -.
    RtlComputeCrc32:
    http://source.winehq.org/source/dlls/ntdll/rtl.c
    , e InstancePath. , .
    . ParentIDPrefix .
    crc32 KeyValue( UNICODE_STRING), . .
    - device-tree, . - ?
    Last edited by Bombera; 16th June 2009 at 04:16.
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  3. #3
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    . ParentIDPrefix, XP/2003
    .

    ... , ?
    , , Vista/7, ParentIDPrefix .


    ParentIDPrefix .
    MountedDevices migrate.inf, XP/2003 setup U: USB , MountedDevices. XP/2003 .
    MountedDevices Vista/7, ParentIDPrefix XP/2003 migrate.inf.

    Vista/7 migrate.inf, XP/2003. , ParentIDPrefix, , CRC32 ( ) .

    MkMigrateInf3.cmd migrate.inf.
    Code:
    MkMigrateInf3.cmd H: migrate.inf
    H: USB , U: .
    Attached Files

  4. #4
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    CRC32 ZIP. match- CRC- device:

    Code:
    #!/usr/bin/python
    import binascii, readline
    
    s = ""
    while True:
    	s = raw_input()
    	print "%x" % (int(binascii.crc32(s.strip())) & 0xffffffff)
    bruteforce search - , .



    :

    \Registry\Machine\System\CurrentControlS et\Enum\XXX

    XXX InstancePath, . , USBSTOR, google
    Last edited by anrieff; 16th June 2009 at 10:24.
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  5. #5
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    , Windows 2000? . , ParentID.
    MS .

  6. #6
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    , bsb,
    , , reverse engineer-. CRC32- , breakpoint ...
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  7. #7
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    , anrief.

    ReactOS , USB , .

  8. #8
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    . , - ( ). WMI, - . , , ParentIDPrefix . , , .
    , .
    Device Tree , , ( .- , ) .

    Quote Originally Posted by bsb View Post
    ... ParentID....
    ParentIDPrefix, - Instance path .
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  9. #9
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    Bombera, 15-20%

    , .

    ---------- 01:36 ---------- 01:15 ----------

    Quote Originally Posted by anrieff View Post
    ... match- CRC- device:
    ...
    :
    Code:
    USBSTOR#Disk&Ven_LEXAR&Prod_JD_LIGHTNING_II&Rev_1100#AA04015900000158&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
    , ?
    http://crc32-checksum.waraxe.us/

    , "16f722a4".
    Last edited by ilko; 17th June 2009 at 01:42.

  10. #10
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    Quote Originally Posted by ilko View Post
    Bombera, 15-20%

    , .

    ---------- 01:36 ---------- 01:15 ----------

    :
    Code:
    USBSTOR#Disk&Ven_LEXAR&Prod_JD_LIGHTNING_II&Rev_1100#AA04015900000158&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
    , ?
    http://crc32-checksum.waraxe.us/

    , "16f722a4".
    , . .
    Python 2.6. python.exe- path- cmd
    Code:
    python crc32.py
    ( )
    ( copy-paste), CRC.

    , - CRC, , 8- , UNICODE, . CRC- (8bit i unicode)

    : :
    Code:
    #!/usr/bin/python
    import binascii
    
    s = ""
    while True:
    	try:
    		s = raw_input()
    	except EOFError:
    		break
    	s = s.strip()
    	hs = binascii.hexlify(s)
    	ds_be = ""
    	ds_le = ""
    	for i in xrange(0, len(hs), 2):
    		ds_be += "00" + hs[i:i+2]
    		ds_le += hs[i:i+2] + "00"
    	print "8-bit     string CRC32: %x" % (int(binascii.crc32(binascii.unhexlify(hs))) & 0xffffffff)
    	print "16-bit LE string CRC32: %x" % (int(binascii.crc32(binascii.unhexlify(ds_le))) & 0xffffffff)
    	print "16-bit BE string CRC32: %x" % (int(binascii.crc32(binascii.unhexlify(ds_be))) & 0xffffffff)
    Last edited by anrieff; 17th June 2009 at 12:42. Reason:
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  11. #11
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    . RtlComputeCrc32 , UNICODE_STRING, (Buffer) (Length). InstancePath DEVICE_NODE . DeviceNode , e DEVICE_NODE , Parent e , , - UNICODE_STRING , InstancePath DEVICE_NODE .
    . RtlComputeCrc32 ( ) .
    , swprintf, DeviceNode->Parent->Level - ( - PCI Bus-a, ACPI, USB Bus Controller-a?). , , - crc2, RtlComputeCrc32.
    swprintf, KeyValue, UNICODE_STRING ( UNICODE_STRING . , ).

    - InstancePath . , . , .

    Windows Managment Inteface, , , , ( Win32_Bus, Win32_DeviceBus).

    , , , USB , , . , , , - (IoCallDriver).
    -( !, ) , " "

    anrieff , , .

    P.S. ParentIDPrefix. ?
    Last edited by Bombera; 17th June 2009 at 02:09.
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  12. #12
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    Quote Originally Posted by Bombera View Post
    ...P.S. ParentIDPrefix. ?...
    , .

    .

    , , USB mass storage device, - Vid&Pid ( /7).

    InstancePath :
    USBSTOR#Disk&Ven_LEXAR&Prod_JD_LIGHTNING _II&Rev_1100

    USBSTOR , Disk , Ven&Prod&Rev . , Vista/7.

    - , USB HKLM\SYSTEM\MountedDevices , 7:
    Code:
    _??_USBSTOR#Disk&Ven_LEXAR&Prod_JD_LIGHT NING_II&Rev_1100#AA04015900000158&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
    ParentIDPrefix.

    , migrate.inf ParentIDPrefix , / Text mode USB . / USB , , InstancePath .

    ---------- 03:39 ---------- 02:46 ----------

    ?

    Code:
    lkd> !devnode 0 1
    Dumping IopRootDeviceNode (= 0x8a366c98)
    ...
            DevNode 0x8a349610 for PDO 0x8a395e50
              InstancePath is "PCI\VEN_8086&DEV_2658&SUBSYS_01881028&REV_03\3&61aaa01&0&E8"
              ServiceName is "usbuhci"
              State = DeviceNodeStarted (0x308)
              Previous State = DeviceNodeEnumerateCompletion (0x30d)
                 DevNode 0x89290568 for PDO 0x8a252030
                  InstancePath is "USB\Vid_05dc&Pid_a640\AA04015900000158"
                  ServiceName is "USBSTOR"
                  State = DeviceNodeStarted (0x308)
                  Previous State = DeviceNodeEnumerateCompletion (0x30d)
                  DevNode 0x89298530 for PDO 0x892d4ea0
                    InstancePath is "USBSTOR\Disk&Ven_LEXAR&Prod_JD_LIGHTNING_II&Rev_1100\AA04015900000158&0"
                    ServiceName is "disk"
                    State = DeviceNodeStarted (0x308)
                    Previous State = DeviceNodeEnumerateCompletion (0x30d)
                    DevNode 0x89504230 for PDO 0x892898e8
                      InstancePath is "STORAGE\RemovableMedia\7&16f722a4&1&RM"
                      ServiceName is "hotcore3"
                      TargetDeviceNotify List - f 0xe25f3808  b 0xe25f3808
                      State = DeviceNodeStarted (0x308)
                      Previous State = DeviceNodeEnumerateCompletion (0x30d)
    .

    :

  13. #13
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    ParentIDPrefix-, . ? Win2K ReactOS. & . 2, , ( - -).
    InstancePath , ( - , 9) . . ? 2 crc32, a ReactOS . .
    ParentIDPrefix.
    2, . ReactOS, RtlComputeCrc32 WINE. ReactOS, RtlComputeCrc32 XP.
    , 2. .
    ?
    Enum, anrieff - . -, InstancePath ( 90% ).
    , .
    , .
    Visual Studio 2005, Release. , 2.
    Attached Files
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  14. #14
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167




    , :
    Code:
    USBSTOR\Disk&Ven_LEXAR&Prod_JD_LIGHTNING_II&Rev_1100\AA04015900000158&0
    PD level 7 2, :
    Code:
    7&16f722a4
    USBSTOR .
    Disk&Ven_LEXAR&Prod_JD_LIGHTNING_II&Rev_ 1100 Vid&Pid&Rev Vista/7.
    AA04015900000158 , Vista/7 .

    7- PD level - USB , USB card reader 8, 7. , 2.

    AA04015900000158&0 - (AA04015900000158).
    , Windows ( ), , .
    0 .

    , UPPERCASE- .
    Vista/7 , , , , Vista/7.
    , Vista/7 :
    Code:
    5F,00,3F,00,3F,00,5F,00,55,00,53,00,42,00,53,00,54,00,4F,00,52,00,23,00,44,00,69,00,73,00,6B,00,26,00,56,00,65,00,6E,00,5F,00,4C,00,45,00,58,00,41,00,52,00,26,00,50,00,72,00,6F,00,64,00,5F,00,4A,00,44,00,5F,00,4C,00,49,00,47,00,48,00,54,00,4E,00,49,00,4E,00,47,00,5F,00,49,00,49,00,26,00,52,00,65,00,76,00,5F,00,31,00,31,00,30,00,30,00,23,00,41,00,41,00,30,00,34,00,30,00,31,00,35,00,39,00,30,00,30,00,30,00,30,00,30,00,31,00,35,00,38,00,26,00,30,00,23,00,7B,00,35,00,33,00,66,00,35,00,36,00,33,00,30,00,37,00,2D,00,62,00,36,00,62,00,66,00,2D,00,31,00,31,00,64,00,30,00,2D,00,39,00,34,00,66,00,32,00,2D,00,30,00,30,00,61,00,30,00,63,00,39,00,31,00,65,00,66,00,62,00,38,00,62,00,7D,00
    . AutoIt .

    ReactOS , bsb .

    @anrieff

    copy-paste
    Code:
    USBSTOR\Disk&Ven_LEXAR&Prod_JD_LIGHTNING_II&Rev_1100\AA04015900000158&0
    "16f722a4". , 2K CRC32 , .

    , ParentIDPrefix 2K:
    http://bbs.driverdevelop.com/htm_dat...508/96099.html

    , ?
    Code:
    HASH_UNICODE_STRING(&valueName, &Hash);
    Last edited by ilko; 19th June 2009 at 01:17.

  15. #15
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    , , Paged -(. , ). , crc32 2 ( pnpirp.c):
    Code:
    #define HASH_UNICODE_STRING( _pustr, _phash ) {                             \
        PWCHAR _p = (_pustr)->Buffer;                                           \
        PWCHAR _ep = _p + ((_pustr)->Length/sizeof(WCHAR));                     \
        ULONG _chHolder =0;                                                     \
                                                                                \
        while( _p < _ep ) {                                                     \
            _chHolder = 37 * _chHolder + (unsigned int) (*_p++);                \
        }                                                                       \
                                                                                \
        *(_phash) = abs(314159269 * _chHolder) % 1000000007;                    \
    }
    UNICODE_STRING, ULONG( 32- . DWORD).
    RtlComputeCrc32 :
    http://source.winehq.org/source/dlls/ntdll/rtl.c ,
    . . , . , XP 2 , . - . 2 . , ?

    , , .

    P.S. , 2 , Uppercase ParentID( ). , .
    Last edited by Bombera; 19th June 2009 at 01:38.
    EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
    Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|

  16. #16
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    Quote Originally Posted by Bombera View Post
    ..., crc32 2 ( pnpirp.c):
    Code:
    #define HASH_UNICODE_STRING( _pustr, _phash ) {                             \
        PWCHAR _p = (_pustr)->Buffer;                                           \
        PWCHAR _ep = _p + ((_pustr)->Length/sizeof(WCHAR));                     \
        ULONG _chHolder =0;                                                     \
                                                                                \
        while( _p < _ep ) {                                                     \
            _chHolder = 37 * _chHolder + (unsigned int) (*_p++);                \
        }                                                                       \
                                                                                \
        *(_phash) = abs(314159269 * _chHolder) % 1000000007;                    \
    }
    ...


    , .
    ?

  17. #17
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    ,

    AutoIt. , .

    Quote Originally Posted by Bombera
    2 . , ?
    XP 2, 2 .
    Last edited by ilko; 19th June 2009 at 01:56.

  18. #18
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    _pustr. (cast) unsigned int. 37*chHolder. chHolder. .
    .
    phash .

  19. #19
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    , , 37- 2^32, 0 65535 0 36. ( 10^8) ,
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  20. #20
    Undead user Oldman's Avatar
    Join Date: Oct:2003
    Location: outside
    Posts: 432
    Quote Originally Posted by icaci View Post
    ... ( 10^8)...
    10^8 ( ), 2^32-1 - 0xffff ffff, . 314159269 .


    _pustr Buffer Length - .
    _p .
    Quote Originally Posted by ilko View Post
    ... _ep ?...
    end pointer , .

    JanBird , wchar_t, windows 2 . :
    _chHolder = 37 * _chHolder + (unsigned int) (*_p++);
    <morning-nonsense>
    ( unsigned int win32 32 ), 2 (.. ).
    </morning-nonsense>
    Last edited by Oldman; 22nd October 2009 at 13:19.
    .

  21. #21
    Registered User
    Join Date: Feb:2006
    Location: Plovdiv
    Posts: 392
    JanBird , wchar_t, windows 2 . :
    :_chHolder = 37 * _chHolder + (unsigned int) (*_p++);

    ( unsigned int win32 32 ), 2 (.. ).
    windows wchar_t, ASCII .

  22. #22
    Undead user Oldman's Avatar
    Join Date: Oct:2003
    Location: outside
    Posts: 432
    Quote Originally Posted by JanBird View Post
    windows wchar_t, ASCII .
    windows , UTF-16 , . ACSII , UTF-8 , 1 4.

    ___________ edit______________
    . . (unsigned int) ( ), ASCII . , -314159269 0xffff ffff. .
    Last edited by Oldman; 22nd October 2009 at 12:42. Reason: ops
    .

  23. #23
    Registered User
    Join Date: Feb:2006
    Location: Plovdiv
    Posts: 392
    Quote Originally Posted by Oldman View Post
    windows , UTF-16 , . ACSII , UTF-8 , 1 4.
    :
    Code:
    #include "math.h"
    #include "string.h"
    
    template<class T>
    unsigned long Hash(T *p)
    {                             
        unsigned long _chHolder = 0;
        while( *p) 
            _chHolder = 37 * _chHolder + (unsigned long) (*p++);               
                                                                                
        return abs(314159269 * (long)_chHolder) % 1000000007;                    
    }
    
    int main()
    {
    	char a[] = "USBSTOR\\Disk&Ven_LEXAR&Prod_JD_LIGHTNING_II&Rev_1100\\AA04015900000158&0";
    	wchar_t b[] = L"USBSTOR\\Disk&Ven_LEXAR&Prod_JD_LIGHTNING_II&Rev_1100\\AA04015900000158&0";
    	auto resultA = Hash(strupr(a));
    	auto resultB = Hash(_wcsupr(b));
    	return 0;
    }

  24. #24
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    Quote Originally Posted by Oldman View Post
    10^8 ( ), 2^32-1 - 0xffff ffff, . 314159269 .
    , * 10^8, , - , . 4-5 0x12B9B0A5. -314159269 0xED464F5B. 0xFFFFFFFF -1 .

    314159269 1000000007 US Patent 6578131 - Scaleable hash table for shared-memory multiprocessor system.

    : , 314159269 .
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  25. #25
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    _pustr USBSTOR\Disk&Ven_LEXAR&Prod_JD_LIGHTNING _II&Rev_1100\AA04015900000158&0 .

    _p ?
    Code:
    PWCHAR _p = (_pustr)->Buffer;
    Code:
    PWCHAR _ep = _p + ((_pustr)->Length/sizeof(WCHAR));
    _ep ?

    C , :
    Code:
    _chHolder = 37 * _chHolder + (unsigned int) (*_p++);
    _phash 314159269 * _chHolder, "%" 1 2 (1000000007) ,
    Code:
    *(_phash) = abs(314159269 * _chHolder) % 1000000007;
    ?

    , 7 , "ULONG _chHolder =0;"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |