Snippets

新妻浩光 8nMMAB: Untitled snippet

Created by 新妻浩光
/* the main */

undefined4
UndefinedFunction_0000c500(int param_1,undefined4 *param_2,undefined4 param_3,undefined4param_4)

{
  int iVar1;
  uint uVar2;
  undefined4 uVar3;
  byte bVar4;
  undefined4 uVar5;
  uint auStack280 [65];
  
  bVar4 = (byte)param_4;
  if (param_1 == 2) {

/// getcwd(launchDir, MAX_PATH - 1); に相当
/// ここで取得したlaunchDirは表示以外に使用していない。
/// (オリジナルでは加工してディレクトリ参照している)

    getcwd((uint)&DAT_00450900,0xff);	

///     strcat(launchDir, "/");に相当

    iVar1 = strlen((uint)&DAT_00450900);
    strncpy((uint *)(&DAT_00450900 + iVar1),(uint *)&DAT_002d9234,2,bVar4);

/// 固定文字列の宣言

    DAT_004507e0 = 0x746e6d2f;	// "/mnt"
    DAT_004507e4 = 0x6e65762f;	// "/ven"
    DAT_004507e8 = 0x2f726f64;  // "dor/"
    DAT_004507ec = 0x2f736572;	// "res/"

	// const char *DAT_004507e0="/mnt/vendor/res";

                    /* roms */
    DAT_004507f0 = 0x736d6f72;
    DAT_004507f4 = 0;

	// const char *DAT_004507f0="roms"

                    /* dor/roms */
    uVar3 = 0x2f726f64;
    uVar5 = 0x2f736572;


    DAT_00450a00 = 0x746e6d2f;	// "/mnt"
    DAT_00450a04 = 0x6e65762f;	// "/ven"
    DAT_00450a08 = 0x2f726f64;	// "dor/"
    DAT_00450a0c = 0x2f736572;	// "res/"
    DAT_00450a10 = 0x68636163;	// "cach"
    DAT_00450a14 = 0x65;	// "e"

	// const char *DAT_00450a00="/mnt/vendor/res/cache";
/// 元のコードにもあるprintfの部分

    FUN_00238240(&DAT_00450b04,param_2[1]);
    printf("launchDir = %s\n",&DAT_00450900,uVar3,uVar5);
    printf("cache_dir = %s\n",&DAT_00450a00,uVar3,uVar5);
    printf("game_dir = %s\n",&DAT_004507e0,uVar3,uVar5);
    bVar4 = (byte)uVar5;
    printf("game_name = %s\n",&DAT_00450b04,uVar3,uVar5);
    thunk_FUN_000a13e0();
    FUN_000a1480();


///
	// auStack280= chache_name
    FUN_00238240(auStack280,&DAT_00450a00);

    iVar1 = strlen((uint)auStack280);
    strncpy((uint *)((int)auStack280 + iVar1),(uint *)&DAT_002d9234,2,bVar4);
    FUN_00237ea0(auStack280,&DAT_00450b04);
    iVar1 = strlen((uint)auStack280);
    strncpy((uint *)((int)auStack280 + iVar1),(uint *)"_cache",7,0xe8);
    uVar2 = FUN_00249c70(auStack280,0);
    DAT_00308adc = 1 - uVar2;
    if (1 < uVar2) {
      DAT_00308adc = 0;
    }

//// このprintfは元のコードに存在しない
    printf("--cache_name = %s isForceCache = %d \n",auStack280,DAT_00308adc,DAT_00308adc);

/// neo_game_w = 320;
/// neo_game_h = 224;

    DAT_00450b00 = 0x140;
    DAT_004508e0 = 0xe0;
    machine_main();
  }
  else {
    printf("usage %s gamename\n",*param_2,param_3,param_4);
  }
  return 0;
}

Comments (0)