From a79fe2b5ee2c071c3844a69af9457c1ccbda2860 Mon Sep 17 00:00:00 2001 From: SombrAbsol Date: Wed, 24 Jan 2024 14:42:34 +0100 Subject: [PATCH] Etape 3 Partie 2 --- a.exe | Bin 30272 -> 29605 bytes a.exe.stackdump | 40 ---------------------------------------- decodages.zip | Bin 0 -> 13750 bytes etape3.c | 45 +++++++++++++++++++++++++++++++-------------- 4 files changed, 31 insertions(+), 54 deletions(-) delete mode 100644 a.exe.stackdump create mode 100644 decodages.zip diff --git a/a.exe b/a.exe index 435a29f304be749a7d69c1212cf70a5ac49a5b45..41eb1461b38bdd632135a745a5852128c6930a1a 100644 GIT binary patch delta 4694 zcmcgudr(x@89(R3vMUc+cUgmgu&@%yXmm*hO@eVTl3pU<0-~UxyU0TxE}I0LB-Jcd z?YKdwkgw^OG@ZPgGlTj72zOm)OlLL6UA^@r*J1;B!SW%hLJa z2er(EgW2iiUuWVn4f2)oOoFEqQ=%{VT%JNRr984pDO4q;@KkD*mQ4=} z7eumH%rrVG7mSyxUxaFbD z*f01UR+JgBBV}npxZqsD>Bz!K`r=7?v98NI-pK!=m`dX8ypx*ZaszfbSYeifwW;O7 zQoFokTPo`{9z$aG)fTzGGpzs0R9ucDAC^d zdaWG%RNisX9r+y<8#Ap(GZ_=>?=}2Z(N0EQpv}e%t5IEX1nEbTkB5=*aeB%)dubbX zAPPSM!v(QW5r|`$4C&pCuMg;BJXh*wY%;#;qdBH|WHwnca-vKqD8Jxbq!ww$Z7Nqh8Tze%RrF1E=(Eo&dY!Z2G`6-4Ao5@gqUB`Yn+nyj zPHb~WL~LQN;Z-;YTLikfQLNH+O5h=2*KD!a-E~T=_%RP76YH$k)HyCF%~kMH7#w3Dv(CF)PHrg9BPGx6wdCYv3OA`-}K%c7dC<@Y?JdJ2_{DBm(BOd_wIva;{Zya@I~1i$2_W1&!AS9!h1HLuJ!{A49HKd*c19w8!gjSvbF`-S>R4MWV!+ zNjIf1R$a5aCj0Z{ryEb6Gy3+t``YrHkr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d@8nY8)@d1%FN?a}udRnp#yCR!|fE?JrXms4x zXapn=QbR_7hz}MGc@oHwLc|Orh#duj^Q!t3^tRpB3(HU0>qA)6$(nSUULRxdMAOi^ z9Gb3;rQDjwv2>^^>NrBZV!%l~8)7lZG;-HSw4+wSVindqjeaEN^q@D3qM9wVWP^n+ zZjPtH4I#1GhOua@a*km_2zjxi-Us27AWWl{x-@)=ZLbSqeL+QEG{jL|MLOMHUsU=U zDvv>t5v-uI)z|C0u*i=<9kOf!<2qz{s}|MX+0}+|6Ma+f%+);Gdpr8Nw_x%bo4On> zT6N>@D>TplkXPl*MeO&pjBV!azAbHxzAU$4e^=djQ`E9kq9o#Fc6zuW+IX8tqFPag z6%%x_!3oc^4O?(>3hOiIvbE8?p8^}R;=hEe3zJcHKb2<7qh-z?Q&OYDWW>CbQLG3z z((opm(F*J?%JQV+q!@ExjM1vfEMp-wi5_lr8q5ZoE={9%8`J34CJVWnlIdi#Rn;x@ z5U>=lg^2)w>xY%&v*4}x9M%c1#TtoXbvwA?w^W2oW}n5H zuwZOIZO2%h&tkNTG1^<7MSnu#5qRe>@E)ba7AJ*$mK67bv1bib+mcO}wOFm?3kDC< zK^(^QEy=~p#V5F~zGWxQKXXML+DTGQ>Wb&-_7-PAWW{dc6>M(a>Jz_(;xCDUfP`I( zaq)LUyx0(EjSv&)BBO%bt_ayu)SVD@Z~zrhW`H0B54Gu;6PjcA{URtr^#o>c_k zxnwT^G0W5rHT@ev^d){MqWbaKjN`8m{EKehR1`>&uP4V3@B$!4IBTA3l`9O`T%tDHK3dqgiU<;gXc9=B zZkgT#qF(|7{vO2WeC&}$c;|G`rEn5OYO^l^;?nte=g(Ft)7sb76YAYk79FL2Qy<>;`M&|=c|NTG diff --git a/a.exe.stackdump b/a.exe.stackdump deleted file mode 100644 index f0a3185..0000000 --- a/a.exe.stackdump +++ /dev/null @@ -1,40 +0,0 @@ -Exception: STATUS_INTEGER_DIVIDE_BY_ZERO at rip=0001004010E2 -rax=000000000000004F rbx=0000000A00000410 rcx=0000000A00000010 -rdx=0000000000000000 rsi=0000000A000003B0 rdi=00000007FFFFCC60 -r8 =00000007FFFFCB1C r9 =00000001800A4F70 r10=0000000800000000 -r11=000000010040115D r12=00000007FFFFCC8D r13=0000000000000000 -r14=0000000000000000 r15=00000007FFFFCC60 -rbp=00000007FFFFCC10 rsp=00000007FFFFCBB0 -program=C:\Users\benja\Documents\UPEC\decodages\a.exe, pid 1692, thread main -cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B -Stack trace: -Frame Function Args -0007FFFFCC10 0001004010E2 (0007FFFFCC60, 000000000000, 000000000030, 000700000000) a.exe+0x10E2 -0007FFFFCD30 000180047ED1 (000000000000, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x7ED1 -000000000000 000180045AC3 (000000000000, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x5AC3 -0007FFFFFFF0 000180045B74 (000000000000, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x5B74 -End of stack trace -Loaded modules: -000100400000 a.exe -7FFC94C70000 ntdll.dll -7FFC93430000 KERNEL32.DLL -7FFC921F0000 KERNELBASE.dll -000180040000 msys-2.0.dll -7FFC93500000 advapi32.dll -7FFC93FC0000 msvcrt.dll -7FFC93230000 sechost.dll -7FFC921C0000 bcrypt.dll -7FFC94070000 RPCRT4.dll -7FFC91740000 CRYPTBASE.DLL -7FFC92020000 bcryptPrimitives.dll -7FFC6FA40000 netapi32.dll -7FFC8C9A0000 SAMCLI.DLL -7FFC920A0000 ucrtbase.dll -7FFC8CF20000 SAMLIB.dll -7FFC90A00000 NETUTILS.DLL -7FFC94190000 user32.dll -7FFC925A0000 win32u.dll -7FFC93C90000 GDI32.dll -7FFC92670000 gdi32full.dll -7FFC925D0000 msvcp_win.dll -7FFC93960000 IMM32.DLL diff --git a/decodages.zip b/decodages.zip new file mode 100644 index 0000000000000000000000000000000000000000..86e2b6181adf9c0d9b6699442d7901293ce63b91 GIT binary patch literal 13750 zcmdU$V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mgE literal 0 HcmV?d00001 diff --git a/etape3.c b/etape3.c index f26f233..dd2b376 100644 --- a/etape3.c +++ b/etape3.c @@ -2,24 +2,41 @@ #include #include -long long int calculmodulo(long long int nb, long long int d, long long int n) { - long long int resultat = 1; +/* Cette fonction utilise la methode d'exponentiation rapide + afin de calculer des grands nombres de maniere recursive*/ +long long int exponentiation(long long int nb, long long int d, long long int n) { + + /* Si on arrive a la puissance 0*/ + if (d == 0) { + return 1; + } + + /* Si la puissance est paire, on la divise par 2 + et on peut ainsi mette notre nombre au carre */ + else if (d % 2 == 0) { + nb = exponentiation(nb, d / 2, n); + return (nb * nb) % n; + } + + /* Sinon la puissance est impaire, on la transforme en puissance paire en enlevant 1 + a la puissance d lors de l'appel recursif de la fonction et en multipliant le resultat par nb */ + else { + return (nb * exponentiation(nb, d - 1, n)) % n; + } - /*Utilisation de l'algorithme d'exponentiation rapide pour gerer les grands nombres */ + /* Version iterative while (d > 0) { - /* Si le bit de droite de d est 1 (d est impair) */ if (d % 2 == 1) { - resultat = (resultat * nb) % n; /* Multiplier le resultat par nb et prendre le modulo n */ + resultat = (resultat * nb) % n; } - d = d / 2; /* Diviser d par 2 (decalage d'octets vers la droite) */ - nb = (nb * nb) % n; /* elever nb au carre et prendre le modulo n */ - - /* Lignes ajoutées pour illustrer le processus */ - printf("d = %lld, nb = %lld, resultat = %lld\n", d, nb, resultat); + d = d / 2; + printf("\nCle : %d Nombre : %d", d, nb); + nb = (nb * nb) % n; } return resultat; + */ } int main(void) { @@ -30,12 +47,12 @@ int main(void) { FILE* stream = fopen("Etape4.bin","r"); - /*Variable pour caracteres*/ + /* Variable pour les caracteres chiffres */ long long int nb; - /*Tant que la fin du fichier n'est pas atteinte, dechiffrer chaque caractere*/ - /*en calculant le modulo de la valeur numerique de chacun*/ + /* Tant que la fin du fichier n'est pas atteinte, dechiffrer chaque caractere + en calculant le modulo de la valeur numerique de chacun */ while (fread(&nb, sizeof(long long int), 1, stream) != 0) { - long long int dechiffre = calculmodulo(nb, d, n); + long long int dechiffre = exponentiation(nb, d, n); printf("%c", (char)dechiffre); } fclose(stream);