Flexlm Cracking Tutorial
Flexlm Cracking Tutorial
Introduction
This article was inspired by the tutorial by SiuL+Hacky ( siulflex.htm ) on how to hack XprismPro 1.0
The above program ran on Linux, but my target ran on Windows 95/NT The aim of this tutorial is to expand on some
of the ideas in the first tutorial and to detail the differences encountered on the PC.
Tools required
W32DASM 8.9: everywhere
Flexlm programmers kit: http://www.flexlm.com
Essay
==========================================
file://C:\Program%20Files\FlexGen\essays.htm 4/08/2003
pilgrim.htm FlexLmPC Page 2 of 8
lm_code.h : This is where you want to put in all the target key information
GenLic32.exe : this program checks the keys and generates licenses for you.
============================================
Load up the target EXE and set break points wherever the lc_init()
function is called.
LM_CHAR_PTR vendor_id,
VENDORCODE_PTR vendor_key,
LM_HANDLE_PTR_PTR job_id));
function.
file://C:\Program%20Files\FlexGen\essays.htm 4/08/2003
pilgrim.htm FlexLmPC Page 3 of 8
short flexlm_version;
short flexlm_revision;
char flexlm_patch[2];
So all the stuff above will be pushed onto the stack prior to calling lc_init.
57 push edi
string
51 push ecx
file://C:\Program%20Files\FlexGen\essays.htm 4/08/2003
pilgrim.htm FlexLmPC Page 4 of 8
==========================
calls to lc_checkout.
int nlic,
int flag,
int dup));
file://C:\Program%20Files\FlexGen\essays.htm 4/08/2003
pilgrim.htm FlexLmPC Page 5 of 8
52 push edx
Now have a look round and look for similar names, your target may use
===================================
Modify the lm_code.h file to contain the encryption seeds, and vendor
keys 1 to 4.
Run genlic32.exe
correctly in lm_code.h
daemon running.
'Make license'
file://C:\Program%20Files\FlexGen\essays.htm 4/08/2003
pilgrim.htm FlexLmPC Page 6 of 8
=======================
Preamble...
FlexLm provides the 5 keys based on your vendor name, so they'll want
to checksum it somehow.
...
OK this bit is more tricky, but keep at it and you'll get there.
Start W32DASM again and load your target ready to read your nice new
license file.
Load up the daemon DLL ( in the active DLLs window double-click on the
daemon DLL ).
into them.
file://C:\Program%20Files\FlexGen\essays.htm 4/08/2003
pilgrim.htm FlexLmPC Page 7 of 8
We can see the keys 1,2,3 and 4 and the vendor ID getting read and XORed
8B4704 mov eax, dword ptr [edi+04] <- seed1 from license.dat
51 push ecx
8B4708 mov eax, dword ptr [edi+08] <- seed2 from license.dat
50 push eax
==============================
file://C:\Program%20Files\FlexGen\essays.htm 4/08/2003
pilgrim.htm FlexLmPC Page 8 of 8
Final Notes
As Siul+Hacky mentioned, the only security here is that of secrecy. Thanks to Siul+ for the initial hard work.
Ob Duh
I wont even bother explaining you that you should BUY this target program if you intend to use it for a longer period
than the allowed one. Should you want to STEAL this software instead, you don't need to crack its protection scheme
at all: you'll find it on most Warez sites, complete and already regged, farewell.
file://C:\Program%20Files\FlexGen\essays.htm 4/08/2003