Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
feat: support params_name
Browse files Browse the repository at this point in the history
  • Loading branch information
KawaiiNahida committed Dec 19, 2023
1 parent eca2bae commit 06e9fc9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/kotlin/com/liteldev/headeroutput/data/MemberTypeData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ data class MemberTypeData(
@SerialName("namespace") val namespace: String, // Mob
@SerialName("name") var name: String, // hasComponent
@SerialName("params") val params: List<VariableTypeData> = emptyList(),
@SerialName("params_name") val paramsName: List<String> = emptyList(),
@SerialName("flag_bits") var flags: Int, // 1
@SerialName("rva") val rva: Long, // 13417264
@SerialName("symbol") var symbol: String, // ?hasComponent@Mob@@UEBA_NAEBVHashedString@@@Z
Expand Down Expand Up @@ -50,8 +51,18 @@ data class MemberTypeData(
valType.name = ""
else if (valType.name.isBlank() && !isConstructor() && !isDestructor()) valType.name = "auto"
else valType.name = valType.name.replaceEnumType()
val paramsString = params.joinToString(", ") { it.name }.replaceEnumType()

var paramsString = ""
val paramNameBeginIndex = if (hasFlag(FLAG_PTR_CALL)) 1 else 0
if (paramsName.isNotEmpty() && params.size + paramNameBeginIndex == paramsName.size) {
// params name available
for (i in params.indices) {
paramsString += "${params[i].name} ${paramsName[i + paramNameBeginIndex]}"
if (i != params.size - 1) paramsString += ", "
}
} else {
paramsString = params.joinToString(", ") { it.name }.replaceEnumType()
}
// Linkage specifiers
if (isVirtual())
if (useFakeSymbol) append("MCVAPI ")
Expand Down

0 comments on commit 06e9fc9

Please sign in to comment.