Skip to content

Commit

Permalink
Move the Execute method declaration to the CommonDialog class and add…
Browse files Browse the repository at this point in the history
… the FindDialog class
  • Loading branch information
[email protected] committed Feb 2, 2014
1 parent 32b8353 commit c1ff27d
Show file tree
Hide file tree
Showing 31 changed files with 1,085 additions and 710 deletions.
4 changes: 2 additions & 2 deletions Cheat Engine/CEFuncProc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function KeyToStr(key:word):string;

procedure ConvertStringToBytes(scanvalue:string; hex:boolean;var bytes: TBytes);
function GetBitCount(value: qword): integer;
function getbit(bitnr: integer; bt: qword):integer;
function getbit(bitnr: integer; bt: qword):integer; inline;
procedure setbit(bitnr: integer; var bt: Byte;state:integer); overload;
procedure setbit(bitnr: integer; var bt: dword;state:integer); overload;
procedure setbit(bitnr: integer; var bt: qword;state:integer); overload;
Expand Down Expand Up @@ -1797,7 +1797,7 @@ function Inttobin(i: qword): string;



function getbit(bitnr: integer; bt: qword):integer;
function getbit(bitnr: integer; bt: qword):integer; inline;
begin
result:=(bt shr bitnr) and 1;
end;
Expand Down
32 changes: 28 additions & 4 deletions Cheat Engine/CUDA pointerscan/cudaPointerscan.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
/>
<Tool
Name="Cudart Build Rule"
Include="$(CUDA_PATH)/include;./;../../common/inc"
Include="$(CUDA_PATH)/include;./;./zlib;F:\svn\Cheat Engine\CUDA pointerscan\Debug"
GenerateRelocatableDeviceCode="true"
Arch1="20"
Arch2="30"
Expand Down Expand Up @@ -312,8 +312,8 @@
AdditionalDependencies="cudart_static.lib zlibwapi.lib"
OutputFile="../bin/cudapointerscan-32.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="$(CUDA_PATH)/lib/$(PlatformName);../../common/lib/$(PlatformName);../../common/lib;"
GenerateDebugInformation="true"
AdditionalLibraryDirectories="$(CUDA_PATH)/lib/$(PlatformName);./zlib;&quot;F:\svn\Cheat Engine\CUDA pointerscan\Debug&quot;"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="1"
Expand Down Expand Up @@ -343,7 +343,7 @@
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine=""
CommandLine="del &quot;$(InputDir)$(ConfigurationName)\$(TargetName).device-link.obj&quot;"
ExecutionBucket="17"
/>
<Tool
Expand Down Expand Up @@ -590,6 +590,14 @@
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\cudapointervaluelist.cuh"
Expand All @@ -602,6 +610,14 @@
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\pointerscan.cuh"
Expand All @@ -614,6 +630,14 @@
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\pscanfileaccess.h"
Expand Down
8 changes: 6 additions & 2 deletions Cheat Engine/CUDA pointerscan/pointerscan.cu
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef __declspec(align(16)) struct _workCommandList
WorkCommand list[MAXCOMMANDLISTSIZE];
} WorkCommandList, *PWorkCommandList;

__device__ WorkCommandList SavedWorkCommandList; //[blocks]
__device__ WorkCommandList SavedWorkCommandList;


__device__ int didWork;
Expand All @@ -64,6 +64,10 @@ Thing I learned after trying to debug from 10PM to 5:30AM: atomic functions do
int index = blockIdx.x * blockDim.x + threadIdx.x;
int level=-1;


//printf("blockIdx.x=%d blockDim.x=%d threadIdx.x=%d\n", blockIdx.x, blockDim.x, threadIdx.x);
//return;

