标签: delphi源码

ikeeper爱克吧上网卡磁条信息算法分析

ikeeper爱克吧上网卡现在早已退出了历史舞台,不过对于学习,把当时分析的爱克吧上网卡磁条信息算法归纳整理一下,算做温故而知新吧!本文属原创,百脑问bnwin.com首发! ikeeper爱克吧是什么?【Ikeeper计费管理系统】是重庆智多信息发展有限公司继【实名上网管理系统】后全新开发的计费管理版本。主要用于网吧,学校及各种收费机房的管理,是一款真正全方位从各网吧老板及各种营业性收费机房业主经营管理角度出发,设计体贴入微的经营管理软件。经过我公司不断的升级完善,目前已经得到了广大用户广泛认可。在重庆地区拥有百分之九十以上的市场占有率,目前公司正在积极拓展四川、海南、内蒙等市场并取得了巨大的成就,充分显示了【Ikeeper计费管理系统】与其他同类产品比较所具备的明显技术优势。简而言之爱克吧就是公安网监强制要求网吧安装的网吧安全及计费实名管理系统! 上网卡是什么?上网卡是爱克吧系统为实现实名制而采用的一种磁卡,上网卡根据身份证信息注册后使用,和银行的磁卡形状及使用方法一样!上网卡有10位数字(如0231466248),但磁条信息并不是只记录了10位数字,而是这种;200329902314662482=500999000113801? 记录了相关信息。看看上网卡的实物上网卡磁条信息算法解析 本文本着学习的思想,当前已经不能使用上网卡,所以发布上网卡磁条信息算法,仅供学习使用,费话不多说,下面入正题,正式分析上网卡磁条信息内容: 先设置一个常量 常量表493806291608186256487098521453479841593425669412557213331214712906201512413249919383758208612080780228491236189833979289217766495864839471398976449709001708631663736696479153718969090756731903064662430102993165969185690184619921373013471 然后我们举一个例,如上网卡号 7474747474磁条信息为;200391774747474742=500999000151993? 分解为;200 3917 7474747474 2 =5009990001 51993 ?1234 5 67890 算法及分析此1-10位的算法而;200 =5009990001和末尾的?为常量,无需要计算。中间为卡号也无需计算,需要计算的就是上图标识的1-10位的数的由来 以下是上网卡磁条信息的delphi的源代码 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586function getnumtotal(firstnum:Integer;jsstring:string;ys:Boolean):Integer; //字符串acsii相加减 var ls,x:integer; ls1:string; begin x:=firstnum; for ls:=1 to Length(jsstring) do begin if ys then x:=x+ord(jsstring[ls]) else x:=x-ord(jsstring[ls]); ls1:='$'+inttohex(x,2); if Length(ls1)>3 then x:=strtoint('$'+rightstr(ls1,2)); end; result:=x; end;function fullcard(numcard:string):string; //取得完整磁卡编码 var mycont,mycont1,mycont2,mycont3,mycont4,mycont5:string; mystr1,mystr2,lsstring:string; a1,a2,a3,a4,a5,a6,a7,a8,a9,a10:integer; b1,b2,b3,b4,b5,b6,b7,b8,b9,b10:string; ls1,ls2:integer; begin //常量表 mycont:='493806291608186256487098521453479841593425669412557213331214712906201512413249919383758208612080780228491236189833979289217766495864839471398976449709001708631663736696479153718969090756731903064662430102993165969185690184619921373013471'; mystr1:=Trim(numcard); //上网卡号 mystr2:='5009990001'; //常数 mycont1:=mystr1+mystr2; //形成 74747474745009990001 mycont2:=LeftStr(mystr1,5)+rightstr(mystr2,5); //形成7474790001 mycont3:=RightStr(mystr1,5)+leftstr(mystr2,5); //形成4747450099 //第一位 a1:=getnumtotal($35,mycont1,true)*getnumtotal($0C,mycont1,false); a1:=a1 mod $D7; b1:=mycont[a1+1]; //第二位 a2:=(a1 shl 2)*3 ; a2:=a2 mod $93; b2:=mycont[a2+1]; //第四位 a4:=(a2+a1) shl 3; a4:=a4 mod $DA; b4:=mycont[a4+1]; //第七位 a7:=(a1 shl 5)+a4; a7:=a7*$20 mod $DA; b7:=mycont[a7+1]; //第八位 a8:=((a1 shl 5)+a1+a7)*$21; a8:=a8 mod $DA; b8:=mycont[a8+1]; //第九位 a9:=((a1 shl 5)+a1+a1+a8)*$22; a9:=a9 mod $DA; b9:=mycont[a9+1]; //第三位 a3:=getnumtotal($7,mycont2,True)+a1; a3:=(a3 shl 3)-getnumtotal($7,mycont2,True)-a1; a3:=a3 mod $93; b3:=mycont[a3+1]; //第十位 a10:=getnumtotal($11,mycont3,false)+a1; a10:=(a10 shl 3)-getnumtotal($11,mycont3,false)-a1; a10:=a10+(a10 shl 2); a10:=a10 mod $93; b10:=mycont[a10+1]; //第五位 mycont4:=';=200'+b1+b2+b3+b4+mystr1; //;=20039177474747474 ls1:=getnumtotal(a1,mycont4,False); lsstring:='='+mystr2; ls2:=getnumtotal(ls1,lsstring,True); a5:=getnumtotal(ls2,b7+b8+b9+b10,False)+a1; a5:=a5+(a5+(a5 shl 3))*2; a5:=a5 mod $93; b5:=mycont[a5+1]; //第六位 mycont5:=mycont4+b5+'='+mystr2; a6:=getnumtotal(getnumtotal(a1,mycont5,True),b7+b8+b9+b10,False)+a1; a6:=(a6 shl 5)-a6; a6:=a6 mod $93; b6:=mycont[a6+1]; result:='200'+b1+b2+b3+b4+mystr1+b5+'='+mystr2+b6+b7+b8+b9+b10; end;

