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

Disassembly:
sub esp, 0x34
push ebx
push ebp
push esi
mov esi, dword [esp + 0x44]
test esi, esi
push edi
mov dword [esp + 0x18], ecx
je 0x4029a1
mov eax, dword [ecx + 0x14]
test eax, eax
jne 0x40205d
push 0
call dword [sym.imp.GDI32.dll_GetStockObject]
push eax
mov eax, dword [esp + 0x50]
push eax
push esi
call dword [sym.imp.USER32.dll_FillRect]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 0x24
mov ebp, dword [esp + 0x4c]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x10], 0
mov edi, dword [ebp + 8]
mov edx, dword [ebp]
mov ebx, dword [ebp + 0xc]
mov ecx, dword [ebp + 4]
mov esi, dword [eax + 4]
sub edi, edx
sub ebx, ecx
mov ecx, dword [eax + 8]
mov eax, dword [esp + 0x48]
lea edx, [esp + 0x10]
push edx
push eax
mov dword [esp + 0x38], edi
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x1c], ecx
call sub.gdiplus.dll_GdipCreateFromHDC
test eax, eax
je 0x4020ba
mov ecx, dword [esp + 0x10]
push ecx
call sub.gdiplus.dll_GdipDeleteGraphics
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 0x24
mov eax, dword [ebp + 4]
mov edx, dword [ebp]
mov ecx, dword [0x41e678]
mov dword [esp + 0x1c], eax
mov eax, dword [0x41e67c]
mov dword [esp + 0x2c], edx
mov edx, dword [esp + 0x68]
neg eax
sbb eax, eax
and eax, ecx
xor ecx, ecx
cmp edx, ecx
mov dword [esp + 0x48], eax
je 0x4020ed
xor eax, eax
mov dword [esp + 0x48], eax
mov edx, dword [esp + 0x50]
cmp edx, ecx
jne 0x40214f
mov edx, dword [esp + 0x18]
cmp eax, ecx
mov edx, dword [edx + 0x14]
je 0x402104
mov eax, dword [eax]
jmp 0x402106
xor eax, eax
cmp edx, ecx
je 0x40210d
mov ecx, dword [edx + 4]
mov edx, dword [esp + 0x54]
push 0
push 0
push eax
mov eax, dword [esp + 0x64]
push 2
push ebx
push edi
push eax
mov eax, dword [esp + 0x38]
push edx
mov edx, dword [esp + 0x4c]
push ebx
push edi
push eax
mov eax, dword [esp + 0x3c]
push edx
push ecx
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x10]
push eax
call sub.gdiplus.dll_GdipDeleteGraphics
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 0x24
cmp edx, 1
jne 0x4021d8
mov ebp, dword [esp + 0x5c]
cmp ebp, ecx
jne 0x402169
cmp edi, esi
lea ebp, [esi - 1]
jne 0x402169
mov ebp, esi
mov edx, dword [esp + 0x60]
cmp edx, ecx
jne 0x40217e
mov esi, dword [esp + 0x14]
cmp ebx, esi
lea edx, [esi - 1]
jne 0x40217e
mov edx, esi
mov esi, dword [esp + 0x18]
cmp eax, ecx
mov esi, dword [esi + 0x14]
je 0x40218d
mov eax, dword [eax]
jmp 0x40218f
xor eax, eax
cmp esi, ecx
je 0x402196
mov ecx, dword [esi + 4]
push 0
push 0
push eax
mov eax, dword [esp + 0x60]
push 2
push edx
mov edx, dword [esp + 0x6c]
push ebp
push edx
mov edx, dword [esp + 0x38]
push eax
mov eax, dword [esp + 0x4c]
push ebx
push edi
push edx
push eax
push ecx
mov ecx, dword [esp + 0x44]
push ecx
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x10]
push eax
call sub.gdiplus.dll_GdipDeleteGraphics
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 0x24
cmp edx, 2
jne 0x402315
mov eax, dword [esp + 0x5c]
cmp eax, ecx
jle 0x4021ef
mov esi, eax
mov dword [esp + 0x24], esi
mov eax, dword [esp + 0x60]
cmp eax, ecx
jle 0x4021fb
mov dword [esp + 0x14], eax
cmp ebx, ecx
mov dword [esp + 0x60], ecx
jle 0x402997
mov edx, dword [esp + 0x14]
mov dword [esp + 0x5c], ebx
neg edx
mov dword [esp + 0x30], edx
xor eax, eax
test edi, edi
jle 0x4022e1
mov edx, dword [esp + 0x14]
add ecx, edx
mov dword [esp + 0x50], ecx
mov ecx, esi
neg ecx
mov dword [esp + 0x1c], ecx
mov ecx, edi
mov dword [esp + 0x68], ecx
jmp 0x402241
mov esi, dword [esp + 0x24]
mov ebp, dword [esp + 0x4c]
mov edx, dword [esp + 0x14]
lea ebx, [eax + esi]
cmp ebx, edi
mov dword [esp + 0x2c], ebx
jle 0x402252
mov esi, ecx
mov ecx, dword [esp + 0x50]
mov ebx, dword [esp + 0x20]
cmp ecx, ebx
jle 0x402262
mov edx, dword [esp + 0x5c]
mov ecx, dword [ebp]
mov ebx, dword [ebp + 4]
mov ebp, dword [esp + 0x48]
add ecx, eax
mov eax, dword [esp + 0x60]
add eax, ebx
mov ebx, dword [esp + 0x18]
test ebp, ebp
mov ebx, dword [ebx + 0x14]
je 0x402284
mov ebp, dword [ebp]
jmp 0x402286
xor ebp, ebp
test ebx, ebx
je 0x40228f
mov ebx, dword [ebx + 4]
jmp 0x402291
xor ebx, ebx
push 0
push 0
push ebp
mov ebp, dword [esp + 0x64]
push 2
push edx
push esi
push ebp
mov ebp, dword [esp + 0x70]
push ebp
push edx
mov edx, dword [esp + 0x34]
push esi
push eax
push ecx
push ebx
push edx
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov ecx, dword [esp + 0x68]
mov esi, dword [esp + 0x1c]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x2c]
add ecx, esi
cmp eax, edi
mov dword [esp + 0x68], ecx
jl 0x402239
mov ecx, dword [esp + 0x60]
mov edx, dword [esp + 0x30]
mov esi, dword [esp + 0x24]
mov ebp, dword [esp + 0x4c]
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x5c]
add ecx, eax
mov eax, dword [esp + 0x20]
add ebx, edx
cmp ecx, eax
mov dword [esp + 0x60], ecx
mov dword [esp + 0x5c], ebx
jl 0x402215
mov eax, dword [esp + 0x10]
push eax
call sub.gdiplus.dll_GdipDeleteGraphics
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 0x24
cmp edx, 3
jne 0x402438
mov eax, 0xaaaaaaab
mov ecx, dword [esp + 0x48]
mul esi
mov eax, dword [esp + 0x18]
mov esi, edx
shr esi, 1
mov eax, dword [eax + 0x14]
test ecx, ecx
je 0x40233c
mov ecx, dword [ecx]
jmp 0x40233e
xor ecx, ecx
test eax, eax
je 0x402347
mov eax, dword [eax + 4]
jmp 0x402349
xor eax, eax
push 0
push 0
mov edx, dword [esp + 0x24]
push ecx
mov ecx, dword [esp + 0x20]
push 2
push ecx
mov ecx, dword [ebp]
push esi
push 0
push 0
push ebx
push esi
push edx
push ecx
push eax
mov eax, dword [esp + 0x44]
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x48]
mov dword [esp + 0x54], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ecx + 0x14]
sub eax, esi
test edx, edx
je 0x40238c
mov edx, dword [edx]
jmp 0x40238e
xor edx, edx
test ecx, ecx
je 0x40239b
mov ecx, dword [ecx + 4]
mov dword [esp + 0x54], ecx
jmp 0x4023a3
mov dword [esp + 0x54], 0
push 0
push 0
push edx
mov edx, dword [esp + 0x20]
push 2
push edx
mov edx, dword [esp + 0x68]
lea ecx, [esi + esi]
push esi
push 0
push ecx
mov ecx, dword [esp + 0x3c]
push ebx
push esi
push ecx
push eax
mov eax, dword [esp + 0x40]
push edx
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov ecx, dword [esp + 0x18]
mov ebp, dword [ebp]
mov dword [esp + 0x54], eax
lea eax, [esi + esi]
sub edi, eax
mov eax, dword [ecx + 0x14]
mov ecx, dword [esp + 0x48]
add ebp, esi
test ecx, ecx
je 0x4023f0
mov edx, ecx
mov ecx, dword [edx]
jmp 0x4023f2
xor ecx, ecx
test eax, eax
je 0x4023fb
mov eax, dword [eax + 4]
jmp 0x4023fd
xor eax, eax
push 0
push 0
mov edx, dword [esp + 0x24]
push ecx
mov ecx, dword [esp + 0x20]
push 2
push ecx
push esi
push 0
push esi
push ebx
push edi
push edx
push ebp
push eax
mov eax, dword [esp + 0x44]
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x10]
push eax
call sub.gdiplus.dll_GdipDeleteGraphics
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 0x24
cmp edx, 4
jne 0x402578
mov eax, 0xaaaaaaab
mov ecx, dword [ebp]
mul esi
mov esi, edx
mov eax, edi
shr esi, 1
sub eax, esi
cdq
sub eax, edx
mov edx, dword [esp + 0x48]
sar eax, 1
mov dword [esp + 0x60], eax
add eax, ecx
mov ecx, dword [esp + 0x18]
test edx, edx
mov ecx, dword [ecx + 0x14]
je 0x402471
mov edx, dword [edx]
jmp 0x402473
xor edx, edx
test ecx, ecx
je 0x40247c
mov ecx, dword [ecx + 4]
jmp 0x40247e
xor ecx, ecx
push 0
push 0
push edx
mov edx, dword [esp + 0x20]
push 2
push edx
mov edx, dword [esp + 0x30]
push esi
push 0
push esi
push ebx
push esi
push edx
push eax
mov eax, dword [esp + 0x40]
push ecx
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x48]
mov dword [esp + 0x54], eax
mov eax, dword [ebp]
mov ecx, dword [ecx + 0x14]
test edx, edx
je 0x4024bb
mov edx, dword [edx]
jmp 0x4024bd
xor edx, edx
test ecx, ecx
je 0x4024ca
mov ecx, dword [ecx + 4]
mov dword [esp + 0x54], ecx
jmp 0x4024d2
mov dword [esp + 0x54], 0
push 0
push 0
push edx
mov edx, dword [esp + 0x20]
lea ecx, [esi - 1]
push 2
push edx
mov edx, dword [esp + 0x30]
push ecx
mov ecx, dword [esp + 0x78]
push 0
push 0
push ebx
push ecx
mov ecx, dword [esp + 0x38]
push edx
push eax
mov eax, dword [esp + 0x84]
push eax
push ecx
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov ecx, dword [esp + 0x60]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x54], eax
mov eax, dword [ebp]
add eax, ecx
sub edi, ecx
mov ecx, dword [edx + 0x14]
mov edx, dword [esp + 0x48]
add eax, esi
sub edi, esi
test edx, edx
je 0x40252a
mov edx, dword [edx]
jmp 0x40252c
xor edx, edx
test ecx, ecx
je 0x402535
mov ecx, dword [ecx + 4]
jmp 0x402537
xor ecx, ecx
push 0
push 0
push edx
mov edx, dword [esp + 0x20]
push 2
push edx
lea edx, [esi - 1]
push edx
lea edx, [esi + esi]
push 0
push edx
mov edx, dword [esp + 0x3c]
push ebx
push edi
push edx
push eax
mov eax, dword [esp + 0x40]
push ecx
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x10]
push eax
call sub.gdiplus.dll_GdipDeleteGraphics
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 0x24
cmp edx, 5
jne 0x40276c
mov eax, 0xaaaaaaab
mov ecx, dword [esp + 0x14]
mul esi
mov esi, edx
xor eax, eax
shr esi, 1
test ebx, ebx
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x2c], eax
jle 0x402997
sub edi, esi
mov dword [esp + 0x60], ebx
neg ecx
mov dword [esp + 0x54], edi
mov dword [esp + 0x1c], ecx
mov ecx, eax
mov edi, dword [esp + 0x4c]
add ecx, dword [ebp + 4]
mov edx, dword [ebp]
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x14]
add eax, ecx
cmp eax, ebx
mov dword [esp + 0x50], eax
jle 0x4025d8
mov edi, dword [esp + 0x60]
mov dword [esp + 0x4c], edi
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x48]
test ecx, ecx
mov eax, dword [eax + 0x14]
je 0x4025eb
mov ecx, dword [ecx]
jmp 0x4025ed
xor ecx, ecx
test eax, eax
je 0x4025f6
mov eax, dword [eax + 4]
jmp 0x4025f8
xor eax, eax
push 0
mov ebx, dword [esp + 0x3c]
push 0
push ecx
push 2
mov ecx, dword [esp + 0x20]
push edi
push esi
push 0
push 0
push edi
push esi
push ebx
push edx
push eax
push ecx
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x48]
mov dword [esp + 0x58], eax
mov eax, dword [ebp + 8]
mov edx, dword [edx + 0x14]
sub eax, esi
test ecx, ecx
je 0x402634
mov ecx, dword [ecx]
jmp 0x402636
xor ecx, ecx
test edx, edx
je 0x40263f
mov edx, dword [edx + 4]
jmp 0x402641
xor edx, edx
push 0
push 0
push ecx
push 2
push edi
push esi
lea ecx, [esi + esi]
push 0
push ecx
push edi
push esi
push ebx
push eax
mov eax, dword [esp + 0x40]
push edx
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov ecx, dword [esp + 0x54]
mov dword [esp + 0x58], eax
cmp esi, ecx
mov eax, esi
jge 0x402736
mov ecx, esi
neg ecx
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x54]
sub ecx, esi
mov dword [esp + 0x58], ecx
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x14]
lea edi, [eax + esi]
cmp edi, ecx
mov ebx, esi
mov dword [esp + 0x30], edi
jle 0x40269c
mov ebx, dword [esp + 0x58]
mov ecx, dword [esp + 0x20]
mov edi, dword [esp + 0x50]
cmp edi, ecx
jle 0x4026ac
mov edx, dword [esp + 0x60]
mov ecx, dword [ebp]
mov edi, dword [ebp + 4]
add ecx, eax
mov eax, dword [esp + 0x2c]
add eax, edi
mov edi, dword [esp + 0x48]
test edi, edi
je 0x4026ca
mov edi, dword [edi]
mov dword [esp + 0x5c], edi
jmp 0x4026d2
mov dword [esp + 0x5c], 0
mov edi, dword [esp + 0x18]
mov edi, dword [edi + 0x14]
test edi, edi
je 0x4026e6
mov edi, dword [edi + 4]
mov dword [esp + 0x68], edi
jmp 0x4026ee
mov dword [esp + 0x68], 0
mov edi, dword [esp + 0x5c]
push 0
push 0
push edi
push 2
push edx
push ebx
push 0
push esi
push edx
mov edx, dword [esp + 0x8c]
push ebx
push eax
mov eax, dword [esp + 0x3c]
push ecx
push edx
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov ecx, dword [esp + 0x24]
mov edi, dword [esp + 0x58]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x30]
add edi, ecx
mov ecx, dword [esp + 0x54]
cmp eax, ecx
mov dword [esp + 0x58], edi
jl 0x402687
mov edx, dword [esp + 0x1c]
mov edi, dword [esp + 0x60]
mov eax, dword [esp + 0x50]
mov ebx, dword [esp + 0x20]
add edi, edx
cmp eax, ebx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x60], edi
jl 0x4025b2
mov eax, dword [esp + 0x10]
push eax
call sub.gdiplus.dll_GdipDeleteGraphics
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 0x24
cmp edx, 6
jne 0x40286e
mov ebp, dword [esp + 0x14]
cmp ebp, ebx
ja 0x402787
cmp esi, edi
ja 0x402787
mov dword [esp + 0x3c], esi
jmp 0x4027dc
mov dword [esp + 0x34], ebp
mov dword [esp + 0x38], ecx
fild qword [esp + 0x34]
fild dword [esp + 0x20]
mov dword [esp + 0x34], esi
mov dword [esp + 0x38], ecx
fdiv st(1)
fild qword [esp + 0x34]
fst qword [esp + 0x24]
fidivr dword [esp + 0x30]
fst qword [esp + 0x34]
fcomp st(1)
fnstsw ax
test ah, 1
je 0x4027c0
fstp st(0)
fld qword [esp + 0x34]
fxch st(1)
fmul st(1)
call fcn.004101a0
fld qword [esp + 0x24]
fmul st(1)
mov ebp, eax
call fcn.004101a0
fstp st(0)
mov dword [esp + 0x3c], eax
mov edx, dword [esp + 0x3c]
mov eax, edi
sub eax, edx
push 7
cdq
sub eax, edx
mov edx, dword [esp + 0x30]
mov edi, eax
mov eax, ebx
sar edi, 1
sub eax, ebp
add edi, edx
cdq
sub eax, edx
mov ebx, eax
mov eax, dword [esp + 0x20]
sar ebx, 1
add ebx, eax
mov eax, dword [esp + 0x14]
push eax
call sub.gdiplus.dll_GdipSetInterpolationMode
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x54], eax
mov eax, dword [ecx + 0x14]
mov ecx, dword [esp + 0x48]
test ecx, ecx
je 0x402825
mov ecx, dword [ecx]
jmp 0x402827
xor ecx, ecx
test eax, eax
je 0x402830
mov eax, dword [eax + 4]
jmp 0x402832
xor eax, eax
mov edx, dword [esp + 0x14]
push 0
push 0
push ecx
mov ecx, dword [esp + 0x48]
push 2
push edx
mov edx, dword [esp + 0x24]
push esi
push 0
push 0
push ebp
push ecx
push ebx
push edi
push eax
push edx
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x10]
push eax
call sub.gdiplus.dll_GdipDeleteGraphics
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 0x24
cmp edx, 7
jne 0x402997
mov eax, 0xaaaaaaab
mul dword [esp + 0x5c]
mov esi, edx
shr esi, 1
test edi, edi
je 0x402997
cmp esi, edi
mov edx, esi
jle 0x402894
mov edx, edi
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x48]
test eax, eax
mov ecx, dword [ecx + 0x14]
je 0x4028a7
mov eax, dword [eax]
jmp 0x4028a9
xor eax, eax
test ecx, ecx
je 0x4028b2
mov ecx, dword [ecx + 4]
jmp 0x4028b4
xor ecx, ecx
push 0
push 0
push eax
mov eax, dword [esp + 0x6c]
push 2
push eax
mov eax, dword [esp + 0x68]
push esi
push 0
push eax
mov eax, dword [ebp]
push ebx
push edx
mov edx, dword [esp + 0x44]
push edx
push eax
mov eax, dword [esp + 0x40]
push ecx
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov ecx, dword [ebp]
mov dword [esp + 0x4c], eax
mov eax, dword [ebp + 8]
sub eax, esi
cmp eax, ecx
jle 0x40293c
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x48]
test edx, edx
mov ecx, dword [ecx + 0x14]
je 0x402901
mov edx, dword [edx]
jmp 0x402903
xor edx, edx
test ecx, ecx
je 0x40290c
mov ecx, dword [ecx + 4]
jmp 0x40290e
xor ecx, ecx
push 0
push 0
push edx
mov edx, dword [esp + 0x6c]
push 2
push edx
mov edx, dword [esp + 0x68]
push esi
push 0
lea edx, [edx + esi*2]
push edx
mov edx, dword [esp + 0x3c]
push ebx
push esi
push edx
push eax
mov eax, dword [esp + 0x40]
push ecx
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov dword [esp + 0x4c], eax
mov ebp, dword [ebp]
lea ecx, [esi + esi]
sub edi, ecx
add ebp, esi
test edi, edi
jle 0x402997
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x48]
test ecx, ecx
mov eax, dword [edx + 0x14]
je 0x40295d
mov ecx, dword [ecx]
jmp 0x40295f
xor ecx, ecx
test eax, eax
je 0x402968
mov eax, dword [eax + 4]
jmp 0x40296a
xor eax, eax
mov edx, dword [esp + 0x54]
push 0
push 0
push ecx
mov ecx, dword [esp + 0x6c]
push 2
push ecx
mov ecx, dword [esp + 0x30]
push esi
add esi, edx
mov edx, dword [esp + 0x28]
push 0
push esi
push ebx
push edi
push ecx
push ebp
push eax
push edx
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x10]
push eax
call sub.gdiplus.dll_GdipDeleteGraphics
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 0x24