Advertisement
Guest User

Untitled

a guest
Jul 27th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.07 KB | None | 0 0
  1. void WINAPI MyInsert()
  2. {
  3.     addIntFunction(NULL, "jsEval", jsEval, "( JavaScript String )", 2, 5);
  4.     __asm add esp, 18h
  5.     addIntFunction(NULL, "jsExec", jsExec, "( File Name )", 2, 5);
  6.     __asm add esp, 18h
  7.     addIntFunction(NULL, "jsNewScope", jsNewScope, "()", 1, 1);
  8.     __asm add esp, 18h
  9.     addIntFunction(NULL, "jsCloseScope", jsCloseScope, "( int ScopeID )", 2, 2);
  10.     __asm add esp, 18h
  11.     addIntFunction(NULL, "jsSetScope", jsSetScope, "( int ScopeID )", 2, 2);
  12.     __asm add esp, 18h
  13.     placeToInsert();
  14. }
  15.  
  16. jsHandler jsHandle;
  17. int scopeNum = -1;
  18.  
  19. void jsEval(void* obj, int argc, const char** argv)
  20. {
  21.     jsHandle.evaluate((char*)argv[1], scopeNum);
  22. }
  23.  
  24. int jsExec(void* obj, int argc, const char** argv)
  25. {
  26.     jsHandle.execute((char*)argv[1], scopeNum);
  27. }
  28.  
  29. int jsNewScope(void* obj, int argc, const char** argv)
  30. {
  31.     return jsHandle.newScope();
  32. }
  33.  
  34. void jsCloseScope(void* obj, int argc, const char** argv)
  35. {
  36.     int scopeNum = atoi(argv[2]);
  37.     jsHandle.closeScope(scopeNum);
  38. }
  39.  
  40. int jsSetScope(void* obj, int argc, const char** argv)
  41. {
  42.     scopeNum = atoi(argv[1]);
  43.     return scopeNum;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement