Complicated pseudocode

.bss:0045E080 is_day_in_room dd ?
.bss:0045E084 sound_id_room dw ?

mov edx, ds:is_day_in_room+2
sar edx, 10h

IDA generate psudocode like this:
*(int *)((char *)&is_day_in_room + 2) >> 16)

is it possible to make it like sound_id_room?

It’s difficult to say without havng the binary, but possibly making a struct for these fields would help. You could also try creating a plugin to detect and transform this pattern.

1 Like

You defined is_day_in_room as double dword, which is 4 bytes. It references something at offset 2 from it. You should have split is_day_in_room to two dwords and update second dword name accordingly.