port over some more

This commit is contained in:
ra
2026-02-14 23:58:01 -07:00
parent 0222be36c5
commit 61176cd416
107 changed files with 9124 additions and 375 deletions

View File

@@ -222,6 +222,21 @@ defmodule Odinsea.Net.Cipher.LoginCrypto do
end
end
@doc """
Hashes a second password (PIC) using SHA-1.
Used for second password storage.
## Parameters
- password: Plain text second password
## Returns
- Hex-encoded SHA-1 hash (lowercase)
"""
@spec hash_second_password(String.t()) :: String.t()
def hash_second_password(password) when is_binary(password) do
hex_sha1(password)
end
# Private helper: hash a string with a given digest algorithm
@spec hash_with_digest(String.t(), atom()) :: String.t()
defp hash_with_digest(input, digest) do

View File

@@ -279,6 +279,10 @@ defmodule Odinsea.Net.Opcodes do
# General
def lp_alive_req(), do: 0x0D
def lp_enable_action(), do: 0x0C
def lp_set_field(), do: 0x14
def lp_set_cash_shop_opened(), do: 0x15
def lp_migrate_command(), do: 0x16
# Login
def lp_login_status(), do: 0x01