4 Star 1 Fork 1

Dillon/WeixinWinPhone

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ICSharpCode.SharpZLib.Phone-cleaned.cs 101.95 KB
一键复制 编辑 原始数据 按行查看 历史
Dillon 提交于 2014-11-27 23:45 . f
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920
// D:\tools\weixin\new\ICSharpCode.SharpZLib.Phone-cleaned.dll
// ICSharpCode.SharpZLib.Phone, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// 架 构: AnyCPU (优先64位)
// 运行时: .NET 2.0
using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Encryption;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
using System;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Cryptography;
using System.Text;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyProduct("ICSharpCode.SharpZLib.Silverlight")]
[assembly: AssemblyTitle("ICSharpCode.SharpZLib.Silverlight")]
[assembly: AssemblyTrademark("")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: ComVisible(false)]
[assembly: Guid("e7cfa3a6-8978-413e-b754-21b37f70c584")]
[assembly: TargetFramework("Silverlight,Version=v4.0,Profile=WindowsPhone", FrameworkDisplayName = "Silverlight 4.0 Windows Phone Profile")]
namespace ICSharpCode.SharpZipLib.Checksums
{
public sealed class Adler32 : IChecksum
{
private const uint uint_0 = 65521u;
private uint uint_1;
public long Value
{
get
{
return (long)((ulong)this.uint_1);
}
}
public Adler32()
{
this.Reset();
}
public void Reset()
{
this.uint_1 = 1u;
}
public void Update(int value)
{
uint num = this.uint_1 & 65535u;
uint num2 = this.uint_1 >> 16;
num = (num + (uint)(value & 255)) % 65521u;
num2 = (num + num2) % 65521u;
this.uint_1 = (num2 << 16) + num;
}
public void Update(byte[] buffer)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
this.Update(buffer, 0, buffer.Length);
}
public void Update(byte[] buffer, int offset, int count)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", "cannot be negative");
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count", "cannot be negative");
}
if (offset >= buffer.Length)
{
throw new ArgumentOutOfRangeException("offset", "not a valid index into buffer");
}
if (offset + count > buffer.Length)
{
throw new ArgumentOutOfRangeException("count", "exceeds buffer size");
}
uint num = this.uint_1 & 65535u;
uint num2 = this.uint_1 >> 16;
while (count > 0)
{
int num3 = 3800;
if (3800 > count)
{
num3 = count;
}
count -= num3;
while (--num3 >= 0)
{
num += (uint)(buffer[offset++] & 255);
num2 += num;
}
num %= 65521u;
num2 %= 65521u;
}
this.uint_1 = (num2 << 16 | num);
}
}
public interface IChecksum
{
long Value
{
get;
}
void Reset();
void Update(int value);
void Update(byte[] buffer);
void Update(byte[] buffer, int offset, int count);
}
public sealed class Crc32 : IChecksum
{
private const uint uint_0 = 4294967295u;
private static readonly uint[] uint_1 = new uint[]
{
0u,
1996959894u,
3993919788u,
2567524794u,
124634137u,
1886057615u,
3915621685u,
2657392035u,
249268274u,
2044508324u,
3772115230u,
2547177864u,
162941995u,
2125561021u,
3887607047u,
2428444049u,
498536548u,
1789927666u,
4089016648u,
2227061214u,
450548861u,
1843258603u,
4107580753u,
2211677639u,
325883990u,
1684777152u,
4251122042u,
2321926636u,
335633487u,
1661365465u,
4195302755u,
2366115317u,
997073096u,
1281953886u,
3579855332u,
2724688242u,
1006888145u,
1258607687u,
3524101629u,
2768942443u,
901097722u,
1119000684u,
3686517206u,
2898065728u,
853044451u,
1172266101u,
3705015759u,
2882616665u,
651767980u,
1373503546u,
3369554304u,
3218104598u,
565507253u,
1454621731u,
3485111705u,
3099436303u,
671266974u,
1594198024u,
3322730930u,
2970347812u,
795835527u,
1483230225u,
3244367275u,
3060149565u,
1994146192u,
31158534u,
2563907772u,
4023717930u,
1907459465u,
112637215u,
2680153253u,
3904427059u,
2013776290u,
251722036u,
2517215374u,
3775830040u,
2137656763u,
141376813u,
2439277719u,
3865271297u,
1802195444u,
476864866u,
2238001368u,
4066508878u,
1812370925u,
453092731u,
2181625025u,
4111451223u,
1706088902u,
314042704u,
2344532202u,
4240017532u,
1658658271u,
366619977u,
2362670323u,
4224994405u,
1303535960u,
984961486u,
2747007092u,
3569037538u,
1256170817u,
1037604311u,
2765210733u,
3554079995u,
1131014506u,
879679996u,
2909243462u,
3663771856u,
1141124467u,
855842277u,
2852801631u,
3708648649u,
1342533948u,
654459306u,
3188396048u,
3373015174u,
1466479909u,
544179635u,
3110523913u,
3462522015u,
1591671054u,
702138776u,
2966460450u,
3352799412u,
1504918807u,
783551873u,
3082640443u,
3233442989u,
3988292384u,
2596254646u,
62317068u,
1957810842u,
3939845945u,
2647816111u,
81470997u,
1943803523u,
3814918930u,
2489596804u,
225274430u,
2053790376u,
3826175755u,
2466906013u,
167816743u,
2097651377u,
4027552580u,
2265490386u,
503444072u,
1762050814u,
4150417245u,
2154129355u,
426522225u,
1852507879u,
4275313526u,
2312317920u,
282753626u,
1742555852u,
4189708143u,
2394877945u,
397917763u,
1622183637u,
3604390888u,
2714866558u,
953729732u,
1340076626u,
3518719985u,
2797360999u,
1068828381u,
1219638859u,
3624741850u,
2936675148u,
906185462u,
1090812512u,
3747672003u,
2825379669u,
829329135u,
1181335161u,
3412177804u,
3160834842u,
628085408u,
1382605366u,
3423369109u,
3138078467u,
570562233u,
1426400815u,
3317316542u,
2998733608u,
733239954u,
1555261956u,
3268935591u,
3050360625u,
752459403u,
1541320221u,
2607071920u,
3965973030u,
1969922972u,
40735498u,
2617837225u,
3943577151u,
1913087877u,
83908371u,
2512341634u,
3803740692u,
2075208622u,
213261112u,
2463272603u,
3855990285u,
2094854071u,
198958881u,
2262029012u,
4057260610u,
1759359992u,
534414190u,
2176718541u,
4139329115u,
1873836001u,
414664567u,
2282248934u,
4279200368u,
1711684554u,
285281116u,
2405801727u,
4167216745u,
1634467795u,
376229701u,
2685067896u,
3608007406u,
1308918612u,
956543938u,
2808555105u,
3495958263u,
1231636301u,
1047427035u,
2932959818u,
3654703836u,
1088359270u,
936918000u,
2847714899u,
3736837829u,
1202900863u,
817233897u,
3183342108u,
3401237130u,
1404277552u,
615818150u,
3134207493u,
3453421203u,
1423857449u,
601450431u,
3009837614u,
3294710456u,
1567103746u,
711928724u,
3020668471u,
3272380065u,
1510334235u,
755167117u
};
private uint uint_2;
public long Value
{
get
{
return (long)((ulong)this.uint_2);
}
set
{
this.uint_2 = (uint)value;
}
}
internal static uint smethod_0(uint uint_3, byte byte_0)
{
return Crc32.uint_1[(int)((UIntPtr)((uint_3 ^ (uint)byte_0) & 255u))] ^ uint_3 >> 8;
}
public void Reset()
{
this.uint_2 = 0u;
}
public void Update(int value)
{
this.uint_2 ^= 4294967295u;
this.uint_2 = (Crc32.uint_1[(int)checked((IntPtr)(unchecked((ulong)this.uint_2 ^ (ulong)((long)value)) & 255uL))] ^ this.uint_2 >> 8);
this.uint_2 ^= 4294967295u;
}
public void Update(byte[] buffer)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
this.Update(buffer, 0, buffer.Length);
}
public void Update(byte[] buffer, int offset, int count)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count", "Count cannot be less than zero");
}
if (offset < 0 || offset + count > buffer.Length)
{
throw new ArgumentOutOfRangeException("offset");
}
this.uint_2 ^= 4294967295u;
while (--count >= 0)
{
this.uint_2 = (Crc32.uint_1[(int)((UIntPtr)((this.uint_2 ^ (uint)buffer[offset++]) & 255u))] ^ this.uint_2 >> 8);
}
this.uint_2 ^= 4294967295u;
}
}
public class StrangeCRC : IChecksum
{
private static readonly uint[] uint_0 = new uint[]
{
0u,
79764919u,
159529838u,
222504665u,
319059676u,
398814059u,
445009330u,
507990021u,
638119352u,
583659535u,
797628118u,
726387553u,
890018660u,
835552979u,
1015980042u,
944750013u,
1276238704u,
1221641927u,
1167319070u,
1095957929u,
1595256236u,
1540665371u,
1452775106u,
1381403509u,
1780037320u,
1859660671u,
1671105958u,
1733955601u,
2031960084u,
2111593891u,
1889500026u,
1952343757u,
2552477408u,
2632100695u,
2443283854u,
2506133561u,
2334638140u,
2414271883u,
2191915858u,
2254759653u,
3190512472u,
3135915759u,
3081330742u,
3009969537u,
2905550212u,
2850959411u,
2762807018u,
2691435357u,
3560074640u,
3505614887u,
3719321342u,
3648080713u,
3342211916u,
3287746299u,
3467911202u,
3396681109u,
4063920168u,
4143685023u,
4223187782u,
4286162673u,
3779000052u,
3858754371u,
3904687514u,
3967668269u,
881225847u,
809987520u,
1023691545u,
969234094u,
662832811u,
591600412u,
771767749u,
717299826u,
311336399u,
374308984u,
453813921u,
533576470u,
25881363u,
88864420u,
134795389u,
214552010u,
2023205639u,
2086057648u,
1897238633u,
1976864222u,
1804852699u,
1867694188u,
1645340341u,
1724971778u,
1587496639u,
1516133128u,
1461550545u,
1406951526u,
1302016099u,
1230646740u,
1142491917u,
1087903418u,
2896545431u,
2825181984u,
2770861561u,
2716262478u,
3215044683u,
3143675388u,
3055782693u,
3001194130u,
2326604591u,
2389456536u,
2200899649u,
2280525302u,
2578013683u,
2640855108u,
2418763421u,
2498394922u,
3769900519u,
3832873040u,
3912640137u,
3992402750u,
4088425275u,
4151408268u,
4197601365u,
4277358050u,
3334271071u,
3263032808u,
3476998961u,
3422541446u,
3585640067u,
3514407732u,
3694837229u,
3640369242u,
1762451694u,
1842216281u,
1619975040u,
1682949687u,
2047383090u,
2127137669u,
1938468188u,
2001449195u,
1325665622u,
1271206113u,
1183200824u,
1111960463u,
1543535498u,
1489069629u,
1434599652u,
1363369299u,
622672798u,
568075817u,
748617968u,
677256519u,
907627842u,
853037301u,
1067152940u,
995781531u,
51762726u,
131386257u,
177728840u,
240578815u,
269590778u,
349224269u,
429104020u,
491947555u,
4046411278u,
4126034873u,
4172115296u,
4234965207u,
3794477266u,
3874110821u,
3953728444u,
4016571915u,
3609705398u,
3555108353u,
3735388376u,
3664026991u,
3290680682u,
3236090077u,
3449943556u,
3378572211u,
3174993278u,
3120533705u,
3032266256u,
2961025959u,
2923101090u,
2868635157u,
2813903052u,
2742672763u,
2604032198u,
2683796849u,
2461293480u,
2524268063u,
2284983834u,
2364738477u,
2175806836u,
2238787779u,
1569362073u,
1498123566u,
1409854455u,
1355396672u,
1317987909u,
1246755826u,
1192025387u,
1137557660u,
2072149281u,
2135122070u,
1912620623u,
1992383480u,
1753615357u,
1816598090u,
1627664531u,
1707420964u,
295390185u,
358241886u,
404320391u,
483945776u,
43990325u,
106832002u,
186451547u,
266083308u,
932423249u,
861060070u,
1041341759u,
986742920u,
613929101u,
542559546u,
756411363u,
701822548u,
3316196985u,
3244833742u,
3425377559u,
3370778784u,
3601682597u,
3530312978u,
3744426955u,
3689838204u,
3819031489u,
3881883254u,
3928223919u,
4007849240u,
4037393693u,
4100235434u,
4180117107u,
4259748804u,
2310601993u,
2373574846u,
2151335527u,
2231098320u,
2596047829u,
2659030626u,
2470359227u,
2550115596u,
2947551409u,
2876312838u,
2788305887u,
2733848168u,
3165939309u,
3094707162u,
3040238851u,
2985771188u
};
private int int_0;
public long Value
{
get
{
return (long)(~(long)this.int_0);
}
}
public StrangeCRC()
{
this.Reset();
}
public void Reset()
{
this.int_0 = -1;
}
public void Update(int value)
{
int num = this.int_0 >> 24 ^ value;
if (num < 0)
{
num = 256 + num;
}
this.int_0 = (int)((long)((long)this.int_0 << 8) ^ (long)((ulong)StrangeCRC.uint_0[num]));
}
public void Update(byte[] buffer)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
this.Update(buffer, 0, buffer.Length);
}
public void Update(byte[] buffer, int offset, int count)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", "cannot be less than zero");
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count", "cannot be less than zero");
}
if (offset + count > buffer.Length)
{
throw new ArgumentOutOfRangeException("count");
}
for (int i = 0; i < count; i++)
{
this.Update((int)buffer[offset++]);
}
}
}
}
namespace ICSharpCode.SharpZipLib.Encryption
{
public abstract class PkzipClassic : SymmetricAlgorithm
{
public static byte[] GenerateKeys(byte[] seed)
{
if (seed == null)
{
throw new ArgumentNullException("seed");
}
if (seed.Length == 0)
{
throw new ArgumentException("Length is zero", "seed");
}
uint[] array = new uint[]
{
305419896u,
591751049u,
878082192u
};
for (int i = 0; i < seed.Length; i++)
{
array[0] = Crc32.smethod_0(array[0], seed[i]);
array[1] = array[1] + (uint)((byte)array[0]);
array[1] = array[1] * 134775813u + 1u;
array[2] = Crc32.smethod_0(array[2], (byte)(array[1] >> 24));
}
return new byte[]
{
(byte)(array[0] & 255u),
(byte)(array[0] >> 8 & 255u),
(byte)(array[0] >> 16 & 255u),
(byte)(array[0] >> 24 & 255u),
(byte)(array[1] & 255u),
(byte)(array[1] >> 8 & 255u),
(byte)(array[1] >> 16 & 255u),
(byte)(array[1] >> 24 & 255u),
(byte)(array[2] & 255u),
(byte)(array[2] >> 8 & 255u),
(byte)(array[2] >> 16 & 255u),
(byte)(array[2] >> 24 & 255u)
};
}
}
internal class Class38
{
private uint[] uint_0;
protected byte method_0()
{
uint num = (this.uint_0[2] & 65535u) | 2u;
return (byte)(num * (num ^ 1u) >> 8);
}
protected void method_1(byte[] byte_0)
{
if (byte_0 == null)
{
throw new ArgumentNullException("keyData");
}
if (byte_0.Length != 12)
{
throw new InvalidOperationException("Key length is not valid");
}
this.uint_0 = new uint[3];
this.uint_0[0] = (uint)((int)byte_0[3] << 24 | (int)byte_0[2] << 16 | (int)byte_0[1] << 8 | (int)byte_0[0]);
this.uint_0[1] = (uint)((int)byte_0[7] << 24 | (int)byte_0[6] << 16 | (int)byte_0[5] << 8 | (int)byte_0[4]);
this.uint_0[2] = (uint)((int)byte_0[11] << 24 | (int)byte_0[10] << 16 | (int)byte_0[9] << 8 | (int)byte_0[8]);
}
protected void method_2(byte byte_0)
{
this.uint_0[0] = Crc32.smethod_0(this.uint_0[0], byte_0);
this.uint_0[1] = this.uint_0[1] + (uint)((byte)this.uint_0[0]);
this.uint_0[1] = this.uint_0[1] * 134775813u + 1u;
this.uint_0[2] = Crc32.smethod_0(this.uint_0[2], (byte)(this.uint_0[1] >> 24));
}
protected void method_3()
{
this.uint_0[0] = 0u;
this.uint_0[1] = 0u;
this.uint_0[2] = 0u;
}
}
internal class Class39 : Class38, ICryptoTransform, IDisposable
{
public bool CanReuseTransform
{
get
{
return true;
}
}
public int InputBlockSize
{
get
{
return 1;
}
}
public int OutputBlockSize
{
get
{
return 1;
}
}
public bool CanTransformMultipleBlocks
{
get
{
return true;
}
}
internal Class39(byte[] byte_0)
{
base.method_1(byte_0);
}
public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
byte[] array = new byte[inputCount];
this.TransformBlock(inputBuffer, inputOffset, inputCount, array, 0);
return array;
}
public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
{
for (int i = inputOffset; i < inputOffset + inputCount; i++)
{
byte byte_ = inputBuffer[i];
outputBuffer[outputOffset++] = (inputBuffer[i] ^ base.method_0());
base.method_2(byte_);
}
return inputCount;
}
public void Dispose()
{
base.method_3();
}
}
internal class Class40 : Class38, ICryptoTransform, IDisposable
{
public bool CanReuseTransform
{
get
{
return true;
}
}
public int InputBlockSize
{
get
{
return 1;
}
}
public int OutputBlockSize
{
get
{
return 1;
}
}
public bool CanTransformMultipleBlocks
{
get
{
return true;
}
}
internal Class40(byte[] byte_0)
{
base.method_1(byte_0);
}
public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
byte[] array = new byte[inputCount];
this.TransformBlock(inputBuffer, inputOffset, inputCount, array, 0);
return array;
}
public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)
{
for (int i = inputOffset; i < inputOffset + inputCount; i++)
{
byte b = inputBuffer[i] ^ base.method_0();
outputBuffer[outputOffset++] = b;
base.method_2(b);
}
return inputCount;
}
public void Dispose()
{
base.method_3();
}
}
public sealed class PkzipClassicManaged : PkzipClassic
{
private byte[] byte_0;
public override int BlockSize
{
get
{
return 8;
}
set
{
if (value != 8)
{
throw new CryptographicException("Block size is invalid");
}
}
}
public override KeySizes[] LegalKeySizes
{
get
{
return new KeySizes[]
{
new KeySizes(96, 96, 0)
};
}
}
public override KeySizes[] LegalBlockSizes
{
get
{
return new KeySizes[]
{
new KeySizes(8, 8, 0)
};
}
}
public override byte[] Key
{
get
{
if (this.byte_0 == null)
{
this.GenerateKey();
}
return (byte[])this.byte_0.Clone();
}
set
{
if (value == null)
{
throw new ArgumentNullException("value");
}
if (value.Length != 12)
{
throw new CryptographicException("Key size is illegal");
}
this.byte_0 = (byte[])value.Clone();
}
}
public override void GenerateIV()
{
}
public override void GenerateKey()
{
this.byte_0 = new byte[12];
Random random = new Random();
random.NextBytes(this.byte_0);
}
public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV)
{
this.byte_0 = rgbKey;
return new Class39(this.get_Key());
}
public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV)
{
this.byte_0 = rgbKey;
return new Class40(this.get_Key());
}
}
}
namespace ICSharpCode.SharpZipLib.Zip.Compression.Streams
{
public class DeflaterOutputStream : Stream
{
private string string_0;
private ICryptoTransform icryptoTransform_0;
protected byte[] AESAuthCode;
private byte[] byte_0;
protected Deflater deflater_;
protected Stream baseOutputStream_;
private bool bool_0;
private bool bool_1 = true;
public bool IsStreamOwner
{
get
{
return this.bool_1;
}
set
{
this.bool_1 = value;
}
}
public bool CanPatchEntries
{
get
{
return this.baseOutputStream_.get_CanSeek();
}
}
public string Password
{
get
{
return this.string_0;
}
set
{
if (value != null && value.get_Length() == 0)
{
this.string_0 = null;
}
else
{
this.string_0 = value;
}
}
}
public override bool CanRead
{
get
{
return false;
}
}
public override bool CanSeek
{
get
{
return false;
}
}
public override bool CanWrite
{
get
{
return this.baseOutputStream_.get_CanWrite();
}
}
public override long Length
{
get
{
return this.baseOutputStream_.get_Length();
}
}
public override long Position
{
get
{
return this.baseOutputStream_.get_Position();
}
set
{
throw new NotSupportedException("Position property not supported");
}
}
public DeflaterOutputStream(Stream baseOutputStream) : this(baseOutputStream, new Deflater(), 512)
{
}
public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater) : this(baseOutputStream, deflater, 512)
{
}
public DeflaterOutputStream(Stream baseOutputStream, Deflater deflater, int bufferSize)
{
if (baseOutputStream == null)
{
throw new ArgumentNullException("baseOutputStream");
}
if (!baseOutputStream.get_CanWrite())
{
throw new ArgumentException("Must support writing", "baseOutputStream");
}
if (deflater == null)
{
throw new ArgumentNullException("deflater");
}
if (bufferSize < 512)
{
throw new ArgumentOutOfRangeException("bufferSize");
}
this.baseOutputStream_ = baseOutputStream;
this.byte_0 = new byte[bufferSize];
this.deflater_ = deflater;
}
public virtual void Finish()
{
this.deflater_.Finish();
while (!this.deflater_.IsFinished)
{
int num = this.deflater_.Deflate(this.byte_0, 0, this.byte_0.Length);
if (num <= 0)
{
break;
}
if (this.icryptoTransform_0 != null)
{
this.EncryptBlock(this.byte_0, 0, num);
}
this.baseOutputStream_.Write(this.byte_0, 0, num);
}
if (!this.deflater_.IsFinished)
{
throw new SharpZipBaseException("Can't deflate all input?");
}
this.baseOutputStream_.Flush();
if (this.icryptoTransform_0 != null)
{
this.icryptoTransform_0.Dispose();
this.icryptoTransform_0 = null;
}
}
protected void EncryptBlock(byte[] buffer, int offset, int length)
{
this.icryptoTransform_0.TransformBlock(buffer, 0, length, buffer, 0);
}
protected void InitializePassword(string password)
{
PkzipClassicManaged pkzipClassicManaged = new PkzipClassicManaged();
byte[] array = PkzipClassic.GenerateKeys(ZipConstants.ConvertToArray(password));
this.icryptoTransform_0 = pkzipClassicManaged.CreateEncryptor(array, null);
}
protected void Deflate()
{
while (!this.deflater_.IsNeedingInput)
{
int num = this.deflater_.Deflate(this.byte_0, 0, this.byte_0.Length);
if (num <= 0)
{
break;
}
if (this.icryptoTransform_0 != null)
{
this.EncryptBlock(this.byte_0, 0, num);
}
this.baseOutputStream_.Write(this.byte_0, 0, num);
}
if (!this.deflater_.IsNeedingInput)
{
throw new SharpZipBaseException("DeflaterOutputStream can't deflate all input?");
}
}
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotSupportedException("DeflaterOutputStream Seek not supported");
}
public override void SetLength(long value)
{
throw new NotSupportedException("DeflaterOutputStream SetLength not supported");
}
public override int ReadByte()
{
throw new NotSupportedException("DeflaterOutputStream ReadByte not supported");
}
public override int Read(byte[] buffer, int offset, int count)
{
throw new NotSupportedException("DeflaterOutputStream Read not supported");
}
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
throw new NotSupportedException("DeflaterOutputStream BeginRead not currently supported");
}
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
throw new NotSupportedException("BeginWrite is not supported");
}
public override void Flush()
{
this.deflater_.Flush();
this.Deflate();
this.baseOutputStream_.Flush();
}
public override void Close()
{
if (!this.bool_0)
{
this.bool_0 = true;
try
{
this.Finish();
if (this.icryptoTransform_0 != null)
{
this.method_0();
this.icryptoTransform_0.Dispose();
this.icryptoTransform_0 = null;
}
}
finally
{
if (this.bool_1)
{
this.baseOutputStream_.Close();
}
}
}
}
private void method_0()
{
}
public override void WriteByte(byte value)
{
this.Write(new byte[]
{
value
}, 0, 1);
}
public override void Write(byte[] buffer, int offset, int count)
{
this.deflater_.SetInput(buffer, offset, count);
this.Deflate();
}
}
public class InflaterInputBuffer
{
private int int_0;
private byte[] byte_0;
private int int_1;
private byte[] byte_1;
private byte[] byte_2;
private int int_2;
private ICryptoTransform icryptoTransform_0;
private Stream stream_0;
public int RawLength
{
get
{
return this.int_0;
}
}
public byte[] RawData
{
get
{
return this.byte_0;
}
}
public int ClearTextLength
{
get
{
return this.int_1;
}
}
public byte[] ClearText
{
get
{
return this.byte_1;
}
}
public int Available
{
get
{
return this.int_2;
}
set
{
this.int_2 = value;
}
}
public ICryptoTransform CryptoTransform
{
set
{
this.icryptoTransform_0 = value;
if (this.icryptoTransform_0 != null)
{
if (this.byte_0 == this.byte_1)
{
if (this.byte_2 == null)
{
this.byte_2 = new byte[this.byte_0.Length];
}
this.byte_1 = this.byte_2;
}
this.int_1 = this.int_0;
if (this.int_2 > 0)
{
this.icryptoTransform_0.TransformBlock(this.byte_0, this.int_0 - this.int_2, this.int_2, this.byte_1, this.int_0 - this.int_2);
}
}
else
{
this.byte_1 = this.byte_0;
this.int_1 = this.int_0;
}
}
}
public InflaterInputBuffer(Stream stream) : this(stream, 4096)
{
}
public InflaterInputBuffer(Stream stream, int bufferSize)
{
this.stream_0 = stream;
if (bufferSize < 1024)
{
bufferSize = 1024;
}
this.byte_0 = new byte[bufferSize];
this.byte_1 = this.byte_0;
}
public void SetInflaterInput(Inflater inflater)
{
if (this.int_2 > 0)
{
inflater.SetInput(this.byte_1, this.int_1 - this.int_2, this.int_2);
this.int_2 = 0;
}
}
public void Fill()
{
this.int_0 = 0;
int num;
for (int i = this.byte_0.Length; i > 0; i -= num)
{
num = this.stream_0.Read(this.byte_0, this.int_0, i);
if (num <= 0)
{
break;
}
this.int_0 += num;
}
if (this.icryptoTransform_0 != null)
{
this.int_1 = this.icryptoTransform_0.TransformBlock(this.byte_0, 0, this.int_0, this.byte_1, 0);
}
else
{
this.int_1 = this.int_0;
}
this.int_2 = this.int_1;
}
public int ReadRawBuffer(byte[] buffer)
{
return this.ReadRawBuffer(buffer, 0, buffer.Length);
}
public int ReadRawBuffer(byte[] outBuffer, int offset, int length)
{
if (length < 0)
{
throw new ArgumentOutOfRangeException("length");
}
int num = offset;
int i = length;
int result;
while (i > 0)
{
if (this.int_2 <= 0)
{
this.Fill();
if (this.int_2 <= 0)
{
result = 0;
return result;
}
}
int num2 = Math.Min(i, this.int_2);
Array.Copy(this.byte_0, this.int_0 - this.int_2, outBuffer, num, num2);
num += num2;
i -= num2;
this.int_2 -= num2;
}
result = length;
return result;
}
public int ReadClearTextBuffer(byte[] outBuffer, int offset, int length)
{
if (length < 0)
{
throw new ArgumentOutOfRangeException("length");
}
int num = offset;
int i = length;
int result;
while (i > 0)
{
if (this.int_2 <= 0)
{
this.Fill();
if (this.int_2 <= 0)
{
result = 0;
return result;
}
}
int num2 = Math.Min(i, this.int_2);
Array.Copy(this.byte_1, this.int_1 - this.int_2, outBuffer, num, num2);
num += num2;
i -= num2;
this.int_2 -= num2;
}
result = length;
return result;
}
public int ReadLeByte()
{
if (this.int_2 <= 0)
{
this.Fill();
if (this.int_2 <= 0)
{
throw new ZipException("EOF in header");
}
}
byte result = this.byte_0[this.int_0 - this.int_2];
this.int_2--;
return (int)result;
}
public int ReadLeShort()
{
return this.ReadLeByte() | this.ReadLeByte() << 8;
}
public int ReadLeInt()
{
return this.ReadLeShort() | this.ReadLeShort() << 16;
}
public long ReadLeLong()
{
return (long)((ulong)this.ReadLeInt() | (ulong)((ulong)((long)this.ReadLeInt()) << 32));
}
}
public class InflaterInputStream : Stream
{
protected Inflater inflater_0;
protected InflaterInputBuffer inputBuffer;
private Stream stream_0;
protected long csize;
private bool bool_0;
private bool bool_1 = true;
public bool IsStreamOwner
{
get
{
return this.bool_1;
}
set
{
this.bool_1 = value;
}
}
public virtual int Available
{
get
{
return this.inflater_0.IsFinished ? 0 : 1;
}
}
public override bool CanRead
{
get
{
return this.stream_0.get_CanRead();
}
}
public override bool CanSeek
{
get
{
return false;
}
}
public override bool CanWrite
{
get
{
return false;
}
}
public override long Length
{
get
{
return (long)this.inputBuffer.RawLength;
}
}
public override long Position
{
get
{
return this.stream_0.get_Position();
}
set
{
throw new NotSupportedException("InflaterInputStream Position not supported");
}
}
public InflaterInputStream(Stream baseInputStream) : this(baseInputStream, new Inflater(), 4096)
{
}
public InflaterInputStream(Stream baseInputStream, Inflater inflater_1) : this(baseInputStream, inflater_1, 4096)
{
}
public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize)
{
if (baseInputStream == null)
{
throw new ArgumentNullException("baseInputStream");
}
if (inflater == null)
{
throw new ArgumentNullException("inflater");
}
if (bufferSize <= 0)
{
throw new ArgumentOutOfRangeException("bufferSize");
}
this.stream_0 = baseInputStream;
this.inflater_0 = inflater;
this.inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize);
}
public long Skip(long count)
{
if (count <= 0L)
{
throw new ArgumentOutOfRangeException("count");
}
long result;
if (this.stream_0.get_CanSeek())
{
this.stream_0.Seek(count, 1);
result = count;
}
else
{
int num = 2048;
if (count < 2048L)
{
num = (int)count;
}
byte[] array = new byte[num];
int num2 = 1;
long num3 = count;
while (num3 > 0L && num2 > 0)
{
if (num3 < (long)num)
{
num = (int)num3;
}
num2 = this.stream_0.Read(array, 0, num);
num3 -= (long)num2;
}
result = count - num3;
}
return result;
}
protected void StopDecrypting()
{
this.inputBuffer.CryptoTransform = null;
}
protected void Fill()
{
if (this.inputBuffer.Available <= 0)
{
this.inputBuffer.Fill();
if (this.inputBuffer.Available <= 0)
{
throw new SharpZipBaseException("Unexpected EOF");
}
}
this.inputBuffer.SetInflaterInput(this.inflater_0);
}
public override void Flush()
{
this.stream_0.Flush();
}
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotSupportedException("Seek not supported");
}
public override void SetLength(long value)
{
throw new NotSupportedException("InflaterInputStream SetLength not supported");
}
public override void Write(byte[] buffer, int offset, int count)
{
throw new NotSupportedException("InflaterInputStream Write not supported");
}
public override void WriteByte(byte value)
{
throw new NotSupportedException("InflaterInputStream WriteByte not supported");
}
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
{
throw new NotSupportedException("InflaterInputStream BeginWrite not supported");
}
public override void Close()
{
if (!this.bool_0)
{
this.bool_0 = true;
if (this.bool_1)
{
this.stream_0.Close();
}
}
}
public override int Read(byte[] buffer, int offset, int count)
{
if (this.inflater_0.IsNeedingDictionary)
{
throw new SharpZipBaseException("Need a dictionary");
}
int num = count;
while (true)
{
int num2 = this.inflater_0.Inflate(buffer, offset, num);
offset += num2;
num -= num2;
if (num == 0 || this.inflater_0.IsFinished)
{
goto IL_83;
}
if (this.inflater_0.IsNeedingInput)
{
this.Fill();
}
else
{
if (num2 == 0)
{
break;
}
}
}
throw new ZipException("Dont know what to do");
IL_83:
return count - num;
}
}
public class OutputWindow
{
private const int int_0 = 32768;
private const int int_1 = 32767;
private byte[] byte_0 = new byte[32768];
private int int_2;
private int int_3;
public void Write(int value)
{
if (this.int_3++ == 32768)
{
throw new InvalidOperationException("Window full");
}
this.byte_0[this.int_2++] = (byte)value;
this.int_2 &= 32767;
}
private void method_0(int int_4, int int_5, int int_6)
{
while (int_5-- > 0)
{
this.byte_0[this.int_2++] = this.byte_0[int_4++];
this.int_2 &= 32767;
int_4 &= 32767;
}
}
public void Repeat(int length, int distance)
{
if ((this.int_3 += length) > 32768)
{
throw new InvalidOperationException("Window full");
}
int num = this.int_2 - distance & 32767;
int num2 = 32768 - length;
if (num <= num2 && this.int_2 < num2)
{
if (length <= distance)
{
Array.Copy(this.byte_0, num, this.byte_0, this.int_2, length);
this.int_2 += length;
}
else
{
while (length-- > 0)
{
this.byte_0[this.int_2++] = this.byte_0[num++];
}
}
}
else
{
this.method_0(num, length, distance);
}
}
public int CopyStored(StreamManipulator input, int length)
{
length = Math.Min(Math.Min(length, 32768 - this.int_3), input.AvailableBytes);
int num = 32768 - this.int_2;
int num2;
if (length > num)
{
num2 = input.CopyBytes(this.byte_0, this.int_2, num);
if (num2 == num)
{
num2 += input.CopyBytes(this.byte_0, 0, length - num);
}
}
else
{
num2 = input.CopyBytes(this.byte_0, this.int_2, length);
}
this.int_2 = (this.int_2 + num2 & 32767);
this.int_3 += num2;
return num2;
}
public void CopyDict(byte[] dictionary, int offset, int length)
{
if (dictionary == null)
{
throw new ArgumentNullException("dictionary");
}
if (this.int_3 > 0)
{
throw new InvalidOperationException();
}
if (length > 32768)
{
offset += length - 32768;
length = 32768;
}
Array.Copy(dictionary, offset, this.byte_0, 0, length);
this.int_2 = (length & 32767);
}
public int GetFreeSpace()
{
return 32768 - this.int_3;
}
public int GetAvailable()
{
return this.int_3;
}
public int CopyOutput(byte[] output, int offset, int int_4)
{
int num = this.int_2;
if (int_4 > this.int_3)
{
int_4 = this.int_3;
}
else
{
num = (this.int_2 - this.int_3 + int_4 & 32767);
}
int num2 = int_4;
int num3 = int_4 - num;
if (num3 > 0)
{
Array.Copy(this.byte_0, 32768 - num3, output, offset, num3);
offset += num3;
int_4 = num;
}
Array.Copy(this.byte_0, num - int_4, output, offset, int_4);
this.int_3 -= num2;
if (this.int_3 < 0)
{
throw new InvalidOperationException();
}
return num2;
}
public void Reset()
{
this.int_2 = 0;
this.int_3 = 0;
}
}
public class StreamManipulator
{
private byte[] byte_0;
private int int_0;
private int int_1;
private uint uint_0;
private int int_2;
public int AvailableBits
{
get
{
return this.int_2;
}
}
public int AvailableBytes
{
get
{
return this.int_1 - this.int_0 + (this.int_2 >> 3);
}
}
public bool IsNeedingInput
{
get
{
return this.int_0 == this.int_1;
}
}
public int PeekBits(int bitCount)
{
int result;
if (this.int_2 < bitCount)
{
if (this.int_0 == this.int_1)
{
result = -1;
return result;
}
this.uint_0 |= (uint)((uint)((int)(this.byte_0[this.int_0++] & 255) | (int)(this.byte_0[this.int_0++] & 255) << 8) << this.int_2);
this.int_2 += 16;
}
result = (int)((ulong)this.uint_0 & (ulong)((long)((1 << bitCount) - 1)));
return result;
}
public void DropBits(int bitCount)
{
this.uint_0 >>= bitCount;
this.int_2 -= bitCount;
}
public int GetBits(int bitCount)
{
int num = this.PeekBits(bitCount);
if (num >= 0)
{
this.DropBits(bitCount);
}
return num;
}
public void SkipToByteBoundary()
{
this.uint_0 >>= (this.int_2 & 7);
this.int_2 &= -8;
}
public int CopyBytes(byte[] output, int offset, int length)
{
if (length < 0)
{
throw new ArgumentOutOfRangeException("length");
}
if ((this.int_2 & 7) != 0)
{
throw new InvalidOperationException("Bit buffer is not byte aligned!");
}
int num = 0;
while (this.int_2 > 0 && length > 0)
{
output[offset++] = (byte)this.uint_0;
this.uint_0 >>= 8;
this.int_2 -= 8;
length--;
num++;
}
int result;
if (length == 0)
{
result = num;
}
else
{
int num2 = this.int_1 - this.int_0;
if (length > num2)
{
length = num2;
}
Array.Copy(this.byte_0, this.int_0, output, offset, length);
this.int_0 += length;
if ((this.int_0 - this.int_1 & 1) != 0)
{
this.uint_0 = (uint)(this.byte_0[this.int_0++] & 255);
this.int_2 = 8;
}
result = num + length;
}
return result;
}
public void Reset()
{
this.uint_0 = 0u;
this.int_2 = 0;
this.int_1 = 0;
this.int_0 = 0;
}
public void SetInput(byte[] buffer, int offset, int count)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", "Cannot be negative");
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count", "Cannot be negative");
}
if (this.int_0 < this.int_1)
{
throw new InvalidOperationException("Old input was not completely processed");
}
int num = offset + count;
if (offset > num || num > buffer.Length)
{
throw new ArgumentOutOfRangeException("count");
}
if ((count & 1) != 0)
{
this.uint_0 |= (uint)((uint)(buffer[offset++] & 255) << this.int_2);
this.int_2 += 8;
}
this.byte_0 = buffer;
this.int_0 = offset;
this.int_1 = num;
}
}
}
[CompilerGenerated]
internal class Class41
{
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 1024)]
private struct Struct48
{
}
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 12)]
private struct Struct49
{
}
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 40)]
private struct Struct50
{
}
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 76)]
private struct Struct51
{
}
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 16)]
private struct Struct52
{
}
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 116)]
private struct Struct53
{
}
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 120)]
private struct Struct54
{
}
internal static Class41.Struct48 struct48_0;
internal static Class41.Struct48 struct48_1;
internal static Class41.Struct49 struct49_0;
internal static Class41.Struct50 struct50_0;
internal static Class41.Struct50 struct50_1;
internal static Class41.Struct50 struct50_2;
internal static Class41.Struct50 struct50_3;
internal static Class41.Struct50 struct50_4;
internal static Class41.Struct51 struct51_0;
internal static Class41.Struct52 struct52_0;
internal static Class41.Struct53 struct53_0;
internal static Class41.Struct53 struct53_1;
internal static Class41.Struct54 struct54_0;
internal static Class41.Struct54 struct54_1;
internal static Class41.Struct49 struct49_1;
internal static Class41.Struct49 struct49_2;
internal static Class41.Struct51 struct51_1;
}
namespace ICSharpCode.SharpZipLib
{
public class SharpZipBaseException : Exception
{
public SharpZipBaseException()
{
}
public SharpZipBaseException(string message) : base(message)
{
}
public SharpZipBaseException(string message, Exception innerException) : base(message, innerException)
{
}
}
}
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
public class Deflater
{
public const int BEST_COMPRESSION = 9;
public const int BEST_SPEED = 1;
public const int DEFAULT_COMPRESSION = -1;
public const int NO_COMPRESSION = 0;
public const int DEFLATED = 8;
private const int int_0 = 1;
private const int int_1 = 4;
private const int int_2 = 8;
private const int int_3 = 0;
private const int int_4 = 1;
private const int int_5 = 16;
private const int int_6 = 20;
private const int int_7 = 28;
private const int int_8 = 30;
private const int int_9 = 127;
private int int_10;
private bool bool_0;
private int int_11;
private long long_0;
private DeflaterPending deflaterPending_0;
private DeflaterEngine deflaterEngine_0;
public int Adler
{
get
{
return this.deflaterEngine_0.Adler;
}
}
public long TotalIn
{
get
{
return this.deflaterEngine_0.TotalIn;
}
}
public long TotalOut
{
get
{
return this.long_0;
}
}
public bool IsFinished
{
get
{
return this.int_11 == 30 && this.deflaterPending_0.IsFlushed;
}
}
public bool IsNeedingInput
{
get
{
return this.deflaterEngine_0.NeedsInput();
}
}
public Deflater() : this(-1, false)
{
}
public Deflater(int level) : this(level, false)
{
}
public Deflater(int level, bool noZlibHeaderOrFooter)
{
if (level == -1)
{
level = 6;
}
else
{
if (level < 0 || level > 9)
{
throw new ArgumentOutOfRangeException("level");
}
}
this.deflaterPending_0 = new DeflaterPending();
this.deflaterEngine_0 = new DeflaterEngine(this.deflaterPending_0);
this.bool_0 = noZlibHeaderOrFooter;
this.SetStrategy(DeflateStrategy.Default);
this.SetLevel(level);
this.Reset();
}
public void Reset()
{
this.int_11 = (this.bool_0 ? 16 : 0);
this.long_0 = 0L;
this.deflaterPending_0.Reset();
this.deflaterEngine_0.Reset();
}
public void Flush()
{
this.int_11 |= 4;
}
public void Finish()
{
this.int_11 |= 12;
}
public void SetInput(byte[] input)
{
this.SetInput(input, 0, input.Length);
}
public void SetInput(byte[] input, int offset, int count)
{
if ((this.int_11 & 8) != 0)
{
throw new InvalidOperationException("Finish() already called");
}
this.deflaterEngine_0.SetInput(input, offset, count);
}
public void SetLevel(int level)
{
if (level == -1)
{
level = 6;
}
else
{
if (level < 0 || level > 9)
{
throw new ArgumentOutOfRangeException("level");
}
}
if (this.int_10 != level)
{
this.int_10 = level;
this.deflaterEngine_0.SetLevel(level);
}
}
public int GetLevel()
{
return this.int_10;
}
public void SetStrategy(DeflateStrategy strategy)
{
this.deflaterEngine_0.Strategy = strategy;
}
public int Deflate(byte[] output)
{
return this.Deflate(output, 0, output.Length);
}
public int Deflate(byte[] output, int offset, int length)
{
int num = length;
if (this.int_11 == 127)
{
throw new InvalidOperationException("Deflater closed");
}
if (this.int_11 < 16)
{
int num2 = 30720;
int num3 = this.int_10 - 1 >> 1;
if (num3 < 0 || num3 > 3)
{
num3 = 3;
}
num2 |= num3 << 6;
if ((this.int_11 & 1) != 0)
{
num2 |= 32;
}
num2 += 31 - num2 % 31;
this.deflaterPending_0.WriteShortMSB(num2);
if ((this.int_11 & 1) != 0)
{
int adler = this.deflaterEngine_0.Adler;
this.deflaterEngine_0.ResetAdler();
this.deflaterPending_0.WriteShortMSB(adler >> 16);
this.deflaterPending_0.WriteShortMSB(adler & 65535);
}
this.int_11 = (16 | (this.int_11 & 12));
}
while (true)
{
int num4 = this.deflaterPending_0.Flush(output, offset, length);
offset += num4;
this.long_0 += (long)num4;
length -= num4;
if (length == 0 || this.int_11 == 30)
{
break;
}
if (!this.deflaterEngine_0.Deflate((this.int_11 & 4) != 0, (this.int_11 & 8) != 0))
{
if (this.int_11 == 16)
{
goto IL_226;
}
if (this.int_11 == 20)
{
if (this.int_10 != 0)
{
for (int i = 8 + (-this.deflaterPending_0.BitCount & 7); i > 0; i -= 10)
{
this.deflaterPending_0.WriteBits(2, 10);
}
}
this.int_11 = 16;
}
else
{
if (this.int_11 == 28)
{
this.deflaterPending_0.AlignToByte();
if (!this.bool_0)
{
int adler2 = this.deflaterEngine_0.Adler;
this.deflaterPending_0.WriteShortMSB(adler2 >> 16);
this.deflaterPending_0.WriteShortMSB(adler2 & 65535);
}
this.int_11 = 30;
}
}
}
}
int result = num - length;
return result;
IL_226:
result = num - length;
return result;
}
public void SetDictionary(byte[] dictionary)
{
this.SetDictionary(dictionary, 0, dictionary.Length);
}
public void SetDictionary(byte[] dictionary, int index, int count)
{
if (this.int_11 != 0)
{
throw new InvalidOperationException();
}
this.int_11 = 1;
this.deflaterEngine_0.SetDictionary(dictionary, index, count);
}
}
public class DeflaterConstants
{
public const bool DEBUGGING = false;
public const int STORED_BLOCK = 0;
public const int STATIC_TREES = 1;
public const int DYN_TREES = 2;
public const int PRESET_DICT = 32;
public const int DEFAULT_MEM_LEVEL = 8;
public const int MAX_MATCH = 258;
public const int MIN_MATCH = 3;
public const int MAX_WBITS = 15;
public const int WSIZE = 32768;
public const int WMASK = 32767;
public const int HASH_BITS = 15;
public const int HASH_SIZE = 32768;
public const int HASH_MASK = 32767;
public const int HASH_SHIFT = 5;
public const int MIN_LOOKAHEAD = 262;
public const int MAX_DIST = 32506;
public const int PENDING_BUF_SIZE = 65536;
public const int DEFLATE_STORED = 0;
public const int DEFLATE_FAST = 1;
public const int DEFLATE_SLOW = 2;
public static int MAX_BLOCK_SIZE = Math.Min(65535, 65531);
public static int[] GOOD_LENGTH = new int[]
{
0,
4,
4,
4,
4,
8,
8,
8,
32,
32
};
public static int[] MAX_LAZY = new int[]
{
0,
4,
5,
6,
4,
16,
16,
32,
128,
258
};
public static int[] NICE_LENGTH = new int[]
{
0,
8,
16,
32,
16,
32,
128,
128,
258,
258
};
public static int[] MAX_CHAIN = new int[]
{
0,
4,
8,
32,
16,
32,
128,
256,
1024,
4096
};
public static int[] COMPR_FUNC = new int[]
{
0,
1,
1,
1,
1,
2,
2,
2,
2,
2
};
}
public enum DeflateStrategy
{
Default,
Filtered,
HuffmanOnly
}
public class DeflaterEngine : DeflaterConstants
{
private const int int_0 = 4096;
private int int_1;
private short[] short_0;
private short[] short_1;
private int int_2;
private int int_3;
private bool bool_0;
private int int_4;
private int int_5;
private int int_6;
private byte[] byte_0;
private DeflateStrategy deflateStrategy_0;
private int int_7;
private int int_8;
private int int_9;
private int int_10;
private int int_11;
private byte[] byte_1;
private long long_0;
private int int_12;
private int int_13;
private DeflaterPending deflaterPending_0;
private DeflaterHuffman deflaterHuffman_0;
private Adler32 adler32_0;
public int Adler
{
get
{
return (int)this.adler32_0.Value;
}
}
public long TotalIn
{
get
{
return this.long_0;
}
}
public DeflateStrategy Strategy
{
get
{
return this.deflateStrategy_0;
}
set
{
this.deflateStrategy_0 = value;
}
}
public DeflaterEngine(DeflaterPending pending)
{
this.deflaterPending_0 = pending;
this.deflaterHuffman_0 = new DeflaterHuffman(pending);
this.adler32_0 = new Adler32();
this.byte_0 = new byte[65536];
this.short_0 = new short[32768];
this.short_1 = new short[32768];
this.int_5 = 1;
this.int_4 = 1;
}
public bool Deflate(bool flush, bool finish)
{
while (true)
{
this.FillWindow();
bool bool_ = flush && this.int_12 == this.int_13;
bool flag;
switch (this.int_11)
{
case 0:
flag = this.method_4(bool_, finish);
goto IL_44;
case 1:
flag = this.method_5(bool_, finish);
goto IL_44;
case 2:
flag = this.method_6(bool_, finish);
goto IL_44;
}
break;
IL_44:
if (!this.deflaterPending_0.IsFlushed || !flag)
{
return flag;
}
}
throw new InvalidOperationException("unknown compressionFunction");
}
public void SetInput(byte[] buffer, int offset, int count)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset");
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count");
}
if (this.int_12 < this.int_13)
{
throw new InvalidOperationException("Old input was not completely processed");
}
int num = offset + count;
if (offset > num || num > buffer.Length)
{
throw new ArgumentOutOfRangeException("count");
}
this.byte_1 = buffer;
this.int_12 = offset;
this.int_13 = num;
}
public bool NeedsInput()
{
return this.int_13 == this.int_12;
}
public void SetDictionary(byte[] buffer, int offset, int length)
{
this.adler32_0.Update(buffer, offset, length);
if (length >= 3)
{
if (length > 32506)
{
offset += length - 32506;
length = 32506;
}
Array.Copy(buffer, offset, this.byte_0, this.int_5, length);
this.method_0();
length--;
while (--length > 0)
{
this.method_1();
this.int_5++;
}
this.int_5 += 2;
this.int_4 = this.int_5;
}
}
public void Reset()
{
this.deflaterHuffman_0.Reset();
this.adler32_0.Reset();
this.int_5 = 1;
this.int_4 = 1;
this.int_6 = 0;
this.long_0 = 0L;
this.bool_0 = false;
this.int_3 = 2;
for (int i = 0; i < 32768; i++)
{
this.short_0[i] = 0;
}
for (int i = 0; i < 32768; i++)
{
this.short_1[i] = 0;
}
}
public void ResetAdler()
{
this.adler32_0.Reset();
}
public void SetLevel(int level)
{
if (level < 0 || level > 9)
{
throw new ArgumentOutOfRangeException("level");
}
this.int_10 = DeflaterConstants.GOOD_LENGTH[level];
this.int_8 = DeflaterConstants.MAX_LAZY[level];
this.int_9 = DeflaterConstants.NICE_LENGTH[level];
this.int_7 = DeflaterConstants.MAX_CHAIN[level];
if (DeflaterConstants.COMPR_FUNC[level] != this.int_11)
{
switch (this.int_11)
{
case 0:
if (this.int_5 > this.int_4)
{
this.deflaterHuffman_0.FlushStoredBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, false);
this.int_4 = this.int_5;
}
this.method_0();
break;
case 1:
if (this.int_5 > this.int_4)
{
this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, false);
this.int_4 = this.int_5;
}
break;
case 2:
if (this.bool_0)
{
this.deflaterHuffman_0.TallyLit((int)(this.byte_0[this.int_5 - 1] & 255));
}
if (this.int_5 > this.int_4)
{
this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, false);
this.int_4 = this.int_5;
}
this.bool_0 = false;
this.int_3 = 2;
break;
}
this.int_11 = DeflaterConstants.COMPR_FUNC[level];
}
}
public void FillWindow()
{
if (this.int_5 >= 65274)
{
this.method_2();
}
while (this.int_6 < 262 && this.int_12 < this.int_13)
{
int num = 65536 - this.int_6 - this.int_5;
if (num > this.int_13 - this.int_12)
{
num = this.int_13 - this.int_12;
}
Array.Copy(this.byte_1, this.int_12, this.byte_0, this.int_5 + this.int_6, num);
this.adler32_0.Update(this.byte_1, this.int_12, num);
this.int_12 += num;
this.long_0 += (long)num;
this.int_6 += num;
}
if (this.int_6 >= 3)
{
this.method_0();
}
}
private void method_0()
{
this.int_1 = ((int)this.byte_0[this.int_5] << 5 ^ (int)this.byte_0[this.int_5 + 1]);
}
private int method_1()
{
int num = (this.int_1 << 5 ^ (int)this.byte_0[this.int_5 + 2]) & 32767;
short num2 = this.short_1[this.int_5 & 32767] = this.short_0[num];
this.short_0[num] = (short)this.int_5;
this.int_1 = num;
return (int)num2 & 65535;
}
private void method_2()
{
Array.Copy(this.byte_0, 32768, this.byte_0, 0, 32768);
this.int_2 -= 32768;
this.int_5 -= 32768;
this.int_4 -= 32768;
for (int i = 0; i < 32768; i++)
{
int num = (int)this.short_0[i] & 65535;
this.short_0[i] = (short)((num >= 32768) ? (num - 32768) : 0);
}
for (int i = 0; i < 32768; i++)
{
int num = (int)this.short_1[i] & 65535;
this.short_1[i] = (short)((num >= 32768) ? (num - 32768) : 0);
}
}
private bool method_3(int int_14)
{
int num = this.int_7;
int num2 = this.int_9;
short[] array = this.short_1;
int num3 = this.int_5;
int num4 = this.int_5 + this.int_3;
int num5 = Math.Max(this.int_3, 2);
int num6 = Math.Max(this.int_5 - 32506, 0);
int num7 = this.int_5 + 258 - 1;
byte b = this.byte_0[num4 - 1];
byte b2 = this.byte_0[num4];
if (num5 >= this.int_10)
{
num >>= 2;
}
if (num2 > this.int_6)
{
num2 = this.int_6;
}
do
{
if (this.byte_0[int_14 + num5] == b2 && this.byte_0[int_14 + num5 - 1] == b && this.byte_0[int_14] == this.byte_0[num3] && this.byte_0[int_14 + 1] == this.byte_0[num3 + 1])
{
int num8 = int_14 + 2;
num3 += 2;
while (this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && this.byte_0[++num3] == this.byte_0[++num8] && num3 < num7)
{
}
if (num3 > num4)
{
this.int_2 = int_14;
num4 = num3;
num5 = num3 - this.int_5;
if (num5 >= num2)
{
break;
}
b = this.byte_0[num4 - 1];
b2 = this.byte_0[num4];
}
num3 = this.int_5;
}
}
while ((int_14 = ((int)array[int_14 & 32767] & 65535)) > num6 && --num != 0);
this.int_3 = Math.Min(num5, this.int_6);
return this.int_3 >= 3;
}
private bool method_4(bool bool_1, bool bool_2)
{
bool result;
if (!bool_1 && this.int_6 == 0)
{
result = false;
}
else
{
this.int_5 += this.int_6;
this.int_6 = 0;
int num = this.int_5 - this.int_4;
if (num >= DeflaterConstants.MAX_BLOCK_SIZE || (this.int_4 < 32768 && num >= 32506) || bool_1)
{
bool flag = bool_2;
if (num > DeflaterConstants.MAX_BLOCK_SIZE)
{
num = DeflaterConstants.MAX_BLOCK_SIZE;
flag = false;
}
this.deflaterHuffman_0.FlushStoredBlock(this.byte_0, this.int_4, num, flag);
this.int_4 += num;
result = !flag;
}
else
{
result = true;
}
}
return result;
}
private bool method_5(bool bool_1, bool bool_2)
{
bool result;
if (this.int_6 < 262 && !bool_1)
{
result = false;
}
else
{
while (this.int_6 >= 262 || bool_1)
{
if (this.int_6 == 0)
{
this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, bool_2);
this.int_4 = this.int_5;
result = false;
return result;
}
if (this.int_5 > 65274)
{
this.method_2();
}
int num;
if (this.int_6 >= 3 && (num = this.method_1()) != 0 && this.deflateStrategy_0 != DeflateStrategy.HuffmanOnly && this.int_5 - num <= 32506 && this.method_3(num))
{
bool flag = this.deflaterHuffman_0.TallyDist(this.int_5 - this.int_2, this.int_3);
this.int_6 -= this.int_3;
if (this.int_3 <= this.int_8 && this.int_6 >= 3)
{
while (--this.int_3 > 0)
{
this.int_5++;
this.method_1();
}
this.int_5++;
}
else
{
this.int_5 += this.int_3;
if (this.int_6 >= 2)
{
this.method_0();
}
}
this.int_3 = 2;
if (!flag)
{
continue;
}
}
else
{
this.deflaterHuffman_0.TallyLit((int)(this.byte_0[this.int_5] & 255));
this.int_5++;
this.int_6--;
}
if (this.deflaterHuffman_0.IsFull())
{
bool flag2 = bool_2 && this.int_6 == 0;
this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, flag2);
this.int_4 = this.int_5;
result = !flag2;
return result;
}
}
result = true;
}
return result;
}
private bool method_6(bool bool_1, bool bool_2)
{
bool result;
if (this.int_6 < 262 && !bool_1)
{
result = false;
}
else
{
while (this.int_6 >= 262 || bool_1)
{
if (this.int_6 == 0)
{
if (this.bool_0)
{
this.deflaterHuffman_0.TallyLit((int)(this.byte_0[this.int_5 - 1] & 255));
}
this.bool_0 = false;
this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, this.int_5 - this.int_4, bool_2);
this.int_4 = this.int_5;
result = false;
return result;
}
if (this.int_5 >= 65274)
{
this.method_2();
}
int num = this.int_2;
int num2 = this.int_3;
if (this.int_6 >= 3)
{
int num3 = this.method_1();
if (this.deflateStrategy_0 != DeflateStrategy.HuffmanOnly && num3 != 0 && this.int_5 - num3 <= 32506 && this.method_3(num3) && this.int_3 <= 5 && (this.deflateStrategy_0 == DeflateStrategy.Filtered || (this.int_3 == 3 && this.int_5 - this.int_2 > 4096)))
{
this.int_3 = 2;
}
}
if (num2 >= 3 && this.int_3 <= num2)
{
this.deflaterHuffman_0.TallyDist(this.int_5 - 1 - num, num2);
num2 -= 2;
do
{
this.int_5++;
this.int_6--;
if (this.int_6 >= 3)
{
this.method_1();
}
}
while (--num2 > 0);
this.int_5++;
this.int_6--;
this.bool_0 = false;
this.int_3 = 2;
}
else
{
if (this.bool_0)
{
this.deflaterHuffman_0.TallyLit((int)(this.byte_0[this.int_5 - 1] & 255));
}
this.bool_0 = true;
this.int_5++;
this.int_6--;
}
if (this.deflaterHuffman_0.IsFull())
{
int num4 = this.int_5 - this.int_4;
if (this.bool_0)
{
num4--;
}
bool flag = bool_2 && this.int_6 == 0 && !this.bool_0;
this.deflaterHuffman_0.FlushBlock(this.byte_0, this.int_4, num4, flag);
this.int_4 += num4;
result = !flag;
return result;
}
}
result = true;
}
return result;
}
}
public class DeflaterHuffman
{
private class Class42
{
public short[] short_0;
public byte[] byte_0;
public int int_0;
public int int_1;
private short[] short_1;
private int[] int_2;
private int int_3;
private DeflaterHuffman deflaterHuffman_0;
public Class42(DeflaterHuffman deflaterHuffman_1, int int_4, int int_5, int int_6)
{
this.deflaterHuffman_0 = deflaterHuffman_1;
this.int_0 = int_5;
this.int_3 = int_6;
this.short_0 = new short[int_4];
this.int_2 = new int[int_6];
}
public void method_0()
{
for (int i = 0; i < this.short_0.Length; i++)
{
this.short_0[i] = 0;
}
this.short_1 = null;
this.byte_0 = null;
}
public void method_1(int int_4)
{
this.deflaterHuffman_0.pending.WriteBits((int)this.short_1[int_4] & 65535, (int)this.byte_0[int_4]);
}
public void method_2()
{
bool flag = true;
for (int i = 0; i < this.short_0.Length; i++)
{
if (this.short_0[i] != 0)
{
flag = false;
}
}
if (!flag)
{
throw new SharpZipBaseException("!Empty");
}
}
public void method_3(short[] short_2, byte[] byte_1)
{
this.short_1 = short_2;
this.byte_0 = byte_1;
}
public void method_4()
{
int[] array = new int[this.int_3];
int num = 0;
this.short_1 = new short[this.short_0.Length];
for (int i = 0; i < this.int_3; i++)
{
array[i] = num;
num += this.int_2[i] << 15 - i;
}
for (int j = 0; j < this.int_1; j++)
{
int i = (int)this.byte_0[j];
if (i > 0)
{
this.short_1[j] = DeflaterHuffman.BitReverse(array[i - 1]);
array[i - 1] += 1 << 16 - i;
}
}
}
public void method_5()
{
int num = this.short_0.Length;
int[] array = new int[num];
int i = 0;
int num2 = 0;
for (int j = 0; j < num; j++)
{
int num3 = (int)this.short_0[j];
if (num3 != 0)
{
int num4 = i++;
int num5;
while (num4 > 0 && (int)this.short_0[array[num5 = (num4 - 1) / 2]] > num3)
{
array[num4] = array[num5];
num4 = num5;
}
array[num4] = j;
num2 = j;
}
}
while (i < 2)
{
int num6 = (num2 < 2) ? (++num2) : 0;
array[i++] = num6;
}
this.int_1 = Math.Max(num2 + 1, this.int_0);
int num7 = i;
int[] array2 = new int[4 * i - 2];
int[] array3 = new int[2 * i - 1];
int num8 = num7;
for (int k = 0; k < i; k++)
{
int num6 = array[k];
array2[2 * k] = num6;
array2[2 * k + 1] = -1;
array3[k] = (int)this.short_0[num6] << 8;
array[k] = k;
}
do
{
int num9 = array[0];
int num10 = array[--i];
int num5 = 0;
int l;
for (l = 1; l < i; l = l * 2 + 1)
{
if (l + 1 < i && array3[array[l]] > array3[array[l + 1]])
{
l++;
}
array[num5] = array[l];
num5 = l;
}
int num11 = array3[num10];
while ((l = num5) > 0 && array3[array[num5 = (l - 1) / 2]] > num11)
{
array[l] = array[num5];
}
array[l] = num10;
int num12 = array[0];
num10 = num8++;
array2[2 * num10] = num9;
array2[2 * num10 + 1] = num12;
int num13 = Math.Min(array3[num9] & 255, array3[num12] & 255);
num11 = (array3[num10] = array3[num9] + array3[num12] - num13 + 1);
num5 = 0;
for (l = 1; l < i; l = num5 * 2 + 1)
{
if (l + 1 < i && array3[array[l]] > array3[array[l + 1]])
{
l++;
}
array[num5] = array[l];
num5 = l;
}
while ((l = num5) > 0 && array3[array[num5 = (l - 1) / 2]] > num11)
{
array[l] = array[num5];
}
array[l] = num10;
}
while (i > 1);
if (array[0] != array2.Length / 2 - 1)
{
throw new SharpZipBaseException("Heap invariant violated");
}
this.method_9(array2);
}
public int method_6()
{
int num = 0;
for (int i = 0; i < this.short_0.Length; i++)
{
num += (int)(this.short_0[i] * (short)this.byte_0[i]);
}
return num;
}
public void method_7(DeflaterHuffman.Class42 class42_0)
{
int num = -1;
int i = 0;
while (i < this.int_1)
{
int num2 = 1;
int num3 = (int)this.byte_0[i];
int num4;
int num5;
if (num3 == 0)
{
num4 = 138;
num5 = 3;
}
else
{
num4 = 6;
num5 = 3;
if (num != num3)
{
short[] expr_41_cp_0 = class42_0.short_0;
int expr_41_cp_1 = num3;
expr_41_cp_0[expr_41_cp_1] += 1;
num2 = 0;
}
}
num = num3;
i++;
while (i < this.int_1 && num == (int)this.byte_0[i])
{
i++;
if (++num2 >= num4)
{
break;
}
}
if (num2 < num5)
{
short[] expr_9B_cp_0 = class42_0.short_0;
int expr_9B_cp_1 = num;
expr_9B_cp_0[expr_9B_cp_1] += (short)num2;
}
else
{
if (num != 0)
{
short[] expr_BF_cp_0 = class42_0.short_0;
int expr_BF_cp_1 = 16;
expr_BF_cp_0[expr_BF_cp_1] += 1;
}
else
{
if (num2 <= 10)
{
short[] expr_E3_cp_0 = class42_0.short_0;
int expr_E3_cp_1 = 17;
expr_E3_cp_0[expr_E3_cp_1] += 1;
}
else
{
short[] expr_100_cp_0 = class42_0.short_0;
int expr_100_cp_1 = 18;
expr_100_cp_0[expr_100_cp_1] += 1;
}
}
}
}
}
public void method_8(DeflaterHuffman.Class42 class42_0)
{
int num = -1;
int i = 0;
while (i < this.int_1)
{
int num2 = 1;
int num3 = (int)this.byte_0[i];
int num4;
int num5;
if (num3 == 0)
{
num4 = 138;
num5 = 3;
}
else
{
num4 = 6;
num5 = 3;
if (num != num3)
{
class42_0.method_1(num3);
num2 = 0;
}
}
num = num3;
i++;
while (i < this.int_1 && num == (int)this.byte_0[i])
{
i++;
if (++num2 >= num4)
{
break;
}
}
if (num2 < num5)
{
while (num2-- > 0)
{
class42_0.method_1(num);
}
}
else
{
if (num != 0)
{
class42_0.method_1(16);
this.deflaterHuffman_0.pending.WriteBits(num2 - 3, 2);
}
else
{
if (num2 <= 10)
{
class42_0.method_1(17);
this.deflaterHuffman_0.pending.WriteBits(num2 - 3, 3);
}
else
{
class42_0.method_1(18);
this.deflaterHuffman_0.pending.WriteBits(num2 - 11, 7);
}
}
}
}
}
private void method_9(int[] int_4)
{
this.byte_0 = new byte[this.short_0.Length];
int num = int_4.Length / 2;
int num2 = (num + 1) / 2;
int num3 = 0;
for (int i = 0; i < this.int_3; i++)
{
this.int_2[i] = 0;
}
int[] array = new int[num];
array[num - 1] = 0;
for (int i = num - 1; i >= 0; i--)
{
if (int_4[2 * i + 1] != -1)
{
int num4 = array[i] + 1;
if (num4 > this.int_3)
{
num4 = this.int_3;
num3++;
}
array[int_4[2 * i]] = (array[int_4[2 * i + 1]] = num4);
}
else
{
int num4 = array[i];
this.int_2[num4 - 1]++;
this.byte_0[int_4[2 * i]] = (byte)array[i];
}
}
if (num3 != 0)
{
int num5 = this.int_3 - 1;
while (true)
{
if (this.int_2[--num5] != 0)
{
do
{
this.int_2[num5]--;
this.int_2[++num5]++;
num3 -= 1 << this.int_3 - 1 - num5;
}
while (num3 > 0 && num5 < this.int_3 - 1);
if (num3 <= 0)
{
break;
}
}
}
this.int_2[this.int_3 - 1] += num3;
this.int_2[this.int_3 - 2] -= num3;
int num6 = 2 * num2;
for (int num7 = this.int_3; num7 != 0; num7--)
{
int j = this.int_2[num7 - 1];
while (j > 0)
{
int num8 = 2 * int_4[num6++];
if (int_4[num8 + 1] == -1)
{
this.byte_0[int_4[num8]] = (byte)num7;
j--;
}
}
}
}
}
}
private const int int_0 = 16384;
private const int int_1 = 286;
private const int int_2 = 30;
private const int int_3 = 19;
private const int int_4 = 16;
private const int int_5 = 17;
private const int int_6 = 18;
private const int int_7 = 256;
private static readonly int[] int_8;
private static readonly byte[] byte_0;
private static short[] short_0;
private static byte[] byte_1;
private static short[] short_1;
private static byte[] byte_2;
public DeflaterPending pending;
private DeflaterHuffman.Class42 class42_0;
private DeflaterHuffman.Class42 class42_1;
private DeflaterHuffman.Class42 class42_2;
private short[] short_2;
private byte[] byte_3;
private int int_9;
private int int_10;
static DeflaterHuffman()
{
DeflaterHuffman.int_8 = new int[]
{
16,
17,
18,
0,
8,
7,
9,
6,
10,
5,
11,
4,
12,
3,
13,
2,
14,
1,
15
};
DeflaterHuffman.byte_0 = new byte[]
{
0,
8,
4,
12,
2,
10,
6,
14,
1,
9,
5,
13,
3,
11,
7,
15
};
DeflaterHuffman.short_0 = new short[286];
DeflaterHuffman.byte_1 = new byte[286];
int i = 0;
while (i < 144)
{
DeflaterHuffman.short_0[i] = DeflaterHuffman.BitReverse(48 + i << 8);
DeflaterHuffman.byte_1[i++] = 8;
}
while (i < 256)
{
DeflaterHuffman.short_0[i] = DeflaterHuffman.BitReverse(256 + i << 7);
DeflaterHuffman.byte_1[i++] = 9;
}
while (i < 280)
{
DeflaterHuffman.short_0[i] = DeflaterHuffman.BitReverse(-256 + i << 9);
DeflaterHuffman.byte_1[i++] = 7;
}
while (i < 286)
{
DeflaterHuffman.short_0[i] = DeflaterHuffman.BitReverse(-88 + i << 8);
DeflaterHuffman.byte_1[i++] = 8;
}
DeflaterHuffman.short_1 = new short[30];
DeflaterHuffman.byte_2 = new byte[30];
for (i = 0; i < 30; i++)
{
DeflaterHuffman.short_1[i] = DeflaterHuffman.BitReverse(i << 11);
DeflaterHuffman.byte_2[i] = 5;
}
}
public DeflaterHuffman(DeflaterPending pending)
{
this.pending = pending;
this.class42_0 = new DeflaterHuffman.Class42(this, 286, 257, 15);
this.class42_1 = new DeflaterHuffman.Class42(this, 30, 1, 15);
this.class42_2 = new DeflaterHuffman.Class42(this, 19, 4, 7);
this.short_2 = new short[16384];
this.byte_3 = new byte[16384];
}
public void Reset()
{
this.int_9 = 0;
this.int_10 = 0;
this.class42_0.method_0();
this.class42_1.method_0();
this.class42_2.method_0();
}
public void SendAllTrees(int blTreeCodes)
{
this.class42_2.method_4();
this.class42_0.method_4();
this.class42_1.method_4();
this.pending.WriteBits(this.class42_0.int_1 - 257, 5);
this.pending.WriteBits(this.class42_1.int_1 - 1, 5);
this.pending.WriteBits(blTreeCodes - 4, 4);
for (int i = 0; i < blTreeCodes; i++)
{
this.pending.WriteBits((int)this.class42_2.byte_0[DeflaterHuffman.int_8[i]], 3);
}
this.class42_0.method_8(this.class42_2);
this.class42_1.method_8(this.class42_2);
}
public void CompressBlock()
{
for (int i = 0; i < this.int_9; i++)
{
int num = (int)(this.byte_3[i] & 255);
int num2 = (int)this.short_2[i];
if (num2-- != 0)
{
int num3 = DeflaterHuffman.smethod_0(num);
this.class42_0.method_1(num3);
int num4 = (num3 - 261) / 4;
if (num4 > 0 && num4 <= 5)
{
this.pending.WriteBits(num & (1 << num4) - 1, num4);
}
int num5 = DeflaterHuffman.smethod_1(num2);
this.class42_1.method_1(num5);
num4 = num5 / 2 - 1;
if (num4 > 0)
{
this.pending.WriteBits(num2 & (1 << num4) - 1, num4);
}
}
else
{
this.class42_0.method_1(num);
}
}
this.class42_0.method_1(256);
}
public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock)
{
this.pending.WriteBits(lastBlock ? 1 : 0, 3);
this.pending.AlignToByte();
this.pending.WriteShort(storedLength);
this.pending.WriteShort(~storedLength);
this.pending.WriteBlock(stored, storedOffset, storedLength);
this.Reset();
}
public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock)
{
short[] expr_15_cp_0 = this.class42_0.short_0;
int expr_15_cp_1 = 256;
expr_15_cp_0[expr_15_cp_1] += 1;
this.class42_0.method_5();
this.class42_1.method_5();
this.class42_0.method_7(this.class42_2);
this.class42_1.method_7(this.class42_2);
this.class42_2.method_5();
int num = 4;
for (int i = 18; i > num; i--)
{
if (this.class42_2.byte_0[DeflaterHuffman.int_8[i]] > 0)
{
num = i + 1;
}
}
int num2 = 14 + num * 3 + this.class42_2.method_6() + this.class42_0.method_6() + this.class42_1.method_6() + this.int_10;
int num3 = this.int_10;
for (int i = 0; i < 286; i++)
{
num3 += (int)(this.class42_0.short_0[i] * (short)DeflaterHuffman.byte_1[i]);
}
for (int i = 0; i < 30; i++)
{
num3 += (int)(this.class42_1.short_0[i] * (short)DeflaterHuffman.byte_2[i]);
}
if (num2 >= num3)
{
num2 = num3;
}
if (storedOffset >= 0 && storedLength + 4 < num2 >> 3)
{
this.FlushStoredBlock(stored, storedOffset, storedLength, lastBlock);
}
else
{
if (num2 == num3)
{
this.pending.WriteBits(2 + (lastBlock ? 1 : 0), 3);
this.class42_0.method_3(DeflaterHuffman.short_0, DeflaterHuffman.byte_1);
this.class42_1.method_3(DeflaterHuffman.short_1, DeflaterHuffman.byte_2);
this.CompressBlock();
this.Reset();
}
else
{
this.pending.WriteBits(4 + (lastBlock ? 1 : 0), 3);
this.SendAllTrees(num);
this.CompressBlock();
this.Reset();
}
}
}
public bool IsFull()
{
return this.int_9 >= 16384;
}
public bool TallyLit(int literal)
{
this.short_2[this.int_9] = 0;
this.byte_3[this.int_9++] = (byte)literal;
short[] expr_39_cp_0 = this.class42_0.short_0;
expr_39_cp_0[literal] += 1;
return this.IsFull();
}
public bool TallyDist(int distance, int length)
{
this.short_2[this.int_9] = (short)distance;
this.byte_3[this.int_9++] = (byte)(length - 3);
int num = DeflaterHuffman.smethod_0(length - 3);
short[] expr_45_cp_0 = this.class42_0.short_0;
int expr_45_cp_1 = num;
expr_45_cp_0[expr_45_cp_1] += 1;
if (num >= 265 && num < 285)
{
this.int_10 += (num - 261) / 4;
}
int num2 = DeflaterHuffman.smethod_1(distance - 1);
short[] expr_9B_cp_0 = this.class42_1.short_0;
int expr_9B_cp_1 = num2;
expr_9B_cp_0[expr_9B_cp_1] += 1;
if (num2 >= 4)
{
this.int_10 += num2 / 2 - 1;
}
return this.IsFull();
}
public static short BitReverse(int toReverse)
{
return (short)((int)DeflaterHuffman.byte_0[toReverse & 15] << 12 | (int)DeflaterHuffman.byte_0[toReverse >> 4 & 15] << 8 | (int)DeflaterHuffman.byte_0[toReverse >> 8 & 15] << 4 | (int)DeflaterHuffman.byte_0[toReverse >> 12]);
}
private static int smethod_0(int int_11)
{
int result;
if (int_11 == 255)
{
result = 285;
}
else
{
int num = 257;
while (int_11 >= 8)
{
num += 4;
int_11 >>= 1;
}
result = num + int_11;
}
return result;
}
private static int smethod_1(int int_11)
{
int num = 0;
while (int_11 >= 4)
{
num += 2;
int_11 >>= 1;
}
return num + int_11;
}
}
public class PendingBuffer
{
private byte[] byte_0;
private int int_0;
private int int_1;
private uint uint_0;
private int int_2;
public int BitCount
{
get
{
return this.int_2;
}
}
public bool IsFlushed
{
get
{
return this.int_1 == 0;
}
}
public PendingBuffer() : this(4096)
{
}
public PendingBuffer(int bufferSize)
{
this.byte_0 = new byte[bufferSize];
}
public void Reset()
{
this.int_2 = 0;
this.int_1 = 0;
this.int_0 = 0;
}
public void WriteByte(int value)
{
this.byte_0[this.int_1++] = (byte)value;
}
public void WriteShort(int value)
{
this.byte_0[this.int_1++] = (byte)value;
this.byte_0[this.int_1++] = (byte)(value >> 8);
}
public void WriteInt(int value)
{
this.byte_0[this.int_1++] = (byte)value;
this.byte_0[this.int_1++] = (byte)(value >> 8);
this.byte_0[this.int_1++] = (byte)(value >> 16);
this.byte_0[this.int_1++] = (byte)(value >> 24);
}
public void WriteBlock(byte[] block, int offset, int length)
{
Array.Copy(block, offset, this.byte_0, this.int_1, length);
this.int_1 += length;
}
public void AlignToByte()
{
if (this.int_2 > 0)
{
this.byte_0[this.int_1++] = (byte)this.uint_0;
if (this.int_2 > 8)
{
this.byte_0[this.int_1++] = (byte)(this.uint_0 >> 8);
}
}
this.uint_0 = 0u;
this.int_2 = 0;
}
public void WriteBits(int int_3, int count)
{
this.uint_0 |= (uint)((uint)int_3 << this.int_2);
this.int_2 += count;
if (this.int_2 >= 16)
{
this.byte_0[this.int_1++] = (byte)this.uint_0;
this.byte_0[this.int_1++] = (byte)(this.uint_0 >> 8);
this.uint_0 >>= 16;
this.int_2 -= 16;
}
}
public void WriteShortMSB(int int_3)
{
this.byte_0[this.int_1++] = (byte)(int_3 >> 8);
this.byte_0[this.int_1++] = (byte)int_3;
}
public int Flush(byte[] output, int offset, int length)
{
if (this.int_2 >= 8)
{
this.byte_0[this.int_1++] = (byte)this.uint_0;
this.uint_0 >>= 8;
this.int_2 -= 8;
}
if (length > this.int_1 - this.int_0)
{
length = this.int_1 - this.int_0;
Array.Copy(this.byte_0, this.int_0, output, offset, length);
this.int_0 = 0;
this.int_1 = 0;
}
else
{
Array.Copy(this.byte_0, this.int_0, output, offset, length);
this.int_0 += length;
}
return length;
}
public byte[] ToByteArray()
{
byte[] array = new byte[this.int_1 - this.int_0];
Array.Copy(this.byte_0, this.int_0, array, 0, array.Length);
this.int_0 = 0;
this.int_1 = 0;
return array;
}
}
public class DeflaterPending : PendingBuffer
{
public DeflaterPending() : base(65536)
{
}
}
public class Inflater
{
private const int int_0 = 0;
private const int int_1 = 1;
private const int int_2 = 2;
private const int int_3 = 3;
private const int int_4 = 4;
private const int int_5 = 5;
private const int int_6 = 6;
private const int int_7 = 7;
private const int int_8 = 8;
private const int int_9 = 9;
private const int int_10 = 10;
private const int int_11 = 11;
private const int int_12 = 12;
private static readonly int[] int_13 = new int[]
{
3,
4,
5,
6,
7,
8,
9,
10,
11,
13,
15,
17,
19,
23,
27,
31,
35,
43,
51,
59,
67,
83,
99,
115,
131,
163,
195,
227,
258
};
private static readonly int[] int_14 = new int[]
{
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
2,
2,
2,
2,
3,
3,
3,
3,
4,
4,
4,
4,
5,
5,
5,
5,
0
};
private static readonly int[] int_15 = new int[]
{
1,
2,
3,
4,
5,
7,
9,
13,
17,
25,
33,
49,
65,
97,
129,
193,
257,
385,
513,
769,
1025,
1537,
2049,
3073,
4097,
6145,
8193,
12289,
16385,
24577
};
private static readonly int[] int_16 = new int[]
{
0,
0,
0,
0,
1,
1,
2,
2,
3,
3,
4,
4,
5,
5,
6,
6,
7,
7,
8,
8,
9,
9,
10,
10,
11,
11,
12,
12,
13,
13
};
private int int_17;
private int int_18;
private int int_19;
private int int_20;
private int int_21;
private int int_22;
private bool bool_0;
private long long_0;
private long long_1;
private bool bool_1;
private StreamManipulator streamManipulator_0;
private OutputWindow outputWindow_0;
private Class43 class43_0;
private InflaterHuffmanTree inflaterHuffmanTree_0;
private InflaterHuffmanTree inflaterHuffmanTree_1;
private Adler32 adler32_0;
public bool IsNeedingInput
{
get
{
return this.streamManipulator_0.IsNeedingInput;
}
}
public bool IsNeedingDictionary
{
get
{
return this.int_17 == 1 && this.int_19 == 0;
}
}
public bool IsFinished
{
get
{
return this.int_17 == 12 && this.outputWindow_0.GetAvailable() == 0;
}
}
public int Adler
{
get
{
return this.IsNeedingDictionary ? this.int_18 : ((int)this.adler32_0.Value);
}
}
public long TotalOut
{
get
{
return this.long_0;
}
}
public long TotalIn
{
get
{
return this.long_1 - (long)this.RemainingInput;
}
}
public int RemainingInput
{
get
{
return this.streamManipulator_0.AvailableBytes;
}
}
public Inflater() : this(false)
{
}
public Inflater(bool noHeader)
{
this.bool_1 = noHeader;
this.adler32_0 = new Adler32();
this.streamManipulator_0 = new StreamManipulator();
this.outputWindow_0 = new OutputWindow();
this.int_17 = (noHeader ? 2 : 0);
}
public void Reset()
{
this.int_17 = (this.bool_1 ? 2 : 0);
this.long_1 = 0L;
this.long_0 = 0L;
this.streamManipulator_0.Reset();
this.outputWindow_0.Reset();
this.class43_0 = null;
this.inflaterHuffmanTree_0 = null;
this.inflaterHuffmanTree_1 = null;
this.bool_0 = false;
this.adler32_0.Reset();
}
private bool method_0()
{
int num = this.streamManipulator_0.PeekBits(16);
bool result;
if (num < 0)
{
result = false;
}
else
{
this.streamManipulator_0.DropBits(16);
num = ((num << 8 | num >> 8) & 65535);
if (num % 31 != 0)
{
throw new SharpZipBaseException("Header checksum illegal");
}
if ((num & 3840) != 2048)
{
throw new SharpZipBaseException("Compression Method unknown");
}
if ((num & 32) == 0)
{
this.int_17 = 2;
}
else
{
this.int_17 = 1;
this.int_19 = 32;
}
result = true;
}
return result;
}
private bool method_1()
{
bool result;
while (this.int_19 > 0)
{
int num = this.streamManipulator_0.PeekBits(8);
if (num < 0)
{
result = false;
return result;
}
this.streamManipulator_0.DropBits(8);
this.int_18 = (this.int_18 << 8 | num);
this.int_19 -= 8;
}
result = false;
return result;
}
private bool method_2()
{
int i = this.outputWindow_0.GetFreeSpace();
bool result;
while (i >= 258)
{
int symbol;
switch (this.int_17)
{
case 7:
while (((symbol = this.inflaterHuffmanTree_0.GetSymbol(this.streamManipulator_0)) & -256) == 0)
{
this.outputWindow_0.Write(symbol);
if (--i < 258)
{
result = true;
return result;
}
}
if (symbol >= 257)
{
try
{
this.int_20 = Inflater.int_13[symbol - 257];
this.int_19 = Inflater.int_14[symbol - 257];
}
catch (Exception)
{
throw new SharpZipBaseException("Illegal rep length code");
}
goto IL_BF;
}
if (symbol < 0)
{
result = false;
return result;
}
this.inflaterHuffmanTree_1 = null;
this.inflaterHuffmanTree_0 = null;
this.int_17 = 2;
result = true;
return result;
case 8:
goto IL_BF;
case 9:
goto IL_119;
case 10:
break;
default:
throw new SharpZipBaseException("Inflater unknown mode");
}
IL_15F:
if (this.int_19 > 0)
{
this.int_17 = 10;
int num = this.streamManipulator_0.PeekBits(this.int_19);
if (num < 0)
{
result = false;
return result;
}
this.streamManipulator_0.DropBits(this.int_19);
this.int_21 += num;
}
this.outputWindow_0.Repeat(this.int_20, this.int_21);
i -= this.int_20;
this.int_17 = 7;
continue;
IL_119:
symbol = this.inflaterHuffmanTree_1.GetSymbol(this.streamManipulator_0);
if (symbol >= 0)
{
try
{
this.int_21 = Inflater.int_15[symbol];
this.int_19 = Inflater.int_16[symbol];
}
catch (Exception)
{
throw new SharpZipBaseException("Illegal rep dist code");
}
goto IL_15F;
}
result = false;
return result;
IL_BF:
if (this.int_19 > 0)
{
this.int_17 = 8;
int num = this.streamManipulator_0.PeekBits(this.int_19);
if (num < 0)
{
result = false;
return result;
}
this.streamManipulator_0.DropBits(this.int_19);
this.int_20 += num;
}
this.int_17 = 9;
goto IL_119;
}
result = true;
return result;
}
private bool method_3()
{
bool result;
while (this.int_19 > 0)
{
int num = this.streamManipulator_0.PeekBits(8);
if (num < 0)
{
result = false;
return result;
}
this.streamManipulator_0.DropBits(8);
this.int_18 = (this.int_18 << 8 | num);
this.int_19 -= 8;
}
if ((int)this.adler32_0.Value != this.int_18)
{
throw new SharpZipBaseException(string.Concat(new object[]
{
"Adler chksum doesn't match: ",
(int)this.adler32_0.Value,
" vs. ",
this.int_18
}));
}
this.int_17 = 12;
result = false;
return result;
}
private bool method_4()
{
bool result;
switch (this.int_17)
{
case 0:
result = this.method_0();
return result;
case 1:
result = this.method_1();
return result;
case 2:
if (this.bool_0)
{
if (this.bool_1)
{
this.int_17 = 12;
result = false;
return result;
}
this.streamManipulator_0.SkipToByteBoundary();
this.int_19 = 32;
this.int_17 = 11;
result = true;
return result;
}
else
{
int num = this.streamManipulator_0.PeekBits(3);
if (num < 0)
{
result = false;
return result;
}
this.streamManipulator_0.DropBits(3);
if ((num & 1) != 0)
{
this.bool_0 = true;
}
switch (num >> 1)
{
case 0:
this.streamManipulator_0.SkipToByteBoundary();
this.int_17 = 3;
break;
case 1:
this.inflaterHuffmanTree_0 = InflaterHuffmanTree.defLitLenTree;
this.inflaterHuffmanTree_1 = InflaterHuffmanTree.defDistTree;
this.int_17 = 7;
break;
case 2:
this.class43_0 = new Class43();
this.int_17 = 6;
break;
default:
throw new SharpZipBaseException("Unknown block type " + num);
}
result = true;
return result;
}
break;
case 3:
if ((this.int_22 = this.streamManipulator_0.PeekBits(16)) < 0)
{
result = false;
return result;
}
this.streamManipulator_0.DropBits(16);
this.int_17 = 4;
break;
case 4:
break;
case 5:
goto IL_1EF;
case 6:
if (!this.class43_0.method_0(this.streamManipulator_0))
{
result = false;
return result;
}
this.inflaterHuffmanTree_0 = this.class43_0.method_1();
this.inflaterHuffmanTree_1 = this.class43_0.method_2();
this.int_17 = 7;
goto IL_281;
case 7:
case 8:
case 9:
case 10:
goto IL_281;
case 11:
result = this.method_3();
return result;
case 12:
result = false;
return result;
default:
throw new SharpZipBaseException("Inflater.Decode unknown mode");
}
int num2 = this.streamManipulator_0.PeekBits(16);
if (num2 < 0)
{
result = false;
return result;
}
this.streamManipulator_0.DropBits(16);
if (num2 != (this.int_22 ^ 65535))
{
throw new SharpZipBaseException("broken uncompressed block");
}
this.int_17 = 5;
IL_1EF:
int num3 = this.outputWindow_0.CopyStored(this.streamManipulator_0, this.int_22);
this.int_22 -= num3;
if (this.int_22 == 0)
{
this.int_17 = 2;
result = true;
return result;
}
result = !this.streamManipulator_0.IsNeedingInput;
return result;
IL_281:
result = this.method_2();
return result;
}
public void SetDictionary(byte[] buffer)
{
this.SetDictionary(buffer, 0, buffer.Length);
}
public void SetDictionary(byte[] buffer, int index, int count)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (index < 0)
{
throw new ArgumentOutOfRangeException("index");
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count");
}
if (!this.IsNeedingDictionary)
{
throw new InvalidOperationException("Dictionary is not needed");
}
this.adler32_0.Update(buffer, index, count);
if ((int)this.adler32_0.Value != this.int_18)
{
throw new SharpZipBaseException("Wrong adler checksum");
}
this.adler32_0.Reset();
this.outputWindow_0.CopyDict(buffer, index, count);
this.int_17 = 2;
}
public void SetInput(byte[] buffer)
{
this.SetInput(buffer, 0, buffer.Length);
}
public void SetInput(byte[] buffer, int index, int count)
{
this.streamManipulator_0.SetInput(buffer, index, count);
this.long_1 += (long)count;
}
public int Inflate(byte[] buffer)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
return this.Inflate(buffer, 0, buffer.Length);
}
public int Inflate(byte[] buffer, int offset, int count)
{
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count", "count cannot be negative");
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", "offset cannot be negative");
}
if (offset + count > buffer.Length)
{
throw new ArgumentException("count exceeds buffer bounds");
}
int result;
if (count == 0)
{
if (!this.IsFinished)
{
this.method_4();
}
result = 0;
}
else
{
int num = 0;
do
{
if (this.int_17 != 11)
{
int num2 = this.outputWindow_0.CopyOutput(buffer, offset, count);
if (num2 > 0)
{
this.adler32_0.Update(buffer, offset, num2);
offset += num2;
num += num2;
this.long_0 += (long)num2;
count -= num2;
if (count == 0)
{
goto Block_11;
}
}
}
}
while (this.method_4() || (this.outputWindow_0.GetAvailable() > 0 && this.int_17 != 11));
result = num;
return result;
Block_11:
result = num;
}
return result;
}
}
internal class Class43
{
private const int int_0 = 0;
private const int int_1 = 1;
private const int int_2 = 2;
private const int int_3 = 3;
private const int int_4 = 4;
private const int int_5 = 5;
private static readonly int[] int_6 = new int[]
{
3,
3,
11
};
private static readonly int[] int_7 = new int[]
{
2,
3,
7
};
private static readonly int[] int_8 = new int[]
{
16,
17,
18,
0,
8,
7,
9,
6,
10,
5,
11,
4,
12,
3,
13,
2,
14,
1,
15
};
private byte[] byte_0;
private byte[] byte_1;
private InflaterHuffmanTree inflaterHuffmanTree_0;
private int int_9;
private int int_10;
private int int_11;
private int int_12;
private int int_13;
private int int_14;
private byte byte_2;
private int int_15;
public bool method_0(StreamManipulator streamManipulator_0)
{
while (true)
{
switch (this.int_9)
{
case 0:
this.int_10 = streamManipulator_0.PeekBits(5);
if (this.int_10 >= 0)
{
this.int_10 += 257;
streamManipulator_0.DropBits(5);
this.int_9 = 1;
goto IL_20B;
}
goto IL_2D6;
case 1:
goto IL_20B;
case 2:
goto IL_1B8;
case 3:
goto IL_17D;
case 4:
break;
case 5:
goto IL_06;
default:
continue;
}
IL_E3:
int symbol;
while (((symbol = this.inflaterHuffmanTree_0.GetSymbol(streamManipulator_0)) & -16) == 0)
{
this.byte_1[this.int_15++] = (this.byte_2 = (byte)symbol);
if (this.int_15 == this.int_13)
{
goto IL_2F0;
}
}
if (symbol >= 0)
{
if (symbol >= 17)
{
this.byte_2 = 0;
}
else
{
if (this.int_15 == 0)
{
goto IL_2EA;
}
}
this.int_14 = symbol - 16;
this.int_9 = 5;
goto IL_06;
}
goto IL_2E6;
IL_17D:
while (this.int_15 < this.int_12)
{
int num = streamManipulator_0.PeekBits(3);
if (num < 0)
{
goto IL_2E2;
}
streamManipulator_0.DropBits(3);
this.byte_0[Class43.int_8[this.int_15]] = (byte)num;
this.int_15++;
}
this.inflaterHuffmanTree_0 = new InflaterHuffmanTree(this.byte_0);
this.byte_0 = null;
this.int_15 = 0;
this.int_9 = 4;
goto IL_E3;
IL_06:
int bitCount = Class43.int_7[this.int_14];
int num2 = streamManipulator_0.PeekBits(bitCount);
if (num2 < 0)
{
goto IL_2F4;
}
streamManipulator_0.DropBits(bitCount);
num2 += Class43.int_6[this.int_14];
if (this.int_15 + num2 > this.int_13)
{
break;
}
while (num2-- > 0)
{
this.byte_1[this.int_15++] = this.byte_2;
}
if (this.int_15 != this.int_13)
{
this.int_9 = 4;
continue;
}
goto IL_2FE;
IL_1B8:
this.int_12 = streamManipulator_0.PeekBits(4);
if (this.int_12 >= 0)
{
this.int_12 += 4;
streamManipulator_0.DropBits(4);
this.byte_0 = new byte[19];
this.int_15 = 0;
this.int_9 = 3;
goto IL_17D;
}
goto IL_2DE;
IL_20B:
this.int_11 = streamManipulator_0.PeekBits(5);
if (this.int_11 >= 0)
{
this.int_11++;
streamManipulator_0.DropBits(5);
this.int_13 = this.int_10 + this.int_11;
this.byte_1 = new byte[this.int_13];
this.int_9 = 2;
goto IL_1B8;
}
goto IL_2DA;
}
throw new SharpZipBaseException();
IL_2D6:
bool result = false;
return result;
IL_2DA:
result = false;
return result;
IL_2DE:
result = false;
return result;
IL_2E2:
result = false;
return result;
IL_2E6:
result = false;
return result;
IL_2EA:
throw new SharpZipBaseException();
IL_2F0:
result = true;
return result;
IL_2F4:
result = false;
return result;
IL_2FE:
result = true;
return result;
}
public InflaterHuffmanTree method_1()
{
byte[] array = new byte[this.int_10];
Array.Copy(this.byte_1, 0, array, 0, this.int_10);
return new InflaterHuffmanTree(array);
}
public InflaterHuffmanTree method_2()
{
byte[] array = new byte[this.int_11];
Array.Copy(this.byte_1, this.int_10, array, 0, this.int_11);
return new InflaterHuffmanTree(array);
}
}
public class InflaterHuffmanTree
{
private const int int_0 = 15;
private short[] short_0;
public static InflaterHuffmanTree defLitLenTree;
public static InflaterHuffmanTree defDistTree;
static InflaterHuffmanTree()
{
try
{
byte[] array = new byte[288];
int i = 0;
while (i < 144)
{
array[i++] = 8;
}
while (i < 256)
{
array[i++] = 9;
}
while (i < 280)
{
array[i++] = 7;
}
while (i < 288)
{
array[i++] = 8;
}
InflaterHuffmanTree.defLitLenTree = new InflaterHuffmanTree(array);
array = new byte[32];
i = 0;
while (i < 32)
{
array[i++] = 5;
}
InflaterHuffmanTree.defDistTree = new InflaterHuffmanTree(array);
}
catch (Exception)
{
throw new SharpZipBaseException("InflaterHuffmanTree: static tree length illegal");
}
}
public InflaterHuffmanTree(byte[] codeLengths)
{
this.method_0(codeLengths);
}
private void method_0(byte[] byte_0)
{
int[] array = new int[16];
int[] array2 = new int[16];
for (int i = 0; i < byte_0.Length; i++)
{
int j = (int)byte_0[i];
if (j > 0)
{
array[j]++;
}
}
int num = 0;
int num2 = 512;
for (int j = 1; j <= 15; j++)
{
array2[j] = num;
num += array[j] << 16 - j;
if (j >= 10)
{
int num3 = array2[j] & 130944;
int num4 = num & 130944;
num2 += num4 - num3 >> 16 - j;
}
}
this.short_0 = new short[num2];
int num5 = 512;
for (int j = 15; j >= 10; j--)
{
int num4 = num & 130944;
num -= array[j] << 16 - j;
int num3 = num & 130944;
for (int i = num3; i < num4; i += 128)
{
this.short_0[(int)DeflaterHuffman.BitReverse(i)] = (short)(-num5 << 4 | j);
num5 += 1 << j - 9;
}
}
for (int i = 0; i < byte_0.Length; i++)
{
int j = (int)byte_0[i];
if (j != 0)
{
num = array2[j];
int num6 = (int)DeflaterHuffman.BitReverse(num);
if (j <= 9)
{
do
{
this.short_0[num6] = (short)(i << 4 | j);
num6 += 1 << j;
}
while (num6 < 512);
}
else
{
int num7 = (int)this.short_0[num6 & 511];
int num8 = 1 << (num7 & 15);
num7 = -(num7 >> 4);
do
{
this.short_0[num7 | num6 >> 9] = (short)(i << 4 | j);
num6 += 1 << j;
}
while (num6 < num8);
}
array2[j] = num + (1 << 16 - j);
}
}
}
public int GetSymbol(StreamManipulator input)
{
int num;
int result;
if ((num = input.PeekBits(9)) >= 0)
{
int num2;
if ((num2 = (int)this.short_0[num]) >= 0)
{
input.DropBits(num2 & 15);
result = num2 >> 4;
}
else
{
int num3 = -(num2 >> 4);
int bitCount = num2 & 15;
if ((num = input.PeekBits(bitCount)) >= 0)
{
num2 = (int)this.short_0[num3 | num >> 9];
input.DropBits(num2 & 15);
result = num2 >> 4;
}
else
{
int availableBits = input.AvailableBits;
num = input.PeekBits(availableBits);
num2 = (int)this.short_0[num3 | num >> 9];
if ((num2 & 15) <= availableBits)
{
input.DropBits(num2 & 15);
result = num2 >> 4;
}
else
{
result = -1;
}
}
}
}
else
{
int availableBits = input.AvailableBits;
num = input.PeekBits(availableBits);
int num2 = (int)this.short_0[num];
if (num2 >= 0 && (num2 & 15) <= availableBits)
{
input.DropBits(num2 & 15);
result = num2 >> 4;
}
else
{
result = -1;
}
}
return result;
}
}
}
namespace ICSharpCode.SharpZipLib.Zip
{
public enum UseZip64
{
Off,
On,
Dynamic
}
public enum CompressionMethod
{
Stored,
Deflated = 8,
Deflate64,
BZip2 = 11,
WinZipAES = 99
}
public enum EncryptionAlgorithm
{
None,
PkzipClassic,
Des = 26113,
RC2,
TripleDes168,
TripleDes112 = 26121,
Aes128 = 26126,
Aes192,
Aes256,
RC2Corrected = 26370,
Blowfish = 26400,
Twofish,
RC4 = 26625,
Unknown = 65535
}
[Flags]
public enum GeneralBitFlags
{
Encrypted = 1,
Method = 6,
Descriptor = 8,
ReservedPKware4 = 16,
Patched = 32,
StrongEncryption = 64,
Unused7 = 128,
Unused8 = 256,
Unused9 = 512,
Unused10 = 1024,
UnicodeText = 2048,
EnhancedCompress = 4096,
HeaderMasked = 8192,
ReservedPkware14 = 16384,
ReservedPkware15 = 32768
}
public sealed class ZipConstants
{
public const int VersionMadeBy = 51;
[Obsolete("Use VersionMadeBy instead")]
public const int VERSION_MADE_BY = 51;
public const int VersionStrongEncryption = 50;
[Obsolete("Use VersionStrongEncryption instead")]
public const int VERSION_STRONG_ENCRYPTION = 50;
public const int VERSION_AES = 51;
public const int VersionZip64 = 45;
public const int LocalHeaderBaseSize = 30;
[Obsolete("Use LocalHeaderBaseSize instead")]
public const int LOCHDR = 30;
public const int Zip64DataDescriptorSize = 24;
public const int DataDescriptorSize = 16;
[Obsolete("Use DataDescriptorSize instead")]
public const int EXTHDR = 16;
public const int CentralHeaderBaseSize = 46;
[Obsolete("Use CentralHeaderBaseSize instead")]
public const int CENHDR = 46;
public const int EndOfCentralRecordBaseSize = 22;
[Obsolete("Use EndOfCentralRecordBaseSize instead")]
public const int ENDHDR = 22;
public const int CryptoHeaderSize = 12;
[Obsolete("Use CryptoHeaderSize instead")]
public const int CRYPTO_HEADER_SIZE = 12;
public const int LocalHeaderSignature = 67324752;
[Obsolete("Use LocalHeaderSignature instead")]
public const int LOCSIG = 67324752;
public const int SpanningSignature = 134695760;
[Obsolete("Use SpanningSignature instead")]
public const int SPANNINGSIG = 134695760;
public const int SpanningTempSignature = 808471376;
[Obsolete("Use SpanningTempSignature instead")]
public const int SPANTEMPSIG = 808471376;
public const int DataDescriptorSignature = 134695760;
[Obsolete("Use DataDescriptorSignature instead")]
public const int EXTSIG = 134695760;
[Obsolete("Use CentralHeaderSignature instead")]
public const int CENSIG = 33639248;
public const int CentralHeaderSignature = 33639248;
public const int Zip64CentralFileHeaderSignature = 101075792;
[Obsolete("Use Zip64CentralFileHeaderSignature instead")]
public const int CENSIG64 = 101075792;
public const int Zip64CentralDirLocatorSignature = 117853008;
public const int ArchiveExtraDataSignature = 117853008;
public const int CentralHeaderDigitalSignature = 84233040;
[Obsolete("Use CentralHeaderDigitalSignaure instead")]
public const int CENDIGITALSIG = 84233040;
public const int EndOfCentralDirectorySignature = 101010256;
[Obsolete("Use EndOfCentralDirectorySignature instead")]
public const int ENDSIG = 101010256;
public static string ConvertToString(byte[] data, int count)
{
string result;
if (data == null)
{
result = string.Empty;
}
else
{
result = Encoding.get_Unicode().GetString(data, 0, count);
}
return result;
}
public static string ConvertToString(byte[] data)
{
string result;
if (data == null)
{
result = string.Empty;
}
else
{
result = ZipConstants.ConvertToString(data, data.Length);
}
return result;
}
public static string ConvertToStringExt(int flags, byte[] data, int count)
{
string result;
if (data == null)
{
result = string.Empty;
}
else
{
if ((flags & 2048) != 0)
{
result = Encoding.get_UTF8().GetString(data, 0, count);
}
else
{
result = ZipConstants.ConvertToString(data, count);
}
}
return result;
}
public static string ConvertToStringExt(int flags, byte[] data)
{
string result;
if (data == null)
{
result = string.Empty;
}
else
{
if ((flags & 2048) != 0)
{
result = Encoding.get_UTF8().GetString(data, 0, data.Length);
}
else
{
result = ZipConstants.ConvertToString(data, data.Length);
}
}
return result;
}
public static byte[] ConvertToArray(string string_0)
{
byte[] result;
if (string_0 == null)
{
result = new byte[0];
}
else
{
result = Encoding.get_Unicode().GetBytes(string_0);
}
return result;
}
public static byte[] ConvertToArray(int flags, string string_0)
{
byte[] result;
if (string_0 == null)
{
result = new byte[0];
}
else
{
if ((flags & 2048) != 0)
{
result = Encoding.get_UTF8().GetBytes(string_0);
}
else
{
result = ZipConstants.ConvertToArray(string_0);
}
}
return result;
}
private ZipConstants()
{
}
}
public class ZipException : SharpZipBaseException
{
public ZipException()
{
}
public ZipException(string message) : base(message)
{
}
public ZipException(string message, Exception exception) : base(message, exception)
{
}
}
}
// D:\tools\weixin\new\MicroMsg-cleaned.dll
// MicroMsg, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// 架 构: AnyCPU (优先64位)
// 运行时: .NET 2.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/dillontools/WeixinWinPhone.git
git@gitee.com:dillontools/WeixinWinPhone.git
dillontools
WeixinWinPhone
WeixinWinPhone
master

搜索帮助