Function at 0x524e50
Capabilities:
Extract resource via kernel32 functions
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x558a03
mov eax, dword fs:[0]
push eax
sub esp, 0x314
mov eax, dword [0x5be9c0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
xor ebx, ebx
mov dword [ebp - 0x318], ebx
mov esi, dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
jne 0x5250c1
call sym.xIns.exe_public:_static_class_DuiLib::CDuiString_const____cdecl_DuiLib::CPaintManagerUI::GetResourcePath_void_
push eax
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::constructor_class_DuiLib::CDuiString_const__
mov dword [ebp - 4], ebx
call sym.xIns.exe_public:_static_class_DuiLib::CDuiString_const____cdecl_DuiLib::CPaintManagerUI::GetResourceZip_void_
mov ecx, eax
call sym.xIns.exe_public:_bool___thiscall_DuiLib::CDuiString::IsEmpty_void_const
test al, al
je 0x524f93
push dword [ebp + 8]
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_class_DuiLib::CDuiString_const____thiscall_DuiLib::CDuiString::operator_wchar_t_const__
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocString
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_wchar_t_const____thiscall_DuiLib::CDuiString::operator_wchar_t_const__void_const
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x2fc], eax
cmp eax, 0xffffffff
jne 0x524f0d
mov dword [ebp - 4], eax
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
jmp 0x52514b
push 0
push eax
call esi
mov esi, eax
test esi, esi
jne 0x524f2f
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
jmp 0x525145
push esi
mov dword [ebp - 0x304], 0
call fcn.004b0c55
add esp, 4
mov edi, eax
lea eax, [ebp - 0x304]
push 0
push eax
push esi
push edi
push dword [ebp - 0x2fc]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x2fc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x304], esi
je 0x5250ad
push edi
call fcn.004b0c50
add esp, 4
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
jmp 0x525145
call sym.xIns.exe_public:_static_class_DuiLib::CDuiString_const____cdecl_DuiLib::CPaintManagerUI::GetResourceZip_void_
push eax
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_class_DuiLib::CDuiString_const____thiscall_DuiLib::CDuiString::operator_class_DuiLib::CDuiString_const__
call sym.xIns.exe_public:_static_bool___cdecl_DuiLib::CPaintManagerUI::IsCachedResourceZip_void_
test al, al
je 0x524fb4
call sym.xIns.exe_public:_static_void____cdecl_DuiLib::CPaintManagerUI::GetResourceZipHandle_void_
jmp 0x524fcc
push 2
push 0
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_wchar_t_const____thiscall_DuiLib::CDuiString::operator_wchar_t_const__void_const
push eax
call fcn.0051abd0
add esp, 0xc
mov dword [ebp - 0x2f8], eax
test eax, eax
jne 0x524fed
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
jmp 0x52514b
lea ecx, [ebp - 0x2f0]
push ecx
lea ecx, [ebp - 0x31c]
push ecx
push 1
push dword [ebp + 8]
push eax
call fcn.0051a4e0
add esp, 0x14
test eax, eax
je 0x525024
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
jmp 0x52514b
mov esi, dword [ebp - 0xc4]
test esi, esi
jne 0x525045
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
jmp 0x525145
push esi
call fcn.004b0c55
push 3
push esi
mov edi, eax
push edi
push dword [ebp - 0x31c]
push dword [ebp - 0x2f8]
call fcn.0051b050
add esp, 0x18
test eax, eax
je 0x525096
cmp eax, 0x600
je 0x525096
push edi
call fcn.004b0c50
add esp, 4
call sym.xIns.exe_public:_static_bool___cdecl_DuiLib::CPaintManagerUI::IsCachedResourceZip_void_
test al, al
jne 0x524f7c
push dword [ebp - 0x2f8]
call fcn.0051a2d0
jmp 0x524f79
call sym.xIns.exe_public:_static_bool___cdecl_DuiLib::CPaintManagerUI::IsCachedResourceZip_void_
test al, al
jne 0x5250ad
push dword [ebp - 0x2f8]
call fcn.0051a2d0
add esp, 4
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
jmp 0x52513d
push eax
push dword [ebp + 8]
call sym.xIns.exe_public:_static_struct_HINSTANCE______cdecl_DuiLib::CPaintManagerUI::GetResourceDll_void_
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
mov dword [ebp - 0x310], esi
test esi, esi
je 0x525145
push esi
call sym.xIns.exe_public:_static_struct_HINSTANCE______cdecl_DuiLib::CPaintManagerUI::GetResourceDll_void_
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x31c], eax
push esi
test eax, eax
jne 0x5250fd
call dword [sym.imp.KERNEL32.dll_FreeResource]
jmp 0x525145
call sym.xIns.exe_public:_static_struct_HINSTANCE______cdecl_DuiLib::CPaintManagerUI::GetResourceDll_void_
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov esi, eax
test esi, esi
je 0x525145
push esi
call fcn.004b0c55
add esp, 4
mov edi, eax
push esi
push dword [ebp - 0x31c]
call dword [sym.imp.KERNEL32.dll_LockResource]
push eax
push edi
call fcn.004ce4c0
add esp, 0xc
push dword [ebp - 0x310]
call dword [sym.imp.KERNEL32.dll_FreeResource]
test edi, edi
jne 0x5251e7
mov esi, dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x2fc], eax
cmp eax, 0xffffffff
je 0x5251c5
push 0
push eax
call esi
mov esi, eax
test esi, esi
je 0x5251c5
push esi
mov dword [ebp - 0x310], 0
call fcn.004b0c55
add esp, 4
mov edi, eax
lea eax, [ebp - 0x310]
push 0
push eax
push esi
push edi
push dword [ebp - 0x2fc]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x2fc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x310], esi
je 0x5251e3
push edi
call fcn.004b0c50
add esp, 4
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004c2ee0
mov esp, ebp
pop ebp
ret
test edi, edi
je 0x5251c5
push 4
lea eax, [ebp - 0x2fc]
push eax
lea eax, [ebp - 0x2f8]
push eax
lea eax, [ebp - 0x30c]
push eax
push esi
push edi
call fcn.00532fb0
mov esi, eax
push edi
mov dword [ebp - 0x308], esi
call fcn.004b0c50
add esp, 0x1c
test esi, esi
je 0x5251c5
movsd xmm0, qword [0x5bfb58]
movsd xmm2, qword [0x586240]
movsd xmm3, qword [0x574dd8]
subsd xmm0, xmm2
comisd xmm0, xmm3
jbe 0x5253e0
movsd xmm1, qword [0x574da0]
comisd xmm1, xmm0
jbe 0x5253e0
movsd xmm0, qword [0x5bfb60]
subsd xmm0, xmm2
comisd xmm0, xmm3
jbe 0x5253e0
comisd xmm1, xmm0
jbe 0x5253e0
cmp dword [0x5c9670], 0
jbe 0x5252c5
push 0xffffffffffffffff
push dword [ebp + 8]
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::constructor_wchar_t_const___int_
mov dword [ebp - 4], 1
lea eax, [ebp - 0xc0]
push eax
lea eax, [ebp - 0x31c]
mov ebx, 1
mov dword [ebp - 0x318], ebx
mov ecx, sym.xIns.exe_class_std::map_class_DuiLib::CDuiString__struct_DuiLib::CRenderEngine::ImageInfo__struct_std::less_class_DuiLib::CDuiString___class_std::allocator_struct_std::pair_class_DuiLib::CDuiString_const___struct_DuiLib::CRenderEngine::ImageInfo____DuiLib::CRenderEngine::m_mapZoomImages
mov esi, dword [sym.xIns.exe_class_std::map_class_DuiLib::CDuiString__struct_DuiLib::CRenderEngine::ImageInfo__struct_std::less_class_DuiLib::CDuiString___class_std::allocator_struct_std::pair_class_DuiLib::CDuiString_const___struct_DuiLib::CRenderEngine::ImageInfo____DuiLib::CRenderEngine::m_mapZoomImages]
push eax
call fcn.005261e0
mov byte [ebp - 0x2f1], bl
cmp dword [eax], esi
jne 0x5252cc
mov byte [ebp - 0x2f1], 0
mov dword [ebp - 4], 0xffffffff
test bl, 1
je 0x5252ec
and ebx, 0xfffffffe
lea ecx, [ebp - 0xc0]
mov dword [ebp - 0x318], ebx
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
cmp byte [ebp - 0x2f1], 0
je 0x525386
push 0xffffffffffffffff
push dword [ebp + 8]
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::constructor_wchar_t_const___int_
mov dword [ebp - 4], 2
lea eax, [ebp - 0xc0]
push eax
mov ecx, sym.xIns.exe_class_std::map_class_DuiLib::CDuiString__struct_DuiLib::CRenderEngine::ImageInfo__struct_std::less_class_DuiLib::CDuiString___class_std::allocator_struct_std::pair_class_DuiLib::CDuiString_const___struct_DuiLib::CRenderEngine::ImageInfo____DuiLib::CRenderEngine::m_mapZoomImages
call fcn.0051f240
mov esi, dword [eax]
mov edi, dword [eax + 4]
mov dword [ebp - 0x2fc], esi
mov dword [ebp - 0x304], edi
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
mov ecx, dword [ebp - 0x30c]
mov eax, dword [ebp - 0x2f8]
cmp esi, ecx
jge 0x52536f
cmp edi, eax
jge 0x52536f
push edi
push esi
push eax
push ecx
push dword [ebp - 0x308]
call sym.xIns.exe_unsigned_char____cdecl_image_zoom_out0_unsigned_char___int__int__int__int_
add esp, 0x14
jmp 0x525615
push edi
push esi
push eax
push ecx
push dword [ebp - 0x308]
call sym.xIns.exe_unsigned_char____cdecl_image_zoom0_unsigned_char___int__int__int__int_
add esp, 0x14
jmp 0x525615
mov ecx, dword [ebp - 0x30c]
mov esi, ecx
mov edi, dword [ebp - 0x2f8]
imul esi, edi
mov dword [ebp - 0x2fc], ecx
mov dword [ebp - 0x304], edi
shl esi, 2
push esi
call fcn.004b0c55
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x5253c3
push esi
push 0
push ebx
call fcn.004c62d0
add esp, 0xc
jmp 0x5253c5
xor ebx, ebx
push esi
push dword [ebp - 0x308]
push ebx
call fcn.004ce4c0
mov esi, dword [ebp - 0x30c]
add esp, 0xc
jmp 0x525617
cmp dword [0x5c9670], 0
jbe 0x525434
push 0xffffffffffffffff
push dword [ebp + 8]
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::constructor_wchar_t_const___int_
mov dword [ebp - 4], 3
lea eax, [ebp - 0xc0]
push eax
lea eax, [ebp - 0x31c]
mov ebx, 2
mov dword [ebp - 0x318], ebx
mov ecx, sym.xIns.exe_class_std::map_class_DuiLib::CDuiString__struct_DuiLib::CRenderEngine::ImageInfo__struct_std::less_class_DuiLib::CDuiString___class_std::allocator_struct_std::pair_class_DuiLib::CDuiString_const___struct_DuiLib::CRenderEngine::ImageInfo____DuiLib::CRenderEngine::m_mapZoomImages
mov esi, dword [sym.xIns.exe_class_std::map_class_DuiLib::CDuiString__struct_DuiLib::CRenderEngine::ImageInfo__struct_std::less_class_DuiLib::CDuiString___class_std::allocator_struct_std::pair_class_DuiLib::CDuiString_const___struct_DuiLib::CRenderEngine::ImageInfo____DuiLib::CRenderEngine::m_mapZoomImages]
push eax
call fcn.005261e0
mov byte [ebp - 0x2f1], 1
cmp dword [eax], esi
jne 0x52543b
mov byte [ebp - 0x2f1], 0
mov dword [ebp - 4], 0xffffffff
test bl, 2
je 0x52545b
and ebx, 0xfffffffd
lea ecx, [ebp - 0xc0]
mov dword [ebp - 0x318], ebx
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
cmp byte [ebp - 0x2f1], 0
je 0x5255a7
push 0xffffffffffffffff
push dword [ebp + 8]
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::constructor_wchar_t_const___int_
mov dword [ebp - 4], 4
lea eax, [ebp - 0xc0]
push eax
mov ecx, sym.xIns.exe_class_std::map_class_DuiLib::CDuiString__struct_DuiLib::CRenderEngine::ImageInfo__struct_std::less_class_DuiLib::CDuiString___class_std::allocator_struct_std::pair_class_DuiLib::CDuiString_const___struct_DuiLib::CRenderEngine::ImageInfo____DuiLib::CRenderEngine::m_mapZoomImages
call fcn.0051f240
mov esi, dword [eax]
mov edi, dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call sym.xIns.exe_public:_void___thiscall_DuiLib::CDuiString::destructor_void_
movd xmm0, dword [ebp - 0x30c]
cvtdq2pd xmm0, xmm0
mov eax, dword [ebp - 0x30c]
mov ecx, dword [ebp - 0x2f8]
movd xmm3, esi
cvtdq2pd xmm3, xmm3
movd xmm1, edi
divsd xmm3, xmm0
movd xmm0, dword [ebp - 0x2f8]
cvtdq2pd xmm0, xmm0
cvtdq2pd xmm1, xmm1
mulsd xmm3, qword [0x5bfb58]
divsd xmm1, xmm0
movsd xmm4, qword [0x586240]
movaps xmm0, xmm3
mulsd xmm1, qword [0x5bfb60]
subsd xmm0, xmm4
movsd xmm2, qword [0x574da0]
movsd qword [ebp - 0x320], xmm3
comisd xmm2, xmm0
movsd qword [ebp - 0x314], xmm1
jbe 0x52554a
movaps xmm0, xmm1
subsd xmm0, xmm4
comisd xmm2, xmm0
jbe 0x52554a
sub esp, 0x10
movsd qword [esp + 8], xmm1
movsd qword [esp], xmm3
push ecx
push eax
push dword [ebp - 0x308]
call sym.xIns.exe_unsigned_char____cdecl_image_zoom_out1_unsigned_char___int__int__double__double_
jmp 0x525565
sub esp, 0x10
movsd qword [esp + 8], xmm1
movsd qword [esp], xmm3
push ecx
push eax
push dword [ebp - 0x308]
call sym.xIns.exe_unsigned_char____cdecl_image_zoom1_unsigned_char___int__int__double__double_
movd xmm1, dword [ebp - 0x30c]
cvtdq2pd xmm1, xmm1
mulsd xmm1, qword [ebp - 0x320]
addsd xmm1, qword [0x586238]
cvttsd2si esi, xmm1
movd xmm1, dword [ebp - 0x2f8]
cvtdq2pd xmm1, xmm1
mulsd xmm1, qword [ebp - 0x314]
addsd xmm1, qword [0x586238]
cvttsd2si edi, xmm1
jmp 0x525606
movups xmm0, xmmword [0x5bfb58]
mov edi, dword [ebp - 0x2f8]
sub esp, 0x10
mov esi, dword [ebp - 0x30c]
movups xmmword [esp], xmm0
push edi
push esi
push dword [ebp - 0x308]
call sym.xIns.exe_unsigned_char____cdecl_image_zoom1_unsigned_char___int__int__double__double_
movd xmm0, esi
cvtdq2pd xmm0, xmm0
mulsd xmm0, qword [0x5bfb58]
addsd xmm0, qword [0x586238]
cvttsd2si esi, xmm0
movd xmm0, edi
cvtdq2pd xmm0, xmm0
mulsd xmm0, qword [0x5bfb60]
addsd xmm0, qword [0x586238]
cvttsd2si edi, xmm0
mov dword [ebp - 0x304], edi
add esp, 0x1c
mov dword [ebp - 0x2fc], esi
mov ebx, eax
push dword [ebp - 0x308]
call fcn.004b0c50
push 0x2c
lea eax, [ebp - 0x3c]
push 0
push eax
call fcn.004c62d0
mov eax, edi
mov dword [ebp - 0x3c], 0x28
neg eax
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x34], eax
add esp, 0x10
mov eax, esi
mov dword [ebp - 0x30], 0x200001
imul eax, edi
mov dword [ebp - 0x2c], 0
push 0
push 0
mov byte [ebp - 0x2f1], 0
mov dword [ebp - 0x310], eax
shl eax, 2
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x300]
push eax
push 0
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x300], 0
push eax
push 0
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov dword [ebp - 0x31c], eax
test eax, eax
je 0x5251c5
mov edx, dword [ebp - 0x310]
xor esi, esi
test edx, edx
jle 0x5257a2
lea ebx, [ebx]
mov eax, dword [ebp - 0x300]
mov cl, byte [ebx + esi*4 + 3]
mov byte [eax + esi*4 + 3], cl
mov edi, dword [ebp - 0x300]
cmp byte [edi + esi*4 + 3], 0xff
jae 0x525735
movzx eax, byte [ebx + esi*4 + 3]
movzx ecx, byte [ebx + esi*4 + 2]
imul ecx, eax
mov eax, 0x80808081
mov byte [ebp - 0x2f1], 1
mul ecx
shr edx, 7
mov byte [edi + esi*4], dl
movzx eax, byte [ebx + esi*4 + 3]
movzx ecx, byte [ebx + esi*4 + 1]
imul ecx, eax
mov eax, 0x80808081
mul ecx
mov eax, dword [ebp - 0x300]
shr edx, 7
mov byte [eax + esi*4 + 1], dl
movzx eax, byte [ebx + esi*4 + 3]
movzx ecx, byte [ebx + esi*4]
imul ecx, eax
mov eax, 0x80808081
mul ecx
mov eax, dword [ebp - 0x300]
shr edx, 7
mov byte [eax + esi*4 + 2], dl
mov edx, dword [ebp - 0x310]
jmp 0x525759
mov al, byte [ebx + esi*4 + 2]
mov byte [edi + esi*4], al
mov eax, dword [ebp - 0x300]
movzx ecx, byte [ebx + esi*4 + 1]
mov byte [eax + esi*4 + 1], cl
mov eax, dword [ebp - 0x300]
movzx ecx, byte [ebx + esi*4]
mov byte [eax + esi*4 + 2], cl
mov eax, dword [ebp - 0x300]
mov ecx, dword [ebp + 0x10]
cmp dword [eax + esi*4], ecx
jne 0x525793
mov byte [eax + esi*4], 0
mov eax, dword [ebp - 0x300]
mov byte [ebp - 0x2f1], 1
mov byte [eax + esi*4 + 1], 0
mov eax, dword [ebp - 0x300]
mov byte [eax + esi*4 + 2], 0
mov eax, dword [ebp - 0x300]
mov byte [eax + esi*4 + 3], 0
inc esi
cmp esi, edx
jl 0x5256b0
mov edi, dword [ebp - 0x304]
push ebx
call fcn.004b0c50
push 0x98
call fcn.004b0c15
add esp, 8
mov dword [ebp - 0x310], eax
mov dword [ebp - 4], 5
test eax, eax
je 0x5257cf
mov ecx, eax
call fcn.004fe9c0
jmp 0x5257d1
xor eax, eax
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x31c]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x2fc]
mov dword [eax + 4], ecx
mov cl, byte [ebp - 0x2f1]
mov dword [eax + 8], edi
mov byte [eax + 0xc], cl
jmp 0x5251c7