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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x51ddbb
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x563910]
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 esi, dword [ebp + 0xc]
mov dword [ebp - 0x60], esi
mov dword [ebp - 0x4c], 0
test esi, esi
jne 0x470182
lea eax, [ebp - 0x4c]
push eax
push dword [ebp + 8]
call fcn.00456b40
add esp, 8
mov edi, eax
jmp 0x470235
mov ecx, str.COLOR
mov eax, esi
lea esp, [esp]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4701b6
test dx, dx
je 0x4701b2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4701b6
add eax, 4
add ecx, 4
test dx, dx
jne 0x470190
xor eax, eax
jmp 0x4701bb
sbb eax, eax
or eax, 1
test eax, eax
jne 0x4701c7
lea edi, [eax + 1]
jmp 0x4702cc
push esi
push dword [ebp + 8]
call fcn.00456da0
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov ebx, eax
test ebx, ebx
je 0x47023d
push ebx
call fcn.00456da0
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov dword [ebp - 0x50], eax
push ebx
test eax, eax
jne 0x4701fa
call dword [sym.imp.KERNEL32.dll_FreeResource]
jmp 0x47023d
call fcn.00456da0
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [ebp - 0x4c], eax
test eax, eax
je 0x47023d
push eax
call fcn.004dab9a
add esp, 4
mov edi, eax
push dword [ebp - 0x4c]
push dword [ebp - 0x50]
call dword [sym.imp.KERNEL32.dll_LockResource]
push eax
push edi
call fcn.004e6b40
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_FreeResource]
test edi, edi
jne 0x4702cc
push 0
push 0x80
push 3
push 0
push 1
push bind
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4702aa
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x4c], eax
test eax, eax
je 0x4702aa
push eax
mov dword [ebp - 0x50], 0
call fcn.004dab9a
add esp, 4
mov edi, eax
lea eax, [ebp - 0x50]
push 0
push eax
push dword [ebp - 0x4c]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x4c]
cmp dword [ebp - 0x50], eax
je 0x4702c8
push edi
call fcn.004dce61
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.004dc2d2
mov esp, ebp
pop ebp
ret
test edi, edi
je 0x4702aa
xor ebx, ebx
mov dword [ebp - 0x5c], 1
mov dword [ebp - 0x54], ebx
mov ebx, 1
mov dword [ebp - 0x58], ebx
test esi, esi
je 0x47031f
mov ecx, str.COLOR
mov eax, esi
jmp 0x4702f0
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x470316
test dx, dx
je 0x470312
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x470316
add eax, 4
add ecx, 4
test dx, dx
jne 0x4702f0
xor eax, eax
jmp 0x47031b
sbb eax, eax
or eax, 1
test eax, eax
je 0x47034f
push 4
lea eax, [ebp - 0x6c]
push eax
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp - 0x5c]
push eax
push dword [ebp - 0x4c]
push edi
call fcn.00484b50
mov ebx, eax
push edi
mov dword [ebp - 0x54], ebx
call fcn.004dce61
add esp, 0x1c
test ebx, ebx
je 0x4702aa
mov ebx, dword [ebp - 0x58]
push 0x2c
lea eax, [ebp - 0x3c]
push 0
push eax
call fcn.004e7190
mov ecx, dword [ebp - 0x5c]
add esp, 0xc
mov eax, ebx
mov dword [ebp - 0x3c], 0x28
neg eax
imul ebx, ecx
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x44]
push 0
push 0
push eax
push 0
shl ebx, 2
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x28], ebx
xor bl, bl
push eax
push 0
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x30], 0x200001
mov dword [ebp - 0x2c], 0
mov byte [ebp - 0x3d], bl
mov dword [ebp - 0x44], 0
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov dword [ebp - 0x64], eax
test eax, eax
je 0x4702aa
xor eax, eax
mov byte [ebp - 0x48], bl
mov word [ebp - 0x47], ax
mov byte [ebp - 0x45], al
test esi, esi
je 0x47043e
mov ecx, str.COLOR
mov eax, esi
mov edi, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4703f6
test dx, dx
je 0x4703f2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4703f6
add eax, 4
add ecx, 4
test dx, dx
jne 0x4703d0
xor eax, eax
jmp 0x4703fb
sbb eax, eax
or eax, 1
test eax, eax
jne 0x47043e
mov dword [ebp - 0x68], eax
mov eax, dword [ebp + 8]
cmp word [eax], 0x23
jne 0x470412
push eax
call dword [sym.imp.USER32.dll_CharNextW]
push 0x10
lea ecx, [ebp - 0x68]
push ecx
push eax
call fcn.004e642e
mov dword [ebp - 0x50], eax
lea edx, [ebp - 0x48]
mov cl, byte [ebp - 0x4d]
add esp, 0xc
mov byte [ebp - 0x46], al
mov al, byte [ebp - 0x4e]
mov byte [ebp - 0x45], cl
mov byte [ebp - 0x47], ah
mov byte [ebp - 0x48], al
mov dword [ebp - 0x54], edx
jmp 0x470441
mov edx, dword [ebp - 0x54]
mov eax, dword [ebp - 0x58]
xor edi, edi
imul eax, dword [ebp - 0x5c]
test eax, eax
jle 0x47052a
mov esi, dword [ebp + 0x10]
mov eax, dword [ebp - 0x44]
mov cl, byte [edx + edi*4 + 3]
mov byte [eax + edi*4 + 3], cl
mov eax, dword [ebp - 0x44]
cmp byte [eax + edi*4 + 3], 0xff
lea ebx, [eax + edi*4]
jae 0x4704ce
movzx eax, byte [edx + edi*4 + 3]
movzx ecx, byte [edx + edi*4 + 2]
imul ecx, eax
mov eax, 0x80808081
mul ecx
shr edx, 7
mov byte [ebx], dl
mov ebx, dword [ebp - 0x54]
movzx eax, byte [ebx + edi*4 + 3]
movzx ecx, byte [ebx + edi*4 + 1]
imul ecx, eax
mov eax, 0x80808081
mul ecx
mov eax, dword [ebp - 0x44]
shr edx, 7
mov byte [eax + edi*4 + 1], dl
movzx eax, byte [ebx + edi*4 + 3]
movzx ecx, byte [ebx + edi*4]
mov bl, 1
imul ecx, eax
mov eax, 0x80808081
mov byte [ebp - 0x3d], bl
mul ecx
mov eax, dword [ebp - 0x44]
shr edx, 7
mov byte [eax + edi*4 + 2], dl
mov edx, dword [ebp - 0x54]
jmp 0x4704ee
mov al, byte [edx + edi*4 + 2]
mov byte [ebx], al
mov eax, dword [ebp - 0x44]
movzx ecx, byte [edx + edi*4 + 1]
mov bl, byte [ebp - 0x3d]
mov byte [eax + edi*4 + 1], cl
mov eax, dword [ebp - 0x44]
movzx ecx, byte [edx + edi*4]
mov byte [eax + edi*4 + 2], cl
mov eax, dword [ebp - 0x44]
cmp dword [eax + edi*4], esi
jne 0x470517
mov byte [eax + edi*4], 0
mov bl, 1
mov eax, dword [ebp - 0x44]
mov byte [ebp - 0x3d], bl
mov byte [eax + edi*4 + 1], 0
mov eax, dword [ebp - 0x44]
mov byte [eax + edi*4 + 2], 0
mov eax, dword [ebp - 0x44]
mov byte [eax + edi*4 + 3], 0
mov eax, dword [ebp - 0x58]
inc edi
imul eax, dword [ebp - 0x5c]
cmp edi, eax
jl 0x470455
mov esi, dword [ebp - 0x60]
test esi, esi
je 0x470562
mov eax, str.COLOR
mov cx, word [esi]
cmp cx, word [eax]
jne 0x470559
test cx, cx
je 0x470555
mov cx, word [esi + 2]
cmp cx, word [eax + 2]
jne 0x470559
add esi, 4
add eax, 4
test cx, cx
jne 0x470533
xor eax, eax
jmp 0x47055e
sbb eax, eax
or eax, 1
test eax, eax
je 0x47056b
push edx
call fcn.004dc2f0
add esp, 4
push 0xa0
call fcn.004dc2f5
mov esi, eax
add esp, 4
mov dword [ebp - 0x60], esi
mov dword [ebp - 4], 0
test esi, esi
je 0x470592
lea ecx, [esi + 0x18]
call fcn.0045d6a0
jmp 0x470594
xor esi, esi
mov eax, dword [ebp - 0x64]
mov dword [esi], eax
mov eax, esi
mov ecx, dword [ebp - 0x44]
mov dword [esi + 4], ecx
mov ecx, dword [ebp - 0x5c]
mov dword [esi + 0xc], ecx
mov ecx, dword [ebp - 0x58]
mov dword [esi + 0x10], ecx
mov byte [esi + 0x14], bl
mov byte [esi + 0x15], 0
mov dword [esi + 8], 0
jmp 0x4702ac