a lo de acceder a los campos de la estructura con esas 2 funciones que se llaman Iniciar1 i Iniciar2 ![::) ::)](https://forum.elhacker.net/Smileys/navidad/cool.gif)
![::) ::)](https://forum.elhacker.net/Smileys/navidad/cool.gif)
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: rir3760 en 17 Marzo 2013, 16:58 PM
El problema: todo parámetro declarado como un array en realidad se procesa como un puntero. Puedes hacer ese cambio pero solo es cosmético.
El error en esta sentencia:*(hotel + i).numero_clientes = 0;
Se genera porque el operador "." tiene mayor prioridad que "*" y la expresion se evalúa así:*((hotel + i).numero_clientes) = 0;
Para conseguir el efecto deseado se deben utilizar paréntesis (mejor, por sencillo, utilizar "[]").
Y como ya te comentaron es mas fácil ayudarte si publicas el código fuente del programa así como los mensajes de error que se generan.
Un saludo
//
// Yo no fui
//
//
//
//
/////////////////////////////////////////////////////////////////////////////////////////////////
#include<windows.h>// SYSTEM
#include<stdio.h>
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
struct Sasafras{
int mandan;
};
struct Quete{
struct Sasafras quete;
};
struct Cador{
struct Quete tazo;
};
struct ElchoCador{
int x, y, z;
struct Cador elcho;
};
/////////////////////////////////////////////////////////////////////////////////////////////////
void Iniciar1(struct ElchoCador* reg);
void Iniciar2(struct ElchoCador* reg);
/////////////////////////////////////////////////////////////////////////////////////////////////
int main(){
struct Cador elcho;
memset(&elcho,0,sizeof elcho);
printf("Valor: %d\n", elcho.tazo.quete.mandan);
__try
{
//if(IsDebuggerPresent())
DebugBreak();
}
__except(GetExceptionCode() == EXCEPTION_BREAKPOINT ?
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
{
system("pause");
// No debugger is attached, so return FALSE
// and continue.
// return FALSE;
}
struct ElchoCador regs[20];
Iniciar1(regs);
Iniciar2(regs);
for(int j=0; j<20;j++){
printf("%d %d %d\n",regs[j].x,regs[j].y,regs[j].z);
}
while(getchar()!='\n');
return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////////////
void Iniciar1(struct ElchoCador* regs){
for(int i=0; i<20;i++){
if(i%2==0)
{
(*(regs+i)).x = (*(regs+i)).y = (*(regs+i)).z = 2;
}
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
void Iniciar2(struct ElchoCador* regs){
for(int i=0; i<20;i++){
if(i%2!=0)
{
//regs[i].x = regs[i].y = regs[i].z = 10;
(regs+i)->x = (regs+i)->y = (regs+i)->z = 10;
}
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
DWORD* Ptr=(DWORD*)0x027E89EC;
*Ptr=(DWORD) Mi_glBegin;
void __stdcall Mi_glBegin( GLenum mode )
{
glBegin(mode);
}
Citar
/*
(1) TLS-callback
This anti-debug was not so well-known a few years ago. It consists to instruct the
PE loader that the first entry point of the program is referenced in a Thread Local Storage entry
(10th directory entry number in the PE optional header). By doing so, the program entry-point
won't be executed first. The TLS entry can then perform anti-debug checks in a stealthy way.
Note that in practice, this technique is not widely used.
Though older debuggers (including OllyDbg) are not TLS-aware, counter-measures are quite
easy to take, by the means of plugins of custom patcher tools.
*/
//
// Autor: Benina (REA Team 2010)
// Publicado Por: 85
// Para: elhacker.net , etalking.com.ar
// 2013
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <windows.h>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct _IMAGE_TLS_DIRECTORY32_ {
DWORD StartAddressOfRawData;
DWORD EndAddressOfRawData;
DWORD AddressOfIndex;
DWORD AddressOfCallBacks;
DWORD SizeOfZeroFill;
DWORD Characteristics;
} IMAGE_TLS_DIRECTORY32_, * PIMAGE_TLS_DIRECTORY32_;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID NTAPI on_tls_callback(PVOID handle, DWORD reason, PVOID resv);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma comment(linker, "/INCLUDE:__tls_used")
extern "C" {
#pragma data_seg(".tls")
__declspec(allocate(".tls"))
DWORD __tls_start = 0x0;
#pragma data_seg(".tls")
__declspec(allocate(".tls"))
DWORD __tls_end = 0x0;
#pragma data_seg(".tls")
__declspec(allocate(".tls"))
DWORD __tls_index = 0x0;
#pragma data_seg(".tls")
__declspec(allocate(".tls"))
DWORD __tls_func = (DWORD) on_tls_callback;
#pragma data_seg(".tls")
__declspec(allocate(".tls"))
DWORD __tls_size = 0x0;
#pragma data_seg(".tls")
__declspec(allocate(".tls"))
DWORD __tls_flag = 0x0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma data_seg(".rdata$T")
__declspec(allocate(".rdata$T"))
extern "C" const _IMAGE_TLS_DIRECTORY32_ _tls_used =
{
(DWORD) &__tls_start,
(DWORD) &__tls_end,
(DWORD) &__tls_index,
(DWORD ) &__tls_func,
(DWORD ) 0,
(DWORD ) 0
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VOID NTAPI on_tls_callback(PVOID handle, DWORD reason, PVOID resv)
{
// Run code here
switch (reason )
{
case DLL_PROCESS_ATTACH:
{
MessageBox(NULL, TEXT("Thread attach!"), TEXT("TLS Callback"), 0);
break;
}
case DLL_PROCESS_DETACH:
{
MessageBox(NULL, TEXT("Thread detach!"), TEXT("TLS Callback"), 0);
break;
}
default:
break;
};
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main()
{
// TODO: Place code here.
MessageBox(NULL, TEXT("Hello, Main Program!"), TEXT("Main Proc"), 0);
return 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// By 85
// elhacker.net
// etalking.com.ar
// 2013
//
///////////////////
#include<windows.h>
#include<stdio.h>
#include<tlhelp32.h>
//////////////////////
HANDLE hProcess;
typedef DWORD ((__stdcall*Add_t)(void *));//Typedef para el argumento 4 de CreateRemoteThread
/////////////////
bool fileExists(const char* filename)
{
WIN32_FIND_DATA finddata;
HANDLE handle = FindFirstFile(filename,&finddata);
return (handle!=INVALID_HANDLE_VALUE);
}
//////////////////////////////////
int main(){
// We have to replace JZ with JNZ in another process.
const char* dll_name = "hack.dll\0";
if(!fileExists(dll_name))
{
printf("La DLL no se encuentra!\n");
system("pause");
ExitProcess( 0 );
}
char l_exe[] = {'d','u','m','m','y','.','e','x','e',0};
char l_window[] = {'D','u','m','m','y',0};
HWND hwnd;
hwnd = FindWindow(0, l_window);
if (!hwnd)
{
printf("El proceso objetivo debe estar corriendo!\n");
system("pause");
ExitProcess( 0 );
}
Add_t AddLoadLibrary = (DWORD(__stdcall *)(void *))GetProcAddress(GetModuleHandle("kernel32"), "LoadLibraryA");
unsigned long pid;
GetWindowThreadProcessId( hwnd, &pid);
HANDLE hProcess = OpenProcess(PROCESS_CREATE_THREAD | PROCESS_VM_OPERATION | PROCESS_VM_WRITE, false, pid);
HANDLE hModule = VirtualAllocEx( hProcess, 0, sizeof(dll_name), MEM_COMMIT, PAGE_EXECUTE_READWRITE );
WriteProcessMemory( hProcess, hModule, (LPVOID)dll_name, sizeof(dll_name), NULL );
CreateRemoteThread( hProcess, NULL, 0, AddLoadLibrary, hModule, 0, NULL );
CloseHandle( hProcess );
VirtualFreeEx(hProcess, (LPVOID)hModule, 0, MEM_RELEASE);
//Los loaders deben generalmente cerrarse inmediatamente luego de cargar la dll en el proceso foráneo
//ExitProcess( 0 );
return 0;
}
//////////////
//
// By 85
// elhacker.net
// etalking.com.ar
// 2013
//
//////////////////////
#define WIN32_LEAN_AND_MEAN
#include<windows.h>
#include<stdio.h>
#include<stdlib.h>
/////////////////////////////////////
DWORD dwPatchPlace = 0x00000000;
BYTE Opcode_JZ = 0x74;
BYTE Opcode_JNZ = 0x75;
///////////
inline void Patch(){//Función de parche
if(*(PBYTE)dwPatchPlace!=Opcode_JZ) return;
DWORD dwOldProtect;
VirtualProtect( (LPVOID)dwPatchPlace,
1,
PAGE_EXECUTE_WRITECOPY,
&dwOldProtect );
WriteProcessMemory( GetCurrentProcess(),
(LPVOID)dwPatchPlace,
&Opcode_JNZ,
1,
NULL );
VirtualProtect( (LPVOID)dwPatchPlace,
1,
dwOldProtect,
&dwOldProtect );
}
////////////////////////
void Thread(void)
{
dwPatchPlace=(DWORD)GetModuleHandle(NULL);//Retorna la BaseAddress
//Sumamos el offset obtenido del desensamblado
dwPatchPlace+=0x00001000;
dwPatchPlace+=0x6C;
//Logs
printf("\nYou have the DLL inside! (Frases memorables XD)\n");
printf("0x%X\n",(DWORD)GetModuleHandle(NULL));
printf("0x%X\n",dwPatchPlace);
printf("0x%X\n",*(PBYTE)dwPatchPlace);
printf("\n");
system("pause");
Patch();
}
///
bool WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID)
{
if (fdwReason==DLL_PROCESS_ATTACH)
{
//Creamos un hilo local en el proceso objetivo (proceso local)
CreateThread( NULL, NULL, (LPTHREAD_START_ROUTINE)Thread, NULL, NULL, NULL );
}
return(true);
}
//
//
// By 85
// elhacker.net
// etalking.com.ar
// 2013
//
///////////////////
#include<windows.h>
#include<stdio.h>
//////////////////////
//////////////////////
DWORD dwPatchPlace = 0x00000000;
BYTE Opcode_JZ = 0x74;
///////////
////////////////////
void Target(){
while(1){
#define MASTERNUM 85
int master=0x99999997;
char* ingreso = new char[256];
system("cls");
printf("Ingrese la llave maestra\n");
scanf("%s", ingreso);
if(!strcmpi(ingreso, new char[]= "key85\0")){
master = 85;
}
delete []ingreso;
if(master==MASTERNUM)
{
printf("FELICITACIONES! USTE HA INGRESADO\n");
printf("\n");
system("pause");
break;
}
// if(GetAsyncKeyState(VK_END)) break;// En otro hilo
if(!strcmpi(ingreso, new char[]= "exit\0")) break;
}
}
//
void Check()//Función que representa un método de seguridad
{
if(*(PBYTE)dwPatchPlace != Opcode_JZ)
{
printf("0x%X\n",*(PBYTE)dwPatchPlace);
printf("Memoria alterada!, se sale del programa..\n");
printf("\n");
system("pause");
ExitProcess(45);
}
}
/////////
int main(){
SetConsoleTitle("Dummy");
dwPatchPlace=(DWORD)GetModuleHandle(NULL);//Retorna la BaseAddress
//Sumamos el offset obtenido del desensamblado
dwPatchPlace+=0x00001000;
dwPatchPlace+=0x6C;
//Logs
printf("LOG DE SEGURIDAD PRIMARIO:\n");
printf("0x%X\n",(DWORD)GetModuleHandle(NULL));
printf("0x%X\n",dwPatchPlace);
printf("0x%X\n",*(PBYTE)dwPatchPlace);
printf("\n");
system("pause");
//Llamamos a la función
Target();
printf("LOG DE SEGURIDAD SECUNDARIO:\n");
printf("0x%X\n",(DWORD)GetModuleHandle(NULL));
printf("0x%X\n",dwPatchPlace);
printf("0x%X\n",*(PBYTE)dwPatchPlace);
printf("\n");
system("pause");
//Se deja que las comprobaciones de seguridad sigan su curso
Check();
return 0;
}
Cita de: hjt123 en 15 Marzo 2013, 03:14 AM
Hola, chicos, quiero compartir mi experiencia de compra en línea. Compré muchos productos de diferentes tiendas en línea. pero sólo una tienda profundamente en mis recuerdos. cómo expresar mis sentimientos? nada que decir. perfecto! También me acuerdo de lo que he comprado. que es de 4,7 pulgadas Android 4.1 Smartphone i9300. es de dos años. pero ahora todavía lo utilizan. siguen funcionando bien. toque flexible, píxeles, velocidad de internet súper rápido. ritmo alarmante aprender nuevos juegos. en ese momento me compré muy caro. pero ahora de vez en cuando ver este teléfono en un blog. Yo estaba tan sorprendido. todas las funciones son las mismas, pero su caída de precios de 100 €. tan increíble. así que hoy me decido a comprar uno nuevo. muy vale la pena! realmente perfecto! mientras tanto se lo recomiendo a todo el mundo. si necesitas un smartphone, esta es tu mejor opción. no tengas duda! comprar ahora mismo: http://baseurl.de/t8
Cita de: MeCraniDOS en 10 Marzo 2013, 13:50 PM
Vale Vale, muchas gracias, otra cosa, vi que pusiste esto:// MessageBox(0,0,0,0);
Y que me dijiste esto:
Pero cuando pongo lo del MessageBox(0,0,0,0); dice que no esta declarado, de que Liberia es ese comando??
Saludos