# baby_mult50pts
Welcome to reversing! Prove your worth and get the flag from this neat little program!
[program.txt]
## Flag:```flagflag{sup3r_v4l1d_pr0gr4m}```
## Solution
Download text file. It's a bunch of comma seperated values. Values range from 0 to 255. ```shell85, 72, 137, 229, 72, 131, 236, 24, 72, 199, 69, 248, 79, 0, 0, 0, 72, 184, 21, 79, 231, 75, 1, 0, 0, 0, 72, 137, 69, 240, 72, 199, 69, 232, 4, 0, 0, 0, 72, 199, 69, 224, 3, 0, 0, 0, 72, 199, 69, 216, 19, 0, 0, 0, 72, 199, 69, 208, 21, 1, 0, 0, 72, 184, 97, 91, 100, 75, 207, 119, 0, 0, 72, 137, 69, 200, 72, 199, 69, 192, 2, 0, 0, 0, 72, 199, 69, 184, 17, 0, 0, 0, 72, 199, 69, 176, 193, 33, 0, 0, 72, 199, 69, 168, 233, 101, 34, 24, 72, 199, 69, 160, 51, 8, 0, 0, 72, 199, 69, 152, 171, 10, 0, 0, 72, 199, 69, 144, 173, 170, 141, 0, 72, 139, 69, 248, 72, 15, 175, 69, 240, 72, 137, 69, 136, 72, 139, 69, 232, 72, 15, 175, 69, 224, 72, 15, 175, 69, 216, 72, 15, 175, 69, 208, 72, 15, 175, 69, 200, 72, 137, 69, 128, 72, 139, 69, 192, 72, 15, 175, 69, 184, 72, 15, 175, 69, 176, 72, 15, 175, 69, 168, 72, 137, 133, 120, 255, 255, 255, 72, 139, 69, 160, 72, 15, 175, 69, 152, 72, 15, 175, 69, 144, 72, 137, 133, 112, 255, 255, 255, 184, 0, 0, 0, 0, 201```
Suspicious, I used CyberChef for convert decimal charcode values to Hex. Not particularly interesting.
```shellUH.åH.ì.HÇEøO...H¸.OçK....H.EðHÇEè....HÇEà....HÇEØ....HÇEÐ....H¸a[dKÏw..H.EÈHÇEÀ....HÇE¸....HÇE°Á!..HÇE¨ée".HÇE 3...HÇE.«..HÇE..ª..H.EøH.¯EðH.E.H.EèH.¯EàH.¯EØH.¯EÐH.¯EÈH.E.H.EÀH.¯E¸H.¯E°H.¯E¨H..xÿÿÿH.E H.¯E.H.¯E.H..pÿÿÿ¸....É```
Flavor text from problem suggest that this is a program. So, disassembly? CyberChef has that ...```shellPUSH RBPMOV RBP,RSPSUB RSP,0000000000000018MOV QWORD PTR [RBP-08],0000004FMOV RAX,000000014BE74F15MOV QWORD PTR [RBP-10],RAXMOV QWORD PTR [RBP-18],00000004MOV QWORD PTR [RBP-20],00000003MOV QWORD PTR [RBP-28],00000013MOV QWORD PTR [RBP-30],00000115MOV RAX,000077CF4B645B61MOV QWORD PTR [RBP -38],RAXMOV QWORD PTR [RBP-40],00000002MOV QWORD PTR [RBP-48],00000011MOV QWORD PTR [RBP-50],000021C1MOV QWORD PTR [RBP-58],182265E9MOV QWORD PTR [RBP-60],00000833MOV QWORD PTR [RBP-68],00000AABMOV QWORD PTR [RBP-70],008DAAADMOV RAX,QWORD PTR [RBP-08]IMUL RAX,QWORD PTR [RBP-10]MOV QWORD PTR [RBP-78],RAXMOV RAX,QWORD PTR [RBP-18]IMUL RAX,QWORD PTR [RBP-20]IMUL RAX,QWORD PTR [RBP-28]IMUL RAX,QWORD PTR [RBP-30]IMUL RAX,QWORD PTR [RBP-38]MOV QWORD PTR [RBP-80],RAXMOV RAX,QWORD PTR [RBP-40]IMUL RAX,QWORD PTR [RBP-48]IMUL RAX,QWORD PTR [RBP-50]IMUL RAX,QWORD PTR [RBP-58]MOV QWORD PTR [RBP-00000088],RAXMOV RAX,QWORD PTR [RBP-60]IMUL RAX,QWORD PTR [RBP-68]IMUL RAX,QWORD PTR [RBP-70]MOV QWORD PTR [RBP-00000090],RAXMOV EAX,00000000LEAVE```
Ok, that makes since, "baby multiply". So, what's happening? Stores values in various variables. Then multiply a few things at a time. Then leave? So, what's thje result. Four variables, that when decoded as ascii give the flag:```pythonvar08 = 0x0000004Fvar10 = 0x000000014BE74F15var18 = 0x00000004var20 = 0x00000003var28 = 0x00000013var30 = 0x00000115var38 = 0x000077CF4B645B61var40 = 0x00000002var48 = 0x00000011var50 = 0x000021C1var58 = 0x182265E9var60 = 0x00000833var68 = 0x00000AABvar70 = 0x008DAAAD
var78 = var08 * var10var80 = var18*var20*var28*var30*var38var88 = var40*var48*var50*var58var90 = var60*var68*var70
parts = [var78, var80, var88,var90]for part in parts:    print(bytes.fromhex(hex(part)[2:]).decode('ascii'), end='')```
original Writeup: [Github](https://github.com/crr0tz-4-d1nn3r/CTFs/blob/master/CSAW_quals_2020/rev/baby_mult/README.md)