Skip to content

Commit

Permalink
Update mkopkt.java
Browse files Browse the repository at this point in the history
  • Loading branch information
yaalsn committed Aug 25, 2015
1 parent a0598b8 commit 080e689
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions drcom-android/src/com/example/drcom/mkopkt.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.example.drcom;

public class mkopkt {
public static byte[] dr_mkopkt(byte[] salt, String ipaddr, String usr, String pwd, String mac) throws Exception{
public static byte[] dr_mkopkt(byte[] salt, String ipaddr, String usr, String pwd, String mac, byte[] authinfo) throws Exception{
String ip = ipaddr; //MainActivity.ipaddr;
String[] ip_foo = ip.split("\\.");

Expand All @@ -15,7 +15,12 @@ public static byte[] dr_mkopkt(byte[] salt, String ipaddr, String usr, String pw
byte[] md5_foo_1 = ByteMerge.byteMerger(md5_foo_10, salt);
byte[] md5_foo = ByteMerge.byteMerger(md5_foo_1, pwd.getBytes());
byte[] md5a = ByteMD5.MD5_lite(md5_foo);
username = usr.getBytes();
byte[] account = usr.getBytes();
for(int i=0;i<usr.length();i++){
username[i] = account[i];

}

for(int i=usr.length();i<35;i++){
username[i] = 0x00;
}
Expand All @@ -24,26 +29,18 @@ public static byte[] dr_mkopkt(byte[] salt, String ipaddr, String usr, String pw
for(int i=0;i<6;i++){
mxm[i] = (byte) (mac_addr[i] ^ md5a[i]);
}
byte[] drco = {0x44, 0x72, 0x63, 0x6f};
byte[] svr_ip = {0x0a, 0x64, 0x3d, 0x03};
byte[] unknow_1 = {(byte) 0xe7, 0x17};

byte[] usr_ip = new byte[4];
for(int ip_i=0;ip_i<ip_foo.length;ip_i++){
usr_ip[ip_i] = (byte) Integer.parseInt(ip_foo[ip_i]);

}
byte[] unknow_2 = {0x01, (byte) 0xc7};

byte[] data_1 = ByteMerge.byteMerger(ctea, md5a);
byte[] data_2 = ByteMerge.byteMerger(data_1, username);
byte[] data_3 = ByteMerge.byteMerger(data_2, fm);
byte[] data_4 = ByteMerge.byteMerger(data_3, mxm);
byte[] data_5 = ByteMerge.byteMerger(data_4, drco);
byte[] data_6 = ByteMerge.byteMerger(data_5, svr_ip);
byte[] data_7 = ByteMerge.byteMerger(data_6, unknow_1);
byte[] data_8 = ByteMerge.byteMerger(data_7, usr_ip);
byte[] data = ByteMerge.byteMerger(data_8, unknow_2);

byte[] data = ByteMerge.byteMerger(data_4, authinfo);
System.out.println(data.length);
return data;
}
}

0 comments on commit 080e689

Please sign in to comment.