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

plugins: update memory addresses retrieval to use procptr32_t/procptr64_t. #2349

Closed
wants to merge 5 commits into from

Conversation

@davidebeatrici
Copy link
Member

commented Jun 14, 2016

Update to almost all plugins to fit the new changes done to memory addresses retrieval system (#2347).

Compile errors:

AOC at line 131:

error: C2440: 'initializing' : cannot convert from 'BYTE *' to 'procptr32_t'
There is no context in which this conversion is possible

BF2 at lines 165 and 168:

error: C2440: '=' : cannot convert from 'BYTE *' to 'procptr32_t'
There is no context in which this conversion is possible

BF4 at lines 47, 48 and 49 and BF4_x86 at lines 45, 46 and 47:

error: C2665: 'peekProc' : none of the 2 overloads could convert all the argument types
../mumble_plugin_win32.h(99): could be 'bool peekProc(procptr64_t,void *,SIZE_T)'
../mumble_plugin_win32.h(93): or 'bool peekProc(procptr32_t,void *,SIZE_T)'
while trying to match the argument list '(procptr64_t, BYTE, int)'

Borderlands 2 at lines 56 and 70:

error: C2665: 'peekProc' : none of the 2 overloads could convert all the argument types
../mumble_plugin_win32.h(99): could be 'bool peekProc(procptr64_t,void *,SIZE_T)'
../mumble_plugin_win32.h(93): or 'bool peekProc(procptr32_t,void *,SIZE_T)'
while trying to match the argument list '(procptr32_t, fetch::<unnamed-type-game_vects>, int)'

CS at line 138:

error: C2440: '=' : cannot convert from 'BYTE *' to 'procptr32_t'
There is no context in which this conversion is possible

DYS at line 131:

error: C2440: 'initializing' : cannot convert from 'BYTE *' to 'procptr32_t'
There is no context in which this conversion is possible

GMod at line 125:

error: C2440: 'initializing' : cannot convert from 'BYTE *' to 'procptr32_t'
There is no context in which this conversion is possible

GTAIV at lines 48 and 66:

error: C2665: 'peekProc' : none of the 2 overloads could convert all the argument types
../mumble_plugin_win32.h(99): could be 'bool peekProc(procptr64_t,void *,SIZE_T)'
../mumble_plugin_win32.h(93): or 'bool peekProc(procptr32_t,void *,SIZE_T)'
while trying to match the argument list '(procptr32_t, unsigned int, int)'

GTAV at line 22:

error: C2665: 'peekProc' : none of the 2 overloads could convert all the argument types
../mumble_plugin_win32.h(99): could be 'bool peekProc(procptr64_t,void *,SIZE_T)'
../mumble_plugin_win32.h(93): or 'bool peekProc(procptr32_t,void *,SIZE_T)'

Insurgency at line 131:

error: C2440: 'initializing' : cannot convert from 'BYTE *' to 'procptr32_t'
There is no context in which this conversion is possible

L4D2 at lines 151 and 158:

error: C2440: 'initializing' : cannot convert from 'BYTE *' to 'procptr32_t'
There is no context in which this conversion is possible

QL at line 32:

error: C2665: 'peekProc' : none of the 2 overloads could convert all the argument types
../mumble_plugin_win32.h(99): could be 'bool peekProc(procptr64_t,void *,SIZE_T)'
../mumble_plugin_win32.h(93): or 'bool peekProc(procptr32_t,void *,SIZE_T)'
while trying to match the argument list '(procptr32_t, BYTE, int)'

UT3 at line 128:

error: C2668: 'peekProc' : ambiguous call to overloaded function
../mumble_plugin_win32.h(129): could be 'T peekProc<procptr32_t>(procptr64_t)'
with
[
T=procptr32_t
]
../mumble_plugin_win32.h(122): or 'T peekProc<procptr32_t>(procptr32_t)'
with
[
T=procptr32_t
]
while trying to match the argument list '(BYTE)'

UT99 at line 102:

error: C2665: 'peekProc' : none of the 2 overloads could convert all the argument types
../mumble_plugin_win32.h(99): could be 'bool peekProc(procptr64_t,void *,SIZE_T)'
../mumble_plugin_win32.h(93): or 'bool peekProc(procptr32_t,void *,SIZE_T)'
while trying to match the argument list '(procptr32_t, char, int)'
At line 158:
error: C2661: 'peekProc' : no overloaded function takes 2 arguments

Reverted change to "logincheck" and "state" values
I changed their declaration by mistake, only "BYTE *" needs to be changed.
@@ -59,7 +58,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa

//peekProc(contextptr, ccontext, 128);

ok = peekProc((BYTE *) 0x00976274, avatar_pos, 12) &&
ok = peekProc((procptr32_t) 0x00976274, avatar_pos, 12) &&

This comment has been minimized.

Copy link
@mkrautz

mkrautz Jun 15, 2016

Member

Cast should not be necessary?

(Goes for a lot of places in throughout the PR)

@davidebeatrici

This comment has been minimized.

Copy link
Member Author

commented Jun 15, 2016

Omitting it results in an error 😉

@mkrautz

This comment has been minimized.

Copy link
Member

commented Jun 15, 2016

Ah. The compiler can't choose the correct One. Hmm.

Maybe the solution is to have a separate header for 64-bit and 32-bit plugins...

@davidebeatrici

This comment has been minimized.

Copy link
Member Author

commented Jun 16, 2016

Can't we use something like peekProc32 and peekProc64?

Both solutions are fine for me, but if we decide to use two headers we will have to update both when an edit needs to be made.

@davidebeatrici

This comment has been minimized.

Copy link
Member Author

commented Jun 20, 2016

Compile error for BF4, BF4_x86, Borderlands 2, GTAIV, GTAV, GW, L4D2, LOL, QL, STO and UT99.:

mumble_plugin_win32_ptr_type.h:83: error: C2664: 'BOOL ReadProcessMemory(HANDLE,LPCVOID,LPVOID,SIZE_T,SIZE_T *)': cannot convert argument 2 from 'procptr32_t' to 'LPCVOID'

@mkrautz

This comment has been minimized.

Copy link
Member

commented Jun 20, 2016

@davidebeatrici Fixed in the PR. Please re-try.

@davidebeatrici

This comment has been minimized.

Copy link
Member Author

commented Jun 20, 2016

Now they compile without any problem; I think that it's all ready to land 😉

ok = peekProc((BYTE *) posptr, pos_corrector) &&
peekProc((BYTE *) frtptr, front_corrector) &&
peekProc((BYTE *) topptr, top_corrector);
ok = peekProc(posptr, pos_corrector, 12) &&

This comment has been minimized.

Copy link
@mkrautz

mkrautz Jun 23, 2016

Member

Size shouldn't be necessary.

peekProc((BYTE *) frtptr, front_corrector) &&
peekProc((BYTE *) topptr, top_corrector);
ok = peekProc(posptr, pos_corrector, 12) &&
peekProc(frtptr, front_corrector, 12) &&

This comment has been minimized.

Copy link
@mkrautz

mkrautz Jun 23, 2016

Member

Size shouldn't be necessary.

peekProc((BYTE *) topptr, top_corrector);
ok = peekProc(posptr, pos_corrector, 12) &&
peekProc(frtptr, front_corrector, 12) &&
peekProc(topptr, top_corrector, 12);

This comment has been minimized.

Copy link
@mkrautz

mkrautz Jun 23, 2016

Member

Size shouldn't be necessary.

ok = peekProc(camptr, cam) &&
peekProc(posptr, pos) &&
peekProc(camfrontptr, camfront) &&
ok = peekProc(camptr, cam, 12) &&

This comment has been minimized.

Copy link
@mkrautz

mkrautz Jun 23, 2016

Member

Size shouldn't be necessary.

peekProc(posptr, pos) &&
peekProc(camfrontptr, camfront) &&
ok = peekProc(camptr, cam, 12) &&
peekProc(posptr, pos, 12) &&

This comment has been minimized.

Copy link
@mkrautz

mkrautz Jun 23, 2016

Member

Size shouldn't be necessary.

peekProc(camfrontptr, camfront) &&
ok = peekProc(camptr, cam, 12) &&
peekProc(posptr, pos, 12) &&
peekProc(camfrontptr, camfront, 12) &&

This comment has been minimized.

Copy link
@mkrautz

mkrautz Jun 23, 2016

Member

Size shouldn't be necessary.

@davidebeatrici

This comment has been minimized.

Copy link
Member Author

commented Jun 23, 2016

I thought that I removed the size changes from every plugin... apparently I forgot some parts; done 😉

@mkrautz mkrautz changed the title plugins/: Update memory addresses retrieval plugins: update memory addresses retrieval to use procptr32_t/procptr64_t. Jun 23, 2016

mkrautz added a commit that referenced this pull request Jun 23, 2016
@mkrautz

This comment has been minimized.

Copy link
Member

commented Jun 23, 2016

Thanks! Landed via f28e9b7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.