Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   HARDLOCK emulator (https://forum.exetools.com/showthread.php?t=5226)

toro 09-04-2004 22:10

HARDLOCK emulator
 
hi all

i decide to write a hardlock emulator. previously i was write a sentinel filter driver that work properly (see rce messageboard, i posted my progress with name nikan).

after some study on data transfer between hardlock protected program and driver i found that all of data transfer is performed via deviceiocontrol.
there are 2 level of encryption on hl_api packet. i gess first level enc is function specefic. second level is done. have anyone any idea about first level encryption algo?

toro.

nikita@work 09-04-2004 22:49

Quote:

Originally Posted by toro
after some study on data transfer between hardlock protected program and driver i found that all of data transfer is performed via deviceiocontrol.
there are 2 level of encryption on hl_api packet. i gess first level enc is function specefic. second level is done. have anyone any idea about first level encryption algo?
toro.

First of all you need last two versions of hardlock.sys because they contain different packet crypt code. And both do it inside virtual machine. Code of VM and p-code obfuscated.
Good luck.

toro 09-04-2004 23:28

hi nikita@work

i tested many programs that protected with hardlock. i can devide those programs in 2 category. in category 1 there is no encryption on hl_api packet (possiblly drivers before 2.85) and in category 2 (drivers after 2.85) i have found one kind of encryption but in 2 level. the level 2 of encryption is very easy to emulate. it use a seed that stored in offset (hl_api+0xBC).
but in level 1 the packet is partially encrypted. are you see this thing too?

however are you have any info on hl_api structure, i was studied it but not completly.

toro.

nikita@work 09-05-2004 01:55

Quote:

Originally Posted by toro
i tested many programs that protected with hardlock.

Last version of HL & HASP API was released more than year ago, but practically nobody use it. That's why I reversed driver.

Quote:

Originally Posted by toro
the level 2 of encryption is very easy to emulate. it use a seed that stored in offset (hl_api+0xBC). but in level 1 the packet is partially encrypted. are you see this thing too?

Right. Each field of packet have it's own encrypt/decrypt routine in p-code. Some of them in native code. And pay attention on field +0xBD - it's a version of crypt algo.

Quote:

Originally Posted by toro
however are you have any info on hl_api structure, i was studied it but not completly.
toro.

Only standard part from SDK.

toro 09-05-2004 03:50

hi nikita@work

can you explain p-code? i see all encryption routin in native. i saw that level 2 is performed on some portion of begining of hl_api. (first 64 byte) is it true?

however i need some info about sequence of data transfer between driver and program when program call hl_code function. i see that when program call this function some call to deviceiocontrol with different buffersize is happen. and another question: some call to deviceiocontrol with buffersize=4 and 6 is happen why?


toro.

nikita@work 09-05-2004 19:25

Quote:

Originally Posted by toro
can you explain p-code? i see all encryption routin in native. i saw that level 2 is performed on some portion of begining of hl_api. (first 64 byte) is it true?

I think you working with old version o hl api. It's true but newest versions of packet crypt algo written in p-code. And algo different (version stored in +0xBD filed).

Quote:

Originally Posted by toro
and another question: some call to deviceiocontrol with buffersize=4 and 6 is happen why?

For example one of these short questions detect softice ;)
Try to see how packet forms while HL_INIT/HL_READ/HL_CODE. It's enough.

toro 09-07-2004 03:58

hi nikita@work

during last day i was working on level 1 of encryption. till now i have written 25 function to decode 25 field of hl_struct, some of fields are remained.
however i work with hl_api version 383, is it old? i download it from aladdin ftp.
are you have any info about structure of hl_struct? i found usage of some of field in hl_struct, such as major and minor api version, refkey and verkey, memory address and memory content , program processid , status code and modad . but i don't found usage of other fields. can you help me?

the seed is a word that start at hl_struct+0xbc.

toro.

nikita@work 09-07-2004 04:49

Quote:

Originally Posted by toro
during last day i was working on level 1 of encryption. till now i have written 25 function to decode 25 field of hl_struct, some of fields are remained.
however i work with hl_api version 383, is it old? i download it from aladdin ftp.

What version stored in +BA field?
0 - no crypt
1 - first version
2 - second version

Quote:

Originally Posted by toro
are you have any info about structure of hl_struct?

Sent via PM.

toro 09-07-2004 13:03

hi nikita@work

