Post this in these sections next time,since we don't know good coding here:
CrossFire Hack Source Code - MPGH - MultiPlayer Game Hacking
C++/C Programming - MPGH - MultiPlayer Game Hacking
Okay there, I've started on some try arounds in Crossfire with mouse events etc. (trying to code some kind of AFK bot), I've seen some AFK bots here working coded with visualbasic and requiring microsoft framework, and then they dont even work for me in XP 32bit.
Whats working:
SetCursorPos -> in any menu
GetCursorPos -> in any menu and ingame (centered because cf centers normal mouse pointer)
for clicking in any menu (not ingame)HWND hWnd= GetForegroundWindow ( );
GetClientRect ( hWnd, &arect );
GetCursorPos ( &point );
PostMessage ( hWnd, WM_LBUTTONDOWN, 0, ( point.x - arect.left ) & ( ( point.y - arect.top ) << 16 ) );
PostMessage ( hWnd, WM_LBUTTONUP, 0, ( point.x - arect.left ) & ( ( point.y - arect.top ) << 16 ) );
what has absolutely no effect in CF but in any other program:
SendInput
keybd_event
mouse_event
SetKeyboardState(not sure if I did it correctly with that one, but from what I've read im kinda sure this doesnt work also)
Does any1 have an idea how I can get ingame clicks to work so my character starts shooting or just already a mouse move would rock... I take anything xD (even just small ideas) (well only thing is it should be C++ or ASM xD)
Well im pretty sure i did wrong because WinAPI surely isnt the right thing for cf since its 3d... maybe i need d3d programming or smth? i am not very informed, but I would start to inform myself if I knew what I need to inform about xD(or prolly some1 helps me but i dont guess that, since we all are human, and humans are lazy xD)
Im also happy for C++ solutions on 64 bit or win7 64 bit w/e because I buy a new PC very soon.
I would be very thankful for help I get here.
Greets Kiruku
Post this in these sections next time,since we don't know good coding here:
CrossFire Hack Source Code - MPGH - MultiPlayer Game Hacking
C++/C Programming - MPGH - MultiPlayer Game Hacking
Kiruku (04-01-2011)
Moved in the C++ programmin section
Kiruku (04-01-2011)
ofc it requires it... whatever i just hate VB (no fun to code)(btw. ive been coding with Vim and MinGW for a while, i guess i didnt need back then? Console ftw)
my code, looks fcking messy since ive tried so much around with it, most infos i basically posted, its just a thread with
all the functions i tested worked everywhere but in CF...while(1){
if(GetAsyncKeyState(VK_F2)&1) {
for(i=0;i<DEF_MAXCOORDS-1;i++){
if (x[i] == 0) break;
SetCursorPos(x[i],y[i]);
keybd_event(0x41, 0, 0, 0);
keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
Sleep(time);
}
}
}
edit: abt the framework thing, i never got error on C++ written progs yet that i have to download newer framework nor gotten that annoying framework error blbalba lets not loose the discussion into framework or not, i may be dumb on that region but i dont even want to know atm.
Last edited by Kiruku; 04-01-2011 at 04:06 PM.
I haven't been able to download CF without my computer crashing for some reason, but it could be that CF ignores all external inputs and only accepts inputs, from within its window, or process. Idk, but I would try injecting a DLL and trying the same thing.
Oh and CF could also, and most likely be doing a global hook, on GASKS(), so the button press never reaches your program, but again idk, you'll have to test all these options. you can start with testing if the code is executed when F2 is pressed inside the game, and injecting a DLL.
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
it does work on XP SP3 32bit...
i also tried injecting the DLL and tried the same... same result
if i press F2 ingame, it doesnt click or do anything but hwen i press ESC for the menu afterwards (i looped it so it will repeat always) in Menu it worked...
means: it gets asynckeystate but the game doesnt accept click in the 3d Engine, in the menu it accepts... (but only the functions i wrote there)
Last edited by Kiruku; 04-02-2011 at 08:50 AM.
Xp is bad to play game !! win7
we can stop disussing this offtopic please? i get new comp in 3 days with win7, but there will be the same i guess, and if not, i want to know why xD. btw. if u try loading win7 on this computer i guess u will have trouble even pressing power on button so dont try to tell me get win7 for those days.