Hello Max,
the file that adds a member to a group is
admin/ug/member-add.tcl?group_id=1 (for side-wide-admin for example)
go there via /admin > /admin/ug > click on i.e. Administration > click on i.e. Site-Wide-Administration > on the bottom you should see "Group Members" and the link "add a member in a role"
I hope that this is what you are looking for...