Function at 0x5104c0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x86716e
mov eax, dword fs:[0]
push eax
sub esp, 0x80
mov eax, dword [0x8ce6f4]
xor eax, esp
mov dword [esp + 0x7c], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x8ce6f4]
xor eax, esp
push eax
lea eax, [esp + 0x94]
mov dword fs:[0], eax
mov eax, dword [esp + 0xa4]
mov esi, dword [esp + 0xa8]
mov dword [esp + 0x2c], ecx
push eax
lea ecx, [esp + 0x18]
mov dword [esp + 0x40], eax
mov dword [esp + 0x24], esi
call fcn.004a8f10
movzx ebp, word [esi + 0xe]
mov dword [esp + 0x9c], 0
mov dword [esp + 0x1c], ebp
cmp ebp, 0x10
je 0x510551
cmp ebp, 0x18
je 0x510551
cmp ebp, 0x20
je 0x510551
push 0
push 0x30
push 0x8124
call fcn.007d3adc
jmp 0x510a0c
mov eax, dword [esi + 8]
mov ebx, dword [esi + 4]
cdq
mov esi, eax
xor esi, edx
sub esi, edx
lea eax, [ebx + ebx*2 + 3]
cdq
and edx, 3
lea edi, [edx + eax]
sar edi, 2
add edi, edi
add edi, edi
mov ecx, edi
imul ecx, esi
sar ebp, 3
push ecx
imul ebp, ebx
call fcn.007c8558
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x24]
add esp, 4
lea edx, [eax + 0x28]
cmp ecx, 8
jg 0x5105a9
mov eax, dword [eax + 0x20]
test eax, eax
jne 0x5105a6
mov eax, 1
shl eax, cl
lea edx, [edx + eax*4]
push ecx
lea eax, [esi - 1]
imul eax, ebp
mov ecx, ebp
neg ecx
push ecx
mov ecx, dword [esp + 0x2c]
add eax, edx
push eax
push 0x18
push edi
push ecx
push esi
push ebx
call fcn.005d28b0
xor eax, eax
add esp, 0x20
push eax
lea edx, [esp + 0x64]
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
push edx
lea eax, [esp + 0x4c]
push eax
mov dword [esp + 0x6c], 1
call sub.gdiplus.dll_GdiplusStartup
push 0x10
call sub.gdiplus.dll_GdipAlloc
mov ebp, eax
test ebp, ebp
je 0x510635
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x18]
push ecx
push edx
push 0x21808
push edi
push esi
push ebx
mov dword [ebp], 0x40c8b4
mov dword [esp + 0x30], 0
call sub.gdiplus.dll_GdipCreateBitmapFromScan0
mov dword [ebp + 8], eax
mov eax, dword [esp + 0x18]
mov dword [ebp + 4], eax
mov ebx, ebp
mov dword [esp + 0x18], ebp
jmp 0x51063b
xor ebx, ebx
mov dword [esp + 0x18], ebx
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x2c]
push edx
call sub.gdiplus.dll_GdipGetImageDecodersSize
mov eax, dword [esp + 0x30]
push eax
call fcn.007c8558
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x2c]
add esp, 4
mov edi, eax
push edi
push ecx
push edx
mov dword [esp + 0x4c], edi
call sub.gdiplus.dll_GdipGetImageDecoders
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x18]
call fcn.004d44d0
push eax
lea ecx, [esp + 0x20]
push 0x40da5c
push ecx
mov byte [esp + 0xa8], 1
call fcn.004b1a10
add esp, 0xc
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
mov byte [esp + 0x9c], 3
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x5106be
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [0x48b790]
mov edx, dword [0x48b794]
mov eax, dword [0x48b798]
xor ebp, ebp
mov dword [esp + 0x70], ecx
mov ecx, dword [0x48b79c]
mov dword [esp + 0x74], edx
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], ecx
mov dword [esp + 0x48], ebp
mov dword [esp + 0x4c], ebp
mov dword [esp + 0x50], ebp
mov dword [esp + 0x54], ebp
mov dword [esp + 0x58], ebp
mov dword [esp + 0x5c], 0xa
mov byte [esp + 0x9c], 4
mov dword [esp + 0x20], ebp
cmp dword [esp + 0x28], ebp
jbe 0x51088c
lea esp, [esp]
lea edx, [esp + 0x70]
push 0x48b790
push edx
call fcn.004c17a0
add esp, 8
test eax, eax
je 0x51088c
mov eax, dword [edi + 0x2c]
push eax
lea ecx, [esp + 0x38]
call fcn.004a8f10
push ebp
push 0x40d394
lea ecx, [esp + 0x50]
push ecx
push eax
lea edx, [esp + 0x48]
push edx
mov byte [esp + 0xb0], 5
call fcn.004f86e0
mov eax, dword [esp + 0x4c]
add eax, 0xfffffff0
add esp, 0x14
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x510788
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
mov byte [esp + 0x9c], 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x5107b0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x48]
mov esi, eax
cmp eax, ebp
je 0x510872
mov eax, 0x10
mov ecx, 0x48b790
lea edx, [esp + 0x70]
lea esp, [esp]
mov ebx, dword [edx]
cmp ebx, dword [ecx]
jne 0x5107e6
sub eax, 4
add ecx, 4
add edx, 4
cmp eax, 4
jae 0x5107d0
jmp 0x51081c
movzx eax, bl
movzx ebx, byte [ecx]
sub eax, ebx
jne 0x510812
movzx eax, byte [edx + 1]
movzx ebx, byte [ecx + 1]
sub eax, ebx
jne 0x510812
movzx eax, byte [edx + 2]
movzx ebx, byte [ecx + 2]
sub eax, ebx
jne 0x510812
movzx eax, byte [edx + 3]
movzx ecx, byte [ecx + 3]
sub eax, ecx
sar eax, 0x1f
or eax, 1
cmp eax, ebp
jne 0x510872
xor eax, eax
cmp esi, ebp
setne al
cmp eax, ebp
je 0x5108ab
mov ecx, dword [esp + 0x1c]
xor edx, edx
cmp ecx, ebp
setne dl
mov eax, esi
mov esi, dword [esi]
cmp edx, ebp
je 0x5108ab
mov eax, dword [eax + 8]
push ecx
push eax
call fcn.00801f5b
add esp, 8
cmp eax, ebp
jne 0x51086a
mov edx, dword [edi]
mov dword [esp + 0x70], edx
mov eax, dword [edi + 4]
mov dword [esp + 0x74], eax
mov ecx, dword [edi + 8]
mov dword [esp + 0x78], ecx
mov edx, dword [edi + 0xc]
mov dword [esp + 0x7c], edx
cmp esi, ebp
jne 0x5107be
mov eax, dword [esp + 0x20]
mov ebx, dword [esp + 0x18]
inc eax
add edi, 0x4c
mov dword [esp + 0x20], eax
cmp eax, dword [esp + 0x28]
jb 0x510720
mov ecx, dword [esp + 0x3c]
mov edx, dword [ebx + 4]
push ebp
lea eax, [esp + 0x74]
push eax
push ecx
push edx
call sub.gdiplus.dll_GdipSaveImageToFile
cmp eax, ebp
je 0x5108b5
mov dword [ebx + 8], eax
mov esi, eax
jmp 0x5108b7
push 0x80004005
call fcn.004a8210
xor esi, esi
mov eax, dword [ebx]
mov edx, dword [eax]
push 1
mov ecx, ebx
call edx
mov eax, dword [esp + 0x40]
push eax
call fcn.007c8563
mov ecx, dword [esp + 0x48]
add esp, 4
push ecx
call sub.gdiplus.dll_GdiplusShutdown
mov edx, dword [esp + 0x24]
push edx
call fcn.007c8563
add esp, 4
cmp esi, ebp
je 0x510930
push ebp
push 0x30
push 0x8124
call fcn.007d3adc
lea ecx, [esp + 0x48]
call fcn.004afe70
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
mov byte [esp + 0x9c], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x510a0c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x510a0c
lea ecx, [esp + 0x48]
call fcn.004afe70
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
mov byte [esp + 0x9c], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x510961
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push 0x401fc4
push 0x40da54
lea ecx, [esp + 0x1c]
call fcn.004aa070
mov edi, dword [esp + 0x2c]
mov ecx, dword [edi + 0xad8]
push ecx
call dword [sym.imp.USER32.dll_GetDC]
push eax
call fcn.007d2dab
mov esi, eax
cmp esi, ebp
je 0x5109ef
mov eax, dword [edi + 0xad8]
lea edx, [esp + 0x80]
push edx
push eax
mov dword [esp + 0x88], ebp
mov dword [esp + 0x8c], ebp
mov dword [esp + 0x90], ebp
mov dword [esp + 0x94], ebp
call dword [sym.imp.USER32.dll_GetClientRect]
mov ecx, dword [esp + 0x88]
sub ecx, dword [esp + 0x80]
mov edx, dword [esi + 4]
push ecx
push edx
lea ecx, [esp + 0x1c]
call fcn.004f5960
mov eax, dword [esi + 4]
mov ecx, dword [edi + 0xad8]
push eax
push ecx
call dword [sym.imp.USER32.dll_ReleaseDC]
mov edx, dword [esp + 0x14]
push 0xbb8
push ecx
mov ecx, esp
mov dword [esp + 0x34], esp
push edx
call fcn.004a8f10
mov ecx, edi
call fcn.004f8390
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov dword [esp + 0x9c], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x510a37
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x94]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x7c]
xor ecx, esp
call fcn.0080262b
add esp, 0x8c
ret 0xc