锐起CGO2043服务端出盘源码

曾经的锐起CGO2043是以IMG包的形式存放游戏的,但服务端又不能自动出盘进行更新,当时就写了这个工具,开机可以自动开IMG包,达到自动更新游戏的目的!源码为delphi,如果需要的可以下载! 下载地址 链接: https://pan.baidu.com/s/1nuNi8hr 密码: r7g6 解压密码 bnwin.com 其中部份源码 12345678910111213141516171819202122232425262728s3:^Integer; begin GSGW32_LoadDriver; s1:=dname; s2:=(dsize*1024)*1024; s2:=s2*1024; asm lea eax,s2; mov edx,s1; mov al,[edx]; mov s3,eax; end; GSGW32_Mount(sn,s3,@s2,PChar(dimg)); end;function TService1.diskgo(diskname:string):Boolean; var d2:string; n,i:Integer; begin d2:=UpperCase(Trim(diskname)); for i:=1 to Length(d2) do begin n:=Ord(d2[i]); GSGW32_Umount(n); end; GSGW32_UnloadDriver; end;

锐起CGO2043客户端绿色出盘源码

锐起CGO2043客户端绿色出盘源码,可以在服务端查看到客户端的状态 源码为delphi,如果需要源码可以下载 下载地址链接: https://pan.baidu.com/s/1i5gn1i9 密码: nnhu 解压密码 bnwin.com 其中部份源码 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172MutexHandle: Longword; mainip,subip,mystr,syspath:string; reg:TRegistry; thand:THandle; RTGSGLogonEvent:TPluginName; myini:TIniFile; myname,cgoip:string; begin syspath:=gtsyspath; if not fileexists(syspath+'\system32\drivers\GAMESGXP.sys') then begin ExtractRes('exefile','RNDINTER',syspath+'\system32\RNDINTER.dll'); ExtractRes('exefile','RTGSGENG',syspath+'\system32\RTGSGENG.dll'); ExtractRes('exefile','udt',syspath+'\system32\udt.dll'); ExtractRes('exefile','GAMESGXP',syspath+'\system32\drivers\GAMESGXP.sys'); ExtractRes('exefile','RTFLTDSK',syspath+'\system32\drivers\RTFLTDSK.sys'); ExtractRes('exefile','RTWRESXP',syspath+'\system32\drivers\RTWRESXP.sys'); end; myini:=TIniFile.Create(ExtractFilePath(ParamStr(0))+'setup.ini'); mainip:= myini.ReadString('配置','主服务器','');//主服务器IP subip:= myini.ReadString('配置','副服务器','');//副服务器IP if subip='' then subip:=mainip; mystr:= uppercase(myini.ReadString('配置','副分流机器',''));//副服务器分流机器名 myini.Free; myname:=gtcomputername; if Pos(myname,mystr)>0 then begin if ScanTCPPort(subip,7499) then cgoip:=subip else cgoip:=mainip; end else begin if ScanTCPPort(mainip,7499) then cgoip:=mainip else begin if ScanTCPPort(subip,7499) then cgoip:=subip else cgoip:=mainip; end; end; if cgoip<>'' then begin reg:=TRegistry.Create; reg.RootKey:=HKEY_LOCAL_MACHINE; if reg.OpenKey('SOFTWARE\Richtech\Cgo',true) then begin reg.WriteInteger('Version',$000007fb); reg.WriteString('ServerIp',cgoip); reg.WriteInteger('NormalSD',1); reg.WriteInteger('UserId',5821298); reg.WriteInteger('KeyId',0); reg.WriteInteger('RegDrive',81); end; reg.CloseKey; reg.Destroy; end; if OpenMutex(MUTEX_ALL_ACCESS, FALSE, 'RTGSGLogonEvent')<>0 then Exit; MutexHandle := CreateMutex(nil,TRUE,'RTGSGLogonEvent'); //.........BEGIN........////寻找进程 Explorer_PID := FindProcess('winlogon.exe'); if (Explorer_PID=0) then begin MessageBox(0, '寻找winlogon进程出错 ', nil, 0); Exit; end; //创建内存映射文件 FileMapH := CreateFileMapping($FFFFFFFF,nil,PAGE_READWRITE,0,SizeOf(node),'RTGSGLogonEventRich'); if (FileMapH=0) then begin