Skip to content

Commit 3f3b773

Browse files
committed
Updated Native method
1 parent 65d0957 commit 3f3b773

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/java/com/beaudoin/jmm/Main.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,23 @@
2424

2525
package com.beaudoin.jmm;
2626

27+
import com.beaudoin.jmm.process.Module;
2728
import com.beaudoin.jmm.process.NativeProcess;
2829

2930
import java.io.IOException;
3031

32+
import static com.beaudoin.jmm.process.NativeProcess.byName;
33+
3134
/**
3235
* Created by Jonathan on 12/22/2015.
3336
*/
3437
public final class Main {
3538

3639
public static void main(String[] args) throws IOException {
37-
NativeProcess proc = NativeProcess.byName("C__Stuff.exe");
40+
NativeProcess proc = byName("csgo.exe");
41+
42+
Module client = proc.findModule("client.dll");
43+
System.out.println(client);
3844
//System.out.println(proc.readInt(0x61ff1c));
3945
}
4046

src/main/java/com/beaudoin/jmm/process/NativeProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public interface NativeProcess extends ReadableRegion {
4545
static NativeProcess byName(String name) {
4646
if (Platform.isWindows()) {
4747
Tlhelp32.PROCESSENTRY32.ByReference entry = new Tlhelp32.PROCESSENTRY32.ByReference();
48-
Pointer snapshot = Kernel32.CreateToolhelp32Snapshot(Tlhelp32.TH32CS_SNAPALL, 0);
48+
Pointer snapshot = Kernel32.CreateToolhelp32Snapshot(Tlhelp32.TH32CS_SNAPALL.intValue(), 0);
4949
try {
5050
while (Kernel32.Process32Next(snapshot, entry)) {
5151
String processName = Native.toString(entry.szExeFile);

0 commit comments

Comments
 (0)