diff --git a/deps/unrar/crypt.cpp b/deps/unrar/crypt.cpp
index 378ffff6b..fc2126d46 100644
--- a/deps/unrar/crypt.cpp
+++ b/deps/unrar/crypt.cpp
@@ -91,11 +91,6 @@ bool CryptData::SetCryptKeys(bool Encrypt,CRYPT_METHOD Method,
   return true;
 }
 
-void CryptData::SetRijndalDecryptKey(byte *Key,byte *InitV)
-{
-  CryptData::Method=CRYPT_RAR30;
-  rin.Init(false,Key,128,InitV);
-}
 
 // Use the current system time to additionally randomize data.
 static void TimeRandomize(byte *RndBuf,size_t BufSize)
diff --git a/deps/unrar/crypt.hpp b/deps/unrar/crypt.hpp
index ebbad96ed..f6382ef50 100644
--- a/deps/unrar/crypt.hpp
+++ b/deps/unrar/crypt.hpp
@@ -81,7 +81,6 @@ class CryptData
     bool SetCryptKeys(bool Encrypt,CRYPT_METHOD Method,SecPassword *Password,
          const byte *Salt,const byte *InitV,uint Lg2Cnt,
          byte *HashKey,byte *PswCheck);
-    void SetRijndalDecryptKey(byte *Key,byte *InitV);
     void SetAV15Encryption();
     void SetCmt13Encryption();
     void EncryptBlock(byte *Buf,size_t Size);
diff --git a/deps/unrar/getbits.hpp b/deps/unrar/getbits.hpp
index 7fbdfdf30..2e151da9a 100644
--- a/deps/unrar/getbits.hpp
+++ b/deps/unrar/getbits.hpp
@@ -4,7 +4,7 @@
 class BitInput
 {
   public:
-    enum BufferSize {MAX_SIZE=0x50000}; // Size of input buffer.
+    enum BufferSize {MAX_SIZE=0x8000}; // Size of input buffer.
 
     int InAddr; // Curent byte position in the buffer.
     int InBit;  // Current bit position in the current byte.
diff --git a/deps/unrar/model.cpp b/deps/unrar/model.cpp
index 3aa29b245..83391c5a4 100644
--- a/deps/unrar/model.cpp
+++ b/deps/unrar/model.cpp
@@ -566,17 +566,14 @@ void ModelPPM::CleanUp()
 }
 
 
-bool ModelPPM::DecodeInit(Unpack *UnpackRead,int &EscChar,byte *hcppm)
+bool ModelPPM::DecodeInit(Unpack *UnpackRead,int &EscChar)
 {
   int MaxOrder=UnpackRead->GetChar();
   bool Reset=(MaxOrder & 0x20)!=0;
 
   int MaxMB;
   if (Reset)
-  {
     MaxMB=UnpackRead->GetChar();
-    if (MaxMB>128) return(false);
-  }
   else
     if (SubAlloc.GetAllocatedMemory()==0)
       return(false);
@@ -593,7 +590,6 @@ bool ModelPPM::DecodeInit(Unpack *UnpackRead,int &EscChar,byte *hcppm)
       SubAlloc.StopSubAllocator();
       return(false);
     }
-    SubAlloc.SetHeapStartFixed(hcppm);
     SubAlloc.StartSubAllocator(MaxMB+1);
     StartModelRare(MaxOrder);
   }
diff --git a/deps/unrar/model.hpp b/deps/unrar/model.hpp
index c7444de33..52abc89b3 100644
--- a/deps/unrar/model.hpp
+++ b/deps/unrar/model.hpp
@@ -115,7 +115,7 @@ class ModelPPM : RARPPM_DEF
   public:
     ModelPPM();
     void CleanUp(); // reset PPM variables after data error
-    bool DecodeInit(Unpack *UnpackRead,int &EscChar,byte *hcppm);
+    bool DecodeInit(Unpack *UnpackRead,int &EscChar);
     int DecodeChar();
 };
 
