Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] Reading Base Address Values
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
deleted user 343211
Cheater
Reputation: 0

Joined: 09 Feb 2013
Posts: 29

PostPosted: Mon Mar 18, 2013 10:09 pm    Post subject: Reply with quote

SteveAndrew wrote:

-snip-

There doesn't seem to be an 'A' version...
Also, I get an error on the line "if(stricmp(me->szModule, ModuleName) == 0) ": argument of type "WCHAR *" is incompatible with parameter of type "const char *".
Back to top
View user's profile Send private message
SteveAndrew
Master Cheater
Reputation: 30

Joined: 02 Sep 2012
Posts: 323

PostPosted: Mon Mar 18, 2013 10:52 pm    Post subject: Reply with quote

Ahh they are being tricky with us! I suppose maybe that's why I started using unicode in the first place, so I wouldn't have to undefine it all the time...

Anyway just have:

Code:

#undef UNICODE
#undef _UNICODE


ABOVE all your includes:

example:
Code:

#undef UNICODE
#undef _UNICODE
#include <Windows.h>
#include <stdio.h>
#include <tlhelp32.h>


this will undefine unicode, so it recognize that you're not using unicode and not force 'MODULEENTRY32' to 'MODULEENTRY32W'

Then remove the A's (yeah I was wrong about that it turns out) It's just MODULEENTRY32, etc


P.S. I just read backwards and saw that you're trying to read/write a pointer:
[[[[[[["jvm.dll"+0066ED50]+1A0]+1A8]+68]+70]+68]+1A8]

That's a pretty long pointer! That would be kind of annoying to have to do that manually... Which is why I took the time to make a class which does it more easily. (and you're in luck because I've recently made it work externally rather than internally)

Getting that module base address of jvm.dll you must get that right though!

Then you could use my class and just do something like:

Code:

PointerHelper *PtrHelper = new PointerHelper(); //globally allocate this (at the top or something)

      PtrHelper->ProcessHandle = MyProcessHandle; //Make sure you do this first before adding the pointer
                //with the jvm.dll module base address, add your pointer to the pointer helper object once
                //-1 at the end denotes the end of the offsets
      PtrHelper->AddPointer("MyPointersName", JVMModuleBaseAddress, 0x66ED50, 0x1A0, 0x1A8, 0x68, 0x70, 0x68, 0x1A8, -1);


      ULONG PointersValue = PtrHelper->ReadValue32("MyPointersName"); //read or write to it anytime you want by name xD
      BYTE PointersByteValue = PtrHelper->ReadByteValue("MyPointersName");
      //etc...
      //there's 8 byte, 4 byte, 2 byte, 1 byte, float, and double read and write methods in the class
      //so you can pretty much read any kind of pointer

      PtrHelper->WriteValue32("MyPointersName", New32BitValue);
      PtrHelper->WriteByteValue("MyPointersName", NewByteValue);
      //etc...

      //when unloading your application, don't forget to delete it
      delete PtrHelper;


I've uploaded them to pastebin so you can copy it in a format that hopefully wont screw up the formatting to bad...

PointerHelper.h
http://pastebin.com/PQjhbQMM

PointerHelper.cpp
http://pastebin.com/pNmw9AyJ

Use them like any other class... Copy both the header and the source file into your projects source folder, add them to your project in your IDE, then #include "PointerHelper.h" in your main header file (or if you're not using a main header file and just including in your source file then put it there)

Hope you can get it working now Very Happy

_________________
Back to top
View user's profile Send private message
deleted user 343211
Cheater
Reputation: 0

Joined: 09 Feb 2013
Posts: 29

PostPosted: Mon Mar 18, 2013 11:28 pm    Post subject: Reply with quote

SteveAndrew wrote:

-snip-

You are really good with C++!
I think the problem with getting the module base address is that I am passing through an incorrect processID.
How do I get a processID that I can use in your previous function?
Back to top
View user's profile Send private message
SteveAndrew
Master Cheater
Reputation: 30

Joined: 02 Sep 2012
Posts: 323

PostPosted: Tue Mar 19, 2013 12:02 am    Post subject: Reply with quote

Yea well thanks! lol C/C++ and ASM are like the only two languages I've ever really enjoyed working with...

As for my GetProcessHandle function, if you pass it a pointer to a ULONG / DWORD / unsigned long (32bit unsigned value)
[Most people just have a GetProcessId function, then call open process manually, I prefer to get both at the same time Wink]

it will write the process id to it...

Code:

ULONG RemoteProcessId = 0;
ULONG *RemoteProcessIdPointer = &RemoteProcessId; //or actually create a pointer to it
HANDLE RemoteProcessHandle = GetProcessHandle(L"whateveryourexeiscalled.exe", &RemoteProcessId);
//or if you created that pointer shown above
HANDLE RemoteProcessHandle = GetProcessHandle(L"exename.exe", RemoteProcessIdPointer);


If you do it like that, RemoteProcessId should contain the process id of your process, if it did actually find your process regardless if it actually did get a valid handle with the call to OpenProcess inside it...

It's this line that writes it (if it found a process named what you passed as the first parameter):
Code:
         
         if(ReturnedProcessId)
            *ReturnedProcessId = pe->th32ProcessID;


the line before it attempts to open the process with PROCESS_ALL_ACCESS
Code:

HANDLE ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pe->th32ProcessID);


you could also do it like this

Code:

ULONG *pRemoteProcessId = new ULONG;
HANDLE RemoteProcessHandle = GetProcessHandle(L"whateveryourexeiscalled.exe", pRemoteProcessId);


like that and you're actually dynamically allocating the 4 byte (32 bit) unsigned value...

which you would need to dereference it to use it's value... So if you did it that way you would do:

Code:

ULONG JVMModuleBase = GetModuleBase("jvm.dll", *pRemoteProcessId);


instead of:
Code:

ULONG JVMModuleBase = GetModuleBase("jvm.dll", RemoteProcessId);


But you shouldn't really have to do that, was just showing how a &Something can be used as a pointer rather than actually having a true pointer as in the second example (when passing it to functions that demand a pointer)...


I just realized what your problem could also be... It may be that 'jvc.dll' is not loaded yet... When are you running your application? Right as you're launching the game, or after it's already loaded and you know for sure jvc.dll is loaded already?


In applications I've written that depends on a module being loaded, i've found that it usually isn't loaded immediately but you have to wait for it to be located...

