You can't have the `f = File.open(fh.path, 'rb')` inside the `begin` as if there is an error on `File.open`, then `f` will be `nil` in the `ensure` and you'll get `NoMethodError: undefined method `close' for nil:NilClass`.  It would probably be better to just use the block form of `File.open` since it is specifically there to handle this use case of wanting to ensure the file is closed when you exit the block.

```ruby
File.open(fh.path, 'rb') do |f|
used = f.read(4)
  if used != "USED"
    print_error "Invalid Configuration File!"
    return
  end
  
  f.seek(0x38)
  start = makefptr(f.read(4))
  userptr = findentry(f, "B014USER", start)
  
  if userptr != nil
    parseusers(f, userptr)
  else
    print_error "Error finding the user table in the configuration."
  end
end
```