Hardware ID and Decoder

Issues related to VMProtect
Post Reply
drlai
Posts: 63
Joined: Tue Sep 27, 2011 2:29 pm

Hardware ID and Decoder

Post by drlai »

Make a page on decoding VMProtect Hardware ID, API available (and implementation details) for those who need it.

https://helloacm.com/decode-hardware-id/

Also, a Win32 and Win64 Executable is available on that page for getting Hardware ID.

Image
zksxmk12
Posts: 11
Joined: Mon Apr 06, 2015 7:57 am

Re: Hardware ID and Decoder

Post by zksxmk12 »

This is more JSON-friendly php code.

Code: Select all

<?php
$s = '';
if (isset($_GET['id']))
	$s = $_GET['id'];

function DecodeHWID($id) {
	$id = base64_decode(trim($id));
	$sz = strlen($id);
	if(($sz == 0) || ($sz % 4 != 0))
		return false;

	$r = array();
	$ethernet_cnt = 0;
		   
	for ($i = 0; $i < $sz; $i += 4) {
		$t1 = ord(substr($id, $i + 0, 1));
		$t2 = ord(substr($id, $i + 1, 1));
		$t3 = ord(substr($id, $i + 2, 1));
		$t4 = ord(substr($id, $i + 3, 1));
		$val = dechex($t4 * (2 << 23) + $t3 * (2 << 15) + $t2 * (2 << 7) + ($t1 & 0xFC));
		
		switch ($t1 & 3) {
		case 0: $r['CPU']							= $val; break;
		case 1: $r['HOST']							= $val; break;
		case 2: $r['ETHERNET' . $ethernet_cnt++]	= $val; break;
		case 3: $r['HDD'] 							= $val; break;
		default:
			return false;
		}
	}
	return $r;
}

print json_encode(DecodeHWID($s));
?>
result of 'hwid.php?id=hCZq9LFrYUxyuC/qvmQjTcpr5NNqGt1WR5kzWw=='

Code: Select all

{"CPU":"f46a2684","HOST":"4c616bb0","ETHERNET0":"ea2fb870","ETHERNET1":"4d2364bc","ETHERNET2":"d3e46bc8","ETHERNET3":"56dd1a68","HDD":"5b339944"}
drlai
Posts: 63
Joined: Tue Sep 27, 2011 2:29 pm

Re: Hardware ID and Decoder

Post by drlai »

Thank you, fixed.
:D
Post Reply