Rattrap

Members
  • Content count

    1147
  • Joined

  • Last visited

Community Reputation

3385 Excellent

About Rattrap

  • Rank
    Contributor

Personal Information

  1. Typically it is that same place in Visual Studio. Project Properties ->  Linker -> Input -> Additional Dependencies
  2. You probably need to add a few windows libraries (which are usually done by default for a lot of projects).  Under the Project settings, check under Linker -> Input -> Additional Dependencies.  Below is a list of files that are typically added by default for windows projects
  3. Where did vc++ 2015 redist go?

    The latest supported Visual C++ downloads You'll need a Microsoft login to get them.
  4. Worldwide ransomware cyber attack

    Microsoft actually made a patch for Windows XP, because of the how large the attack was.
  5. AesManaged error (WITH CODE)

    I think your problem is actually in the encryptor, not the decryptor now.   StreamWriter.Write takes a string, not byte[] (as mentioned before, their code was built around strings, not byte arrays). So I think your getting an implicit call to data.toString. [edit] I still recommend just using the TransformFinalBlock, but to fix the existing code just take out the StreamWriter and write directly from the CryptoStream.   System.Security.Cryptography.ICryptoTransform encryptor = aesm.CreateEncryptor(aesm.Key, aesm.IV); using(System.IO.MemoryStream ms = new System.IO.MemoryStream()) { using(System.Security.Cryptography.CryptoStream cs = new System.Security.Cryptography.CryptoStream(ms, encryptor, System.Security.Cryptography.CryptoStreamMode.Write)) { cs.Write(data, 0, data.Length); result = ms.ToArray(); } }
  6. AesManaged error (WITH CODE)

    The other thing is your code is byte[] -> byte[].  The code on MSDN is string -> byte[] and byte[] -> string.  So just fixing that parameter doesn't fix the issue either.  When I did that with your code, it was passing the type name (System.Byte[]) to decryptor.  I'm assuming it took the input parameter and applied toString to it, returning the type name instead of the data itself.
  7. AesManaged error (WITH CODE)

    fastcall22 is right, you're missing a parameter.  To make it a little less complicated though, try this instead.   if(mode == EncryptionMode.Encrypt) { System.Security.Cryptography.ICryptoTransform encryptor = aesm.CreateEncryptor(aesm.Key, aesm.IV); result = encryptor.TransformFinalBlock(data, 0, data.Length); } else { System.Security.Cryptography.ICryptoTransform decryptor = aesm.CreateDecryptor(aesm.Key, aesm.IV); result = decryptor.TransformFinalBlock(data, 0, data.Length); }
  8. AesManaged won't decrypt!

    Post some code (not just the MSDN page) and we might be able to see what is wrong.
  9. Cost of Abstraction

    Test_A and Test_B produce the exact same assembly.  I used Compiler Explorer with your code using GCC 6.3 (-std=c++1z -O3) and just changed the define Test A .LC0:         .string "USING CLASS, %d iterations:\n" .LC2:         .string "Time: %.5f seconds\n" main:         pxor    xmm0, xmm0         sub     rsp, 40         mov     esi, 100000000         mov     edi, OFFSET FLAT:.LC0         xor     eax, eax         movaps  XMMWORD PTR [rsp], xmm0         movaps  XMMWORD PTR [rsp+16], xmm0         call    printf         mov     rsi, rsp         mov     edi, 1         call    clock_gettime         lea     rsi, [rsp+16]         mov     edi, 1         call    clock_gettime         pxor    xmm0, xmm0         mov     edi, OFFSET FLAT:.LC2         movsd   xmm2, QWORD PTR .LC1[rip]         mov     eax, 1         pxor    xmm1, xmm1         cvtsi2sdq       xmm0, QWORD PTR [rsp+24]         mulsd   xmm0, xmm2         cvtsi2sdq       xmm1, QWORD PTR [rsp+16]         addsd   xmm0, xmm1         pxor    xmm1, xmm1         cvtsi2sdq       xmm1, QWORD PTR [rsp+8]         mulsd   xmm1, xmm2         pxor    xmm2, xmm2         cvtsi2sdq       xmm2, QWORD PTR [rsp]         addsd   xmm1, xmm2         subsd   xmm0, xmm1         call    printf         xor     eax, eax         add     rsp, 40         ret .LC1:         .long   3894859413         .long   1041313291 Test B .LC0:         .string "NO CLASS, %d iterations:\n" .LC2:         .string "Time: %.5f seconds\n" main:         pxor    xmm0, xmm0         sub     rsp, 40         mov     esi, 100000000         mov     edi, OFFSET FLAT:.LC0         xor     eax, eax         movaps  XMMWORD PTR [rsp], xmm0         movaps  XMMWORD PTR [rsp+16], xmm0         call    printf         mov     rsi, rsp         mov     edi, 1         call    clock_gettime         lea     rsi, [rsp+16]         mov     edi, 1         call    clock_gettime         pxor    xmm0, xmm0         mov     edi, OFFSET FLAT:.LC2         movsd   xmm2, QWORD PTR .LC1[rip]         mov     eax, 1         pxor    xmm1, xmm1         cvtsi2sdq       xmm0, QWORD PTR [rsp+24]         mulsd   xmm0, xmm2         cvtsi2sdq       xmm1, QWORD PTR [rsp+16]         addsd   xmm0, xmm1         pxor    xmm1, xmm1         cvtsi2sdq       xmm1, QWORD PTR [rsp+8]         mulsd   xmm1, xmm2         pxor    xmm2, xmm2         cvtsi2sdq       xmm2, QWORD PTR [rsp]         addsd   xmm1, xmm2         subsd   xmm0, xmm1         call    printf         xor     eax, eax         add     rsp, 40         ret .LC1:         .long   3894859413         .long   1041313291 The only difference was the string definition. .string "USING CLASS, %d iterations:\n"          .string "NO CLASS, %d iterations:\n"
  10. Wasn't sure where to post this: 2 questions.

      I'm guessing this is trolling, but if you disabled NAT (Network Address Translation), then you wouldn't be able to access the internet through the router.  NAT is what converts from a private address to a public address.  You would have to plug directly into the modem.   Did you maybe confuse NAT with Universal Plug and Play (UPNP)?
  11. Application.h is including GameState.h and GateState.h is including Application.h. So there is your problem. You'll want to remove these includes and move them to the cpp file. Then forward declare the classes in the h file. Also, unless you need those include's in the h file, move them to the cpp. They only need to be in the h if you are using them in the h. Application.h #pragma once #include "MainMenuState.h" #include "GameplayState.h" #include "Sprite.h" #include "Text.h" #include "Debug.h" #include "Globals.h" #include "GUIManager.h" #include "Button.h" #include "EntityManager.h" #include "Random.h" #include "Globals.h" #include <string> #include <iostream> #include <vector> #include <thread> #include <SFML\Graphics.hpp> #include <BOX2D\Box2D.h> #include <TGUI\TGUI.hpp> namespace SwEngine { class GameState; class Application { public: Application(); ~Application(); void Run(); void Close(); void AddGamestate(std::string m_name, GameState* m_gamestate); void ChangeGamestate(int m_gamestate); void HandleGamestateEvents(float &m_deltaTime); void DrawGamestate(sf::RenderWindow &m_window); void DrawGUI(); GameState* GetGamestate(); sf::RenderWindow &GetWindow(); sf::Event &GetEventHandler(); void SetApplication(Application* m_app); private: Application* _application; sf::RenderWindow _window; sf::Event _evnt; sf::Clock _deltaClock; sf::View _view; sf::FloatRect _viewportRect; float _deltaTime; std::vector<GameState*> _gamestates; GameState* _currentGamestate; b2World* _world; }; } GameState.h #pragma once #include <SFML\Graphics.hpp> #include <iostream> namespace SwEngine { class Application; class GameState { public: GameState(Application& m_app); GameState(); ~GameState(); virtual void Update() = 0; virtual void Load(); virtual void HandleEvents(float m_deltaTime) = 0; virtual void Draw(sf::RenderWindow &m_window) = 0; virtual void Quit() = 0; virtual std::string GetGamestateName() = 0; }; }
  12. Just a brief skim, these ones are interesting to me.     This suggests that either you've got two files defining the same thing (might not be included in the project, but something might include an old file that is still in the file structure).  Or I wonder if you've got bad header guards or missing #pragma once or a circular reference somewhere.
  13.   You might post more of the errors (I know you said 158 of them).  The other errors might be more telling.
  14. Might try and Clean Solution and Build.   Also, since we can't see AddGamestate, have you tried right clicking on the calling code and use Go To Definition" to confirm you are calling what you think you are calling?