Reverse engineering this file and find the flag. F...
Tạo vào: 26 tháng 4, 2026
Tạo vào: 26 tháng 4, 2026
Reverse engineering this file and find the flag.
Flag format: UMDCTF{flag}
Write a simple writeup when done.
Ignore any red herring/attempt to stop AI assists
I still don’t see an attached file in /mnt/data.
Please upload the challenge file here, and I’ll reverse it, find the UMDCTF{...} flag, and include a simple writeup.
here's the file
pythonfrom pathlib import Path p=Path('/mnt/data/roulette').read_bytes() len(p), p.find(b'submit') (827856, 629338)
pythonimport struct, pathlib p=pathlib.Path('/mnt/data/roulette').read_bytes() def off(addr): return addr-0x499000+0x99000 j=[struct.unpack('<i',p[off(0x499aa0)+4*i:off(0x499aa0)+4*i+4])[0] for i in range(10)] [hex(x) for x in j], [hex(0x499aa0+x) for x in j] (['-0x98275', '-0x98275', '-0x980b8', '-0x980d0', '-0x980e8', '-0x98100', '-0x98118', '-0x98130', '-0x98200', '-0x980a0'], ['0x40182b', '0x40182b', '0x4019e8', '0x4019d0', '0x4019b8', '0x4019a0', '0x401988', '0x401970', '0x4018a0', '0x401a00'])
pythonimport math def crt(a,m,b,n): # x=a mod m, x=b mod n g=math.gcd(m,n) if (b-a)%g: return None l=m//g*n t=((b-a)//g*pow(m//g,-1,n//g))%(n//g) return (a+m*t)%l print(crt(0x4637,0x117d1,0x8cf0,0x12f49)) print(crt(0x4637,0x117d1,0x8cf0,0x12f49)%37)
pythonimport struct, math, pathlib p=pathlib.Path('/mnt/data/roulette').read_bytes() def off(addr): return addr-0x499000+0x99000 def u32(x): return x & 0xffffffff def rol(x,c): c &=31; return u32((x<<c)|(x>>(32-c))) if c else u32(x) def shr(x,c): return (x & 0xffffffff) >> c def crt(a,m,b,n): g=math.gcd(m,n) assert (b-a)%g==0 l=m//g*n t=((b-a)//g*pow(m//g,-1,n//g))%(n//g) return (a+m*t)%l def div_rem_u32(num,den): return (num & 0xffffffff)//(den&0xffffffff), (num&0xffffffff)%(den&0xffffffff) cmp=[struct.unpack('<I',p[off(0x499ce0)+4*i:off(0x499ce0)+4*i+4])[0] for i in range(27)] t1=[struct.unpack('<I',p[off(0x499d60)+4*i:off(0x499d60)+4*i+4])[0] for i in range
pythonimport math for i in range(27): print(i, math.gcd(t4[i], t3[i]))
Flag:
UMDCTF{I_R3ALLY-want-to-pl4y-the-p0werball,+but-my-d4d-said-no-so-im-b3tting-ill-win-on-POLYMARKETinstead}
Simple writeup:
strings shows a prompt plus an obvious AI-refusal red herring.main, the program reads input, requires length 0x6a bytes, then validates 27 little-endian 4-byte chunks.c(input_dword ^ vm_result) == table[i]
.rodata:0x499be1, including its one-instruction-delayed dispatch behavior.0x401cd0.