very tanks for hl_packet structure. the version stored in 0xba is 1 so after work on this version i must work on next version. this project is very harder than superpro!!!. i will try to download new hl_api from aladdin ftp.


tanks
toro.

kab 09-07-2004 16:15

Nikita, can you send hl_struct structure to me too?
Thanks in advance!

toro 09-07-2004 16:39

hi nikita@work

very tanks for your helpfull info. i have seen your id in brain studio emulator so you must be an expert in hardlock and hasp (posibly sentinel, tanks for your first reply to me about sentinel).
i see ealaddin site. there is a hl_api installation file that can be download. its time is 11/2002 . i download it last mount. there is no new version. after installing it, i foun a hl_demo project. so i compiled it with msvc and worked with it. in hl_struct+0xba i see 1. also i test some program that envelpoed with hardlock and see version 1. in which program you see version 2 and p-code?

tanks

toro

nikita@work 09-07-2004 17:45

Quote:

Originally Posted by toro
in which program you see version 2 and p-code?

As I told before it was latest hardlock.sys =)
(from hinstall.exe v4.95)

toro 09-08-2004 15:46

hi nikita@work

my level 1 & level 2 enc/dec routin compeleted. in level 1 there are 37 fields that encoded and decoded but your hl_struct has 26 member. this means that other members is not used?

you say the hardlock.sys that installed with hinstall version 4.95 has a different enc\dec algo in p-code, are you see any hardlock protected program that making use of this hardlock.sys?

toro.

nikita@work 09-08-2004 16:16

Quote:

Originally Posted by toro
my level 1 & level 2 enc/dec routin compeleted. in level 1 there are 37 fields that encoded and decoded but your hl_struct has 26 member. this means that other members is not used?

Reserved area contain fileds like PortFlags that used only by driver.
But it seems some of them used in HL RUS API.

Quote:

Originally Posted by toro
you say the hardlock.sys that installed with hinstall version 4.95 has a different enc\dec algo in p-code, are you see any hardlock protected program that making use of this hardlock.sys?

At this moment - no =)

toro 09-09-2004 03:48

hi nikita

as i say before currently i found 2 version of hardlock.sys. one version has no enc\dec algo and one version has. can you tell me about version 0, is it the same as uncrypted version?
however my problem is to distinguish between crypted an uncrypted packets in runtime. my approach is to test the seed, if it is 0 then packet is not crypted and if is not 0 then packet crypted in 2 level is it true?

toro

nikita@work 09-09-2004 04:00

Quote:

Originally Posted by toro
as i say before currently i found 2 version of hardlock.sys. one version has no enc\dec algo and one version has. can you tell me about version 0, is it the same as uncrypted version?

Right. Simply check +0xBA field and if it's zero skip decrypt.

Quote:

Originally Posted by toro
however my problem is to distinguish between crypted an uncrypted packets in runtime. my approach is to test the seed, if it is 0 then packet is not crypted and if is not 0 then packet crypted in 2 level is it true?

If +0xBA field not zero then decrypt first layer (common for both version) and then decrypt each field.

BadBoy 09-09-2004 17:30

BadBoy
 
Hello Nikita .
Can you send hl_struct structure to me too?
Thanks in advance!

toro 09-10-2004 18:41

hi nikita

i am workin on hl_code. its packet size is 0x138; 0x100 byte is coded and uncoded via enc\dec routins. i tested hl_code with bcnt=4. for one hl_code call only one deviceiocontrol is called with packet size=0x138. that packet only contain first block of data at hl_packet+0x128. at return it contain crypted first block plus a 0x8 byte in hl_packet+0x100 that i gess is hardlock signature. because it seems that encryption of other blocks is performed in programs itself by use of that signiture, is it true?

however i found some of function numbers, but not all of them. can you help me.

tanks
toro.

nikita@work 09-10-2004 20:24

Quote:

Originally Posted by toro
seems that encryption of other blocks is performed in programs itself by use of that signiture, is it true?

Only 8 bytes transformed with dongle. On each step internal results stored in result block for ring3. It's used to crypt rest part of data.

Quote:

Originally Posted by toro
however i found some of function numbers, but not all of them. can you help me.

Just call function you need and look +0x18 field at the driver.

toro 09-10-2004 20:43

hi nikita

Quote:

Only 8 bytes transformed with dongle. On each step internal results stored in result block for ring3. It's used to crypt rest part of data.
you are right. my question: is it possible to make other hl_code result with this internal result? in another word is this internal result the hardlock signature?

Quote:

