Skip to content

CreateRemoteThread, WriteProcessMemory and ReadProcessMemory#286

Closed
sstokic-tgm wants to merge 1 commit intojava-native-access:masterfrom
sstokic-tgm:master
Closed

CreateRemoteThread, WriteProcessMemory and ReadProcessMemory#286
sstokic-tgm wants to merge 1 commit intojava-native-access:masterfrom
sstokic-tgm:master

Conversation

@sstokic-tgm
Copy link
Copy Markdown

Added some missing functions in Kernel32.java => CreateRemoteThread, WriteProcessMemory and ReadProcessMemory.

Test-Cases for:
-) WriteProcessMemory
-) ReadProcessMemory
(Wasn´t able to run the tests because somehow i get an error from eclipse about JUnit 3 when i try to run it)

There is no Test-Case for CreateRemoteThread because we need LPTHREAD_START_ROUTINE and also some other functions (that should come also if i have more time, or someone else does it instead of me).
MSDN for CreateRemoteThread: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682437%28v=vs.85%29.aspx

@dblock
Copy link
Copy Markdown
Member

dblock commented Oct 22, 2013

I'll check this out. Can you please:

  • Update CHANGELOG
  • Squash this commit
  • Write any test that invokes CreateRemoteThread or remove it - I'd be happy with a test that calls it and fails, as expected, because some parameter is null.

…teProcessMemory and ReadProcessMemory

Fixed some line formatting issues

Added in com.sun.jna.platform.win32.Kernel32: CreateRemoteThread, WriteProcessMemory and ReadProcessMemory

Added CreateRemoteThread test
@sstokic-tgm
Copy link
Copy Markdown
Author

-) CHANGELOG updated
-) Added a test for CreateRemoteThread
-) Commits squashed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should rewrite this test to be an actual test and to be predictable. Right now if I merge this the build will break. In this case you're trying to open a process, pick a number that you know that doesn't exist and expect the error. This is valid for all the other tests.

You could try to use the current process for the test, for example, or launch a new process.

@dblock
Copy link
Copy Markdown
Member

dblock commented Mar 14, 2014

Bump.

@sstokic-tgm
Copy link
Copy Markdown
Author

Sorry for late answer but i was busy.

The problem is if I use the current process or launch another, the process will crash cause if I write or read from an address of a process I don't know (or just the address doesn't exist), then it will crash so or so or get Address Violation Exception.

@dblock
Copy link
Copy Markdown
Member

dblock commented Apr 27, 2014

Why don't you write to an address you know within the current process?

@dblock
Copy link
Copy Markdown
Member

dblock commented Jun 28, 2014

@Timeroot, we can close this after #343, right?

@Timeroot
Copy link
Copy Markdown
Contributor

Yeah, all of this was integrated.

@dblock dblock closed this Jun 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants