File tree Expand file tree Collapse file tree
src/main/java/com/beaudoin/jmm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .beaudoin .jmm .natives .win32 ;
22
33import com .beaudoin .jmm .process .Module ;
4- import com .beaudoin .jmm .process .impl .win32 .Wind32Process ;
4+ import com .beaudoin .jmm .process .impl .win32 .Win32Process ;
55import com .sun .jna .Native ;
66import com .sun .jna .NativeLibrary ;
77import com .sun .jna .Pointer ;
@@ -24,7 +24,7 @@ public final class Psapi {
2424 Native .register (NativeLibrary .getInstance ("Psapi" ));
2525 }
2626
27- public static Map <String , Module > getModules (Wind32Process process ) {
27+ public static Map <String , Module > getModules (Win32Process process ) {
2828 Map <String , Module > modules = new HashMap <>();
2929
3030 WinDef .HMODULE [] lphModules = new WinDef .HMODULE [1024 ];
Original file line number Diff line number Diff line change 1+ package com .beaudoin .jmm .process .impl .mac ;
2+
3+ import com .beaudoin .jmm .misc .MemoryBuffer ;
4+ import com .beaudoin .jmm .process .Module ;
5+ import com .beaudoin .jmm .process .NativeProcess ;
6+ import com .sun .jna .Pointer ;
7+
8+ import java .util .HashMap ;
9+ import java .util .Map ;
10+
11+ /**
12+ * Created by Jonathan on 1/10/2016.
13+ */
14+ public final class MacProcess implements NativeProcess {
15+
16+ private final int id ;
17+ private final int task ;
18+ private Map <String , Module > modules = new HashMap <>();
19+
20+ public MacProcess (int id , int mach_task ) {
21+ this .id = id ;
22+ this .task = mach_task ;
23+ initModules ();
24+ }
25+
26+ public int task () {
27+ return task ;
28+ }
29+
30+ @ Override
31+ public int id () {
32+ return id ;
33+ }
34+
35+ @ Override
36+ public void initModules () {
37+ //TODO
38+ }
39+
40+ @ Override
41+ public Module findModule (String moduleName ) {
42+ //TODO
43+ return null ;
44+ }
45+
46+ @ Override
47+ public MemoryBuffer read (Pointer address , int size ) {
48+
49+ return null ;
50+ }
51+
52+ @ Override
53+ public NativeProcess write (Pointer address , MemoryBuffer buffer ) {
54+ //TODO
55+ return null ;
56+ }
57+
58+ @ Override
59+ public boolean canRead (Pointer address , int size ) {
60+ try {
61+ read (address , size );
62+ return true ;
63+ } catch (Exception e ) {
64+ return false ;
65+ }
66+ }
67+
68+ }
You can’t perform that action at this time.
0 commit comments