wp super cache bgogo yobit eobot free wallet app yobit.net codecanyon nulled rüya tabirleri kahve falı hitbtc.com login yobit net berlin escort pakistan escort service human donation cat otel Food Drink discover discussions yobit.net yobit poloniex forum body silivri spor iclinica sikiş
MapleStory ASM to C++ Error - GamerSoul - Where Gaming Meets Hacking

Announcement

Collapse
No announcement yet.

MapleStory ASM to C++ Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    c++ MapleStory ASM to C++ Error

    I'm trying to convert an ASM to c++
    This is the ASM script
    Code:
    [ENABLE]
    alloc(Hook,128)
    label(Return)
    label(FTF)
     
    Hook:
    cmp [esp],0135D539 //DC ? ? ? ? ? DF E0 F6 ? ? 7A ? 8B ? 24 ? 8B
    jne Return
    mov [esp],FTF
     
    Return:
    //DD ? ? C3 CC CC CC CC CC CC CC CC CC CC CC CC DD ? ? C3 CC CC CC CC CC CC CC CC CC CC CC CC DD
    jmp 01479EE0
     
    FTF:
    mov [esp+58],0 //check esp stacks for value 00000002
    jmp 0135D539 //Same as hook address
     
    0189E304: //4Byte Scan address in Return
    dd Hook
     
    [DISABLE]
    0189E304: //Same as above
    dd 01479EE0 //Address in Return
    This is the C++ code
    Code:
    DWORD FTFAddy = 0x0189E304;
        DWORD FTFRet = 0x01479EE0;
        DWORD FTFHook = 0x0135D539;
    
    
    void __declspec(naked)FallThroughFloor() {
        __asm {
            Hook:
            cmp [esp],0x0135D539 //DC ? ? ? ? ? DF E0 F6 ? ? 7A ? 8B ? 24 ? 8B
            jne Return
            mov [esp],FTF
     
            Return:
            //DD ? ? C3 CC CC CC CC CC CC CC CC CC CC CC CC DD ? ? C3 CC CC CC CC CC CC CC CC CC CC CC CC DD
            jmp FTFRet
     
            FTF:
            mov [esp+0x58],0 //check esp stacks for value 00000002
            jmp FTFHook //Same as hook address
        }
    
    
    }

    There's an error at mov[esp],FTF

    Code:
     Error C2415: Improper operand type
    How do I fix this?

    #2
    htsttr fhpae

    i still remenber how to code :O!

    your error its located in FTF its a Cheat Engine Label not an C++ Address or something related to C++

    check this out and you may be able to find the problem : http://en.wikipedia.org/wiki/MOV_(x86_instruction)

    If you have no idea what i am talking about dont try to convert it or go search for what i just told you.

    Comment


      #3
      Originally posted by gunminimon View Post
      i still remenber how to code :O!

      your error its located in FTF its a Cheat Engine Label not an C++ Address or something related to C++

      check this out and you may be able to find the problem : http://en.wikipedia.org/wiki/MOV_(x86_instruction)

      If you have no idea what i am talking about dont try to convert it or go search for what i just told you.
      Do I have to mov FTF into a register first. Then mov that register into [esp]?

      Comment


        #4
        Originally posted by thecute View Post
        Do I have to mov FTF into a register first. Then mov that register into [esp]?
        yes. mov [esp],FTF is an invalid addressing mode. a very easy way to get past this is something like...


        int registerStorage; //some random shit global var
        __asm {
        mov registerStorage,eax //store value
        mov eax,FTF
        mov [esp],eax
        mov eax,registerStorage //place value back
        }

        you can of course avoid the global var if you store a register onto the stack first then just pop it off after you're finished

        Comment


          #5
          Originally posted by kuy123 View Post
          yes. mov [esp],FTF is an invalid addressing mode. a very easy way to get past this is something like...


          int registerStorage; //some random shit global var
          __asm {
          mov registerStorage,eax //store value
          mov eax,FTF
          mov [esp],eax
          mov eax,registerStorage //place value back
          }

          you can of course avoid the global var if you store a register onto the stack first then just pop it off after you're finished
          If I don't put eax back as it was. Will anything bad happen?

          Comment


            #6
            Originally posted by thecute View Post
            If I don't put eax back as it was. Will anything bad happen?
            not always but probably. if its doesn't get screwed up it's because of a lucky occurance. its safest to move the value back into the register as if everything is normal

            Comment


              #7
              Originally posted by thecute View Post
              I'm trying to convert an ASM to c++
              This is the ASM script
              Code:
              [ENABLE]
              alloc(Hook,128)
              label(Return)
              label(FTF)
               
              Hook:
              cmp [esp],0135D539 //DC ? ? ? ? ? DF E0 F6 ? ? 7A ? 8B ? 24 ? 8B
              jne Return
              mov [esp],FTF
               
              Return:
              //DD ? ? C3 CC CC CC CC CC CC CC CC CC CC CC CC DD ? ? C3 CC CC CC CC CC CC CC CC CC CC CC CC DD
              jmp 01479EE0
               
              FTF:
              mov [esp+58],0 //check esp stacks for value 00000002
              jmp 0135D539 //Same as hook address
               
              0189E304: //4Byte Scan address in Return
              dd Hook
               
              [DISABLE]
              0189E304: //Same as above
              dd 01479EE0 //Address in Return
              This is the C++ code
              Code:
              DWORD FTFAddy = 0x0189E304;
                  DWORD FTFRet = 0x01479EE0;
                  DWORD FTFHook = 0x0135D539;
              
              
              void __declspec(naked)FallThroughFloor() {
                  __asm {
                      Hook:
                      cmp [esp],0x0135D539 //DC ? ? ? ? ? DF E0 F6 ? ? 7A ? 8B ? 24 ? 8B
                      jne Return
                      mov [esp],FTF
               
                      Return:
                      //DD ? ? C3 CC CC CC CC CC CC CC CC CC CC CC CC DD ? ? C3 CC CC CC CC CC CC CC CC CC CC CC CC DD
                      jmp FTFRet
               
                      FTF:
                      mov [esp+0x58],0 //check esp stacks for value 00000002
                      jmp FTFHook //Same as hook address
                  }
              
              
              }

              There's an error at mov[esp],FTF

              Code:
               Error C2415: Improper operand type
              How do I fix this?

              Alright, i'm pretty sure you can not do jmp FTFHook, since its a dword pointer (dword ptr), so you'll have to do jmp dword ptr [FTFHook].
              Next, will be cause if the error is still appearing even though we didn't touch it.
              You call a "Function" that returns a value in some-point-of-a-way, so you will want to change the mov [esp],FTF to mov dword ptr [esp],Offset FTF.
              To be honesT? i'm not sure about the mov dword ptr [esp], Offset FTF, since people with higher VS then me (2012 and higher) says it's working, without the Offset.

              Hope i helped you !

              Cheers,
              Raz.

              Having fun on summer vacation.
              If you need any help, or just wanna talk, pm me :)

              Comment


                #8
                Originally posted by kuy123 View Post
                not always but probably. if its doesn't get screwed up it's because of a lucky occurance. its safest to move the value back into the register as if everything is normal
                Okay. Thanks for your help!

                - - - Edit - - -

                Originally posted by tamirt8 View Post
                Alright, i'm pretty sure you can not do jmp FTFHook, since its a dword pointer (dword ptr), so you'll have to do jmp dword ptr [FTFHook].
                Next, will be cause if the error is still appearing even though we didn't touch it.
                You call a "Function" that returns a value in some-point-of-a-way, so you will want to change the mov [esp],FTF to mov dword ptr [esp],Offset FTF.
                To be honesT? i'm not sure about the mov dword ptr [esp], Offset FTF, since people with higher VS then me (2012 and higher) says it's working, without the Offset.

                Hope i helped you !

                Cheers,
                Raz.
                How do I know if the address is a pointer or not? Should jmp FTFRet be changed to jump dword ptr[FTFRet] too?

                Comment


                  #9
                  Originally posted by thecute View Post
                  Okay. Thanks for your help!

                  - - - Edit - - -


                  How do I know if the address is a pointer or not? Should jmp FTFRet be changed to jump dword ptr[FTFRet] too?
                  Alright, as for as i know, address is a Assembly address, idk how to expalin this since i'm a begineer with this too..
                  Pointer would be you're FTFRet and FTFHook, Address would be your FTFAddy, since FTFAddy points to an auto-assembler address,
                  while a Pointer will be a value.

                  Yea, you need to change jmp to jmp dword ptr [FTFRet] If you use a pointer to jump from.
                  I would summerise this like that - Address in Assembly, will point you to a "Cheat Engine address" as like if you want to search for an address, you'll do CTRL+F in the Auto-Assembly and then put the address you want to view, and the Pointer, is actually the Value on the following address..

                  I'm pretty sure i had some wrong spelling, and grammar aswell, but most important - it's probably not 100% right.
                  This is how i understand assembly, although i'm not so good at it (;

                  Having fun on summer vacation.
                  If you need any help, or just wanna talk, pm me :)

                  Comment


                    #10
                    Originally posted by tamirt8 View Post
                    Alright, as for as i know, address is a Assembly address, idk how to expalin this since i'm a begineer with this too..
                    Pointer would be you're FTFRet and FTFHook, Address would be your FTFAddy, since FTFAddy points to an auto-assembler address,
                    while a Pointer will be a value.

                    Yea, you need to change jmp to jmp dword ptr [FTFRet] If you use a pointer to jump from.
                    I would summerise this like that - Address in Assembly, will point you to a "Cheat Engine address" as like if you want to search for an address, you'll do CTRL+F in the Auto-Assembly and then put the address you want to view, and the Pointer, is actually the Value on the following address..

                    I'm pretty sure i had some wrong spelling, and grammar aswell, but most important - it's probably not 100% right.
                    This is how i understand assembly, although i'm not so good at it (;
                    Thanks for your help! Is this also a pointer?
                    Code:
                    cmp [esp], 0x0135D539 // <<< 

                    Comment


                      #11
                      Originally posted by thecute View Post
                      Thanks for your help! Is this also a pointer?
                      Code:
                      cmp [esp], 0x0135D539 // <<< 
                      Pretty sure it is.
                      :)
                      Feel free to ask more questions ..

                      Having fun on summer vacation.
                      If you need any help, or just wanna talk, pm me :)

                      Comment


                        #12
                        Originally posted by thecute View Post
                        Thanks for your help! Is this also a pointer?
                        Code:
                        cmp [esp], 0x0135D539 // <<< 
                        it is not a pointer.

                        that instruction says: compare the int value 0x0135D539 to the value at the address of ESP.

                        So if esp was 00180000, and the address 00180000 had 0xDEADBEEF in it, the compare sets the conditional flags (ZF, CF, etc...) in some way that tells the processor whether or not to take the next coniditional jump or not (jne, jle, jge, etc)

                        Comment


                          #13
                          Originally posted by kuy123 View Post
                          it is not a pointer.

                          that instruction says: compare the int value 0x0135D539 to the value at the address of ESP.

                          So if esp was 00180000, and the address 00180000 had 0xDEADBEEF in it, the compare sets the conditional flags (ZF, CF, etc...) in some way that tells the processor whether or not to take the next coniditional jump or not (jne, jle, jge, etc)
                          I still don't quite understand how to determine whether or not an address is a pointer...

                          Comment


                            #14
                            a pointer is always an address, an address is not always a pointer

                            if you go to whatever address you're looking at and see it consistently contains an address which contains some value, you can probably treat it as a pointer? [address] simply means "value of bytes at address" instead of "address number"

                            Comment


                              #15
                              Originally posted by kuy123 View Post
                              a pointer is always an address, an address is not always a pointer

                              if you go to whatever address you're looking at and see it consistently contains an address which contains some value, you can probably treat it as a pointer? [address] simply means "value of bytes at address" instead of "address number"
                              Okay so, I scanned and find the address of the FTFRet address by using the aob and this is what I got.

                              I tried searching for C33441DD in hex but I found nothing. That means FTFRET is not a pointer?

                              Comment

                              Working...
                              X