diff --git a/deps/unrar/os.hpp b/deps/unrar/os.hpp
index dadec759a..b69f34878 100644
--- a/deps/unrar/os.hpp
+++ b/deps/unrar/os.hpp
@@ -53,7 +53,7 @@
 #include <prsht.h>
 #include <shlwapi.h>
 #pragma comment(lib, "Shlwapi.lib")
-#include <powrprof.h>
+#include <PowrProf.h>
 #pragma comment(lib, "PowrProf.lib")
 #include <shellapi.h>
 #include <shlobj.h>
diff --git a/deps/unrar/rdwrfn.cpp b/deps/unrar/rdwrfn.cpp
index 5c85753da..66a68fc74 100644
--- a/deps/unrar/rdwrfn.cpp
+++ b/deps/unrar/rdwrfn.cpp
@@ -201,7 +201,7 @@ void ComprDataIO::UnpWrite(byte *Addr,size_t Count)
   {
     if (Count <= UnpackToMemorySize)
     {
-      //memcpy(UnpackToMemoryAddr,Addr,Count);
+      memcpy(UnpackToMemoryAddr,Addr,Count);
       UnpackToMemoryAddr+=Count;
       UnpackToMemorySize-=Count;
     }
@@ -292,13 +292,6 @@ void ComprDataIO::SetEncryption(bool Encrypt,CRYPT_METHOD Method,
 #endif
 }
 
-void ComprDataIO::InitRijindal(byte *Key,byte *InitV)
-{
-#ifndef RAR_NOCRYPT
-  Decryption=true;
-  Decrypt->SetRijndalDecryptKey(Key,InitV);
-#endif
-}
 
 #if !defined(SFX_MODULE) && !defined(RAR_NOCRYPT)
 void ComprDataIO::SetAV15Encryption()
@@ -326,10 +319,3 @@ void ComprDataIO::SetUnpackToMemory(byte *Addr,uint Size)
   UnpackToMemoryAddr=Addr;
   UnpackToMemorySize=Size;
 }
-
-void ComprDataIO::SetUnpackFromMemory(byte *Addr,uint Size)
-{
-  UnpackFromMemory=true;
-  UnpackFromMemoryAddr=Addr;
-  UnpackFromMemorySize=Size;
-}
diff --git a/deps/unrar/rdwrfn.hpp b/deps/unrar/rdwrfn.hpp
index 24c09eec4..fc38fd309 100644
--- a/deps/unrar/rdwrfn.hpp
+++ b/deps/unrar/rdwrfn.hpp
@@ -70,11 +70,9 @@ class ComprDataIO
     void SetSubHeader(FileHeader *hd,int64 *Pos) {SubHead=hd;SubHeadPos=Pos;}
     void SetEncryption(bool Encrypt,CRYPT_METHOD Method,SecPassword *Password,
          const byte *Salt,const byte *InitV,uint Lg2Cnt,byte *HashKey,byte *PswCheck);
-    void InitRijindal(byte *Key,byte *InitV);
     void SetAV15Encryption();
     void SetCmt13Encryption();
     void SetUnpackToMemory(byte *Addr,uint Size);
-    void SetUnpackFromMemory(byte *Addr,uint Size);
     void SetCurrentCommand(wchar Cmd) {CurrentCommand=Cmd;}
 
 
diff --git a/deps/unrar/rijndael.cpp b/deps/unrar/rijndael.cpp
index cbb1722fd..dd19750a3 100644
--- a/deps/unrar/rijndael.cpp
+++ b/deps/unrar/rijndael.cpp
@@ -11,11 +11,10 @@
 #include <wmmintrin.h>
 #endif
 
-// not thread-safe ?
-//static byte S[256],S5[256],rcon[30];
-//static byte T1[256][4],T2[256][4],T3[256][4],T4[256][4];
-//static byte T5[256][4],T6[256][4],T7[256][4],T8[256][4];
-//static byte U1[256][4],U2[256][4],U3[256][4],U4[256][4];
+static byte S[256],S5[256],rcon[30];
+static byte T1[256][4],T2[256][4],T3[256][4],T4[256][4];
+static byte T5[256][4],T6[256][4],T7[256][4],T8[256][4];
+static byte U1[256][4],U2[256][4],U3[256][4],U4[256][4];
 
 
 inline void Xor128(void *dest,const void *arg1,const void *arg2)
