Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 12:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[v5592] Memory Reading Whole Map at Once!

Discussion on [v5592] Memory Reading Whole Map at Once! within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
[v5592] Memory Reading Whole Map at Once!



Code:
    /*
CPU Disasm
Address   Hex dump          Command                                  Comments
006394EB  /> \FF75 0C       PUSH DWORD PTR SS:[EBP+0C]               ; /Arg2
006394EE  |.  FF75 08       PUSH DWORD PTR SS:[EBP+8]                ; |Arg1
006394F1  |.  E8 A629DDFF   CALL 0040BE9C                            ; |
006394F6  |.  8BC8          MOV ECX,EAX                              ; |
006394F8  |.  E8 3726FBFF   CALL 005EBB34                            ; \Conquer.005EBB34
006394FD  |.  8985 D0FEFFFF MOV DWORD PTR SS:[EBP-130],EAX
(Returns CELL STRUCT)
CPU Disasm
Address   Hex dump          Command                                  Comments
0063952C  |.  FFB5 D0FEFFFF PUSH DWORD PTR SS:[EBP-130]              ; /Arg1
00639532  |.  E8 6529DDFF   CALL 0040BE9C                            ; |
00639537  |.  8BC8          MOV ECX,EAX                              ; |
00639539  |.  E8 E329FBFF   CALL 005EBF21                            ; \Conquer.005EBF21
(Returns 1 if you can not go there, 0 if you can go there)
     */
    
    public byte[] asmForGetDMapCell() {
        return (new AsmBuilder())
           .CALL(0x0040BE9C)
           .MOV_ECX_EAX()
           .CALL(0x005EBB34)
           .getCode();
    }
    
    public byte[] asmForIsDMapCellNonstandable() {
        return (new AsmBuilder())
           .CALL(0x0040BE9C)
           .MOV_ECX_EAX()
           .CALL(0x005EBF21)
           .getCode();
    }
    
    @Override
    public void readMap(BitSet bitSet, int minX, int minY, int width, int height) {
        if (width == 0 || height == 0) { return; }
        AsmBuilder asm = new AsmBuilder();
        asm.reset()
           .JMP_NEXT_EIP_PLUS(8 + width * height)
           .ZEROS(8 + width * height)
           // Set yIdx to 0
           .MOV_EAX_ASM_START()
           .ADD_EAX(5+4)
           .PUSH(0)
           .POP_DWORD_PTR_EAX()
           // Y-Loop
           .label("loopY")
                // Set xIdx to 0
                .MOV_EAX_ASM_START()
                .ADD_EAX(5)
                .PUSH(0)
                .POP_DWORD_PTR_EAX()
                // X-Loop
                .label("loopX")
                    // Param 2: Y + minY
                    .MOV_EAX_ASM_START()
                    .ADD_EAX(5+4)
                    .MOV_EAX_DWORD_PTR_EAX()
                    .ADD_EAX(minY)
                    .PUSH_EAX()
                    // Param 1: X + minX
                    .MOV_EAX_ASM_START()
                    .ADD_EAX(5)
                    .MOV_EAX_DWORD_PTR_EAX()
                    .ADD_EAX(minX)
                    .PUSH_EAX()
                    // GetDMapCell(Param1, Param 2)
                    .CODE(asmForGetDMapCell())
                    // Param 1: Result
                    .PUSH_EAX()
                    // IsDemapCellNonstandable(Param1)
                    .CODE(asmForIsDMapCellNonstandable())
                    // Save Result
                    .PUSH_EAX()
                    // index = y * width + x
                    .MOV_ECX(width)
                    .MOV_EAX_ASM_START()
                    .ADD_EAX(5+4)
                    .MOV_EAX_DWORD_PTR_EAX()
                    .MUL_ECX()
                    .MOV_ECX_EAX()
                    .MOV_EAX_ASM_START()
                    .ADD_EAX(5)
                    .MOV_EAX_DWORD_PTR_EAX()
                    .ADD_ECX_EAX()
                    // map[index] = {Restore Result}
                    .MOV_EAX_ASM_START()
                    .ADD_EAX(8)
                    .ADD_EAX_ECX()
                    .POP_ECX()
                    .MOV_BYTE_PTR_EAX_CL()
                // End Of X-Loop
                .MOV_EAX_ASM_START()
                .ADD_EAX(5)
                .INC_DWORD_PTR_EAX()
                .MOV_EAX_DWORD_PTR_EAX()
                .CMP_EAX(width)
                .JGE_SHORT_NEXT_EIP_PLUS((byte)5)
                .JMP_label("loopX")
           // End Of Y-Loop
           .MOV_EAX_ASM_START()
           .ADD_EAX(5+4)
           .INC_DWORD_PTR_EAX()
           .MOV_EAX_DWORD_PTR_EAX()
           .CMP_EAX(height)
           .JGE_SHORT_NEXT_EIP_PLUS((byte)5)
           .JMP_label("loopY")
           .RETN();
        byte[] code = asm.getCode();
        int codeMem = alloc(code.length);
        write(codeMem, code);
        execute(codeMem);
        byte[] cells = readBytes(codeMem + 5 + 8, width * height);
        free(codeMem);
        for (int i = 0; i < cells.length; ++i) {
            if (cells[i] == 0) {
                bitSet.clear(i);
            } else {
                bitSet.set(i);
            }
        }
    }
Might be a bit of a crazy way of doing it, but it works!

