Wouldn't it make more sense to just pull out the difference (the pack argument)?:

```ruby
unpacked_data = [0x4d4d6353, 0x07, cmd_length]

if target.arch.include?(ARCH_MIPSBE)
  pack_format = 'NVV'
else
  pack_format = 'VNN'
end

data = unpacked_data.pack(pack_format)
```