anyone know? (cs go console)

Posts 1–13 of 13 · Page 1 of 1
anyone know? (cs go console)
is there anyway to control console externally? have an idea on something i want to do
Yes, just inject your commands.
Quote Originally Posted by hkKenshin View Post
Yes, just inject your commands.
"Inject" is the worst term you can use ... Just to be curios: do you know what is he asking?
@huizne your question is a bit misinterpretable. Is this console application your?
Quote Originally Posted by maestro1994 View Post
"Inject" is the worst term you can use ... Just to be curios: do you know what is he asking?
@huizne your question is a bit misinterpretable. Is this console application your?
Quote Originally Posted by hkKenshin View Post
Ah, it's been a while since I've seen your dumbass around here.
Fine, let's debate this like school kids.

"Inject" refers to adding information. My past console I made for games literally "injected" commands via a combination of WriteProcessMemory and CreateRemoteThread.

If you want to manipulate it to remove commands, you're doing the opposite of injecting and rather clearing the cbuf within the game which still uses WPM/CRT.
If you want to change how the console looks, you still have to inject opcodes and/or your textual format.

Either way, manipulation from an external application to communicate with the game's interface, since we're talking about CS, always requires you to inject something.

There, satisfied asshole?

( Tbh, I'm seriously getting tired of your bullshit due to criticizing everyone's response even if they're correct just because they don't meet your standards. )
Actually im talking about console for inputing commands like sv_cheats etc for movie making purposes ive already started making a program but i cant seem to find how to control it extrenally im using autohotkey
Quote Originally Posted by huizne View Post
Actually im talking about console for inputing commands like sv_cheats etc for movie making purposes ive already started making a program but i cant seem to find how to control it extrenally im using autohotkey
http://www.mpgh.net/forum/showthread.php?t=933182

So basically what I posted there.

The engines are based off quake so you can do it there too.

All you need to do:
- Find the address of CBuf_ExecuteText/CBuf_AppendBuffer
- Find out the calling decl of it *
- Allocate a string + null terminator
- Write it
- Pass your parameters to CRT to either directly ( CBuf functions ) or your shellcode function.
- Wait for the thread to return ( CBuf_AppendText is thread safe. I believe all CBuf functions are as well )
- Free your string
- Profit???

Some example asm for a function defined as void __cdecl CBuf_ExecuteText( int delay, const char* cmd ) is:
Code:
push ebp
mov ebp, esp
push 0 ; delay
lea eax, [ esp + 8 ]
push eax
mov eax, 0xdeaddead ; CBuf address
call eax
add esp, 8
mov esp, ebp
pop ebp
ret
*If it uses one param, CreateRemoteThread can be called directly else you'll need to inject some shell code like I had to due to the game being used as x64's __fastcall convention.

Edit: The above allows you to execute commands without it showing the user you're typing anything ( Such as opening the console window, pressing buttons, closing the window )

It happens "instantly". If however you want to do it via opening the console, attach to the window and send your keys to it. AHK has functions for that, if I recall.
Quote Originally Posted by hkKenshin View Post

*If it uses one param, CreateRemoteThread can be called directly else you'll need to inject some shell code like I had to due to the game being used as x64's __fastcall convention.
I'm having a hard time understanding this. I'm going to assume you don't know how to properly pass parameters using CreateRemoteThread if you think you can only pass 1.

Here's some psuedo-ish code

Code:
struct ConsoleParameters {
    int delay;
    char* command;
}

ConsoleParameters.delay = 0;
ConsoleParameters.command = "something";

CreateRemoteThread(...,...,...,...,&ConsoleParameters,...,...);
game being used as x64's __fastcall convention.
What uses the fastcall convention? The entire game? Just the console function? Assuming the little snippet you gave above for the console command is correct that function doesn't use the fastcall convention. You're pushing parameters onto the stack, not putting them in registers.

You need to elaborate more and be nicer to maestro.
Quote Originally Posted by Void View Post
I'm having a hard time understanding this. I'm going to assume you don't know how to properly pass parameters using CreateRemoteThread if you think you can only pass 1.

Here's some psuedo-ish code

Code:
struct ConsoleParameters {
    int delay;
    char* command;
}

ConsoleParameters.delay = 0;
ConsoleParameters.command = "something";

CreateRemoteThread(...,...,...,...,&ConsoleParameters,...,...);


What uses the fastcall convention? The entire game? Just the console function? Assuming the little snippet you gave above for the console command is correct that function doesn't use the fastcall convention. You're pushing parameters onto the stack, not putting them in registers.

You need to elaborate more and be nicer to maestro.
On x64, __fastcall is the standard calling convention for all functions. The first 4 parameters are passed in registers ( RCX, RDX, R8, R9 respectively ) which doesn't involve the stack. Since most CBuf functions only use 2 parameters, I had to manually write a fastcall convention that uses registers compared to the stack.

CRT only passes parameters on the stack. And no, I didn't know about passing structure references via CRT. Or at least, I forgot.
Quote Originally Posted by hkKenshin View Post
On x64, __fastcall is the standard calling convention for all functions. The first 4 parameters are passed in registers ( RCX, RDX, R8, R9 respectively ) which doesn't involve the stack. Since most CBuf functions only use 2 parameters, I had to manually write a fastcall convention that uses registers compared to the stack.

CRT only passes parameters on the stack. And no, I didn't know about passing structure references via CRT. Or at least, I forgot.
The registers are loaded with the last 4 args, but they have the space reversed in the stack.
Quote Originally Posted by maestro1994 View Post
"Inject" is the worst term you can use ... Just to be curios: do you know what is he asking?
Ah, it's been a while since I've seen your dumbass around here.
Fine, let's debate this like school kids.

"Inject" refers to adding information. My past console I made for games literally "injected" commands via a combination of WriteProcessMemory and CreateRemoteThread.

If you want to manipulate it to remove commands, you're doing the opposite of injecting and rather clearing the cbuf within the game which still uses WPM/CRT.
If you want to change how the console looks, you still have to inject opcodes and/or your textual format.

Either way, manipulation from an external application to communicate with the game's interface, since we're talking about CS, always requires you to inject something.

There, satisfied asshole?

( Tbh, I'm seriously getting tired of your bullshit due to criticizing everyone's response even if they're correct just because they don't meet your standards. )
Quote Originally Posted by hkKenshin View Post
Ah, it's been a while since I've seen your dumbass around here.
Fine, let's debate this like school kids.

"Inject" refers to adding information. My past console I made for games literally "injected" commands via a combination of WriteProcessMemory and CreateRemoteThread.

If you want to manipulate it to remove commands, you're doing the opposite of injecting and rather clearing the cbuf within the game which still uses WPM/CRT.
If you want to change how the console looks, you still have to inject opcodes and/or your textual format.

Either way, manipulation from an external application to communicate with the game's interface, since we're talking about CS, always requires you to inject something.

There, satisfied asshole?

( Tbh, I'm seriously getting tired of your bullshit due to criticizing everyone's response even if they're correct just because they don't meet your standards. )
Dude, you need to calm down.
Fine, let's debate this like school kids.
I'm older than you.

I didn't anyway know you were talking about a game. Generally you can't do much communication with an external application, unless the external application was designed to allow external control
There, satisfied asshole?
Yes.

Tbh, I'm seriously getting tired of your bullshit
Do I?

due to criticizing everyone's response even if they're correct
Everything you say is not so correct, as it would be a bit misinterpretable, but don't worry, because this happens if you are a beginner in C++. Happened also to me when I were.
I still can't understand so much what do you say. Also this part:
*If it uses one param, CreateRemoteThread can be called directly else you'll need to inject some shell code like I had to due to the game being used as x64's __fastcall convention.
Could you explain it or not?

If you make a code, I'd comment it and advise you something. But just calm down.
Quote Originally Posted by maestro1994 View Post
If you make a code, I'd comment it and advise you something. But just calm down.
Gui, Add, Button, x302 y50 w90 h30 , SETreset
Gui, Add, Button, x302 y110 w90 h30 , CLEARon
Gui, Add, Button, x402 y60 w90 h30 , GREENon
Gui, Add, Button, x402 y100 w90 h30 , DNon
Gui, Add, Button, x402 y20 w90 h30 , DOFon
Gui, Add, Button, x402 y140 w90 h30 , SMOOTHon
Gui, Add, Button, x232 y180 w90 h40 , SetTick
Gui, Add, Edit, x342 y190 w90 h20
Gui, Add, UpDown, %Tick% Range1-1000000, 1}
Gui, Add, Button, x162 y70 w90 h30 , Start
Gui, Add, Button, x162 y110 w90 h30 , Exec Movie
Gui, Show, x280 y207 h293 w514, Demo Recorder





return

#singleinstance
GuiClose:
ExitApp

https://gyazo.com/2f90b29c639f94cb328e95adbe28e6c8
thats what i got, opening it im sure youll get what im trying to do!

- - - Updated - - -
@Void maybe you can help? posted what im trying to do a post above

- - - Updated - - -

the bigger text (buttons) i want to execute those console commands when i press the button, this is the movie CFG i got from someone but i would like to implement it into a program make it easier (ik you can bind but sometimes i forget what keys do what and i felt this would make it simpler for me since the demoui is kinda buggy)

Also want to be able to exec the cfg via the program , includes the commands for viewmodel hud etc.
hope this gives an idea of what im trying to do.

//starting
Exec DemoTick
mp_display_kill_assists 0
mirv_cvar_unhide_all
sv_cheats 1
sv_disablefreezecam 1
mat_dxlevel 95
host_timescale 0


//framerate
bind "CTRL" "host_framerate 0;echo host_framerate reverted to default. DemoUI is functional again."
bind "UPARROW" "host_framerate 100;echo ;echo Now Capturing @ 100 FPS"
bind "DOWNARROW" "host_framerate 300;echo ;echo Now Capturing @ 300 FPS"
bind "LEFTARROW" "host_framerate 500;echo ;echo Now Capturing @ 500 FPS"
bind "RIGHTARROW" "host_framerate 1000;echo ;echo Now Capturing @ 1000 FPS"


//aliases
alias MENU "clear; echo "MENU - CMDLIST"; echo ""; echo ""; echo "HLAE: shows hlae commands"; echo ""; echo "FPS: shows fps / host_framerate commands"; echo ""; echo "mCMD: shows all movie commands""

alias HLAE "clear; echo "HLAE COMMANDS"; echo ""; echo ""; echo "START RECORDING: host_framerate x- mirv_camexport start NAME.bvh x"; echo ""; echo "STOP RECORDING: host_framerate 0- mirv_camexport stop"; echo ""; echo ""; echo "x => FPS YOU WANT"; echo ""; echo ""; echo "START PLAYING: host_framerate x- mirv_camimport start NAME.bvh"; echo ""; echo "STOP PLAYING: host_framerate 0- mirv_camimport stop""

alias FPS "clear; echo "FPS commands (host_framerate):"; echo""; echo ""; echo "CTRL: host_framerate 0 - DemoUI will work again."; echo ""; echo "100 FPS: LEFTARROW"; echo ""; echo "300 FPS: DOWNARROW"; echo ""; echo "500 FPS: UPARROW"; echo ""; echo "1000 FPS: RIGHTARROW"

alias mCMD "clear; echo "MOVIEMAKING COMMANDS"; echo""; echo ""; echo "F1/F2 start/stop recording"; echo ""; echo "F3/F4 toggle deathnotices/cl_drawhud"; echo ""; echo "F5/F6 toggle viewmodel/particles"; echo ""; echo "GREENon viewmodel greenscreen on"; echo ""; echo "DOFon depth of field settings"; echo ""; echo "SMOOTHon smooth settings"; echo ""; echo "CLEARon clear screen"; echo ""; echo "DNon deathnotices on black background"; echo ""; echo "SETreset reset all screen settings"; echo ""

alias GREENon "fog_enable 1; fog_hdrcolorscale 1; fog_override 1; fog_maxdensity 1; fog_color 0 255 0; fog_start 0; fog_end 1; r_drawviewmodel 1; r_drawparticles 0; cl_drawhud 0; fov_cs_debug 103; r_3dsky 1; r_skybox 1; echo ""; echo "VIEWMODEL GREENSCREEN SUCCESSFULLY CREATED""

alias DOFon "fog_enable 1; fog_color 255 255 255; fog_hdrcolorscale 1; fog_colorskybox 255 255 255; fog_enable_water_fog 1; fog_override 1; fog_start 350; fog_end 1250; fog_maxdensity 1; r_drawviewmodel 0; r_drawparticles 0; cl_drawhud 0; fov_cs_debug 103; r_3dsky 1; r_skybox 1; echo ""; echo "DEPTH OF FIELD SCREEN SUCCESSFULLY CREATED""

alias CLEARon "fog_enable 0; r_drawviewmodel 0; r_drawparticles 1; cl_drawhud 0; cl_draw_only_deathnotices 1; fov_cs_debug 103; r_3dsky 1; r_skybox 1; echo ""; echo "SCREEN SUCCESSFULLY CLEARED""

alias SMOOTHon "fog_enable 0; cl_drawhud 0; fov_cs_debug 40; r_3dsky 1; r_skybox 1; echo ""; echo "SMOOTH SETTINGS SUCCESSFULLY LOADED""

alias DNon "fog_enable 1; fog_override 1; fog_maxdensity 1; fog_color 0 0 0; fog_start 0; fog_end 1; fog_skyboxstart 0; fog_skyboxend 1; fog_skyboxcolor 0 0 0; r_drawviewmodel 0; r_drawparticles 0; cl_drawhud 1; fov_cs_debug 103; cl_draw_only_deathnotices 1; r_3dsky 0; r_skybox 0; echo ""; echo "DEATHNOTICES BLACKSCREEN SUCCESSFULLY CREATED""

alias SETreset "fog_enable 0; r_drawviewmodel 1; r_drawparticles 1; cl_drawhud 1; cl_draw_only_deathnotices 1; fov_cs_debug 103; echo ""; echo "ALL SCREEN SETTINGS SUCCESSFULLY RESET""


//removals

hud_showtargetid 0
cl_teamid_overhead 0
cl_teamid_overhead_maxdist "0"
cl_teamid_overhead_maxdist_spec "0"

bind "f3" "toggle cl_draw_only_deathnotices 0 1"
bind "f4" "toggle cl_drawhud 0 1"
bind "f5" "toggle r_drawviewmodel 0 1"
bind "f6" "toggle r_drawparticles 0 1"


//movement

bind w "+forward"
bind s "+back"
bind a "+moveleft"
bind d "+moveright"
bind i "+moveup"
bind k "+movedown"
bind v "+moveup"
bind c "+movedown"
bind j "+left"
bind l "+right"
cl_forwardspeed "235"
cl_yawspeed "235"
cl_backspeed "235"
cl_sidespeed "235"
cl_upspeed "235"
sensitivity 5

//disabledcrosshair

cl_crosshairalpha 0

//viewmodelsettings

viewmodel_fov 68
viewmodel_offset_x 1.3
viewmodel_offset_y 2
viewmodel_offset_z -1.7
cl_righthand 1
fov_cs_debug 103

//other

weapon_recoil_model 0
mat_postprocess_enable 0
sv_nomvp 1
sv_nostats 1
sv_nonemesis 1
cl_bob_lower_amt 10

clear
echo "MOVIE CONFIG SUCCESSFULLY LOADED"
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?