Function at 0x47c480
Capabilities:
Delete file
Extract resource via kernel32 functions
Get common file path
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x214]
push ebx
sub esp, 0x380
mov dword [esp + 4], edi
mov dword [esp], 0x104
call dword [sym.imp.kernel32.dll_GetTempPathW]
mov edx, edi
sub esp, 8
cmp word [ebp - 0x214], 0
je 0x47c4c1
lea esi, [esi]
add edx, 2
cmp word [edx], 0
jne 0x47c4b8
xor eax, eax
lea esi, [esi]
nop
movzx ecx, word [eax + str.wine_testfont0.ttf]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x47c4c8
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0xc0000000
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov dword [ebp - 0x368], eax
call fcn.0049bde0
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc55
mov eax, dword fs:[0x18]
mov esi, dword [eax + 0x34]
mov eax, edi
shr eax, 0x10
je 0x47cd40
mov dword [esp + 4], 0xffffffff
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
sub esp, 8
test eax, eax
jne 0x47c670
cmp word [ebp - 0x214], 0
je 0x47cd80
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [edi + edx*2 + 2], 0
jne 0x47c570
movzx eax, word [0x4afc14]
mov dword [ebp - 0x36c], esi
lea ecx, [ebp - 0x33e]
mov dword [ebp - 0x364], edi
mov word [ebp - 0x340], ax
jmp 0x47c5db
cmp ax, 9
je 0x47ccb0
cmp ax, 0xa
jne 0x47ccd0
movzx eax, word [0x4afc16]
add ecx, 2
mov word [ecx - 2], ax
lea esi, [esi]
lea ebx, [ebp - 0x21e]
lea eax, [edx - 1]
cmp ebx, ecx
jb 0x47c630
test edx, edx
jle 0x47c630
mov edx, eax
add dword [ebp - 0x364], 2
mov eax, dword [ebp - 0x364]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x47cc98
jbe 0x47c5a0
cmp ax, 0x22
je 0x47cd28
cmp ax, 0x5c
jne 0x47ccc3
movzx eax, word [0x4afc1e]
add ecx, 2
lea ebx, [ebp - 0x21e]
mov word [ecx - 2], ax
lea eax, [edx - 1]
cmp ebx, ecx
jae 0x47c5d5
lea esi, [esi]
nop
mov byte [ecx], 0x22
mov esi, dword [ebp - 0x36c]
test eax, eax
jle 0x47cd78
movzx eax, word [0x4afc20]
mov byte [ecx + 3], 0x2e
mov word [ecx + 1], ax
lea eax, [ecx + 4]
mov byte [eax], 0
lea eax, [ebp - 0x340]
mov dword [ebp - 0x36c], eax
mov dword [esp], eax
call fcn.0049de00
jmp 0x47c681
lea ebx, [ebp - 0x340]
mov eax, str._invalid_
mov dword [ebp - 0x36c], ebx
mov dword [esp + 0xc], esi
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], str.file_creation_failed__at__s__error__ld_n
cmp dword [ebp - 0x368], 0xffffffff
setne al
mov dword [esp], eax
call fcn.00471350
mov ebx, dword [sym.imp.kernel32.dll_GetModuleHandleA]
mov dword [esp], 0
call ebx
sub esp, 4
mov dword [esp + 8], 0xa
mov dword [esp + 4], 2
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_FindResourceA]
sub esp, 0xc
mov esi, eax
call fcn.0049bde0
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc5a
xor eax, eax
test esi, esi
setne al
mov dword [esp + 4], str.couldnt_find_resource_n
mov dword [esp], eax
call fcn.00471350
mov dword [esp], 0
call ebx
sub esp, 4
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LoadResource]
sub esp, 8
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LockResource]
sub esp, 4
mov dword [ebp - 0x364], eax
mov dword [esp], 0
call ebx
sub esp, 4
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SizeofResource]
sub esp, 8
mov esi, eax
lea eax, [ebp - 0x360]
mov dword [esp + 8], esi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov edx, dword [ebp - 0x364]
mov dword [esp + 4], edx
mov ebx, dword [ebp - 0x368]
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_WriteFile]
mov edx, dword [ebp - 0x360]
sub esp, 0x14
mov dword [ebp - 0x364], edx
call fcn.0049bde0
mov edx, dword [ebp - 0x364]
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc60
xor eax, eax
cmp edx, esi
sete al
mov dword [esp + 0xc], edx
mov dword [esp + 8], esi
mov dword [esp + 4], 0x4acc08
mov dword [esp], eax
call fcn.00471350
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
lea eax, [ebp - 0x350]
sub esp, 4
mov dword [esp], eax
call sub.gdiplus.dll_GdipNewPrivateFontCollection
sub esp, 4
mov esi, eax
call fcn.0049bde0
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc65
xor eax, eax
test esi, esi
sete al
mov dword [esp + 0xc], esi
mov dword [esp], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x4acc08
call fcn.00471350
mov dword [esp + 4], edi
mov eax, dword [ebp - 0x350]
mov dword [esp], eax
call sub.gdiplus.dll_GdipPrivateAddFontFile
xor edx, edx
sub esp, 8
mov ecx, eax
mov eax, 0xc68
call fcn.00471450
mov ebx, dword [ebp - 0x36c]
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x350]
mov dword [esp], eax
call sub.gdiplus.dll_GdipGetFontCollectionFamilyCount
xor edx, edx
sub esp, 8
mov ecx, eax
mov eax, 0xc6b
call fcn.00471450
mov esi, dword [ebp - 0x340]
call fcn.0049bde0
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc6c
xor eax, eax
cmp esi, 1
sete al
mov dword [esp + 0xc], esi
lea esi, [ebp - 0x344]
mov dword [esp], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x4acc08
call fcn.00471350
lea eax, [ebp - 0x34c]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x340]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x350]
mov dword [esp], eax
call sub.gdiplus.dll_GdipGetFontCollectionFamilyList
xor edx, edx
sub esp, 0x10
mov ecx, eax
mov eax, 0xc6f
call fcn.00471450
lea eax, [ebp - 0x354]
mov dword [esp + 0xc], 2
mov dword [esp + 0x10], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x41800000
mov eax, dword [ebp - 0x34c]
mov dword [esp], eax
call sub.gdiplus.dll_GdipCreateFont
sub esp, 0x14
mov ebx, eax
call fcn.0049bde0
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc72
xor eax, eax
test ebx, ebx
sete al
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0
mov dword [esp + 4], 0x4acc08
mov dword [esp], eax
call fcn.00471350
mov dword [esp], 0
call dword [sym.imp.gdi32.dll_CreateCompatibleDC]
sub esp, 4
mov ebx, eax
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], 0x4ad148
mov dword [esp + 0xc], 2
mov dword [esp + 8], 0x4ad998
mov dword [esp + 4], 4
mov dword [esp], eax
call sub.gdiplus.dll_GdipRecordMetafile
xor edx, edx
mov ecx, eax
sub esp, 0x18
mov eax, 0xc78
call fcn.00471450
mov dword [esp], ebx
lea ebx, [ebp - 0x348]
call dword [sym.imp.gdi32.dll_DeleteDC]
sub esp, 4
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x344]
mov dword [esp], eax
call sub.gdiplus.dll_GdipGetImageGraphicsContext
sub esp, 8
mov dword [ebp - 0x364], eax
call fcn.0049bde0
mov edx, dword [ebp - 0x364]
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc7d
xor eax, eax
test edx, edx
sete al
mov dword [esp + 0xc], edx
mov dword [esp], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x4acc08
call fcn.00471350
lea eax, [ebp - 0x358]
mov dword [esp], 0xff0000ff
mov dword [esp + 4], eax
call sub.gdiplus.dll_GdipCreateSolidFill
xor edx, edx
mov ecx, eax
sub esp, 8
mov eax, 0xc80
call fcn.00471450
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 5
mov dword [esp + 0x14], 0x4ad990
mov eax, dword [ebp - 0x358]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x354]
mov dword [esp + 8], 4
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x4ad1e0
mov eax, dword [ebp - 0x348]
mov dword [esp], eax
call sub.gdiplus.dll_GdipDrawDriverString
sub esp, 0x20
mov dword [ebp - 0x364], eax
call fcn.0049bde0
mov edx, dword [ebp - 0x364]
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc85
xor eax, eax
test edx, edx
sete al
mov dword [esp + 0xc], edx
mov dword [esp], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x4acc08
call fcn.00471350
mov eax, dword [ebp - 0x354]
mov dword [esp], eax
call sub.gdiplus.dll_GdipDeleteFont
lea eax, [ebp - 0x350]
sub esp, 4
mov dword [esp], eax
call sub.gdiplus.dll_GdipDeletePrivateFontCollection
sub esp, 4
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_DeleteFileW]
sub esp, 4
mov edi, eax
call fcn.0049bde0
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc8b
xor eax, eax
cmp edi, 1
sete al
mov dword [esp + 0xc], edi
mov dword [esp], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x4acc08
call fcn.00471350
mov eax, dword [ebp - 0x348]
mov dword [esp], eax
call sub.gdiplus.dll_GdipDeleteGraphics
mov ecx, str.unknownfontdecode_metafile
mov edx, 0x4ae400
mov dword [ebp - 0x348], 0
sub esp, 4
mov dword [esp + 4], 0x4ad998
mov dword [esp], 0x4ad978
mov eax, dword [ebp - 0x344]
call fcn.00472b30
mov edx, str.unknownfontdecode.emf
mov eax, esi
call fcn.00473260
lea eax, [ebp - 0x35c]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], 0x26200a
mov dword [esp + 8], 0
mov dword [esp + 4], 0x64
mov dword [esp], 0x64
call sub.gdiplus.dll_GdipCreateBitmapFromScan0
sub esp, 0x18
mov esi, eax
call fcn.0049bde0
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc95
xor eax, eax
test esi, esi
sete al
mov dword [esp + 0xc], esi
mov dword [esp], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x4acc08
call fcn.00471350
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x35c]
mov dword [esp], eax
call sub.gdiplus.dll_GdipGetImageGraphicsContext
sub esp, 8
mov ebx, eax
call fcn.0049bde0
mov dword [eax], 0x4acab6
mov dword [eax + 4], 0xc98
xor eax, eax
test ebx, ebx
sete al
mov dword [esp + 0xc], ebx
mov dword [esp], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x4acc08
call fcn.00471350
mov dword [esp + 8], 0x4ad998
mov ecx, 0x4ae400
mov dword [esp + 4], 0x4ad978
mov dword [esp], str.unknownfontdecode_playback
mov edx, dword [ebp - 0x348]
mov eax, dword [ebp - 0x344]
call fcn.004729b0
mov eax, dword [ebp - 0x348]
mov dword [esp], eax
call sub.gdiplus.dll_GdipDeleteGraphics
mov eax, dword [ebp - 0x358]
sub esp, 4
mov dword [esp], eax
call sub.gdiplus.dll_GdipDeleteBrush
mov eax, dword [ebp - 0x35c]
sub esp, 4
mov dword [esp], eax
call sub.gdiplus.dll_GdipDisposeImage
mov eax, dword [ebp - 0x344]
sub esp, 4
mov dword [esp], eax
call sub.gdiplus.dll_GdipDisposeImage
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, word [0x4afc18]
add ecx, 2
mov word [ecx - 2], ax
jmp 0x47c5c8
movzx eax, word [0x4afc1a]
add ecx, 2
mov word [ecx - 2], ax
jmp 0x47c5c8
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x47cd68
mov esi, eax
mov byte [ecx], 0x5c
add ecx, 5
shr si, 0xc
movzx esi, si
movzx ebx, byte [esi + 0x4ad968]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ecx - 4], bl
movzx ebx, byte [esi + 0x4ad968]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + 0x4ad968]
and esi, 0xf
mov byte [ecx - 3], bl
movzx ebx, byte [esi + 0x4ad968]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x47c5c8
movzx eax, word [0x4afc1c]
add ecx, 2
mov word [ecx - 2], ax
jmp 0x47c5c8
movzx eax, di
mov dword [esp], str._04x
lea ebx, [ebp - 0x340]
mov dword [esp + 4], eax
call fcn.00470b40
mov dword [ebp - 0x36c], ebx
jmp 0x47c681
mov byte [ecx], al
add ecx, 1
jmp 0x47c5c8
lea eax, [ecx + 1]
jmp 0x47c653
movzx eax, word [0x4afc14]
mov byte [ebp - 0x33e], 0x22
mov word [ebp - 0x340], ax
lea eax, [ebp - 0x33d]
jmp 0x47c653