(编辑:jimmy 日期: 2024/12/25 浏览:2)
small_000.jpg
small_001.jpg
small_002.jpg
small_003.jpg
small_004.jpg
small_005.jpg
small_006.jpg
string_const_struct { dword ref_count; dword align1; qword address; //// 保存字符串的缓冲区 qword unknown1; dword length; dword properties; /// 0x08000100 qword unknown2;}
small_007.jpg
small_008.jpg
small_009.jpg
small_010.jpg
small_011.jpg
small_012.jpg
small_013.jpg
small_014.jpg
small_015.jpg
small_016.jpg
memory_block_object_struct { pointer methods[]; pointer properties[]; pointer events[]; qword ref_count; qword unknown; qword unknown; qword size; pointer data_buffer; //// 保存数据的缓冲区的指针 byte isInit; byte isAllowDirectAccessBuffer; byte[6] mem_align;}
small_017.jpg
small_018.jpg
small_019.jpg
small_020.jpg
small_021.jpg
small_022.jpg
small_023.jpg
small_024.jpg
small_025.jpg
small_026.jpg
small_027.jpg
small_028.jpg
small_029.jpg
small_030.jpg
small_031.jpg
small_032.jpg
small_033.jpg
small_034.jpg
small_035.jpg
small_036.jpg
small_037.jpg
small_038.jpg
small_039.jpg
small_040.jpg
small_040_1.jpg
small_041.jpg
small_042.jpg
small_043.jpg
small_044.jpg
small_045.jpg
small_046.jpg
small_047.jpg
small_048.jpg
small_049.jpg
small_050.jpg
small_051.jpg
small_052.jpg
small_053.jpg
small_054.jpg
small_055.jpg
small_056.jpg
small_057.jpg
small_058.jpg
small_059.jpg
small_060.jpg
small_061.jpg
small_062.jpg
small_063.jpg
small_064.jpg
small_065.jpg
small_066.jpg
small_067.jpg
small_068.jpg
small_069.jpg
small_070.jpg
small_071.jpg
small_072.jpg
small_073.jpg
small_074.jpg
small_075.jpg
small_076.jpg
small_077.jpg
small_078.jpg
small_079.jpg
small_080.jpg
small_081.jpg
small_081_1.jpg
small_082.jpg
small_083.jpg
small_084.jpg
small_085.jpg
small_086.jpg
small_087.jpg
small_088.jpg
small_089.jpg
small_090.jpg
1 - Not for resale2 - Desktop4 - Web8 - Database Servers16 - iOS32 - Console64 - Pro128 - Lite Mac256 - Lite Windows512 - Lite Linux1024 - Pro Plus2048 - Single Board Computerother - Unknown
small_091.jpg
small_092.jpg
small_093.jpg
small_094.jpg
small_095.jpg
small_096.jpg
small_097.jpg
small_098.jpg
small_099.jpg
small_100.jpg
small_101.jpg
small_102.jpg
small_103.jpg
small_104.jpg
small_105.jpg
small_106.jpg
small_107.jpg
small_108.jpg
small_109.jpg
small_110.jpg
small_111.jpg
small_112.jpg
small_113.jpg
small_114.jpg
small_115.jpg
<?xml version="1.0" ?><methodResponse><params><param><value><int>8888</int></value></param></params></methodResponse>
small_116.jpg
small_117.jpg
small_118.jpg
variant_struct { pointer methods[]; /// methods = NULL pointer properties[]; /// pointer events[]; /// events = NULL qword ref_count; /// reference count qword unknown1; qword unknown2; qword value_or_address; //// 当时基本类型值时,保存的是实际值;当是字符串或对象时,保存的是地址指针}
small_119.jpg
small_120.jpg
small_121.jpg
small_122.jpg
small_123.jpg
small_124.jpg
small_125.jpg
small_125_1.jpg
small_126.jpg
small_127.jpg
small_127_1.jpg
small_127_2.jpg
small_128.jpg
object_struct { pointer events[]; pointer properties[]; pointer metheds[]; qword ref_count; qword inherited_count; //// 不确定 dword unknown1; pointer ref_object; //// 最后引用的对象,没有则是指向对象本身 dword unknown3; dword unknown4; dword unknown5;}
properties_struct { pointer base_class; qword unknown1; char * class_name; dword unknown2; dword unknown3; ....... properties_list}
small_129.jpg
small_129_1.jpg
small_129_2.jpg
small_130.jpg
RSASign(data As MemoryBlock, privateKey As MemoryBlock) As MemoryBlock
small_131.jpg
small_132.jpg
BlowFishDecrypt(publicKey As String, data As MemoryBlock, blockMode As Crypto = BlockModes.CBC, initializationVector As MemoryBlock) As MemoryBlockBlowFishEncrypt(publicKey As String, data As MemoryBlock, blockMode As Crypto = BlockModes.CBC, initializationVector As MemoryBlock) As MemoryBlock
const NID_SHA1 as Integer = 64 ////&H40var features() as int64 = Array(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 2147479552)var crlf as String = EndOfLine.UNIXconst xml_cryptoKey as String = "+%%o<Graphics>o<RectControl>o<RBControl>i4i4"//// email and passwordvar email as String = txtEmail.Text.Trim.Lowercaseif email = "" then MessageBox "Please Input a Email Address!!!" exit subend if//if lstEditions.SelectedRowIndex = ListBox.NoSelection then//MessageBox "Please select edition features!!!"//exit sub//end if///// ==================================================================================================================///// 生成序列号var password as string = email//if password = "" then//MessageBox "Password(email address) is Null, Input eMail Address First!!!!!!"//exit sub//end ifvar mem as MemoryBlock = new MemoryBlock(24)mem.LittleEndian = false// unusedmem.Int8Value(0) = &H20// release date// 2022-04-06/// shipped_datevar today as date = new Datevar shippedDate as date = dtpShippedDate.SelectedDatevar year as UInt16 = shippedDate.Yearvar wks as UInt8 = shippedDate.WeekOfYearvar wDays as UInt8 = shippedDate.DayOfWeek/// shipped datemem.UInt16Value(1) = Yearmem.UInt8Value(3) = wks // yestodaymem.UInt8Value(4) = wDays/// expiration = valid_days - today - 1var expiredDays as Integer = CType((dtpLicensedDate.SelectedDate.SecondsFrom1970 - dtpShippedDate.SelectedDate.SecondsFrom1970) / 86400, Integer)if expiredDays < 0 then MessageBox "Licensed Date Must be more than Shipped Date!!!" Exit subend if if expiredDays > (&H7FFE - today.Day) then MessageBox "Licensed Date too bigger!!!" Exit subend if//mem.Int16Value(5) = expiredDays //// key的有效天数,默认 365 天,生成的授权文件在 365 天内加入都 有效,否则会失效mem.Int16Value(5) = &H7FFF - 365// loop one, [7]>1 则 raise UnsupportedFormatExceptionmem.Int8Value(7) = 1 // not loop// unusedmem.Int8Value(8) = &H20mem.Int8Value(9) = &H20// SubscriptionIDmem.Int32Value(10) = Integer.FromString(txtSubscriptionID.Text.Trim)//&H88888888// serial_indexmem.Int16Value(14) = Integer.FromString(txtSerialIndex.Text.Trim) //&H6667// unusedmem.Int8Value(16) = &H20//featurevar feature as UInt32 = 0for i as Integer = 0 to lstEditions.LastRowIndex if lstEditions.RowAt(i).Selected then feature = feature or features(i) end ifnext iif bitwise.BitAnd(feature, &H36) = 0 then //// Desktop, Web, iOS, Console 必选 feature = &H476 // Desktop, Web, iOS, Console, Pro, Pro Plusend ifmem.UInt32Value(17) = feature//&H7FFFFFFE// tagmem.Int8Value(21) = &H2C /// 逗号 ',',序列号有效性标志// unusedmem.Int8Value(22) = &H20mem.Int8Value(23) = &H20 //Crypto.BlowFishEncrypt(key As String, data As MemoryBlock, blockMode As BlockModes = BlockModes.CBC, initializationVector As MemoryBlock) As MemoryBlockvar mem2 as MemoryBlock = Crypto.BlowFishEncrypt(password, mem, Crypto.BlockModes.ECB, nil)var serial_hex as string = mem2.StringValue(0, mem2.Size)var serial_str as string = EncodeHex(serial_hex)var serial_xml as string = serial_str.Middle(0, 8) + "-" + serial_str.Middle(8, 8) + "-" + serial_str.Middle(16, 8) + "-" + serial_str.Middle(24, 8) + "-" + serial_str.Middle(32, 8) + "-" + serial_str.Middle(40, 8)////// debug////MessageBox "SerialNo: " + serial_xml////// ==================================================================================================================///// 生成序列号和地址信息的签名var privateKey as String = Self.rsa_private_key.ReplaceLineEndings(EndOfLine.UNIX) //// 取得私钥if privateKey = "" then MessageBox "RSA private key is null!!!!" exit subend if//// 用户名,一般为电脑登陆名var userName as String = txtName.Text.Trimif userName = "" then userName = app.LoggedInUserName ///end if/// 生成地址信息var address as String = txtName.Text + crlf + txtAddress1.Text + crlf + txtAddress2.Text + crlf + txtCity.Text + "," + txtProvince.Text + "," + txtPostCode.Text + crlf + txtCountry.Textaddress = address.ReplaceLineEndings(EndOfLine.UNIX)//// 生成RSA签名文本var msg as String = serial_xml + crlf + addressvar signRet as String = ""var private_key_pem as String = "-----BEGIN PRIVATE KEY-----" + EndOfLine.UNIX + privateKey + EndOfLine.UNIX + "-----END PRIVATE KEY-----"//var public_key_pem as String = "-----BEGIN PUBLIC KEY-----" + EndOfLine.UNIX + publicKey + EndOfLine.UNIX + "-----END LUBLIC KEY-----"//// 注意:需要安装插件 OpenSSLPlugin.xojo_plugin,否则不能调用下面4个OpenSSL函数,该插件可自制//// 注意:需要安装插件 OpenSSLPlugin.xojo_plugin,否则不能调用下面4个OpenSSL函数,该插件可自制//// 注意:需要安装插件 OpenSSLPlugin.xojo_plugin,否则不能调用下面4个OpenSSL函数,该插件可自制var rsa as Ptr = OpenSSL.RSA_New()rsa = OpenSSL.PEM_read_RSAPrivateKey(private_key_pem, rsa)var isRsaSignOK as Boolean = OpenSSL.RSA_Sign(NID_SHA1, msg, signRet, rsa) //// 生成RSA签名: signRetOpenSSL.RSA_Free(rsa)var signRet_str as String = ""if isRsaSignOK then signRet_str = EncodeHex(signRet) //// debugInfo ////MessageBox "RSA Sinature return: " + crlf + signRet_strelse MessageBox "Generate RSA Signature failure!!!!!!" exit subend ifif signRet_str.Length <> 512 then MessageBox "Encode RSA Signature failure!!!!!!" exit subend if////// debug///taLicenseKeyContent.Text = signRet_str/////==================================================================================================================///// 生成 XML 文件的 signature 标签内容var sign_pass As MemoryBlock = new MemoryBlock(64)sign_pass.LittleEndian = False//MD5var md5Value As MemoryBlock = Crypto.MD5(password)sign_pass.StringValue(0, 16) = md5Value.StringValue(0,16)//Serialsign_pass.StringValue(16, 24) = serial_hexvar signature_password_constant as String = password_retrieval_table //// 含一定的字符串:“CAF", "BAD", "11", "8", "B", "3", "7", "D", "F", "C"等var signature_verify as String = signRet_strif signature_verify = "" then MessageBox "RSA Signature First!!!!!" exit subend ifvar pass_str as String if chkRandomPwdBase.Value then //var randBytes as MemoryBlock = Crypto.GenerateRandomBytes(256) //var signature_password_random as String = EncodeHex(randBytes.StringValue(0, 256), false) var signature_password_random as String = getRandomString() //// 生成随机的密码检索表 //// debugInfo //// MessageBox "random string: " + signature_password_random pass_str = signature_password_random //// 随机else pass_str = signature_password_constant //// 固定end ifvar sign_verify_str as String = signature_verify var sign_verify_str_hex as String = app.MyDecodeHex(sign_verify_str) // 16 进制的签名if pass_str.Length <> 512 then MessageBox "pass base string length is not 512 bytes!" exit subend ifif sign_verify_str.Length <> 512 then MessageBox "signature verity string length is not 512 bytes!" exit subend//MessageBox "sign_verify_str.length = " + sign_verify_str.Length.ToString//MessageBox "sign_verify_str_hex.length = " + sign_verify_str_hex.Length.ToStringwhile (sign_verify_str_hex.length mod 8) <> 0 sign_verify_str_hex = sign_verify_str_hex + " "wendvar count as Integer = 0var min_val as Integer = 0var sum_val as Integer = 0var position as Integer = 0var start as Integer = 0var pow_val as Double = 0.0var str_tmp1 as string = ""var str_tmp2 as string = ""var str_tmp3 as string = ""/// byte(40)count = CountOfStr(pass_str, "A")sign_pass.Int8Value(40) = count/// byte(41)str_tmp1 = pass_str.Right(1)str_tmp2 = MidStr(pass_str, pass_str.Length-2, 1)position = charAt(pass_str, str_tmp2) // Instr()count = CountOfStr(pass_str, str_tmp1, position)sign_pass.Int8Value(41) = count//messagebox str_tmp1 + ", " + str_tmp2 + "," + position.ToString/// byte(42)count = CountOfStr(pass_str, "CAF")sign_pass.Int8Value(42) = count//messagebox "count of ""CAF"": " + count.ToString/// byte(43)count = CountOfStr(pass_str, "8")sign_pass.Int8Value(43) = count//messagebox "count of ""8"": " + count.ToString/// byte(44)position = charAt(pass_str, "B") // Instr()min_val = Min(position * 8, 255)sign_pass.Int8Value(44) = min_val//messagebox "min of InStr(""B"")*3 between ""255"": " + min_val.ToString/// byte(45)count = CountOfStr(pass_str, "BAD")sign_pass.Int8Value(45) = count//messagebox "count of ""BAD"": " + count.ToString//// byte(46)position = charAt(pass_str, "3") // Instr()count = CountOfStr(pass_str, "7", position)min_val = Min(count, 12)sign_pass.Int8Value(46) = min_val//messagebox "min of InStr(""7"", InStr(""3"")) between ""12"": " + min_val.ToString/// byte(47)sign_pass.Int8Value(47) = 9 /// '\t'/// byte(48)sign_pass.Int8Value(48) = password.Length // 用户密码长度/// byte(49)str_tmp1 = MidStr(pass_str, 21, 1)str_tmp2 = MidStr(pass_str, 203, 1)str_tmp3 = MidStr(pass_str, 48, 1)sum_val = str_tmp1.Asc + str_tmp2.Asc + str_tmp3.Ascsign_pass.Int8Value(49) = sum_val//MessageBox str_tmp1 + ", " + str_tmp2 + ", " + str_tmp3/// byte(50)position = charAt(pass_str, "11") // Instr()if position > 0 then sign_pass.Int8Value(50) = 1else sign_pass.Int8Value(50) = 0 /// 默认就是0,可跳过end if/// byte(51)sign_pass.Int8Value(51) = 42/// byte(52)sign_pass.Int8Value(52) = sign_pass.Int8Value(0) /// byte(52) = MD5Bytes[0]/// byte(53)sign_pass.Int8Value(53) = sign_pass.Int8Value(31) * 7 /// byte(53) = serialBytes[15] * 7/// byte(54)count = CountOfStr(pass_str, "D", 127)sign_pass.Int8Value(54) = count/// byte(55)str_tmp1 = MidStr(pass_str, pass_str.Length-2, 1)str_tmp2 = pass_str.Right(1)position = charAt(pass_str, str_tmp2)count = CountOfStr(pass_str, str_tmp1, position)sign_pass.Int8Value(55) = count//MessageBox str_tmp1 + ", " + str_tmp2 + ", pos = " + position.ToString + ", count = " + count.ToString/// byte(56) ~ byte(63)position = charAt(pass_str, "F")count = CountOfStr(pass_str, "C", 1)pow_val = Pow(position, count)sign_pass.DoubleValue(56) = pow_valvar sign_pass_string as String = sign_pass.StringValue(0, 64)/// enrypted signature_verify_partvar sign_verify_data as MemoryBlock = new MemoryBlock(sign_verify_str_hex.Length)sign_verify_data.StringValue(0, sign_verify_str_hex.Length) = sign_verify_str_hex//// 加密var bf as _Blowfish = new _Blowfish(sign_pass_string)//MessageBox "sign_verify_str_hex.length = " + sign_verify_str_hex.Length.ToStringvar data0 as MemoryBlock = new MemoryBlock(sign_verify_str_hex.Length)data0.StringValue(0, sign_verify_str_hex.Length) = sign_verify_str_hexvar data as MemoryBlock = new MemoryBlock(sign_verify_str_hex.Length)data.StringValue(0, sign_verify_str_hex.Length) = sign_verify_str_hexdata.LittleEndian = Falsebf.Encipher(data) /// 加密//// 256var xml_signature as String = ""var encrypted_signature as Stringif data <> nil then //MessageBox encrypt_verify_data.Size.ToString encrypted_signature = EncodeHex(data.StringValue(0, data.Size), false) xml_signature = pass_str + encrypted_signature //MessageBox "encryped signature: "+ crlf + encrypted_signature //MessageBox "signature ok!!!"else MessageBox "XML Signature is null" exit subend if////// debug////taLicenseKeyContent.Text = xml_signature/////==================================================================================================================///// 生成 XML 文件内容if encrypted_signature = "" then MessageBox "XML Signature is empty." exit subend ifif encrypted_signature.Length <> 512 then MessageBox "Ecrypted Signature String Length not equal 512" exit subend if//if pass_str.Length <> 512 then//MessageBox "Password Base String Length not equal 512"//exit sub//end if//// XML 文件var xml_str as String = "<?xml version=""1.0"" encoding=""UTF-8""?>" + EndOfLine.Unix + "<key>" + EndOfLine.Unix + "</key>"var xml as XmlDocument = new XmlDocument()xml.PreserveWhitespace = truexml.LoadXml(xml_str)var xml_element as XmlElement = xml.DocumentElementvar n as Integer = xml_element.ChildCountvar serialNode as XmlTextNode = xml.CreateTextNode(serial_xml)xml_element.AppendChild(xml.CreateElement("serial")).AppendChild(serialNode)var addressNode as XmlTextNode = xml.CreateTextNode(address)xml_element.AppendChild(xml.CreateElement("address")).AppendChild(addressNode)var emailNode as XmlTextNode = xml.CreateTextNode(email) //// passwordxml_element.AppendChild(xml.CreateElement("email")).AppendChild(emailNode)var signatureNode as XmlTextNode = xml.CreateTextNode(xml_signature)xml_element.AppendChild(xml.CreateElement("signature")).AppendChild(signatureNode)////// debug///taLicenseKeyContent.Text = xml.ToString/////==================================================================================================================///// 生成 最终加密的 XML 文件内容// 加密var sData as String = xml.ToString.ReplaceLineEndings(EndOfLine.Unix)while ((sData.Length mod 8) <> 0) sData = sData + " "wendvar mbData as MemoryBlock = new MemoryBlock(sData.Length)mbData.LittleEndian = FalsembData.StringValue(0, sData.Length) = sData// BlowFishEncrypt(publicKey As String, data As MemoryBlock, blockMode As Crypto = Crypto, initializationVector As MemoryBlock) As MemoryBlockvar encryptData as MemoryBlock = Crypto.BlowFishEncrypt(xml_cryptoKey, mbData, Crypto.blockModes.ECB, Nil)var encryptedXML as string = EncodeHex(encryptData.StringValue(0, encryptData.Size-8), False) ///// 需要去除 XML 加密后多出来的8个padding字符,否则XMLDocument会出错////// show license keytaLicenseKeyContent.Text = encryptedXML////MessageBox "Generate License Key Success!!!!!"
small_133.jpg