So have your module finding code in a loop (on a thread separate from your GUI thread of course (so you don't freeze it while this is happening))

Code:

ULONG RemoteProcessId = 0; //globals
ULONG JVMModuleBase = 0;
HANDLE RemoteProcessHandle = 0;

//...
//where you'll wait and make sure you get your handle, then wait and get your module

while(RemoteProcessHandle == 0)
{
        RemoteProcessHandle = GetProcessHandle(L"whateveryourexeiscalled.exe", &RemoteProcessId);
        if(RemoteProcessHandle == 0) Sleep(1000);
}

//it will never make it here unless it's successfully opened that process and got it's handle
//even though only the process id is needed to actually get the module, since you're going to be reading a pointer you will actually need it
//after you do actually get your module base

while(JVMModuleBase == 0)
{
        JVMModuleBase = GetModuleBase("jvm.dll", RemoteProcessId);
        if(JVMModuleBase == 0) Sleep(1000); //wait at approximately 1 second intervals until you find your module's base addy
}

//it will never make it here unless you get your module base...
//Is it really called "jvm.dll" as I've even been making a mistake and calling it "jvc.dll" lol
//which is it? case doesn't matter with my functions but it still has to be correct letter for letter...



Very Happy Let me know how far it gets... Do you get the handle? do you get a valid process id? verify with task manager do you get the module?

You are running your application as administrator too right? Very Happy

_________________
Back to top
View user's profile Send private message
deleted user 343211
Cheater
Reputation: 0

Joined: 09 Feb 2013
Posts: 29

PostPosted: Tue Mar 19, 2013 11:12 am    Post subject: Reply with quote

SteveAndrew wrote:

-snip-

It got through the first loop, by using "java.exe", but not the second loop.
I think the problem is that I have been using the wrong module all along Laughing .
How do I find the correct module? (Sorry for being so stupid and thanks for all your help so far)
Back to top
View user's profile Send private message
SteveAndrew
Master Cheater
Reputation: 30

Joined: 02 Sep 2012
Posts: 323

PostPosted: Tue Mar 19, 2013 5:17 pm    Post subject: Reply with quote

TheChickenWings wrote:
SteveAndrew wrote:

-snip-

It got through the first loop, by using "java.exe", but not the second loop.
I think the problem is that I have been using the wrong module all along Laughing .
How do I find the correct module? (Sorry for being so stupid and thanks for all your help so far)


So it's java huh? Well I didn't even have java installed lol (shows how much I don't care for java) but I went ahead and installed the damn JRE to see what's up, as I didn't believe it's not possible to find a module of java's executable...

I thought pointers don't work or don't work reliably for java anyway? Is that not the case, or for you at least it isn't?

Looking back at the first page it appears this is for minecraft right? Well I downloaded a version of it so I'll be on the same page as you even though since it's java probably any java game would work...

Anyway what I found out is, the game (for me at least) doesn't run under "java.exe" but instead "javaw.exe" in fact I didn't even happen to have a "java.exe" running at all, only "javaw.exe"... So I didn't get through even the first loop like that...

Found some info about it here: http://stackoverflow.com/questions/1997718/difference-between-java-exe-and-javaw-exe

So after I changed it to "javaw.exe" it went ahead and found it, then it found the module "jvm.dll"

jvm is the right module, it stands for java virtual machine... it's probably what does all the emulation converting that java virtual machine code into real machine code instructions.

You can add this to it to have it print out the modules (I've used OutputDebugStringA [which you need DebugView by sysinternals to view debug output from that API] printf could also be used but I prefer OutputDebugStringA because I usually don't make console window apps anymore (can't use printf if it's not a console app))

Code:

OutputDebugStringA(me->szModule);
      if(!ModuleName || _stricmp(me->szModule, ModuleName) == 0)
      {
         OutputDebugStringA("^^ Found The Right Module! ^^");
         CloseHandle(Snap);



After I did that, and made a small test console app (just to be quick about it) I got this debug output:


As you can see it went through all those modules before finally landing on "jvm.dll"

This was the code of my small console app (I didn't make a header file for it though I usually do, just wanted it to be a single copy/paste here)

Code:

#undef UNICODE
#undef _UNICODE
#include <Windows.h>
#include <stdio.h>
#include <tlhelp32.h>

//Function Declarations
HANDLE GetProcessHandleW(wchar_t *ProcessName, ULONG *ReturnedProcessId);
ULONG GetModuleBaseW(wchar_t *ModuleName, ULONG ProcessId);
ULONG GetModuleBaseA(char *ModuleName, ULONG ProcessId);

void GetNeededStuffThread();

HANDLE JavaProcessHandle = 0;
ULONG JavaProcessId = 0;
ULONG JVMModuleBase = 0;
char dbgoutput[260]; //used for sprintf (for OutputDebugStringA to output debug info)

int main()
{
   printf("Starting!\n");
   CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&GetNeededStuffThread, 0, 0, 0);

   for(;; Sleep(10))
   {
      if(JVMModuleBase) //Finally Got Module Base!
         break;
   }

   printf("Found everything required! Ready for next step...\nHandle: %x; ProcessId: %x; JVM Base: 0x%p\n", JavaProcessHandle, JavaProcessId, JVMModuleBase);

   //Now do something with it!!
   //<-- CODE
   //HERE -->

   //Don't forget to close that handle when you're all done! ;)
   CloseHandle(JavaProcessHandle);

   return 0;
}

void GetNeededStuffThread()
{
   while(JavaProcessHandle == 0)
   {
      JavaProcessHandle = GetProcessHandleW(L"javaw.exe", &JavaProcessId);
      if(JavaProcessHandle == 0) Sleep(1000);
   }

   sprintf(dbgoutput, "\"javaw.exe\" Found! Java Process Handle: %x; Java Process Id: %x", JavaProcessHandle, JavaProcessId);
   OutputDebugStringA(dbgoutput);

   while(JVMModuleBase == 0)
   {
      JVMModuleBase = GetModuleBaseA("jvm.dll", JavaProcessId);
      if(JVMModuleBase == 0) Sleep(1000);
   }

   sprintf(dbgoutput, "\"jvm.dll\" Base Address: %p", JVMModuleBase);
   OutputDebugStringA(dbgoutput);
}

//Get process ids/handles/modules functions
HANDLE GetProcessHandleW(wchar_t *ProcessName, ULONG *ReturnedProcessId)
{
   PROCESSENTRY32W *pe = new PROCESSENTRY32W;
   HANDLE Snap;

   pe->dwSize = sizeof(PROCESSENTRY32W);
   Snap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

   if(Snap == INVALID_HANDLE_VALUE)
   {
      delete pe;
      return 0;
   }

   BOOL bProcess = Process32FirstW(Snap, pe);
   while(bProcess)
   {
      if(_wcsicmp(pe->szExeFile, ProcessName) == 0)
      {
         HANDLE ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pe->th32ProcessID);
         
         if(ReturnedProcessId)
            *ReturnedProcessId = pe->th32ProcessID;

         CloseHandle(Snap);
         delete pe;
         return ProcessHandle;
      }

      bProcess = Process32NextW(Snap, pe);
   }

   CloseHandle(Snap);
   delete pe;
   return 0;
}

ULONG GetModuleBaseW(wchar_t *ModuleName, ULONG ProcessId)
{
   MODULEENTRY32W *me = new MODULEENTRY32W;

   HANDLE Snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, ProcessId);

   me->dwSize = sizeof(MODULEENTRY32W);
   if(Snap == INVALID_HANDLE_VALUE)
   {
      delete me;
      return 0;
   }

   BOOL bModule = Module32FirstW(Snap, me);
   while(bModule)
   {
      if(!ModuleName|| _wcsicmp(me->szModule, ModuleName) == 0)
      {
         CloseHandle(Snap);
         delete me;
         return (ULONG)me->modBaseAddr;
      }

      bModule = Module32NextW(Snap, me);
   }

   CloseHandle(Snap);
   delete me;
   return 0;
}

ULONG GetModuleBaseA(char *ModuleName, ULONG ProcessId)
{
   MODULEENTRY32 *me = new MODULEENTRY32;

   HANDLE Snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, ProcessId);

   me->dwSize = sizeof(MODULEENTRY32);
   if(Snap == INVALID_HANDLE_VALUE)
   {
      delete me;
      return 0;
   }

   BOOL bModule = Module32First(Snap, me);
   while(bModule)
   {
      OutputDebugStringA(me->szModule);
      if(!ModuleName || _stricmp(me->szModule, ModuleName) == 0)
      {
         OutputDebugStringA("^^ Found The Right Module! ^^");
         CloseHandle(Snap);
         delete me;
         return (ULONG)me->modBaseAddr;
      }

      bModule = Module32Next(Snap, me);
   }

   CloseHandle(Snap);
   delete me;
   return 0;
}


I've renamed the functions appropriately adding a 'W' suffix for unicode version or 'A' for ANSI

It successfully finds it whether you run it after the game, or before! (As it waits until it finds the both exe and module before exiting that thread)


Alright we should have it this time!! It works now right? Very Happy

_________________
Back to top
View user's profile Send private message
deleted user 343211
Cheater
Reputation: 0

Joined: 09 Feb 2013
Posts: 29

PostPosted: Tue Mar 19, 2013 6:01 pm    Post subject: Reply with quote

SteveAndrew wrote:

-snip-

Using your exact code, it doesn't get past the initial for loop. D:

I tried:
Using Unicode.
Starting minecraft with javaw.
Running as administrator.

But it doesn't work!
There has to be something wrong my end, but I have no idea what.

Here is some more information about my system:
Java version: 1.7.0_15
Windows version: Windows 7 64-bit Service Pack 1
Minecraft version: 1.5
Compiler/IDE: Visual Studio 2012
CPU: Intel i7 2600k @ 3.40 GHz
RAM: 8GB 1600

Information about the address:
I am trying to read the minecraft health variable
I am using the address from this post: http://www.cheatengine.org/forum/viewtopic.php?p=5430786&sid=8a010e8febfb2646c0352dcffb1ed813
Back to top
View user's profile Send private message
SteveAndrew
Master Cheater
Reputation: 30

Joined: 02 Sep 2012
Posts: 323

PostPosted: Tue Mar 19, 2013 8:50 pm    Post subject: Reply with quote

hmm... Very odd indeed! Have you gotten Debug View from sysinternals and see even which modules are being outputted to it's window?

You are able to attach with cheat engine though you said right? And that pointer works for you with CE?

Also when you said you tried starting minecraft with javaw, how are you starting it normally?

For me I just have a 'Minecraft Launcher.exe' in: C:\Users\Steve\AppData\Roaming\.minecraft\minecraft launcher

which is what the icon created on my desktop leads to, which I just double click it to run the game it doesn't seem I have a choice to run it with either java.exe or javaw.exe it just does the latter...

My minecraft version is 1.5 too (at least the torrent I got it from lol says it's 1.5 and even the game itself says it)

BUT that pointer doesn't work for me! So I had to come up with my own way for health, to prove that yes you can use code injection on a java game!

Try this and see if it works for infinite health for you... the offset 1a8 is pretty consistent with that pointer's last offset, so that should be fine, but i'm not sure about the [ecx+80] == 3 bit... For me at least that is how I can tell health apart from the other few addresses that still pass through even with the 1a8 offset (although it still appeared to be pretty safe and didnt crash even with just that filter)

Code:

[enable]
alloc(InfiniteHP,64)
aobscan(HPPassThroughAddress,59 3b 01 89 04 19 e9 ? ? ? ? 83 f8 07)
label(HPPassThroughAddy)
label(HPRet)
label(NotHP)
registersymbol(HPPassThroughAddy)

InfiniteHP:
cmp ebx,1a8 //HP offset / some others
jne NotHP

//cmp [ecx+80],3 //it's not your hp structure if its not 3 (I think EDIT: nope lol)
//jne NotHP

cmp eax,15 //If it's higher than 20 it for sure can't be HP
jnb NotHP

mov eax,14 //Full HP / 20 / 0x14

NotHP:
cmp eax,[ecx]
mov [ecx+ebx],eax
jmp HPRet

HPPassThroughAddress+1:
HPPassThroughAddy:
jmp InfiniteHP
HPRet:

[disable]

HPPassThroughAddy:
cmp eax,[ecx]
mov [ecx+ebx],eax

dealloc(InfiniteHP)
unregistersymbol(HPPassThroughAddy)


See if it even enables / finds that AOB in your copy of the game...

EDIT: actually [ecx+80] == 3 isn't right, it was different after I re-ran the game a 3rd time... So I have commented it out, it seems to not crash just with those two filters even though a few more addresses pass through then HP, it doesn't seem to be harmful! lol

As for what's wrong on your end, I'm not sure at this point, but you've seen that the code does work so it seems it isn't something wrong with the code... If CE can find the jvm module of whatever exe you attach to, then using the above code with that same exename should work as well... So if it doesn't then I'm confused about why that is... As I haven't experienced the same...

_________________
Back to top
View user's profile Send private message
deleted user 343211
Cheater
Reputation: 0

Joined: 09 Feb 2013
Posts: 29

PostPosted: Tue Mar 19, 2013 10:27 pm    Post subject: Reply with quote

SteveAndrew wrote:

-snip-

I start minecraft using a launcher that I created, and I had that starting minecraft with java.exe instead of javaw.exe.
Are you using 1.5 or beta 1.5?
When I run that script I get an error: "Error in line 3 (aobscan(HPPassThroughAddress,59 3b 01 89 04 19 e9 ? ? ? ? 83 f8 07)): The array of byte '59 3b 01 89 04 19 e9 ? ? ? ? 83 f8 07' could not be found".
Back to top
View user's profile Send private message
SteveAndrew
Master Cheater
Reputation: 30

Joined: 02 Sep 2012
Posts: 323

PostPosted: Wed Mar 20, 2013 3:59 am    Post subject: Reply with quote

TheChickenWings wrote:
SteveAndrew wrote:

-snip-

I start minecraft using a launcher that I created, and I had that starting minecraft with java.exe instead of javaw.exe.
Are you using 1.5 or beta 1.5?
When I run that script I get an error: "Error in line 3 (aobscan(HPPassThroughAddress,59 3b 01 89 04 19 e9 ? ? ? ? 83 f8 07)): The array of byte '59 3b 01 89 04 19 e9 ? ? ? ? 83 f8 07' could not be found".



I see, well here's the thing I'm learning about java and other virtual machine / emulation type deals... Not only do the addresses change, but the code can change too! Sometimes it will look completely unrecognizable depending on how any one person's Java runtime enviroment decides to assemble the code... I'm not sure how to defeat this...

See if you can find any of this code (the addy I hooked is in the middle): I copied a large section so there's plenty of AOBs that could be made from there: (it's labeled HPPassThroughAddy in the middle where I hooked) So just try taking some random combination of bytes from in there that seem pretty unique and see if you can find the same area of code...

It seems to work 100% for me though, it always finds it no matter how many times I restart the game (compared to other java games I've been playing with where the code changes at every restart, to the point where I can't even recognize it anymore [they'll use different registers and things and it will seem completely out of place stuffed between some other random code that wasn't there last time])

Code:

02940196 - E8 4538505D           - call jvm.dll+539E0
0294019B - 83 C4 08              - add esp,08
0294019E - C7 87 18010000 00000000 - mov [edi+00000118],00000000
029401A8 - C7 87 20010000 00000000 - mov [edi+00000120],00000000
029401B2 - 81 7F 04 00000000     - cmp [edi+04],00000000
029401B9 - 0F85 8101FFFF         - jne 02930340
029401BF - 8B 75 E4              - mov esi,[ebp-1C]
029401C2 - 8B 7D E8              - mov edi,[ebp-18]
029401C5 - C3                    - ret
029401C6 - 0FB7 56 01            - movzx edx,word ptr [esi+01]
029401CA - 8B 4D EC              - mov ecx,[ebp-14]
029401CD - C1 E2 02              - shl edx,02
029401D0 - 8B 5C 91 18           - mov ebx,[ecx+edx*4+18]
029401D4 - 8B 44 91 1C           - mov eax,[ecx+edx*4+1C]
029401D8 - 8B D0                 - mov edx,eax
029401DA - C1 EA 19              - shr edx,19
029401DD - 83 E2 01              - and edx,01
029401E0 - C1 E8 1C              - shr eax,1C
029401E3 - 83 E0 0F              - and eax,0F
029401E6 - 0F85 0C000000         - jne 029401F8
029401EC - 58                    - pop eax
029401ED - 59                    - pop ecx
029401EE - 3B 01                 - cmp eax,[ecx]
029401F0 - 88 04 19              - mov [ecx+ebx],al
029401F3 - E9 C8000000           - jmp 029402C0
029401F8 - 83 F8 03              - cmp eax,03
029401FB - 0F85 0C000000         - jne 0294020D
02940201 - 58                    - pop eax
02940202 - 59                    - pop ecx
HPPassThroughAddy- 3B 01                 - cmp eax,[ecx]
02940205 - 89 04 19              - mov [ecx+ebx],eax
02940208 - E9 B3000000           - jmp 029402C0
0294020D - 83 F8 07              - cmp eax,07
02940210 - 0F85 17000000         - jne 0294022D
02940216 - 58                    - pop eax
02940217 - 59                    - pop ecx
02940218 - 3B 01                 - cmp eax,[ecx]
0294021A - 89 04 19              - mov [ecx+ebx],eax
0294021D - C1 E9 09              - shr ecx,09
02940220 - C6 04 0D 80B6704A 00  - mov byte ptr [ecx+4A70B680],00
02940228 - E9 93000000           - jmp 029402C0
0294022D - 83 F8 01              - cmp eax,01
02940230 - 0F85 0D000000         - jne 02940243
02940236 - 58                    - pop eax
02940237 - 59                    - pop ecx
02940238 - 3B 01                 - cmp eax,[ecx]
0294023A - 66 89 04 19           - mov [ecx+ebx],ax
0294023E - E9 7D000000           - jmp 029402C0
02940243 - 83 F8 02              - cmp eax,02
02940246 - 0F85 0D000000         - jne 02940259
0294024C - 58                    - pop eax
0294024D - 59                    - pop ecx
0294024E - 3B 01                 - cmp eax,[ecx]
02940250 - 66 89 04 19           - mov [ecx+ebx],ax
02940254 - E9 67000000           - jmp 029402C0
02940259 - 83 F8 04              - cmp eax,04
0294025C - 0F85 33000000         - jne 02940295
02940262 - 85 D2                 - test edx,edx
02940264 - 0F84 1A000000         - je 02940284
0294026A - 58                    - pop eax
0294026B - 5A                    - pop edx
0294026C - 59                    - pop ecx
0294026D - 3B 01                 - cmp eax,[ecx]
0294026F - 52                    - push edx
02940270 - 50                    - push eax
02940271 - DF 2C 24              - fild qword ptr [esp]
02940274 - DF 3C 19              - fistp qword ptr [ecx+ebx]
02940277 - 83 C4 08              - add esp,08
0294027A - F0 83 04 24  00       - lock add dword ptr [esp],00



As for minecraft beta, I'm fairly certain I don't have the beta, and I have release version 1.5... This is what mine looks like:


At one point the yellow text on the logo said 'It's Here!' making me think almost confirming that it's the release version (because I know this game was in beta for a while before they actually had a release version so that would make sense...)


So you made your own launcher... Not sure how you did that, but maybe it has something to do with that? (I looked at mine and it appears to be called Team Extreme launcher) So the game has to be launched a certain way for it to work is that it?

Because I tried to just double click minecraft.jar in the .minecraft/bin folder and it gave a java exception! lol So yeah there is something weird about launching it...

Even from cmd.exe didn't work either, neither with javaw.exe or java.exe
Code:

c:\Program Files (x86)\Java\jre7\bin>javaw -jar C:\Users\Steve\AppData\Roaming\.minecraft\bin\minecraft.jar


Code:

c:\Program Files (x86)\Java\jre7\bin>java -jar C:\Users\Steve\AppData\Roaming\.m
inecraft\bin\minecraft.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLExcept
ion
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)


So yeah obviously I don't know much about java! lol

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Mar 20, 2013 9:17 am    Post subject: Reply with quote

SteveAndrew wrote:
Ahh they are being tricky with us! I suppose maybe that's why I started using unicode in the first place, so I wouldn't have to undefine it all the time...

Anyway just have:

Code:

#undef UNICODE
#undef _UNICODE


ABOVE all your includes:

example:
Code:

#undef UNICODE
#undef _UNICODE
#include <Windows.h>
#include <stdio.h>
#include <tlhelp32.h>


this will undefine unicode, so it recognize that you're not using unicode and not force 'MODULEENTRY32' to 'MODULEENTRY32W'


Rather than force undefining Unicode with an #undef, you should just change the compiler properties to compile as Ansi instead.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
deleted user 343211
Cheater
Reputation: 0

Joined: 09 Feb 2013
Posts: 29

PostPosted: Wed Mar 20, 2013 10:14 am    Post subject: Reply with quote

SteveAndrew wrote:

-snip-

Those codes didn't seem to work.
Maybe this isn't possible with minecraft?

Also, launchers work by starting minecraft.jar with all the dependencies.
Here's an example script that runs as a bat file:
Code:

javaw -Xmx1024m -Xms512m -cp "%APPDATA%\.minecraft\bin\minecraft.jar;%APPDATA%\.minecraft\bin\jinput.jar;%APPDATA%\.minecraft\bin\lwjgl.jar;%APPDATA%\.minecraft\bin\lwjgl_util.jar" -Djava.library.path="%APPDATA%\.minecraft\bin\natives" net.minecraft.client.Minecraft Player
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites