-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsteamspawnkeyboard.lua
More file actions
93 lines (70 loc) · 2.22 KB
/
Copy pathsteamspawnkeyboard.lua
File metadata and controls
93 lines (70 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
function spawnSteamKeyboard()
return autoAssemble([[
{$c}
#include <stdio.h>
#include <stdint.h>
#define RTLD_LAZY 0x00001 /* Lazy function call binding. */
#define RTLD_NOW 0x00002 /* Immediate function call binding. */
#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
#define RTLD_NOLOAD 0x00004 /* Do not load the object. */
#define RTLD_DEEPBIND 0x00008 /* Use deep binding. */
void *dlopen(const char *path, int flags);
void *dlsym(void *handle, const char *symbol);
const int k_cchMaxSteamErrMsg = 1024;
typedef char SteamErrMsg[1024];
typedef int (INIT)(SteamErrMsg *msg);
typedef void* (STEAMCLIENT)();
typedef void* (STEAMAPI_STEAMUTILS_V011)();
typedef int (STEAMAPI_ISTEAMUTILS_SHOWGAMEPADTEXTINPUT)( void* self, int eInputMode, int eLineInputMode, const char * pchDescription, uint32_t unCharMax, const char * pchExistingText );
INIT *init;
STEAMCLIENT *SteamClient;
STEAMAPI_STEAMUTILS_V011 *SteamAPI_SteamUtils_v011;
STEAMAPI_ISTEAMUTILS_SHOWGAMEPADTEXTINPUT *SteamAPI_ISteamUtils_ShowGamepadTextInput;
int xxx;
void bla(void)
{
xxx++;
void *steamapi=dlopen("/home/eric/snap/steam/common/.local/share/Steam/steamrt64/libsteam_api.so", RTLD_NOW);
if (steamapi)
{
init=dlsym(steamapi, "SteamAPI_InitFlat");
if (init)
{
int r;
SteamErrMsg err;
err[0]=0;
r=init(&err);
printf("r=%d err=%s\n", r,err);
if (r==0)
{
SteamClient=dlsym(steamapi, "SteamClient");
SteamAPI_SteamUtils_v011=dlsym(steamapi, "SteamAPI_SteamUtils_v011");
SteamAPI_ISteamUtils_ShowGamepadTextInput=dlsym(steamapi, "SteamAPI_ISteamUtils_ShowGamepadTextInput");
if (SteamAPI_SteamUtils_v011)
{
void *su=SteamAPI_SteamUtils_v011();
printf("su=%p\n",su);
if (su)
{
char bla[100];
strcpy(bla,"Fuck you!");
r=SteamAPI_ISteamUtils_ShowGamepadTextInput(su,0,0,"fuck you",100, bla);
printf("SteamAPI_ISteamUtils_ShowGamepadTextInput returned %d\n",r);
}
}
else
printf("Failed finding SteamClient export\n");
}
}
}
else
{
printf("failed opening steamapi");
}
fflush(0);
xxx++;
}
{$asm}
createthread(bla)
]],true)
end