/*if (SavedWorkCommandList.count>MAXCOMMANDLISTSIZE)
{
printf("SavedWorkCommandList.count invalid at entry: %d\n", SavedWorkCommandList.count);
Expand Down Expand Up @@ -183,7 +187,7 @@ Thing I learned after trying to debug from 10PM to 5:30AM: atomic functions do



__syncthreads(); //note: If using multiple blocks, then SavedWorkCommandList must be split up into blocks as well
__syncthreads();

// printf("after __syncthreads()\n");
// printf("SavedWorkCommandList.count=%d\n", SavedWorkCommandList.count);
Expand Down
172 changes: 86 additions & 86 deletions Cheat Engine/Java/CEJVMTI/CEJVMTI/CEJVMTI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,92 +26,92 @@ jvmtiIterationControl JNICALL initialHeapIterate(jlong class_tag, jlong size, jl
}


JNIEXPORT jint JNICALL Agent_OnAttach(JavaVM* vm, char* options, void* reserved)
{
jvmtiEnv *env;
JNIEnv *jni;
jvmtiError error;

jint r=vm->GetEnv((void **)&env, JVMTI_VERSION);
if (r!=JNI_OK)
{
OutputDebugStringA("GetEnv(JVMTI_VERSION) failed");
return 1;
}

r=vm->GetEnv((void **)&jni, JNI_VERSION_1_6);
if (r!=JNI_OK)
{
OutputDebugStringA("GetEnv(JNI_VERSION_1_6) failed");
return 1;
}


JNIEXPORT jint JNICALL Agent_OnAttach(JavaVM* vm, char* options, void* reserved)
{
jvmtiEnv *env;
JNIEnv *jni;
jvmtiError error;

jint r=vm->GetEnv((void **)&env, JVMTI_VERSION);
if (r!=JNI_OK)
{
OutputDebugStringA("GetEnv(JVMTI_VERSION) failed");
return 1;
}

r=vm->GetEnv((void **)&jni, JNI_VERSION_1_6);
if (r!=JNI_OK)
{
OutputDebugStringA("GetEnv(JNI_VERSION_1_6) failed");
return 1;
}


jvmtiCapabilities cap, wantedcap;

env->GetPotentialCapabilities(&cap);



if (cap.can_tag_objects)
{
env->GetCapabilities(&wantedcap);
wantedcap.can_tag_objects=1;
error=env->AddCapabilities(&wantedcap);

/*
if (error==JVMTI_ERROR_NONE)
{
error=env->IterateOverHeap(JVMTI_HEAP_OBJECT_EITHER, initialHeapIterate, NULL);
if (error==JVMTI_ERROR_NONE)
{
int i;
jlong tags[1];
jint count;
jobject *list;
jlong *taglist;
tags[0]=1;
error=env->GetObjectsWithTags(1, tags, &count, &list, &taglist);
for (i=0; i<count; i++)
{
jobject j1,j2;
j1=list[i];
j2=jni->NewGlobalRef(j1);
if (j2==NULL)
OutputDebugStringA("Failure\n");
}
}
}
*/
}






jclass threadclass=jni->FindClass("java/lang/Thread");
if (threadclass==0)
{
OutputDebugStringA("jni->FindClass(\"java/lang/Thread\") failure");
return 1;
}

jmethodID threadinit=jni->GetMethodID(threadclass, "<init>", "()V");
if (threadinit==0)
{
OutputDebugStringA("jni->GetMethodID failure");
return 1;
}

jthread t=jni->NewObject(threadclass, threadinit);

env->RunAgentThread(t, AgentThread, NULL, JVMTI_THREAD_NORM_PRIORITY);


return 1; //die

env->GetPotentialCapabilities(&cap);



if (cap.can_tag_objects)
{
env->GetCapabilities(&wantedcap);
wantedcap.can_tag_objects=1;
error=env->AddCapabilities(&wantedcap);

/*
if (error==JVMTI_ERROR_NONE)
{
error=env->IterateOverHeap(JVMTI_HEAP_OBJECT_EITHER, initialHeapIterate, NULL);
if (error==JVMTI_ERROR_NONE)
{
int i;
jlong tags[1];
jint count;
jobject *list;
jlong *taglist;
tags[0]=1;
error=env->GetObjectsWithTags(1, tags, &count, &list, &taglist);
for (i=0; i<count; i++)
{
jobject j1,j2;
j1=list[i];
j2=jni->NewGlobalRef(j1);
if (j2==NULL)
OutputDebugStringA("Failure\n");
}
}
}
*/
}






jclass threadclass=jni->FindClass("java/lang/Thread");
if (threadclass==0)
{
OutputDebugStringA("jni->FindClass(\"java/lang/Thread\") failure");
return 1;
}

jmethodID threadinit=jni->GetMethodID(threadclass, "<init>", "()V");
if (threadinit==0)
{
OutputDebugStringA("jni->GetMethodID failure");
return 1;
}

jthread t=jni->NewObject(threadclass, threadinit);

env->RunAgentThread(t, AgentThread, NULL, JVMTI_THREAD_NORM_PRIORITY);


return 1; //die

}
Loading

0 comments on commit c1ff27d

Please sign in to comment.