Function at 0x497650
Capabilities:
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x19c
push ebx
mov eax, dword [ebp + 0x10]
push esi
lea ecx, [ebp - 0x19c]
push edi
mov edi, dword [ebp + 8]
push edi
push eax
push 0x5430c4
push ecx
call fcn.00519a30
add esp, 0x10
mov ecx, dword [ebp + 0x14]
test ecx, ecx
jne 0x497778
push 0
lea eax, [ebp - 0x19c]
push pe_nt_image_headers32
push 4
push 0
push 1
push Ordinal_4
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov esi, eax
jne 0x4976db
push edi
lea eax, [ebp - 0x98]
push str.Error:_Open_new_ResFile__mapped_file__s_not_Found.
push eax
call fcn.00519a30
add esp, 0xc
lea eax, [ebp - 0x98]
push 0x30
push str.RESOURCE_ERROR
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0
push 2
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov ebx, eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
test ebx, ebx
jne 0x497716
push 0x30
push str.RESOURCE_ERROR
push str.Error:_Open_Mapped_ResFile__Could_not_map_file_1_.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0
push 4
push ebx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 8], eax
test eax, eax
jne 0x497747
push 0x30
push str.RESOURCE_ERROR
push str.Error:_Open_Mapped_ResFile__Could_not_map_file_to_addr.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call esi
push 0x114
call fcn.00513ee0
add esp, 4
mov ebx, eax
test ebx, ebx
jne 0x4977c6
push 0x30
push str.RESOURCE_ERROR
push str.Error:_Out_of_memory_in_Open_resfile.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x8000
lea eax, [ebp - 0x19c]
push eax
call fcn.00519e70
add esp, 8
mov dword [ebp - 4], eax
cmp eax, 0xffffffff
jne 0x49774a
push edi
lea eax, [ebp - 0x98]
push str.Error:_Open_new_ResFile__file__s_not_Found.
push eax
call fcn.00519a30
add esp, 0xc
lea eax, [ebp - 0x98]
push 0x30
push str.RESOURCE_ERROR
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
shr ecx, 2
mov esi, edi
lea edi, [ebx + 0x10]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebx + 0xc], 0
mov eax, dword [ebp + 0x14]
test eax, eax
jne 0x49781d
mov eax, dword [ebp - 8]
lea esi, [ebx + 8]
mov dword [ebx], eax
mov dword [esi], eax
mov dword [ebx + 4], 0xffffffff
mov eax, dword [0x549f38]
test eax, eax
jne 0x4978c5
mov dword [0x549f38], ebx
jmp 0x4978e0
mov eax, dword [ebp - 4]
push 1
push 0
mov dword [ebx + 4], eax
push eax
mov dword [ebx], 0
call fcn.00519d90
add esp, 0xc
lea ecx, [ebp - 0x48]
mov edx, dword [ebp - 4]
nop
push 0x40
push ecx
push edx
call fcn.00519b20
add esp, 0xc
cmp eax, 0x40
je 0x49786a
int3
lea esi, [ebx + 8]
mov eax, dword [ebp - 0xc]
push eax
call fcn.00513ee0
add esp, 4
mov dword [esi], eax
mov eax, dword [ebp - 4]
nop
push 0
push 0
push eax
call fcn.00519d90
add esp, 0xc
mov eax, dword [ebp - 0xc]
mov ecx, dword [esi]
mov edx, dword [ebp - 4]
push eax
push ecx
push edx
call fcn.00519b20
add esp, 0xc
mov ecx, dword [ebp - 0xc]
cmp ecx, eax
je 0x497805
push 0x30
push str.RESOURCE_ERROR
push str.Error:_Reading_resfile_header_data.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [0x549f38]
mov ecx, dword [eax + 0xc]
test ecx, ecx
je 0x4978dd
xor ecx, ecx
mov eax, dword [eax + 0xc]
mov edx, dword [eax + 0xc]
test edx, edx
jne 0x4978d3
mov dword [eax + 0xc], ebx
mov eax, dword [esi]
mov ecx, dword [ebp + 0xc]
add eax, 0x2c
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x497908
or dl, dl
je 0x497904
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x497908
add eax, 2
add ecx, 2
or dl, dl
jne 0x4978e8
xor eax, eax
jmp 0x49790d
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x49792c
push 0x30
push str.RESOURCE_ERROR
push str.Error:_Open_ResFile__Corruption_detected_in_resfile.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 4
mov eax, dword [esi]
push str.1.00
add eax, 0x28
push eax
call fcn.0051c800
add esp, 0xc
test eax, eax
je 0x497959
push 0x30
push str.RESOURCE_ERROR
push str.Error:_Open_ResFile__Resfile_not_correct.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret