Calificación:
  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5
minecraft 1.6.4 test
#6
(07-11-2013, 01:47 PM)admin escribió:
(07-11-2013, 01:35 PM)ToyDead escribió: esas dudas tengo AT que relacion tiene lo destacado.

y ese

estas descompilando el launcher con pestaña de skin? o el Minecraft.jar ??

mejor empieza por descompilar el Minecraft.jar .. que es dentro del juego donde se ven los skins .. una vez comenzado el juego creo que el launcher se cierra

si tu abres www.minecraft.net/cualquiernombre.png y en vez de bajar un png te sale un xml diciendo que la cuenta no existe o algo asi ... me parece que la direccion es en realidad un script que revisa la parte de "cualquiernombre" y revisa si existe la cuenta, si es premium y si ha cambiado el skin .. y si es asi lee el archivo png y te lo manda

o sea que la verificacion pienso que la debe hacer el servidor web donde estan los skins .. yo no pienso hacer ninguna verificacion y si el jugador no tiene skin se le mandara un 404 no mas .. supongo que con eso debe bastar

de nuevo ... revisa el codigo del Minecraft.jar .. no de los launchers .. despues lo hacemos para ver como hacen para saltarse la cuenta premium Sonrisa

si estoy revisando el launcher con pestaña skin.

Pero como podi ver en el codigo de echo hace ese proceso.
te logeas (el cliente crea una UUID deribada del username, ligada).
que queda registrada en el archivo Launcher_profile.json.
en el codigo que te puse en recortes dice que ahuntentifica ese username con su UUID en el servidor original la cual revisa si el username y su UUID tiene un skin designado, el servidor de skin se encarga de sacar 843824.png renombrandola al nombre de usuario y la envia al cliente y el cliente la manda al servidor de juego, (SE CIERRA LAUNCHER), es por eso que no se puede acceder por link a la foto via web.

es asi, tambien revise el codigo de la seccion ahuntentificacion y hay genera el UUID a partir del username.

[shcode=java]package net.minecraft.launcher.authentication;

import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import net.minecraft.launcher.authentication.yggdrasil.YggdrasilAuthenticationService;

public class AuthenticationDatabase
{
public static final String DEMO_UUID_PREFIX = "demo-";
private final Map<String, AuthenticationService> authById;

public AuthenticationDatabase()
{
this(new HashMap());
}

public AuthenticationDatabase(Map<String, AuthenticationService> authById) {
this.authById = authById;
}

public AuthenticationService getByName(String name) {
if (name == null) return null;

for (Map.Entry entry : authById.entrySet()) {
GameProfile profile = ((AuthenticationService)entry.getValue()).getSelectedProfile();

if ((profile != null) && (profile.getName().equals(name)))
return (AuthenticationService)entry.getValue();
if ((profile == null) && (getUserFromDemoUUID((String)entry.getKey()).equals(name))) {
return (AuthenticationService)entry.getValue();
}
}

return null;
}

public AuthenticationService getByUUID(String uuid) {
return (AuthenticationService)authById.get(uuid);
}

public Collection<String> getKnownNames() {
List names = new ArrayList();

for (Map.Entry entry : authById.entrySet()) {
GameProfile profile = ((AuthenticationService)entry.getValue()).getSelectedProfile();

if (profile != null)
names.add(profile.getName());
else {
names.add(getUserFromDemoUUID((String)entry.getKey()));
}
}

return names;
}

public void register(String uuid, AuthenticationService authentication) {
authById.put(uuid, authentication);
}

public Set<String> getknownUUIDs() {
return authById.keySet();
}

public void removeUUID(String uuid) {
authById.remove(uuid);
}

public static String getUserFromDemoUUID(String uuid)
{
if ((uuid.startsWith("demo-")) && (uuid.length() > "demo-".length())) {
return "Demo User " + uuid.substring("demo-".length());
}
return "Demo User";
}

public static class Serializer
implements JsonDeserializer<AuthenticationDatabase>, JsonSerializer<AuthenticationDatabase>
{
public AuthenticationDatabase deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
throws JsonParseException
{
TypeToken token = new TypeToken()
{
};
Map services = new HashMap();
Map credentials = (Map)context.deserialize(json, token.getType());

for (Map.Entry entry : credentials.entrySet()) {
AuthenticationService service = new YggdrasilAuthenticationService();
service.loadFromStorage((Map)entry.getValue());
services.put(entry.getKey(), service);
}

return new AuthenticationDatabase(services);
}

public JsonElement serialize(AuthenticationDatabase src, Type typeOfSrc, JsonSerializationContext context)
{
Map services = src.authById;
Map credentials = new HashMap();

for (Map.Entry entry : services.entrySet()) {
credentials.put(entry.getKey(), ((AuthenticationService)entry.getValue()).saveForStorage());
}

return context.serialize(credentials);
}
}
}

package net.minecraft.launcher.authentication;

import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import javax.swing.SwingUtilities;
import net.minecraft.launcher.Launcher;
import net.minecraft.launcher.events.AuthenticationChangedListener;
import org.apache.commons.lang3.StringUtils;

public abstract class BaseAuthenticationService
implements AuthenticationService
{
private static final String LEGACY_LASTLOGIN_PASSWORD = "passwordfile";
private static final int LEGACY_LASTLOGIN_SEED = 43287234;
private final List<AuthenticationChangedListener> listeners = new ArrayList();
private String username;
private String password;
private GameProfile selectedProfile;
private boolean shouldRememberMe = true;

public boolean canLogIn()
{
return (!canPlayOnline()) && (StringUtils.isNotBlank(getUsername())) && (StringUtils.isNotBlank(getPassword()));
}

public void logOut()
{
password = null;
setSelectedProfile(null);
}

public boolean isLoggedIn()
{
return getSelectedProfile() != null;
}

public boolean canPlayOnline()
{
return (isLoggedIn()) && (getSelectedProfile() != null) && (getSessionToken() != null);
}

public void addAuthenticationChangedListener(AuthenticationChangedListener listener)
{
listeners.add(listener);
}

public void removeAuthenticationChangedListener(AuthenticationChangedListener listener)
{
listeners.remove(listener);
}

protected void fireAuthenticationChangedEvent() {
final List listeners = new ArrayList(this.listeners);

for (Iterator iterator = listeners.iterator(); iterator.hasNext(); ) {
AuthenticationChangedListener listener = (AuthenticationChangedListener)iterator.next();

if (!listener.shouldReceiveEventsInUIThread()) {
listener.onAuthenticationChanged(this);
iterator.remove();
}
}

if (!listeners.isEmpty())
SwingUtilities.invokeLater(new Runnable()
{
public void run() {
for (AuthenticationChangedListener listener : listeners)
listener.onAuthenticationChanged(BaseAuthenticationService.this);
}
});
}

public void setUsername(String username)
{
if ((isLoggedIn()) && (canPlayOnline())) {
throw new IllegalStateException("Cannot change username whilst logged in & online");
}

this.username = username;
}

public void setPassword(String password) {
if ((isLoggedIn()) && (canPlayOnline()) && (StringUtils.isNotBlank(password))) {
throw new IllegalStateException("Cannot set password whilst logged in & online");
}

this.password = password;
}

public String getUsername() {
return username;
}

protected String getPassword() {
return password;
}

public void loadFromStorage(Map<String, String> credentials)
{
logOut();

if (credentials.containsKey("rememberMe")) {
setRememberMe(Boolean.getBoolean((String)credentials.get("rememberMe")));
}

setUsername((String)credentials.get("username"));

if ((credentials.containsKey("displayName")) && (credentials.containsKey("uuid")))
setSelectedProfile(new GameProfile((String)credentials.get("uuid"), (String)credentials.get("displayName")));
}

public Map<String, String> saveForStorage()
{
Map result = new HashMap();

if (!shouldRememberMe()) {
result.put("rememberMe", Boolean.toString(false));
return result;
}

if (getUsername() != null) {
result.put("username", getUsername());
}

if (getSelectedProfile() != null) {
result.put("displayName", getSelectedProfile().getName());
result.put("uuid", getSelectedProfile().getId());
}

return result;
}

public boolean shouldRememberMe()
{
return shouldRememberMe;
}

public void setRememberMe(boolean rememberMe)
{
shouldRememberMe = rememberMe;
}

protected void setSelectedProfile(GameProfile selectedProfile) {
this.selectedProfile = selectedProfile;
}

public GameProfile getSelectedProfile() {
return selectedProfile;
}

public String toString()
{
StringBuilder result = new StringBuilder();

result.append(getClass().getSimpleName());
result.append("{");

if (isLoggedIn()) {
result.append("Logged in as ");
result.append(getUsername());

if (getSelectedProfile() != null) {
result.append(" / ");
result.append(getSelectedProfile());
result.append(" - ");

if (canPlayOnline()) {
result.append("Online with session token '");
result.append(getSessionToken());
result.append("'");
} else {
result.append("Offline");
}
}
} else {
result.append("Not logged in");
}

result.append("}");

return result.toString();
}

public String guessPasswordFromSillyOldFormat(File file) {
String[] details = getStoredDetails(file);

if ((details != null) &&
(details[0].equals(getUsername()))) {
return details[1];
}

return null;
}

public static String[] getStoredDetails(File lastLoginFile) {
if (!lastLoginFile.isFile()) return null;
try
{
Cipher cipher = getCipher(2, "passwordfile");
DataInputStream dis;
DataInputStream dis;
if (cipher != null)
dis = new DataInputStream(new CipherInputStream(new FileInputStream(lastLoginFile), cipher));
else {
dis = new DataInputStream(new FileInputStream(lastLoginFile));
}

String username = dis.readUTF();
String password = dis.readUTF();
dis.close();
return new String[] { username, password };
} catch (Exception e) {
Launcher.getInstance().println("Couldn't load old lastlogin file", e);
}return null;
}

private static Cipher getCipher(int mode, String password) throws Exception
{
Random random = new Random(43287234L);
byte[] salt = new byte[8];
random.nextBytes(salt);
PBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, 5);

SecretKey pbeKey = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(new PBEKeySpec(password.toCharArray()));
Cipher cipher = Cipher.getInstance("PBEWithMD5AndDES");
cipher.init(mode, pbeKey, pbeParamSpec);
return cipher;
}
}[/shcode]
Responder


Mensajes en este tema
minecraft 1.6.4 test - por atesin - 06-11-2013, 05:56 PM
RE: minecraft 1.6.4 - por atesin - 06-11-2013, 10:30 PM
RE: minecraft 1.6.4 - por ToyDead - 07-11-2013, 09:46 AM
RE: minecraft 1.6.4 - por ToyDead - 07-11-2013, 01:35 PM
RE: minecraft 1.6.4 - por atesin - 07-11-2013, 01:47 PM
RE: minecraft 1.6.4 - por ToyDead - 07-11-2013, 02:01 PM
RE: minecraft 1.6.4 - por atesin - 07-11-2013, 11:12 PM
RE: minecraft 1.6.4 - por atesin - 12-11-2013, 12:38 AM
RE: minecraft 1.6.4 - por ToyDead - 12-11-2013, 12:53 AM

Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)