Tutorial kali ini tentang pembuatan file dll yang akan mengunci/lock serial Sebuah Flashdisk. Ok, pertama-tama jalankan Serial Number Retrivier.exe yang bisa kamu download bersama Source dibawah. Kemudian pilih drive dimana FlashDisk berada lalu klik Get Serial. Setelah Mendapatkan serial FD sekarang waktunya mengimplementasikan di Visual C++
code :
// 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;
#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);
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);
}
return TRUE;
}
Download Full Source
Edit agar Coding lebih pendek :
if (HWID == dwSerial || HWID == dwSerial1 || HWID == dwSerial2 || HWID == dwSerial3 || HWID == dwSerial4 || HWID == dwSerial5 || HWID == dwSerial6 || HWID == dwSerial7 || HWID == dwSerial8)
{
MessageBox(0,"SERIAL ANDA BENAR","INFORMATION",MB_OK | MB_ICONINFORMATION);
}
else // Jika serial tersebut tidak cocok
else // Jika serial tersebut tidak cocok
{
MessageBox(0,"SERIAL ANDA SALAH","ERROR",MB_OK | MB_ICONERROR);
ExitProcess(1); // Force Exit
}
Selamat Mencoba ^_^
0 komentar:
Posting Komentar