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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x631cd9
mov eax, dword fs:[0]
push eax
sub esp, 0x370
mov eax, dword [0x6bae70]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x2f8], 0
mov dword [ebp - 0x2fc], 0
cmp dword [ebp + 0xc], 0
jne 0x4d5c46
call fcn.004bcf60
push eax
lea ecx, [ebp - 0xc0]
call fcn.004b8b50
mov dword [ebp - 4], 0
call fcn.004bcf70
mov ecx, eax
call fcn.004b9c50
movzx eax, al
test eax, eax
je 0x4d5a7f
mov ecx, dword [ebp + 8]
push ecx
lea ecx, [ebp - 0xc0]
call fcn.004b91b0
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
lea ecx, [ebp - 0xc0]
call fcn.004b8f40
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x318], eax
cmp dword [ebp - 0x318], 0xffffffff
jne 0x4d5992
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.004b8d30
jmp 0x4d5d41
push 0
mov edx, dword [ebp - 0x318]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x2fc], eax
cmp dword [ebp - 0x2fc], 0
jne 0x4d59d4
mov eax, dword [ebp - 0x318]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.004b8d30
jmp 0x4d5d41
mov dword [ebp - 0x348], 0
mov ecx, dword [ebp - 0x2fc]
push ecx
call fcn.005d4157
add esp, 4
mov dword [ebp - 0x36c], eax
mov edx, dword [ebp - 0x36c]
mov dword [ebp - 0x2f8], edx
push 0
lea eax, [ebp - 0x348]
push eax
mov ecx, dword [ebp - 0x2fc]
push ecx
mov edx, dword [ebp - 0x2f8]
push edx
mov eax, dword [ebp - 0x318]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [ebp - 0x318]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x348]
cmp edx, dword [ebp - 0x2fc]
je 0x4d5a7a
mov eax, dword [ebp - 0x2f8]
mov dword [ebp - 0x370], eax
mov ecx, dword [ebp - 0x370]
push ecx
call fcn.005eaed6
add esp, 4
mov dword [ebp - 0x2f8], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.004b8d30
jmp 0x4d5d41
jmp 0x4d5c2f
call fcn.004bcf70
push eax
lea ecx, [ebp - 0xc0]
call fcn.004b90f0
mov dword [ebp - 0x314], 0
call fcn.004bd260
movzx edx, al
test edx, edx
je 0x4d5ab3
call fcn.004bcf80
mov dword [ebp - 0x314], eax
jmp 0x4d5ad1
push 2
push 0
lea ecx, [ebp - 0xc0]
call fcn.004b8f40
push eax
call fcn.004dc560
add esp, 0xc
mov dword [ebp - 0x314], eax
cmp dword [ebp - 0x314], 0
jne 0x4d5af1
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.004b8d30
jmp 0x4d5d41
lea eax, [ebp - 0x2f0]
push eax
lea ecx, [ebp - 0x374]
push ecx
push 1
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x314]
push eax
call fcn.004db910
add esp, 0x14
test eax, eax
je 0x4d5b2f
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.004b8d30
jmp 0x4d5d41
mov ecx, dword [ebp - 0xc4]
mov dword [ebp - 0x2fc], ecx
cmp dword [ebp - 0x2fc], 0
jne 0x4d5b5b
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.004b8d30
jmp 0x4d5d41
mov edx, dword [ebp - 0x2fc]
push edx
call fcn.005d4157
add esp, 4
mov dword [ebp - 0x378], eax
mov eax, dword [ebp - 0x378]
mov dword [ebp - 0x2f8], eax
push 3
mov ecx, dword [ebp - 0x2fc]
push ecx
mov edx, dword [ebp - 0x2f8]
push edx
mov eax, dword [ebp - 0x374]
push eax
mov ecx, dword [ebp - 0x314]
push ecx
call fcn.004dcbc0
add esp, 0x14
mov dword [ebp - 0x340], eax
cmp dword [ebp - 0x340], 0
je 0x4d5c14
cmp dword [ebp - 0x340], 0x600
je 0x4d5c14
mov edx, dword [ebp - 0x2f8]
mov dword [ebp - 0x368], edx
mov eax, dword [ebp - 0x368]
push eax
call fcn.005eaed6
add esp, 4
mov dword [ebp - 0x2f8], 0
call fcn.004bd260
movzx ecx, al
test ecx, ecx
jne 0x4d5bfd
mov edx, dword [ebp - 0x314]
push edx
call fcn.004db650
add esp, 4
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.004b8d30
jmp 0x4d5d41
call fcn.004bd260
movzx eax, al
test eax, eax
jne 0x4d5c2f
mov ecx, dword [ebp - 0x314]
push ecx
call fcn.004db650
add esp, 4
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xc0]
call fcn.004b8d30
jmp 0x4d5d39
push str.COLOR
mov edx, dword [ebp + 0xc]
push edx
call fcn.005ecf88
add esp, 8
test eax, eax
jne 0x4d5c6a
mov dword [ebp - 0x2f8], 1
jmp 0x4d5d39
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.004bcf40
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov dword [ebp - 0x324], eax
cmp dword [ebp - 0x324], 0
jne 0x4d5c92
jmp 0x4d5d41
mov edx, dword [ebp - 0x324]
push edx
call fcn.004bcf40
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x334], eax
cmp dword [ebp - 0x334], 0
jne 0x4d5cc3
mov eax, dword [ebp - 0x324]
push eax
call dword [sym.imp.KERNEL32.dll_FreeResource]
jmp 0x4d5d41
mov ecx, dword [ebp - 0x324]
push ecx
call fcn.004bcf40
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x2fc], eax
cmp dword [ebp - 0x2fc], 0
jne 0x4d5ce7
jmp 0x4d5d41
mov edx, dword [ebp - 0x2fc]
push edx
call fcn.005d4157
add esp, 4
mov dword [ebp - 0x358], eax
mov eax, dword [ebp - 0x358]
mov dword [ebp - 0x2f8], eax
mov ecx, dword [ebp - 0x2fc]
push ecx
mov edx, dword [ebp - 0x334]
push edx
call dword [sym.imp.KERNEL32.dll_LockResource]
push eax
mov eax, dword [ebp - 0x2f8]
push eax
call fcn.005e9ba0
add esp, 0xc
mov ecx, dword [ebp - 0x324]
push ecx
call dword [sym.imp.KERNEL32.dll_FreeResource]
xor edx, edx
jne 0x4d5900
cmp dword [ebp - 0x2f8], 0
jne 0x4d5e44
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x328], eax
cmp dword [ebp - 0x328], 0xffffffff
jne 0x4d5d7e
jmp 0x4d5e44
push 0
mov ecx, dword [ebp - 0x328]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x2fc], eax
cmp dword [ebp - 0x2fc], 0
jne 0x4d5dae
mov edx, dword [ebp - 0x328]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4d5e44
mov dword [ebp - 0x33c], 0
mov eax, dword [ebp - 0x2fc]
push eax
call fcn.005d4157
add esp, 4
mov dword [ebp - 0x34c], eax
mov ecx, dword [ebp - 0x34c]
mov dword [ebp - 0x2f8], ecx
push 0
lea edx, [ebp - 0x33c]
push edx
mov eax, dword [ebp - 0x2fc]
push eax
mov ecx, dword [ebp - 0x2f8]
push ecx
mov edx, dword [ebp - 0x328]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x328]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x33c]
cmp ecx, dword [ebp - 0x2fc]
je 0x4d5e3d
mov edx, dword [ebp - 0x2f8]
mov dword [ebp - 0x360], edx
mov eax, dword [ebp - 0x360]
push eax
call fcn.005eaed6
add esp, 4
mov dword [ebp - 0x2f8], 0
jmp 0x4d5e44
cmp dword [ebp - 0x2f8], 0
jne 0x4d5e54
xor eax, eax
jmp 0x4d638f
mov dword [ebp - 0x300], 0
mov dword [ebp - 0x320], 1
mov dword [ebp - 0x31c], 1
cmp dword [ebp + 0xc], 0
je 0x4d5e8d
push str.COLOR
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.005ecf88
add esp, 8
test eax, eax
je 0x4d5eeb
push 4
lea edx, [ebp - 0x37c]
push edx
lea eax, [ebp - 0x31c]
push eax
lea ecx, [ebp - 0x320]
push ecx
mov edx, dword [ebp - 0x2fc]
push edx
mov eax, dword [ebp - 0x2f8]
push eax
call fcn.00502da0
add esp, 0x18
mov dword [ebp - 0x300], eax
mov ecx, dword [ebp - 0x2f8]
mov dword [ebp - 0x364], ecx
mov edx, dword [ebp - 0x364]
push edx
call fcn.005eaed6
add esp, 4
cmp dword [ebp - 0x300], 0
jne 0x4d5eeb
xor eax, eax
jmp 0x4d638f
push 0x2c
push 0
lea eax, [ebp - 0x3c]
push eax
call fcn.005eb2b0
add esp, 0xc
mov dword [ebp - 0x3c], 0x28
mov ecx, dword [ebp - 0x320]
mov dword [ebp - 0x38], ecx
mov edx, dword [ebp - 0x31c]
neg edx
mov dword [ebp - 0x34], edx
mov eax, 1
mov word [ebp - 0x30], ax
mov ecx, 0x20
mov word [ebp - 0x2e], cx
mov dword [ebp - 0x2c], 0
mov edx, dword [ebp - 0x320]
imul edx, dword [ebp - 0x31c]
shl edx, 2
mov dword [ebp - 0x28], edx
mov byte [ebp - 0x305], 0
mov dword [ebp - 0x304], 0
push 0
push 0
lea eax, [ebp - 0x304]
push eax
push 0
lea ecx, [ebp - 0x3c]
push ecx
push 0
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov dword [ebp - 0x344], eax
cmp dword [ebp - 0x344], 0
jne 0x4d5f82
xor eax, eax
jmp 0x4d638f
mov byte [ebp - 0x310], 0
xor edx, edx
mov word [ebp - 0x30f], dx
mov byte [ebp - 0x30d], dl
cmp dword [ebp + 0xc], 0
je 0x4d60a3
push str.COLOR
mov eax, dword [ebp + 0xc]
push eax
call fcn.005ecf88
add esp, 8
test eax, eax
jne 0x4d60a3
mov dword [ebp - 0x350], 0
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x32c], ecx
mov edx, dword [ebp - 0x32c]
movzx eax, word [edx]
cmp eax, 0x23
jne 0x4d5fef
mov ecx, dword [ebp - 0x32c]
push ecx
call dword [sym.imp.USER32.dll_CharNextW]
mov dword [ebp - 0x32c], eax
push 0x10
lea edx, [ebp - 0x350]
push edx
mov eax, dword [ebp - 0x32c]
push eax
call fcn.005ed787
add esp, 0xc
mov dword [ebp - 0x354], eax
lea ecx, [ebp - 0x354]
mov dword [ebp - 0x300], ecx
mov edx, 1
imul eax, edx, 3
mov ecx, 1
imul edx, ecx, 3
mov ecx, dword [ebp - 0x300]
mov al, byte [ecx + eax]
mov byte [ebp + edx - 0x310], al
mov ecx, 1
imul edx, ecx, 0
mov eax, 1
shl eax, 1
mov ecx, dword [ebp - 0x300]
mov dl, byte [ecx + edx]
mov byte [ebp + eax - 0x310], dl
mov eax, 1
shl eax, 0
mov ecx, 1
shl ecx, 0
mov edx, dword [ebp - 0x300]
mov al, byte [edx + eax]
mov byte [ebp + ecx - 0x310], al
mov ecx, 1
shl ecx, 1
mov edx, 1
imul eax, edx, 0
mov edx, dword [ebp - 0x300]
mov cl, byte [edx + ecx]
mov byte [ebp + eax - 0x310], cl
lea edx, [ebp - 0x310]
mov dword [ebp - 0x300], edx
mov dword [ebp - 0x2f4], 0
jmp 0x4d60be
mov eax, dword [ebp - 0x2f4]
add eax, 1
mov dword [ebp - 0x2f4], eax
mov ecx, dword [ebp - 0x320]
imul ecx, dword [ebp - 0x31c]
cmp dword [ebp - 0x2f4], ecx
jge 0x4d6296
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x304]
mov ecx, dword [ebp - 0x2f4]
mov esi, dword [ebp - 0x300]
mov cl, byte [esi + ecx*4 + 3]
mov byte [eax + edx*4 + 3], cl
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x304]
movzx ecx, byte [eax + edx*4 + 3]
cmp ecx, 0xff
jge 0x4d61d5
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x300]
movzx eax, byte [eax + edx*4 + 2]
mov ecx, dword [ebp - 0x2f4]
mov edx, dword [ebp - 0x300]
movzx ecx, byte [edx + ecx*4 + 3]
imul eax, ecx
xor edx, edx
mov ecx, 0xff
div ecx
mov edx, dword [ebp - 0x2f4]
mov ecx, dword [ebp - 0x304]
mov byte [ecx + edx*4], al
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x300]
movzx eax, byte [eax + edx*4 + 1]
mov ecx, dword [ebp - 0x2f4]
mov edx, dword [ebp - 0x300]
movzx ecx, byte [edx + ecx*4 + 3]
imul eax, ecx
xor edx, edx
mov ecx, 0xff
div ecx
mov edx, dword [ebp - 0x2f4]
mov ecx, dword [ebp - 0x304]
mov byte [ecx + edx*4 + 1], al
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x300]
movzx eax, byte [eax + edx*4]
mov ecx, dword [ebp - 0x2f4]
mov edx, dword [ebp - 0x300]
movzx ecx, byte [edx + ecx*4 + 3]
imul eax, ecx
xor edx, edx
mov ecx, 0xff
div ecx
mov edx, dword [ebp - 0x2f4]
mov ecx, dword [ebp - 0x304]
mov byte [ecx + edx*4 + 2], al
mov byte [ebp - 0x305], 1
jmp 0x4d6233
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x304]
mov ecx, dword [ebp - 0x2f4]
mov esi, dword [ebp - 0x300]
mov cl, byte [esi + ecx*4 + 2]
mov byte [eax + edx*4], cl
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x304]
mov ecx, dword [ebp - 0x2f4]
mov esi, dword [ebp - 0x300]
mov cl, byte [esi + ecx*4 + 1]
mov byte [eax + edx*4 + 1], cl
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x304]
mov ecx, dword [ebp - 0x2f4]
mov esi, dword [ebp - 0x300]
mov cl, byte [esi + ecx*4]
mov byte [eax + edx*4 + 2], cl
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x304]
mov ecx, dword [eax + edx*4]
cmp ecx, dword [ebp + 0x10]
jne 0x4d6291
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x304]
mov byte [eax + edx*4], 0
mov ecx, dword [ebp - 0x2f4]
mov edx, dword [ebp - 0x304]
mov byte [edx + ecx*4 + 1], 0
mov eax, dword [ebp - 0x2f4]
mov ecx, dword [ebp - 0x304]
mov byte [ecx + eax*4 + 2], 0
mov edx, dword [ebp - 0x2f4]
mov eax, dword [ebp - 0x304]
mov byte [eax + edx*4 + 3], 0
mov byte [ebp - 0x305], 1
jmp 0x4d60af
cmp dword [ebp + 0xc], 0
je 0x4d62b1
push str.COLOR
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.005ecf88
add esp, 8
test eax, eax
je 0x4d62c0
mov edx, dword [ebp - 0x300]
push edx
call fcn.00502d80
add esp, 4
push 0xa0
call fcn.005e8f55
add esp, 4
mov dword [ebp - 0x330], eax
mov dword [ebp - 4], 1
cmp dword [ebp - 0x330], 0
je 0x4d62ff
mov ecx, dword [ebp - 0x330]
add ecx, 0x18
call fcn.004b8bd0
mov eax, dword [ebp - 0x330]
mov dword [ebp - 0x338], eax
jmp 0x4d6309
mov dword [ebp - 0x338], 0
mov ecx, dword [ebp - 0x338]
mov dword [ebp - 0x35c], ecx
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x35c]
mov dword [ebp - 0x30c], edx
mov eax, dword [ebp - 0x30c]
mov ecx, dword [ebp - 0x344]
mov dword [eax], ecx
mov edx, dword [ebp - 0x30c]
mov eax, dword [ebp - 0x304]
mov dword [edx + 4], eax
mov ecx, dword [ebp - 0x30c]
mov edx, dword [ebp - 0x320]
mov dword [ecx + 0xc], edx
mov eax, dword [ebp - 0x30c]
mov ecx, dword [ebp - 0x31c]
mov dword [eax + 0x10], ecx
mov edx, dword [ebp - 0x30c]
mov al, byte [ebp - 0x305]
mov byte [edx + 0x14], al
mov ecx, dword [ebp - 0x30c]
mov byte [ecx + 0x15], 0
mov edx, dword [ebp - 0x30c]
mov dword [edx + 8], 0
mov eax, dword [ebp - 0x30c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005e9734
mov esp, ebp
pop ebp
ret