__getptd
function · crt · boundary
- Address
0x40acbb· 103 bytes, up to0x40ad21- Meaning
- Returns the C runtime's per-thread data
- Confidence
- inferred
- Name from
- the community database (idb)
- Finding
- random#the-c-runtime-rand
Finding: The C runtime rand in random
rand (0x7400e5) updates a per-thread dword as s = s·214013 + 2531011 and returns
(s >> 16) & 0x7fff. srand (0x7400d8) stores its argument there. The main thread's state is
seeded at startup, before WinMain, with the client clock 0x42c010; again with the clock
whenever the player enters a PIN at login; and whenever Lua code calls math.randomseed. So the
sequence differs on every run. rand has 15 call
sites; one is Lua's math.random (0x7fb310), and one, MakeSocketPipe (0x5bcf90), picks its
first loopback port as 40000 + rand() % 10000.
The derivation is in the doc.
Callers 18
- __XcptFilter crt
- _signal crt
- _raise crt
- 0x40c407 crt
- ___pxcptinfoptrs crt
- __errno crt
- ___doserrno crt
- _srand crt
- _rand crt
- 0x741a4c crt
- _strerror crt
- _gmtime crt
- _asctime crt
- 0x746bf7 crt
- 0x746daa crt
- 0x746fe0 crt
- 0x7473cc crt
- 0x74742d crt
Callees 3
- __amsg_exit crt
- __initptd crt
- 0x40d9b5 crt
Calls and jumps by a bare address, from tables/calls.tsv.