Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateRemoteThread, WriteProcessMemory and ReadProcessMemory #286

Closed
wants to merge 1 commit into from
Closed

Conversation

sstokic-tgm
Copy link

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
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
Author

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


HANDLE handle = kernel.OpenProcess(dwDesiredAccess, bInheritHandle, dwProcessId);

if (handle == null) {
Copy link
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
Member

dblock commented Mar 14, 2014

Bump.

@sstokic-tgm
Copy link
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
Member

dblock commented Apr 27, 2014

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

@dblock
Copy link
Member

dblock commented Jun 28, 2014

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

@Timeroot
Copy link
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