質問編集履歴

7

試したこと #6

2018/12/26 10:36

投稿

YouheiSakurai
YouheiSakurai

スコア6142

test CHANGED
File without changes
test CHANGED
@@ -267,3 +267,51 @@
267
267
 
268
268
 
269
269
  ![実行環境の情報](997a19ed63fb475f4f1ef0dcddb736e2.png)
270
+
271
+
272
+
273
+ **試したこと #6**
274
+
275
+
276
+
277
+ VS2017 (スタティックリンク)/Ubuntu 16.04/wine-1.6.2
278
+
279
+
280
+
281
+ ```
282
+
283
+ > cl /MT poc.c
284
+
285
+ Microsoft(R) C/C++ Optimizing Compiler Version 19.13.26128 for x86
286
+
287
+ Copyright (C) Microsoft Corporation. All rights reserved.
288
+
289
+
290
+
291
+ poc.c
292
+
293
+ Microsoft (R) Incremental Linker Version 14.13.26128.0
294
+
295
+ Copyright (C) Microsoft Corporation. All rights reserved.
296
+
297
+
298
+
299
+ /out:poc.exe
300
+
301
+ poc.obj
302
+
303
+
304
+
305
+ root@6c9ee3b182f1:/# ls -l /tmp/poc.exe
306
+
307
+ -rwxr-xr-x 1 root root 97792 Dec 26 10:35 /tmp/poc.exe
308
+
309
+ root@6c9ee3b182f1:/# wine /tmp/poc.exe
310
+
311
+
312
+
313
+
314
+
315
+ Access denied.
316
+
317
+ ```

6

試したこと #5追記

2018/12/26 10:36

投稿

YouheiSakurai
YouheiSakurai

スコア6142

test CHANGED
File without changes
test CHANGED
@@ -229,3 +229,41 @@
229
229
  30202.132:0090:0091:Ret KERNEL32.WriteProcessMemory() retval=00000000 ret=004016de
230
230
 
231
231
  ```
232
+
233
+
234
+
235
+ **試したこと #5**
236
+
237
+
238
+
239
+ VS2017/Ubuntu 16.04/wine-1.6.2で試してみましたが結果は`Access denied.`となりました。
240
+
241
+
242
+
243
+ ```
244
+
245
+ > cl /EHsc poc.c
246
+
247
+ Microsoft(R) C/C++ Optimizing Compiler Version 19.13.26128 for x86
248
+
249
+ Copyright (C) Microsoft Corporation. All rights reserved.
250
+
251
+
252
+
253
+ poc.c
254
+
255
+ Microsoft (R) Incremental Linker Version 14.13.26128.0
256
+
257
+ Copyright (C) Microsoft Corporation. All rights reserved.
258
+
259
+
260
+
261
+ /out:poc.exe
262
+
263
+ poc.obj
264
+
265
+ ```
266
+
267
+
268
+
269
+ ![実行環境の情報](997a19ed63fb475f4f1ef0dcddb736e2.png)

5

試したこと追記

2018/12/26 10:29

投稿

YouheiSakurai
YouheiSakurai

スコア6142

test CHANGED
File without changes
test CHANGED
@@ -183,3 +183,49 @@
183
183
 
184
184
 
185
185
  [このスレッド](https://forum.winehq.org/viewtopic.php?t=5925)で言及されている[injectdll.exe](http://www.quantumg.net/injectdll.php)を試しても、Wine環境では`WriteProcessMemory`のところで`can't write to memory in that pid`となる。
186
+
187
+
188
+
189
+ **試したこと #4**
190
+
191
+
192
+
193
+ `hProcess`が毎回同じ値(`WriteProcessMemory(00000020,...`の`00000020`)になるのが気になる。。。
194
+
195
+
196
+
197
+ ```
198
+
199
+ wineuser@d2efe6cf1283:~$ WINEDEBUG=+all wine /opt/poc.exe 2>&1 | grep WriteProcess
200
+
201
+ 30197.178:008a:008b:trace:imports:import_dll --- WriteProcessMemory KERNEL32.dll.1310 = 0x7b42854c
202
+
203
+ 30197.332:008a:008b:Call KERNEL32.WriteProcessMemory(00000020,00230000,00404048,00000004,00000000) ret=004016de
204
+
205
+ 30197.332:008a:008b:Ret KERNEL32.WriteProcessMemory() retval=00000000 ret=004016de
206
+
207
+ wineuser@d2efe6cf1283:~$ WINEDEBUG=+all wine /opt/poc.exe 2>&1 | grep WriteProcess
208
+
209
+ 30199.196:008c:008d:trace:imports:import_dll --- WriteProcessMemory KERNEL32.dll.1310 = 0x7b42854c
210
+
211
+ 30199.359:008c:008d:Call KERNEL32.WriteProcessMemory(00000020,00230000,00404048,00000004,00000000) ret=004016de
212
+
213
+ 30199.359:008c:008d:Ret KERNEL32.WriteProcessMemory() retval=00000000 ret=004016de
214
+
215
+ wineuser@d2efe6cf1283:~$ WINEDEBUG=+all wine /opt/poc.exe 2>&1 | grep WriteProcess
216
+
217
+ 30200.351:008e:008f:trace:imports:import_dll --- WriteProcessMemory KERNEL32.dll.1310 = 0x7b42854c
218
+
219
+ 30200.521:008e:008f:Call KERNEL32.WriteProcessMemory(00000020,00230000,00404048,00000004,00000000) ret=004016de
220
+
221
+ 30200.522:008e:008f:Ret KERNEL32.WriteProcessMemory() retval=00000000 ret=004016de
222
+
223
+ wineuser@d2efe6cf1283:~$ WINEDEBUG=+all wine /opt/poc.exe 2>&1 | grep WriteProcess
224
+
225
+ 30201.972:0090:0091:trace:imports:import_dll --- WriteProcessMemory KERNEL32.dll.1310 = 0x7b42854c
226
+
227
+ 30202.132:0090:0091:Call KERNEL32.WriteProcessMemory(00000020,00230000,00404048,00000004,00000000) ret=004016de
228
+
229
+ 30202.132:0090:0091:Ret KERNEL32.WriteProcessMemory() retval=00000000 ret=004016de
230
+
231
+ ```

4

試したこと追記

2018/12/26 09:27

投稿

YouheiSakurai
YouheiSakurai

スコア6142

test CHANGED
File without changes
test CHANGED
@@ -175,3 +175,11 @@
175
175
  $ WINEPREFIX=/tmp/wine WINEDLLOVERRIDES= WINEDEBUG= wine poc.exe
176
176
 
177
177
  ```
178
+
179
+
180
+
181
+ **試したこと #3**
182
+
183
+
184
+
185
+ [このスレッド](https://forum.winehq.org/viewtopic.php?t=5925)で言及されている[injectdll.exe](http://www.quantumg.net/injectdll.php)を試しても、Wine環境では`WriteProcessMemory`のところで`can't write to memory in that pid`となる。

3

日本語の修正

2018/12/26 08:57

投稿

YouheiSakurai
YouheiSakurai

スコア6142

test CHANGED
File without changes
test CHANGED
@@ -166,7 +166,7 @@
166
166
 
167
167
 
168
168
 
169
- `WINEDLLOVERRIDES`や`WINEDEBUG`を空にして`WINEPREFIX`に新しい場所をしても結果は変わりませんでした。
169
+ `WINEDLLOVERRIDES`や`WINEDEBUG`を空にして`WINEPREFIX`に新しい場所を指定しても結果は変わりませんでした。
170
170
 
171
171
 
172
172
 

2

日本語の修正

2018/12/26 06:16

投稿

YouheiSakurai
YouheiSakurai

スコア6142

test CHANGED
File without changes
test CHANGED
@@ -166,7 +166,7 @@
166
166
 
167
167
 
168
168
 
169
- `WINEDLLOVERRIDES`や`WINEDEBUG`を空にして`WINEPREFIX`に新しい場所をしていても結果は変わりませんでした。
169
+ `WINEDLLOVERRIDES`や`WINEDEBUG`を空にして`WINEPREFIX`に新しい場所をしても結果は変わりませんでした。
170
170
 
171
171
 
172
172
 

1

試したこと #2の追加

2018/12/26 06:15

投稿

YouheiSakurai
YouheiSakurai

スコア6142

test CHANGED
File without changes
test CHANGED
@@ -142,7 +142,7 @@
142
142
 
143
143
 
144
144
 
145
- **試したこと**
145
+ **試したこと #1**
146
146
 
147
147
 
148
148
 
@@ -159,3 +159,19 @@
159
159
  VirtualProtect(&address, sizeof(data), PAGE_EXECUTE_READWRITE, &access);
160
160
 
161
161
  ```
162
+
163
+
164
+
165
+ **試したこと #2**
166
+
167
+
168
+
169
+ `WINEDLLOVERRIDES`や`WINEDEBUG`を空にして`WINEPREFIX`に新しい場所をしていても結果は変わりませんでした。
170
+
171
+
172
+
173
+ ```
174
+
175
+ $ WINEPREFIX=/tmp/wine WINEDLLOVERRIDES= WINEDEBUG= wine poc.exe
176
+
177
+ ```