@@ -64,7 +63,7 @@ inline void Copy128(byte *dest,const byte *src)
 
 Rijndael::Rijndael()
 {
-  //if (S[0]==0)
+  if (S[0]==0)
     GenerateTables();
   CBCMode = true; // Always true for RAR.
 }
diff --git a/deps/unrar/rijndael.hpp b/deps/unrar/rijndael.hpp
index 33537d890..2144e02e5 100644
--- a/deps/unrar/rijndael.hpp
+++ b/deps/unrar/rijndael.hpp
@@ -33,11 +33,6 @@ class Rijndael
     int      m_uRounds;
     byte     m_initVector[MAX_IV_SIZE];
     byte     m_expandedKey[_MAX_ROUNDS+1][4][4];
-
-    byte S[256],S5[256],rcon[30];
-    byte T1[256][4],T2[256][4],T3[256][4],T4[256][4];
-    byte T5[256][4],T6[256][4],T7[256][4],T8[256][4];
-    byte U1[256][4],U2[256][4],U3[256][4],U4[256][4];
   public:
     Rijndael();
     void Init(bool Encrypt,const byte *key,uint keyLen,const byte *initVector);
diff --git a/deps/unrar/suballoc.cpp b/deps/unrar/suballoc.cpp
index bdf2b06f0..07d32859f 100644
--- a/deps/unrar/suballoc.cpp
+++ b/deps/unrar/suballoc.cpp
@@ -71,7 +71,7 @@ void SubAllocator::StopSubAllocator()
   if ( SubAllocatorSize ) 
   {
     SubAllocatorSize=0;
-    //free(HeapStart);
+    free(HeapStart);
   }
 }
 
@@ -88,8 +88,7 @@ bool SubAllocator::StartSubAllocator(int SASize)
   // units: one as reserve for HeapEnd overflow checks and another
   // to provide the space to correctly align UnitsStart.
   uint AllocSize=t/FIXED_UNIT_SIZE*UNIT_SIZE+2*UNIT_SIZE;
-  //if ((HeapStart=(byte *)malloc(AllocSize)) == NULL)
-  if ((HeapStart=(byte *)HeapStartFixed) == NULL)
+  if ((HeapStart=(byte *)malloc(AllocSize)) == NULL)
   {
     ErrHandler.MemoryError();
     return false;
diff --git a/deps/unrar/suballoc.hpp b/deps/unrar/suballoc.hpp
index fec0aac2a..2a1d1320e 100644
--- a/deps/unrar/suballoc.hpp
+++ b/deps/unrar/suballoc.hpp
@@ -80,9 +80,6 @@ class SubAllocator
     long GetAllocatedMemory() {return(SubAllocatorSize);}
 
     byte *pText, *UnitsStart,*HeapEnd,*FakeUnitsStart;
-
-    byte *HeapStartFixed;
-    void SetHeapStartFixed(byte *p) {HeapStartFixed=p;}
 };
 
 
diff --git a/deps/unrar/unpack.cpp b/deps/unrar/unpack.cpp
index 5f577d85d..037c35546 100644
--- a/deps/unrar/unpack.cpp
+++ b/deps/unrar/unpack.cpp
@@ -16,7 +16,7 @@
 #include "unpack50frag.cpp"
 
 Unpack::Unpack(ComprDataIO *DataIO)
