Function at 0x4d8bf0
Capabilities:
Read file on windows

Disassembly:
mov eax, dword [0x5c989c]
sub esp, 0x268
cmp eax, 4
push ebx
push ebp
push esi
push edi
mov ebp, ecx
jne 0x4d8c0d
mov byte [ebp + 0x124], 1
mov edi, str.Terrain
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x27c]
mov dword [ebp + 0x118], ecx
mov ecx, dword [esp + 0x280]
mov edx, dword [ecx]
mov dword [ebp + 0xed0], edx
mov eax, dword [ecx + 4]
mov dword [ebp + 0xed4], eax
mov eax, dword [ecx + 8]
test eax, eax
jne 0x4d8c67
mov dword [ebp + 0xedc], 0x50
jmp 0x4d8c6d
mov dword [ebp + 0xedc], eax
mov eax, dword [ecx + 0xc]
test eax, eax
jne 0x4d8c80
mov dword [ebp + 0xed8], 8
jmp 0x4d8c86
mov dword [ebp + 0xed8], eax
fld dword [ecx + 0x14]
fcomp dword [0x58ddb8]
fnstsw ax
test ah, 0x40
je 0x4d8ca2
mov dword [ebp + 0xf3c], 0x41a00000
jmp 0x4d8cab
mov edx, dword [ecx + 0x14]
mov dword [ebp + 0xf3c], edx
mov eax, dword [ecx + 0x18]
mov dword [esp + 0x28], 0
mov dword [ebp + 0x388], eax
mov edx, dword [ecx + 0x1c]
mov eax, dword [ebp + 0xed0]
mov dword [ebp + 0x38c], edx
cdq
sub eax, edx
mov esi, dword [sym.imp.MSVCRT.dll_strncpy]
sar eax, 1
neg eax
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 0xed4]
fild dword [esp + 0x14]
cdq
fmul dword [ebp + 0xf3c]
sub eax, edx
push 0x104
sar eax, 1
fstp dword [esp + 0x28]
mov edx, dword [esp + 0x28]
mov dword [esp + 0x18], eax
fild dword [esp + 0x18]
lea eax, [ebp + 0xef0]
fmul dword [ebp + 0xf3c]
mov dword [eax], edx
mov edx, dword [esp + 0x2c]
fstp dword [esp + 0x30]
mov dword [eax + 4], edx
mov edx, dword [esp + 0x30]
mov dword [eax + 8], edx
mov eax, dword [ecx + 0x10]
mov ecx, dword [esp + 0x288]
mov dword [ebp + 0x3a0], eax
lea eax, [ebp + 0xbc4]
push ecx
push eax
call esi
mov edx, dword [esp + 0x294]
lea ebx, [ebp + 0xcc8]
push 0x104
push edx
push ebx
call esi
mov ecx, dword [esp + 0x2a4]
lea eax, [ebp + 0xdcc]
push 0x104
push ecx
push eax
call esi
push ebx
lea edx, [esp + 0x98]
push ebp
push edx
call fcn.0050eea0
lea eax, [esp + 0xa0]
push 0x5ceba0
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 0x38
test esi, esi
jne 0x4d8dad
mov edx, dword [0x5e062c]
lea ecx, [esp + 0x70]
push ecx
push str.A3DTerrain::Init_Can_not_open_height_map:__s
push edx
jmp 0x4d9710
mov eax, dword [ebp + 0xed4]
mov ecx, dword [ebp + 0xed0]
inc eax
inc ecx
imul eax, ecx
shl eax, 2
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [ebp + 0x378], eax
test eax, eax
jne 0x4d8df8
mov edx, dword [0x5e062c]
push str.A3DTerrain::Init_Not_Enough_Memory_
push edx
call fcn.004c6d70
add esp, 8
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x268
ret 0x14
push str..h16
push ebx
mov dword [ebp + 0x380], 0xc61c4000
mov dword [ebp + 0x384], 0x47c35000
call dword [sym.imp.MSVCRT.dll_strstr]
mov edi, dword [sym.imp.MSVCRT.dll_fread]
add esp, 8
test eax, eax
je 0x4d8efe
mov eax, dword [ebp + 0xed4]
mov dword [esp + 0x10], 0
inc eax
test eax, eax
jle 0x4d9077
mov ecx, dword [ebp + 0xed0]
xor ebx, ebx
inc ecx
test ecx, ecx
jle 0x4d8ee1
push esi
push 1
lea edx, [esp + 0x27]
push 1
push edx
call edi
push esi
push 1
lea eax, [esp + 0x36]
push 1
push eax
call edi
mov edx, dword [ebp + 0xed0]
xor ecx, ecx
mov ch, byte [esp + 0x3f]
add esp, 0x20
mov cl, byte [esp + 0x1e]
mov eax, dword [ebp + 0x378]
and ecx, 0xffff
inc edx
imul edx, dword [esp + 0x10]
mov dword [esp + 0x14], ecx
add edx, ebx
fild dword [esp + 0x14]
fmul dword [ebp + 0x38c]
fadd dword [ebp + 0x388]
fst dword [eax + edx*4]
fcom dword [ebp + 0x380]
fnstsw ax
test ah, 0x41
jne 0x4d8eba
fst dword [ebp + 0x380]
fcom dword [ebp + 0x384]
fnstsw ax
test ah, 1
je 0x4d8ecf
fstp dword [ebp + 0x384]
jmp 0x4d8ed1
fstp st(0)
mov ecx, dword [ebp + 0xed0]
inc ebx
inc ecx
cmp ebx, ecx
jl 0x4d8e51
mov eax, dword [esp + 0x10]
mov edx, dword [ebp + 0xed4]
inc eax
inc edx
cmp eax, edx
mov dword [esp + 0x10], eax
jl 0x4d8e40
jmp 0x4d9077
push str..bin
push ebx
call dword [sym.imp.MSVCRT.dll_strstr]
add esp, 8
test eax, eax
je 0x4d8fc2
mov eax, dword [ebp + 0xed4]
mov dword [esp + 0x18], 0
inc eax
test eax, eax
jle 0x4d9077
mov ecx, dword [ebp + 0xed0]
xor ebx, ebx
inc ecx
test ecx, ecx
jle 0x4d8fa5
push esi
push 1
lea edx, [esp + 0x18]
push 4
push edx
call edi
mov eax, dword [ebp + 0xed0]
add esp, 0x10
inc eax
mov ecx, dword [ebp + 0x378]
imul eax, dword [esp + 0x18]
fld dword [esp + 0x10]
add eax, ebx
fstp dword [ecx + eax*4]
fld dword [ebp + 0x380]
fcomp dword [esp + 0x10]
fnstsw ax
test ah, 1
je 0x4d8f7e
mov edx, dword [esp + 0x10]
mov dword [ebp + 0x380], edx
fld dword [ebp + 0x384]
fcomp dword [esp + 0x10]
fnstsw ax
test ah, 0x41
jne 0x4d8f99
mov eax, dword [esp + 0x10]
mov dword [ebp + 0x384], eax
mov ecx, dword [ebp + 0xed0]
inc ebx
inc ecx
cmp ebx, ecx
jl 0x4d8f39
mov eax, dword [esp + 0x18]
mov edx, dword [ebp + 0xed4]
inc eax
inc edx
cmp eax, edx
mov dword [esp + 0x18], eax
jl 0x4d8f2c
jmp 0x4d9077
mov eax, dword [ebp + 0xed4]
mov dword [esp + 0x18], 0
inc eax
test eax, eax
jle 0x4d9077
mov ecx, dword [ebp + 0xed0]
xor ebx, ebx
inc ecx
test ecx, ecx
jle 0x4d905f
push esi
push 1
lea edx, [esp + 0x1c]
push 1
push edx
call edi
mov eax, dword [esp + 0x24]
mov ecx, dword [ebp + 0xed0]
add esp, 0x10
and eax, 0xff
inc ecx
mov dword [esp + 0x10], eax
imul ecx, dword [esp + 0x18]
fild dword [esp + 0x10]
fmul dword [ebp + 0x38c]
fadd dword [ebp + 0x388]
mov edx, dword [ebp + 0x378]
add ecx, ebx
fst dword [edx + ecx*4]
fcom dword [ebp + 0x380]
fnstsw ax
test ah, 0x41
jne 0x4d903c
fst dword [ebp + 0x380]
fcom dword [ebp + 0x384]
fnstsw ax
test ah, 1
je 0x4d9051
fstp dword [ebp + 0x384]
jmp 0x4d9053
fstp st(0)
mov eax, dword [ebp + 0xed0]
inc ebx
inc eax
cmp ebx, eax
jl 0x4d8fe6
mov eax, dword [esp + 0x18]
mov ecx, dword [ebp + 0xed4]
inc eax
inc ecx
cmp eax, ecx
mov dword [esp + 0x18], eax
jl 0x4d8fd9
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [ebp + 0xed4]
mov esi, dword [sym.imp.MSVCRT.dll_malloc]
imul eax, dword [ebp + 0xed0]
lea edx, [eax + eax*2]
shl edx, 3
push edx
call esi
add esp, 8
mov dword [ebp + 0x394], eax
test eax, eax
jne 0x4d90c9
push str.A3DTerrain::Init_Not_Enough_Memory_
mov eax, dword [0x5e062c]
push eax
call fcn.004c6d70
add esp, 8
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x268
ret 0x14
mov eax, dword [ebp + 0xed4]
mov ecx, dword [ebp + 0xed0]
inc eax
inc ecx
imul eax, ecx
lea edx, [eax + eax*2]
shl edx, 2
push edx
call esi
add esp, 4
mov dword [ebp + 0x398], eax
test eax, eax
je 0x4d90a7
mov ecx, ebp
call fcn.004de140
lea eax, [ebp + 0xdcc]
lea ecx, [esp + 0x70]
push eax
push ebp
push ecx
call fcn.0050eea0
lea edx, [esp + 0x7c]
push 0x5ceba0
push edx
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x4d9131
lea eax, [esp + 0x70]
push eax
push str.A3DTerrain::Init_Can_not_open_texture_map:__s
jmp 0x4d9709
mov eax, dword [ebp + 0xed4]
mov ecx, dword [ebp + 0xed8]
cdq
idiv ecx
mov ebx, eax
mov eax, dword [ebp + 0xed0]
cdq
idiv ecx
imul ebx, eax
push ebx
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
mov dword [ebp + 0x37c], eax
jne 0x4d9177
mov edx, dword [0x5e062c]
push str.A3DTerrain::Init_Not_Enough_Memory_
push edx
jmp 0x4d90b2
mov eax, dword [ebp + 0xed4]
mov ecx, dword [ebp + 0xed8]
cdq
idiv ecx
push esi
push 1
mov ebx, eax
mov eax, dword [ebp + 0xed0]
cdq
idiv ecx
imul ebx, eax
mov eax, dword [esp + 0x1c]
push ebx
push eax
call edi
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [ebp + 0xed4]
mov ebx, dword [ebp + 0xed8]
mov dword [esp + 0x28], eax
add esp, 0x14
cdq
idiv ebx
mov dword [esp + 0x18], 0
test eax, eax
mov dword [esp + 0x20], eax
jle 0x4d9218
mov eax, dword [ebp + 0xed0]
cdq
idiv ebx
xor edi, edi
mov dword [esp + 0x10], edi
xor ecx, ecx
test eax, eax
jle 0x4d91fd
mov edx, dword [ebp + 0x37c]
mov esi, dword [ebp + 0x3a0]
add edi, edx
xor edx, edx
mov dl, byte [edi + ecx]
cmp edx, esi
jge 0x4d924d
inc ecx
cmp ecx, eax
jl 0x4d91ef
mov ecx, dword [esp + 0x18]
mov edi, dword [esp + 0x10]
mov edx, dword [esp + 0x20]
inc ecx
add edi, eax
cmp ecx, edx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x10], edi
jl 0x4d91db
mov al, byte [ebp + 0x124]
test al, al
jne 0x4d96a0
lea eax, [ebx - 2]
cmp eax, 0xe
ja case.0x4d923a.6
xor edx, edx
mov dl, byte [eax + 0x4d973c]
jmp dword [edx*4 + 0x4d9728]
mov dword [ebp + 0x308], 1
jmp 0x4d9298
mov eax, dword [esp + 0x18]
push eax
push ecx
mov ecx, dword [0x5e062c]
push str.A3DTerrain::Init_The_texture_map_contained_more_than_m_nNumTexture_index__pos__d___d_
push ecx
call fcn.004c6d70
add esp, 0x10
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x268
ret 0x14
mov dword [ebp + 0x308], 2
jmp 0x4d9298
mov dword [ebp + 0x308], 3
jmp 0x4d9298
mov dword [ebp + 0x308], 4
mov ecx, dword [ebp + 0xed0]
mov eax, ecx
cdq
idiv ebx
test edx, edx
jne 0x4d96da
mov eax, dword [esp + 0x14]
cdq
idiv ebx
test edx, edx
jne 0x4d96da
mov eax, dword [ebp + 0x308]
mov esi, dword [sym.imp.MSVCRT.dll_malloc]
shl eax, 2
push eax
call esi
add esp, 4
mov dword [ebp + 0x36c], eax
test eax, eax
jne 0x4d92ea
mov ecx, dword [0x5e062c]
push str.A3DTerrain::Init_Not_enough_memory_
push ecx
jmp 0x4d90b2
mov edx, dword [ebp + 0x308]
shl edx, 2
push edx
call esi
add esp, 4
mov dword [ebp + 0x370], eax
test eax, eax
jne 0x4d930d
push str.A3DTerrain::Init_Not_enough_memory_
jmp 0x4d90ac
mov ecx, dword [ebp + 0x308]
mov eax, dword [ebp + 0xed0]
mov esi, dword [ebp + 0xed4]
xor ebx, ebx
test ecx, ecx
mov dword [esp + 0x18], 1
jle 0x4d93ed
lea ecx, [ebp + 0x32c]
mov dword [esp + 0x10], ecx
jmp 0x4d9345
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x20]
cdq
sub eax, edx
sar eax, 1
mov edi, eax
mov eax, esi
cdq
sub eax, edx
mov edx, dword [esp + 0x18]
sar eax, 1
mov esi, eax
add edx, edx
imul esi, edi
mov dword [ecx - 0x20], edi
mov dword [ecx], eax
push esi
mov dword [esp + 0x24], edi
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
mov dword [ecx + 0x20], edx
call dword [sym.imp.MSVCRT.dll_malloc]
mov ecx, dword [ebp + 0x36c]
add esp, 4
mov dword [ecx + ebx*4], eax
mov edx, dword [ebp + 0x36c]
mov edi, dword [edx + ebx*4]
test edi, edi
je 0x4d9303
mov ecx, esi
or eax, 0xffffffff
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
lea eax, [esi*4]
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
mov ecx, dword [ebp + 0x370]
add esp, 4
mov dword [ecx + ebx*4], eax
mov edx, dword [ebp + 0x370]
cmp dword [edx + ebx*4], 0
je 0x4d92d9
mov ecx, dword [esp + 0x10]
mov eax, dword [ebp + 0x308]
inc ebx
add ecx, 4
cmp ebx, eax
mov dword [esp + 0x10], ecx
jl 0x4d933d
mov eax, dword [ebp + 0xedc]
cdq
idiv dword [ebp + 0xed8]
test edx, edx
je 0x4d940f
mov edx, dword [0x5e062c]
push str.A3DTerrain::Init_m_nSightRange_must_be_dividable_by_m_nTextureCover
push edx
jmp 0x4d90b2
mov eax, dword [ebp + 0x3a0]
xor ebx, ebx
test eax, eax
jle 0x4d952e
mov edi, dword [sym.imp.MSVCRT.dll_malloc]
lea esi, [ebp + 0x208]
mov eax, 0x180
mov dword [esi + 0x40], eax
mov dword [esi], eax
mov dword [esi + 0x60], eax
mov dword [esi + 0x20], eax
mov eax, dword [esi]
lea ecx, [eax*8]
sub ecx, eax
shl ecx, 2
push ecx
call edi
add esp, 4
mov dword [esi - 0x80], eax
test eax, eax
je 0x4d90a7
mov edx, dword [esi + 0x20]
shl edx, 1
push edx
call edi
add esp, 4
mov dword [esi - 0x60], eax
test eax, eax
je 0x4d951d
mov eax, dword [esi + 0x40]
lea ecx, [eax*8]
sub ecx, eax
shl ecx, 2
push ecx
call edi
add esp, 4
mov dword [esi + 0x80], eax
test eax, eax
je 0x4d8dd5
mov edx, dword [esi + 0x60]
shl edx, 1
push edx
call edi
mov dword [esi + 0xa0], eax
mov eax, dword [esi - 0x60]
add esp, 4
test eax, eax
je 0x4d90a7
lea eax, [ebp + 0xbc4]
push ebx
push eax
lea eax, [esp + 0x17c]
push str._s_02d.bmp
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
mov ecx, dword [ebp + 0x118]
add esp, 0x10
lea eax, [esi - 0xa4]
mov edx, dword [ecx + 0x764]
push 0
push 0
push eax
mov ecx, dword [edx + 0x6c]
lea edx, [esp + 0x180]
push str.TexturesTerrain
push edx
call fcn.004c3670
test al, al
je 0x4d9718
xor eax, eax
inc ebx
mov dword [esi - 0x20], eax
mov dword [esi - 0x40], eax
mov eax, dword [ebp + 0x3a0]
add esi, 4
cmp ebx, eax
jl 0x4d942b
jmp 0x4d9534
mov ecx, dword [0x5e062c]
push str.A3DTerrain::Init_Not_Enough_Memory_
push ecx
jmp 0x4d90b2
mov edi, dword [sym.imp.MSVCRT.dll_malloc]
mov ecx, dword [ebp + 0xed4]
imul ecx, dword [ebp + 0xed0]
shl ecx, 2
push ecx
call edi
add esp, 4
mov dword [ebp + 0x374], eax
test eax, eax
jne 0x4d9565
mov edx, dword [0x5e062c]
push str.A3DTerrain::Init_Not_enough_memory_
push edx
jmp 0x4d90b2
mov ecx, ebp
call fcn.004e0090
mov ecx, ebp
call fcn.004dfc90
mov eax, dword [ebp + 0xed4]
mov ecx, dword [ebp + 0xed0]
inc eax
inc ecx
imul eax, ecx
shl eax, 2
push eax
call edi
add esp, 4
mov dword [ebp + 0x390], eax
test eax, eax
jne 0x4d95a8
mov edx, dword [0x5e062c]
push str.A3DTerrain::Init_Not_Enough_Memory_
push edx
jmp 0x4d90b2
mov ecx, ebp
call fcn.004ded70
mov ecx, dword [ebp + 0x118]
mov eax, 8
mov dword [ebp + 0xf40], eax
mov dword [ebp + 0xf44], eax
call fcn.0049d240
test al, al
je 0x4d96a0
mov edi, str.DetailTexture.bmp
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp + 0xf64]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0
mov eax, ecx
mov esi, edi
mov edi, edx
push 1
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 0x118]
mov eax, dword [ecx + 0x764]
mov ecx, dword [eax + 0x6c]
lea eax, [ebp + 0xf5c]
push eax
push str.TexturesTerrain
push edx
call fcn.004c3670
test al, al
je 0x4d9718
mov edx, dword [ebp + 0xf44]
mov eax, dword [ebp + 0xf40]
lea ecx, [eax + 1]
lea esi, [edx + 1]
imul ecx, esi
imul eax, edx
mov esi, dword [sym.imp.MSVCRT.dll_malloc]
lea edx, [ecx*8]
sub edx, ecx
mov dword [ebp + 0xf48], ecx
shl edx, 2
shl eax, 1
push edx
mov dword [ebp + 0xf4c], eax
call esi
add esp, 4
mov dword [ebp + 0xf54], eax
test eax, eax
je 0x4d90a7
mov eax, dword [ebp + 0xf4c]
lea ecx, [eax + eax*2]
shl ecx, 1
push ecx
call esi
add esp, 4
mov dword [ebp + 0xf58], eax
test eax, eax
jne 0x4d96a0
mov edx, dword [0x5e062c]
push str.A3DTerrain::Init_Not_Enough_Memory_
push edx
jmp 0x4d90b2
lea eax, [esp + 0x30]
push eax
call fcn.004aab90
mov ecx, 0x10
mov esi, eax
lea edi, [esp + 0x34]
add esp, 4
rep movsd dword es:[edi], dword [esi]
lea edi, [ebp + 0xefc]
mov ecx, 0x10
lea esi, [esp + 0x30]
mov al, 1
rep movsd dword es:[edi], dword [esi]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x268
ret 0x14
mov edx, dword [esp + 0x14]
mov eax, dword [0x5e062c]
push ebx
push edx
push ecx
push str.m_nWidth__d__and_m_nHeight__d__must_be_dividable_by_m_nTextureCover__d__
push eax
call fcn.004c6d70
add esp, 0x14
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x268
ret 0x14
push ebx
push str.Too_large_texture_cover___d__or_it_is_not_a_power_of_2__The_max_is_16_
mov ecx, dword [0x5e062c]
push ecx
call fcn.004c6d70
add esp, 0xc
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x268
ret 0x14