MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / ConvertDosPassword

Method ConvertDosPassword

Libraries/unrar/extract.cpp:1027–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1025
1026#if defined(_WIN_ALL) && !defined(SFX_MODULE)
1027void CmdExtract::ConvertDosPassword(Archive &Arc,SecPassword &DestPwd)
1028{
1029 if (Arc.Format==RARFMT15 && Arc.FileHead.HostOS==HOST_MSDOS)
1030 {
1031 // We need the password in OEM encoding if file was encrypted by
1032 // native RAR/DOS (not extender based). Let's make the conversion.
1033 wchar PlainPsw[MAXPASSWORD];
1034 Cmd->Password.Get(PlainPsw,ASIZE(PlainPsw));
1035 char PswA[MAXPASSWORD];
1036 CharToOemBuffW(PlainPsw,PswA,ASIZE(PswA));
1037 PswA[ASIZE(PswA)-1]=0;
1038 CharToWide(PswA,PlainPsw,ASIZE(PlainPsw));
1039 DestPwd.Set(PlainPsw);
1040 cleandata(PlainPsw,sizeof(PlainPsw));
1041 cleandata(PswA,sizeof(PswA));
1042 }
1043}
1044#endif
1045
1046

Callers

nothing calls this directly

Calls 4

CharToWideFunction · 0.85
cleandataFunction · 0.85
GetMethod · 0.80
SetMethod · 0.80

Tested by

no test coverage detected