Function at 0x46c510
Capabilities:
Delete file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5043e0
mov eax, dword fs:[0]
push eax
sub esp, 0x5c
mov eax, dword [0x54c728]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x68], ecx
mov edx, dword [ebp + 8]
xor eax, eax
mov dword [ebp - 0x64], edx
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 7
mov word [ebp - 0x40], ax
cmp dword [edx + 0x14], 8
mov esi, edx
mov dword [ebp - 4], eax
jb 0x46c564
mov esi, dword [edx]
mov edi, dword [edx + 0x10]
test edi, edi
je 0x46c593
lea eax, [edi - 1]
or ecx, 0xffffffff
cmp eax, ecx
cmovb ecx, eax
cmp word [esi + ecx*2], 0x2e
lea eax, [esi + ecx*2]
je 0x46c58d
cmp eax, esi
je 0x46c593
sub eax, 2
cmp word [eax], 0x2e
jne 0x46c580
sub eax, esi
sar eax, 1
jmp 0x46c596
or eax, 0xffffffff
inc eax
mov dword [ebp - 0x18], 0
xor ecx, ecx
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], cx
cmp edi, eax
jb 0x46c7ff
sub edi, eax
mov esi, 0xffffffff
cmp edi, 0xffffffff
mov ecx, edx
cmovb esi, edi
cmp dword [edx + 0x14], 8
jb 0x46c5ca
mov ecx, dword [edx]
lea eax, [ecx + eax*2]
push esi
push eax
lea ecx, [ebp - 0x28]
call fcn.004042a0
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
push str.jpeg
cmovae eax, dword [ebp - 0x28]
push eax
mov byte [ebp - 4], 1
call fcn.004de826
add esp, 8
test eax, eax
je 0x46c665
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
push 0x515e3c
cmovae eax, dword [ebp - 0x28]
push eax
call fcn.004de826
add esp, 8
test eax, eax
je 0x46c665
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
push 0x515e44
cmovae eax, dword [ebp - 0x28]
push eax
call fcn.004de826
add esp, 8
test eax, eax
jne 0x46c63b
push 9
push str.image_png
jmp 0x46c66c
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
push 0x515e4c
cmovae eax, dword [ebp - 0x28]
push eax
call fcn.004de826
add esp, 8
test eax, eax
jne 0x46c6f6
push 9
push str.image_bmp
jmp 0x46c66c
push 0xa
push 0x515eac
lea ecx, [ebp - 0x40]
call fcn.004042a0
cmp dword [ebp - 0x2c], 8
lea eax, [ebp - 0x40]
mov dword [ebp - 0x54], 0
cmovae eax, dword [ebp - 0x40]
mov dword [ebp - 0x60], eax
lea eax, [ebp - 0x58]
push eax
lea eax, [ebp - 0x54]
mov dword [ebp - 0x58], 0
push eax
call sub.gdiplus.dll_GdipGetImageEncodersSize
mov eax, dword [ebp - 0x58]
test eax, eax
je 0x46c6f6
push eax
call fcn.004d434e
mov edi, eax
add esp, 4
mov dword [ebp - 0x5c], edi
test edi, edi
je 0x46c6f6
push edi
push dword [ebp - 0x58]
push dword [ebp - 0x54]
call sub.gdiplus.dll_GdipGetImageEncoders
xor esi, esi
cmp dword [ebp - 0x54], esi
jbe 0x46c6ed
add edi, 0x30
nop dword [eax]
push dword [ebp - 0x60]
push dword [edi]
call fcn.004de826
add esp, 8
test eax, eax
je 0x46c72e
inc esi
add edi, 0x4c
cmp esi, dword [ebp - 0x54]
jb 0x46c6d0
mov edi, dword [ebp - 0x5c]
push edi
call fcn.004d008d
add esp, 4
xor esi, esi
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x46c796
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x46c78c
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x46c804
jmp 0x46c78c
mov ecx, dword [ebp - 0x5c]
imul eax, esi, 0x4c
push ecx
movups xmm0, xmmword [eax + ecx]
movups xmmword [ebp - 0x50], xmm0
call fcn.004d008d
add esp, 4
cmp esi, 0xffffffff
je 0x46c6f6
mov esi, dword [ebp - 0x64]
mov eax, esi
cmp dword [esi + 0x14], 8
jb 0x46c757
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp dword [esi + 0x14], 8
jb 0x46c766
mov esi, dword [esi]
mov edi, dword [ebp - 0x68]
lea eax, [ebp - 0x50]
push 0
push eax
push esi
mov edi, dword [edi + 0x10]
push dword [edi + 4]
call sub.gdiplus.dll_GdipSaveImageToFile
test eax, eax
je 0x46c782
mov dword [edi + 8], eax
mov esi, 1
jmp 0x46c6f8
push edx
push ecx
call fcn.004a96a6
add esp, 8
mov edx, dword [ebp - 0x2c]
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
cmp edx, 8
jb 0x46c7e0
mov ecx, dword [ebp - 0x40]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x46c7d6
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x46c809
push edx
push ecx
call fcn.004a96a6
add esp, 8
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004a995c
mov esp, ebp
pop ebp
ret 4
call fcn.00408040
call fcn.004d003c
call fcn.004d003c
int3