Guest User

Untitled

a guest
Dec 14th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <dlfcn.h>
  2. #include <unistd.h>
  3. #include <cstdlib>
  4. #include <iostream>
  5.  
  6. int main(int argc, char**argv)
  7. {
  8. setenv("SteamAppId", "22320", 0);
  9. void* steamapi = dlopen("./libsteam_api64.so", RTLD_LAZY);
  10.  
  11. if (!steamapi)
  12. {
  13. throw std::runtime_error("Can't open libsteam_api64.so");
  14. }
  15.  
  16. typedef void funcsig(void);
  17.  
  18. funcsig* steamapi_init = (funcsig*) dlsym(steamapi, "SteamAPI_Init");
  19.  
  20. if (steamapi_init == NULL)
  21. {
  22. throw std::runtime_error("Can't find SteamAPI_Init");
  23. }
  24.  
  25. steamapi_init();
  26.  
  27. while(1)
  28. {
  29. sleep(1);
  30. }
  31. }
Add Comment
Please, Sign In to add comment