Just call function you need and look +0x18 field at the driver.
again you are right but some function such as hl_meminf call more than one function. for example hl_meminf's function number are 0x17,0x14,0x15. is it true? i want the meaning of this functions if possible.

tanks.
toro

toro 09-12-2004 22:03

hi nikita

are you there?

finally i found an apllication that use version 2 of algo. after compeletion of my emulator when i work with bistro2.5, i see that function numbers are incorect. so i test the calls to driver and find version 2 in hlvdd. i wonder that hlvdd is packed with upx, i unpacked it manually ( is there an unpacker that uncpack upx packed dlls aotumaticlly?).

you don't answer to my last question, previously i read in another forum that for emulation of hl_code function , 8kB of hl_code blocks is needed (meteo), but as i see in hlvdd, a signature is return from driver that the caller can calculate encrypted datablocks by it, is it true?

toro.

nikita@work 09-12-2004 22:53

Quote:

Originally Posted by toro
finally i found an apllication that use version 2 of algo. after compeletion of my emulator when i work with bistro2.5, i see that function numbers are incorect. so i test the calls to driver and find version 2 in hlvdd.

Are you surprised that aladdin used latest API in own product? ;)

Quote:

Originally Posted by toro
previously i read in another forum that for emulation of hl_code function , 8kB of hl_code blocks is needed (meteo), but as i see in hlvdd, a signature is return from driver that the caller can calculate encrypted datablocks by it, is it true?

This 8 byte hash valid only for current block. For another block it would be another. And about 8kb table... yes, HL can be universally emulated with such table. Private function known since 1992.

toro 09-13-2004 01:21

hi nikita

thanks for your reply and forgive me for my questions.
i added version 2 of algo to my driver and it is completed. i deside to start a same project on hasp. can you compair hardlock and hasp from packet encryption point of view?

previously you say that there are 2 version of enc\dec algo for sentinel, are you know there are 3.

toro

nikita@work 09-13-2004 02:04

Quote:

Originally Posted by toro
i deside to start a same project on hasp. can you compair hardlock and hasp from packet encryption point of view?

Actually the same, but for some model specific fileds used other routines. In fact it's "union" ;)

Quote:

Originally Posted by toro
previously you say that there are 2 version of enc\dec algo for sentinel, are you know there are 3.

Hm... May be it's very-very old or the newest one (for example from UltraPro key)... so it would be interesing to see.

toro 09-13-2004 03:21

hi nikita

for sentinel enc\dec version detection, i use (packet+0x4). i saw that in superpro 6.3 this memory address contain 0x7. in last versions i saw 0x6. so i decide to use this memory address for detection of version, am i true?

however in a target that this memory address contain 6, i saw 2 different algo, both of them is in shell.

toro.

nikita@work 09-13-2004 04:06

Quote:

Originally Posted by toro
for sentinel enc\dec version detection, i use (packet+0x4). i saw that in superpro 6.3 this memory address contain 0x7. in last versions i saw 0x6. so i decide to use this memory address for detection of version, am i true?

Try to reverse driver. It contain decrypt routines for all models... and they all different. So then I told about two versions I mean only sspro keys.

isnull 09-14-2004 13:33

Aladdin released new dongle with AES crypt algo.
hppt://www.ealaddin.com/hasp/hasphl.asp

And new hasp hl driver - ver 5.11
_ftp://ftp.ealaddin.com/pub/hasp/hl/windows/installed/redistribute/drivers/HASPDinst.zip

CD _ftp://ftp.ealaddin.com/pub/hasp/hl/HASP_HL_CD_1.10.iso
Tools _ftp://ftp.ealaddin.com/pub/hasp/hl/windows/HASP_HL_For_Windows.zip

toro 09-16-2004 20:41

hi nikita

i found another algo version in sx32w.dll version 5.0.0.0 . it is used by rnbosprofunctions and its packet version is 4 also packet size is 0xffc that is very bigger than 6 and 7 versions.

toro

papi 08-17-2005 18:50

Hello Nikita .
Can you send hl_struct structure to me too?
Thanks.

learner38 09-12-2005 07:26

Hello Nikita .
Can you send hl_struct structure to me too? orshare it here
Thanks. :)

toro 09-13-2005 14:50

to papi and minawahib1
you can see include files of hasp or hardlock apis for complete details of hl_struct .

learner38 09-15-2005 17:31

yes.. i found it on SDK(starter Kit)
thanks alot


All times are GMT +8. The time now is 01:20.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX