forked from MD-Levitan/fridas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsocket_conn_all_new.js
234 lines (199 loc) · 9.25 KB
/
socket_conn_all_new.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
Java.perform(function () {
var Socket = Java.use("java.net.Socket");
Socket.$init.overload().implementation = function () {
console.log("socket constructor: Socket()");
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init();
};
Socket.$init.overload("java.net.InetAddress","int").implementation = function (p1,p2) {
console.log("socket constructor: Socket(InetAddress host, int port)");
console.log(p1.getHostAddress());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1,p2);
};
Socket.$init.overload("java.net.InetAddress","int","boolean").implementation = function (p1,p2,p3) {
console.log("socket constructor: Socket(InetAddress host, int port, boolean stream)");
console.log(p1.getHostAddress());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1,p2,p3);
};
Socket.$init.overload("java.net.InetAddress","int","java.net.InetAddress","int").implementation = function (p1,p2,p3,p4) {
console.log("socket constructor: Socket(InetAddress host, int port, InetAddress localAddr, int localPort)");
console.log(p1.getHostAddress());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1,p2,p3,p4);
};
Socket.$init.overload("java.net.Proxy").implementation = function (p1) {
console.log("socket constructor: Socket(Proxy proxy)");
console.log(p1.address().toString());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1);
};
Socket.$init.overload("java.net.SocketImpl").implementation = function (p1) {
console.log("socket constructor: Socket(SocketImpl impl)");
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1);
};
Socket.$init.overload("java.lang.String","int").implementation = function (p1,p2) {
console.log("socket constructor: Socket(String host, int port)");
console.log(p1);
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1,p2);
};
Socket.$init.overload("java.lang.String","int","boolean").implementation = function (p1,p2,p3) {
console.log("socket constructor: Socket(String host, int port, boolean stream)");
console.log(p1);
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1,p2,p3);
};
Socket.$init.overload("java.lang.String","int","java.net.InetAddress","int").implementation = function (p1,p2,p3,p4) {
console.log("socket constructor: Socket(String host, int port, InetAddress localAddr, int localPort)");
console.log(p1);
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1,p2,p3,p4);
};
Socket.connect.overload("java.net.SocketAddress").implementation = function (endPoint) {
console.log("socket connection establishing (1)");
console.log(endPoint.toString());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.connect(endPoint);
};
Socket.connect.overload("java.net.SocketAddress","int").implementation = function (endPoint, timeout) {
console.log("socket connection establishing (2)");
console.log(endPoint.toString());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.connect(endPoint,timeout);
};
///////////////////////////////////
var DatagramSocket = Java.use("java.net.DatagramSocket");
DatagramSocket.$init.overload().implementation = function () {
console.log("socket constructor: DatagramSocket()");
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init();
};
DatagramSocket.$init.overload("java.net.DatagramSocketImpl").implementation = function (p1) {
console.log("socket constructor: DatagramSocket(DatagramSocketImpl impl)");
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1);
};
DatagramSocket.$init.overload("int").implementation = function (p1) {
console.log("socket constructor: DatagramSocket(int port)");
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1);
};
DatagramSocket.$init.overload("int","java.net.InetAddress").implementation = function (p1,p2) {
console.log("socket constructor: DatagramSocket(int port, InetAddress laddr)");
console.log(p2.getHostAddress());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1,p2);
};
DatagramSocket.$init.overload("java.net.SocketAddress").implementation = function (p1) {
console.log("socket constructor: DatagramSocket(SocketAddress bindAddr)");
console.log(p1.toString());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1);
};
DatagramSocket.bind.implementation=function(p1){
console.log("binding DatagramSocket");
console.log(p1.toString());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.bind(p1);
};
DatagramSocket.connect.overload("java.net.InetAddress","int").implementation=function(p1,p2){
console.log("connecting DatagramSocket (1)");
console.log(p1.getHostAddress());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.connect(p1,p2);
};
DatagramSocket.connect.overload("java.net.SocketAddress").implementation=function(p1){
console.log("connecting DatagramSocket (2)");
console.log(p1.toString());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.connect(p1);
};
////////////////////////////
var ServerSocket = Java.use("java.net.ServerSocket");
ServerSocket.$init.overload().implementation = function () {
console.log("socket constructor: ServerSocket()");
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init();
};
ServerSocket.$init.overload("int").implementation = function (p1) {
console.log("socket constructor: ServerSocket(int port)");
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1);
};
ServerSocket.$init.overload("int","int").implementation = function (p1,p2) {
console.log("socket constructor: ServerSocket(int port,int backLog)");
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1,p2);
};
ServerSocket.$init.overload("int","int","java.net.InetAddress").implementation = function (p1,p2,p3) {
console.log("socket constructor: ServerSocket(int port,int backLog, InetAddress bindAddr)");
console.log(p3.getHostAddress());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.$init(p1,p2,p3);
};
ServerSocket.bind.overload("java.net.SocketAddress").implementation = function (p1) {
console.log("binding ServerSocket (1)");
console.log(p1.toString());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.bind(p1);
};
ServerSocket.bind.overload("java.net.SocketAddress","int").implementation = function (p1, p2) {
console.log("binding ServerSocket (2)");
console.log(p1.toString());
Java.perform(function() {
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Exception").$new()))
});
return this.bind(p1,p2);
};
});