Only 1 call per entire map pull, only need to call it when your player changed maps.
clintonselke is offline  
Thanks
10 Users
Old 04/25/2012, 18:04   #2
 
tkblackbelt's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 291
Received Thanks: 95
That is really cool, great job.
tkblackbelt is offline  
Old 04/26/2012, 11:39   #3
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
****, you're running with the flow.
I don't have a username is offline  
Old 05/05/2012, 04:11   #4
 
elite*gold: 0
Join Date: Aug 2010
Posts: 951
Received Thanks: 76
This builds a .dll correct? A simple yes or no will suffice.
denominator is offline  
Old 05/05/2012, 05:14   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Quote:
Originally Posted by denominator View Post
This builds a .dll correct? A simple yes or no will suffice.
.... Something tells me you don't understand what a dll even is...


DLL's are basically codes which you may want to use across a number of projects... so you create a resource file, code all the functions you may want to use that are related to it and pack it up.

You then include this dll in any project you wish to use the functions in and call them.

The only difference between a normal winform or console application and a dll.... is that a dll cannot be directly run. It must be a part of a program that itself can be run.

Aka... you could put this as part of a dll or part of your program itself, it makes ZERO difference (same could be said of ANYTHING in programming that is not directly related to the currently running application. Makes no difference if you code it in a dll or the application itself, aside from a re-usability and organization standpoint)
pro4never is offline  
Thanks
1 User
Old 05/05/2012, 05:27   #6


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by pro4never View Post
[...]Makes no difference if you code it in a dll or the application itself, aside from a re-usability and organization standpoint)
Loading a dynamic library is less optimized than a static library or the same code in the application. There is a few minors difference too, but else you're right.
CptSky is offline  
Old 05/05/2012, 05:48   #7
 
elite*gold: 0
Join Date: Aug 2010
Posts: 951
Received Thanks: 76
My understanding of a .dll was simply that it held information for a project, I know that sometimes to add codes into various projects you need to download some .dlls and add as a reference otherwise you get a ton of errors.

But as you stated that's not always the case, I was talking to somebody on another site who said I needed to have AsmBuilder class for this and I didn't or at least it didn't appear that I had, so I decided to look around the net and found a site that gave an AsmBuilder class and basically what it does is builds a .dll.

Again though that's all new to me and I have never really understood it to much anyway but the code I got worked and it created a basic .dll albeit it more than likely does nothing lol.

I'm currently just looking around Google for various different things that catches my eye and it doesn't necessarily have to be Conquer based such as the VOIP server and client thing as well lol.

I'm also currently looking at this site to help me get a bit of a better understanding I mean for GUI and C# :P

Ok so I have only one error for this and that is
Code:
Error	1	The type or namespace name 'BitSet' could not be found (are you missing a using directive or an assembly reference?)
denominator is offline  
Old 05/05/2012, 14:30   #8
 
bone-you's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 1,491
Received Thanks: 536
oh *** asm in .NET. I've just about seen everything now :P

on the subject of DLLs though, DLLs are just more flexible libraries. Really, the only reason to use a DLL over a static library is to be able to switch it out at will without having to rebuild the original executable (say, for a bug fix or something). Otherwise it's more efficient to build it into your exe itself. (also though, some source licenses prevent being able to do that. As in, you must use it as a DLL or not at all)
bone-you is offline  
Old 05/16/2012, 10:15   #9
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
Quote:
Originally Posted by bone-you View Post
oh *** asm in .NET. I've just about seen everything now :P
I think i might point out shes done in Java :P ... but it could equally run on .Net with minor changes.
clintonselke is offline  
Old 05/16/2012, 23:16   #10
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
I had said earlier that I thought you butchered .NET standards using the conventions I see above. I'm glad I was mistaken.
InfamousNoone is offline  
Reply


Similar Threads Similar Threads
[Vb.NET] WoW Memory Reading
11/20/2010 - World of Warcraft - 1 Replies
Hallo, Ist es irgendwie möglich mit VB.NET die Memory von WoW auszulesen wie bei C# mit der BlackMagic.dll Danke m vorraus
Help with memory reading. C++.
06/12/2010 - Aion - 0 Replies
Hello people, I'm kinda new to memory reading in c++. Been doing similiar stuff, and done some other stuff like packet hacks etc but anyway, to the issue. I get weird values from AION when reading. And I'm prolly going about this totally wrong so I'll post you the code and hopefully some kind soul out there will point me in the right direction. int address = 0xA82424; int value; DWORD pid; if(!GameWindow) {
C++ Memory Reading
01/02/2010 - C/C++ - 4 Replies
huhu ich wollte jetzt von Autoit auf C++ umsteigen ... nun weis ich nur leider nicht wie die befehle fürs process id und memory aulesen usw bei c++ sind :) hat da jmd ne kleine übersicht oder sowas .. wäre toll x) mfg karl
Help with Reading Memory
01/28/2007 - Conquer Online 2 - 1 Replies
Hello, I've been programming my own Program, but im now busy with the hardest stuff, and i'm writing in VB.NET 2005 who can help me with a simple Example to read a memory adress and this convert to an TEXT label? the basic is:
VB.Net Memory Reading
11/03/2006 - .NET Languages - 0 Replies
Basically I'm doing a course in VB.Net and I'm wondering if theres anyone here who can teach me or show me how to read memory values in my project. My course does not cover this, so I'm stuck with either self-research or asking questions. If anyone can help then I'd be very grateful. PS: The target game I'll be testing on is Conquer Online 2



All times are GMT +1. The time now is 12:36.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.