-:Inp(false),VMCodeInp(false)
+:Inp(true),VMCodeInp(true)
 {
   UnpIO=DataIO;
   Window=NULL;
@@ -49,8 +49,8 @@ Unpack::~Unpack()
 {
   InitFilters30(false);
 
-  //if (Window!=NULL)
-  //  free(Window);
+  if (Window!=NULL)
+    free(Window);
 #ifdef RAR_SMP
   delete UnpThreadPool;
   delete[] ReadBufMT;
@@ -69,21 +69,6 @@ void Unpack::SetThreads(uint Threads)
 }
 #endif
 
-void Unpack::SetWin(void *win)
-{
-  hcwin=(byte *)win;
-}
-
-void Unpack::SetPPM(void *ppm)
-{
-  hcppm=(byte *)ppm;
-}
-
-void Unpack::SetExternalBuffer(byte *InpBuf,byte *VMCodeBuf)
-{
-  Inp.SetExternalBuffer(InpBuf);
-  VMCodeInp.SetExternalBuffer(VMCodeBuf);
-}
 
 void Unpack::Init(size_t WinSize,bool Solid)
 {
@@ -117,7 +102,7 @@ void Unpack::Init(size_t WinSize,bool Solid)
   if (Grow && Fragmented)
     throw std::bad_alloc();
 
-  byte *NewWindow=Fragmented ? NULL : (byte *)hcwin;
+  byte *NewWindow=Fragmented ? NULL : (byte *)malloc(WinSize);
 
   if (NewWindow==NULL)
     if (Grow || WinSize<0x1000000)
@@ -130,7 +115,7 @@ void Unpack::Init(size_t WinSize,bool Solid)
     {
       if (Window!=NULL) // If allocated by preceding files.
       {
-        //free(Window);
+        free(Window);
         Window=NULL;
       }
       FragWindow.Init(WinSize);
@@ -141,7 +126,7 @@ void Unpack::Init(size_t WinSize,bool Solid)
   {
     // Clean the window to generate the same output when unpacking corrupt
     // RAR files, which may access unused areas of sliding dictionary.
-    //memset(NewWindow,0,WinSize);
+    memset(NewWindow,0,WinSize);
 
     // If Window is not NULL, it means that window size has grown.
     // In solid streams we need to copy data to a new window in such case.
@@ -151,8 +136,8 @@ void Unpack::Init(size_t WinSize,bool Solid)
       for (size_t I=1;I<=MaxWinSize;I++)
         NewWindow[(UnpPtr-I)&(WinSize-1)]=Window[(UnpPtr-I)&(MaxWinSize-1)];
 
-    //if (Window!=NULL)
-    //  free(Window);
+    if (Window!=NULL)
+      free(Window);
     Window=NewWindow;
   }
 
diff --git a/deps/unrar/unpack.hpp b/deps/unrar/unpack.hpp
index f76ddcc86..75dadb0e0 100644
--- a/deps/unrar/unpack.hpp
+++ b/deps/unrar/unpack.hpp
@@ -375,9 +375,6 @@ class Unpack:PackDef
   public:
     Unpack(ComprDataIO *DataIO);
     ~Unpack();
-    void SetWin(void *win);
-    void SetPPM(void *PPM);
-    void SetExternalBuffer(byte *InpBuf,byte *VMCodeBuf);
     void Init(size_t WinSize,bool Solid);
     void DoUnpack(uint Method,bool Solid);
     bool IsFileExtracted() {return(FileExtracted);}
@@ -389,9 +386,6 @@ class Unpack:PackDef
     void UnpackDecode(UnpackThreadData &D);
 #endif
 
-    byte *hcwin;
-    byte *hcppm;
-
     size_t MaxWinSize;
     size_t MaxWinMask;
 
diff --git a/deps/unrar/unpack30.cpp b/deps/unrar/unpack30.cpp
index 346bcf970..6a8efa23b 100644
--- a/deps/unrar/unpack30.cpp
+++ b/deps/unrar/unpack30.cpp
@@ -637,7 +637,7 @@ bool Unpack::ReadTables30()
   if (BitField & 0x8000)
   {
     UnpBlockType=BLOCK_PPM;
-    return(PPM.DecodeInit(this,PPMEscChar,hcppm));
+    return(PPM.DecodeInit(this,PPMEscChar));
   }
   UnpBlockType=BLOCK_LZ;
   
