// CONTOH SC DLL Dengan Check Serial FlashDisk
// maaf jika kode nya agak berantakan
// coded by drache
// modified by indrascott for FD Check HWID
#include <windows.h>
UCHAR
szFileSys[255],
szVolNameBuff[255];
DWORD
dwMFL,
dwSysFlags,
dwSerial,
dwSerial1,
dwSerial2,
dwSerial3,
dwSerial4,
dwSerial5,
dwSerial6,
dwSerial7,
dwSerial8;
// Check di Serial Checker, apakah serial minus apa tidak
#define HWID (402104450)//letakkan Hasil Check Serial disini
void SerialCheck()
{
GetVolumeInformation("C:\\",(LPTSTR)szVolNameBuff,255,&dwSerial, &dwMFL,&dwSysFlags,(LPTSTR)szFileSys,255);
GetVolumeInformation("D:\\",(LPTSTR)szVolNameBuff,255,&dwSerial1, &dwMFL,&dwSysFlags,(LPTSTR)szFileSys,255);
GetVolumeInformation("E:\\",(LPTSTR)szVolNameBuff,255,&dwSerial2, &dwMFL,&dwSysFlags,(LPTSTR)szFileSys,255);
GetVolumeInformation("F:\\",(LPTSTR)szVolNameBuff,255,&dwSerial3, &dwMFL,&dwSysFlags,(LPTSTR)szFileSys,255);
GetVolumeInformation("G:\\",(LPTSTR)szVolNameBuff,255,&dwSerial4, &dwMFL,&dwSysFlags,(LPTSTR)szFileSys,255);
GetVolumeInformation("H:\\",(LPTSTR)szVolNameBuff,255,&dwSerial5, &dwMFL,&dwSysFlags,(LPTSTR)szFileSys,255);
GetVolumeInformation("I:\\",(LPTSTR)szVolNameBuff,255,&dwSerial6, &dwMFL,&dwSysFlags,(LPTSTR)szFileSys,255);
GetVolumeInformation("J:\\",(LPTSTR)szVolNameBuff,255,&dwSerial7, &dwMFL,&dwSysFlags,(LPTSTR)szFileSys,255);
GetVolumeInformation("K:\\",(LPTSTR)szVolNameBuff,255,&dwSerial8, &dwMFL,&dwSysFlags,(LPTSTR)szFileSys,255);
// Lakukan perbandingan dengan hwid yang ada di salah satu drive dmn FD berada
if (dwSerial == HWID)
{
MessageBox(0,"SERIAL ANDA BENAR","INFORMATION",MB_OK | MB_ICONINFORMATION);
}
else if (dwSerial1== HWID)
{
MessageBox(0,"SERIAL ANDA BENAR","INFORMATION",MB_OK | MB_ICONINFORMATION);
}
else if (dwSerial2== HWID)
{
MessageBox(0,"SERIAL ANDA BENAR","INFORMATION",MB_OK | MB_ICONINFORMATION);
}
else if (dwSerial3== HWID)
{
MessageBox(0,"SERIAL ANDA BENAR","INFORMATION",MB_OK | MB_ICONINFORMATION);
}
else if (dwSerial4== HWID)
{
MessageBox(0,"SERIAL ANDA BENAR","INFORMATION",MB_OK | MB_ICONINFORMATION);
}
else if (dwSerial5== HWID)
{
MessageBox(0,"SERIAL ANDA BENAR","INFORMATION",MB_OK | MB_ICONINFORMATION);
}
else if (dwSerial6== HWID)
{
MessageBox(0,"SERIAL ANDA BENAR","INFORMATION",MB_OK | MB_ICONINFORMATION);
}
else if (dwSerial7== HWID)
{
MessageBox(0,"SERIAL ANDA BENAR","INFORMATION",MB_OK | MB_ICONINFORMATION);
}
else if (dwSerial8== HWID)
{
MessageBox(0,"SERIAL ANDA BENAR","INFORMATION",MB_OK | MB_ICONINFORMATION);
}
else // Jika serial tersebut tidak cocok
{
MessageBox(0,"SERIAL ANDA SALAH","ERROR",MB_OK | MB_ICONERROR);
ExitProcess(1); // Force Exit
}
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
if (dwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hDll);
SerialCheck(); //Call Serial Check
}
return TRUE;
}