Function at 0x40bd80
Capabilities:
Link many functions at runtime

Disassembly:
mov eax, 0x1064
call fcn.004d6340
push ebx
push ebp
push esi
push edi
mov ecx, 0x7e
xor eax, eax
lea edi, [esp + 0x67]
mov byte [esp + 0x60], 0
mov byte [esp + 0x61], 0
mov byte [esp + 0x62], 0
mov byte [esp + 0x63], 0
mov byte [esp + 0x64], 0
mov byte [esp + 0x65], 0
mov byte [esp + 0x66], 0
rep stosd dword es:[edi], eax
mov ecx, dword [0x5b5574]
mov ebp, dword [sym.imp.USER32.dll_LoadStringW]
stosb byte es:[edi], al
lea eax, [esp + 0x3e0]
push 0x40
push eax
push 0x4e73
push ecx
mov dword [esp + 0x40], 0
call ebp
mov ebx, dword [esp + 0x1084]
lea edx, [esp + 0x3e0]
push 0x598300
push edx
push ebx
call fcn.004d5ee1
mov eax, dword [esp + 0x1088]
add esp, 0xc
test eax, eax
je 0x40be1b
mov esi, 1
mov dword [esp + 0x1080], esi
jmp 0x40be22
mov esi, dword [esp + 0x1080]
mov edi, dword [esp + 0x1078]
push 0x598030
push edi
call fcn.004d5ece
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40be76
mov ecx, dword [0x5b5574]
lea eax, [esp + 0x3e0]
push 0x40
push eax
push 0x4e70
push ecx
call ebp
lea edx, [esp + 0x3e0]
push edi
push edx
push ebx
call fcn.004d5ee1
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1064
ret
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x60]
push eax
push 0x200
push 1
push ecx
call fcn.004d58aa
push 7
lea edx, [esp + 0x74]
push str.PCD_OPA
push edx
call fcn.004d6370
add esp, 0x1c
test eax, eax
jne 0x40bec3
mov eax, dword [esp + 0x14]
push eax
call fcn.004d5e20
push ebx
push edi
call fcn.0040c740
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1064
ret
push 7
lea ecx, [esp + 0x64]
push 0x5982f0
push ecx
call fcn.004d6370
add esp, 0xc
test eax, eax
je 0x40bee5
mov edx, dword [esp + 0x14]
push edx
jmp 0x40c71c
cmp esi, 3
jle 0x40c264
mov ecx, 6
mov esi, str.PHOTOCD.DLL
lea edi, [esp + 0x48]
lea eax, [esp + 0x48]
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x86c]
push eax
push ecx
call fcn.004904e0
add esp, 8
lea edx, [esp + 0x86c]
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
jne 0x40bf43
push eax
lea eax, [esp + 0x4c]
push ebx
push eax
call fcn.004905d0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1064
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.PCDopen
push edi
call esi
push str.PCDclose
push edi
mov ebx, eax
call esi
push str.PCDgetCount
push edi
mov dword [esp + 0x24], eax
call esi
push str.PCDsetResolution
push edi
mov dword [esp + 0x2c], eax
call esi
push str.PCDgetSize
push edi
mov dword [esp + 0x34], eax
call esi
push str.PCDsetFormat
push edi
mov ebp, eax
call esi
push str.PCDgetBlock
push edi
mov dword [esp + 0x28], eax
call esi
test ebx, ebx
mov dword [esp + 0x28], eax
je 0x40c239
mov ecx, dword [esp + 0x1c]
test ecx, ecx
je 0x40c239
mov ecx, dword [esp + 0x24]
test ecx, ecx
je 0x40c239
mov esi, dword [esp + 0x2c]
test esi, esi
je 0x40c239
test ebp, ebp
je 0x40c239
mov ecx, dword [esp + 0x20]
test ecx, ecx
je 0x40c239
test eax, eax
je 0x40c239
mov edx, dword [esp + 0x1078]
lea ecx, [esp + 0x768]
push ecx
push edx
call fcn.00490210
lea eax, [esp + 0x18]
lea ecx, [esp + 0x770]
push eax
push ecx
call ebx
add esp, 0x10
test ax, ax
je 0x40c021
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1064
ret
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x14]
lea eax, [esp + 0x3c]
push edx
push eax
push ecx
call dword [esp + 0x30]
add esp, 0xc
test ax, ax
jne 0x40c1ee
mov edx, dword [esp + 0x1080]
mov eax, dword [esp + 0x10]
push edx
push eax
call esi
mov eax, dword [esp + 0x1084]
add esp, 8
test eax, eax
je 0x40c069
mov ecx, dword [esp + 0x10]
push 1
push ecx
call esi
add esp, 8
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x34]
push edx
push eax
call ebp
mov ecx, dword [esp + 0x18]
push 2
push ecx
call dword [esp + 0x30]
mov bp, word [esp + 0x4a]
add esp, 0x10
movsx eax, bp
movsx ebx, word [esp + 0x38]
lea edx, [eax + eax*2]
mov esi, ebx
lea eax, [edx*8 + 0x1f]
cdq
and edx, 0x1f
add eax, edx
mov ecx, eax
sar ecx, 5
shl ecx, 2
imul esi, ecx
test bp, bp
jle 0x40c219
cmp word [esp + 0x38], 0
jle 0x40c219
test ecx, ecx
jle 0x40c219
mov eax, esi
xor edx, edx
div ebx
test eax, eax
jle 0x40c219
test esi, esi
jle 0x40c219
cmp bp, 0x4000
jg 0x40c219
cmp word [esp + 0x38], 0x4000
jg 0x40c219
mov eax, esi
cdq
idiv ebx
cmp eax, ecx
jl 0x40c219
cmp esi, 0xfffffbd7
ja 0x40c219
add esi, 0x28
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
xor esi, esi
mov dword [esp + 0x30], eax
cmp eax, esi
jne 0x40c166
mov eax, dword [esp + 0x1084]
mov ecx, dword [0x5b5574]
push 0x80
push eax
push 0x50a
push ecx
call dword [sym.imp.USER32.dll_LoadStringW]
mov edx, dword [esp + 0x10]
push edx
call dword [esp + 0x20]
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1064
ret
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov dword [eax], 0x28
movsx ecx, word [esp + 0x3a]
mov dword [eax + 4], ecx
lea ecx, [eax + 0x28]
movsx edx, word [esp + 0x38]
mov dword [eax + 8], edx
mov dword [eax + 0x20], esi
mov word [eax + 0xe], 0x18
mov word [eax + 0xc], 1
mov dword [eax + 0x10], esi
mov dword [eax + 0x14], esi
mov dword [eax + 0x24], esi
mov dword [eax + 0x18], esi
mov dword [eax + 0x1c], esi
mov ax, word [esp + 0x3a]
mov word [esp + 0x46], ax
mov dx, word [esp + 0x38]
movsx eax, ax
mov word [esp + 0x44], dx
mov word [esp + 0x42], si
lea eax, [eax + eax*2]
mov word [esp + 0x40], si
lea eax, [eax*8 + 0x1f]
cdq
and edx, 0x1f
add eax, edx
mov edx, dword [esp + 0x10]
sar eax, 5
shl eax, 2
push eax
push ecx
lea ecx, [esp + 0x48]
push ecx
push edx
call dword [esp + 0x38]
add esp, 0x10
mov ecx, dword [esp + 0x10]
push ecx
call dword [esp + 0x20]
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov esi, dword [esp + 0x30]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1064
ret
mov eax, dword [esp + 0x10]
push eax
call dword [esp + 0x20]
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1064
ret
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov edx, dword [esp + 0x1084]
push 0
lea eax, [esp + 0x4c]
push edx
push eax
call fcn.004905d0
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1064
ret
mov edi, dword [esp + 0x14]
push 0
push 0xe02
push edi
call fcn.004d5be4
push edi
push 1
lea ecx, [esp + 0x2f]
push 1
push ecx
call fcn.004d58aa
mov dl, byte [esp + 0x37]
add esp, 0x1c
mov eax, esi
and dl, 7
dec eax
mov byte [esp + 0x1b], dl
push 0
je 0x40c2ee
dec eax
je 0x40c2d3
dec eax
je 0x40c2b8
mov edx, edi
push 0xb800
push edx
call fcn.004d5be4
mov edi, 0x180
mov esi, pe_nt_image_headers32
jmp 0x40c307
mov eax, dword [esp + 0x18]
push 0x30000
push eax
call fcn.004d5be4
mov edi, 0x300
mov esi, 0x200
jmp 0x40c307
mov ecx, dword [esp + 0x18]
push 0xb800
push ecx
call fcn.004d5be4
mov edi, 0x180
mov esi, pe_nt_image_headers32
jmp 0x40c307
mov edx, dword [esp + 0x18]
push 0x2000
push edx
call fcn.004d5be4
mov edi, 0xc0
mov esi, 0x80
mov eax, esi
add esp, 0xc
imul eax, edi
mov dword [esp + 0x1c], edi
lea ecx, [eax + eax*2]
test ecx, ecx
jle 0x40c717
mov eax, ecx
xor edx, edx
div esi
lea edx, [edi + edi*2]
cmp eax, edx
jl 0x40c717
cmp ecx, 0xfffffbd7
ja 0x40c717
add ecx, 0x28
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
mov dword [esp + 0x30], eax
jne 0x40c36c
mov eax, dword [0x5b5574]
push 0x80
push ebx
push 0x50a
push eax
call ebp
mov ecx, dword [esp + 0x14]
push ecx
jmp 0x40c71c
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov dword [eax + 8], esi
xor ecx, ecx
add esi, 0xfffffffe
mov dword [esp + 0x20], eax
cmp esi, ecx
mov dword [eax], 0x28
mov dword [eax + 4], edi
mov dword [eax + 0x20], ecx
mov word [eax + 0xe], 0x18
mov word [eax + 0xc], 1
mov dword [eax + 0x10], ecx
mov dword [eax + 0x14], ecx
mov dword [eax + 0x24], ecx
mov dword [eax + 0x18], ecx
mov dword [eax + 0x1c], ecx
mov dword [esp + 0x2c], esi
jl 0x40c68a
mov eax, esi
mov ebx, dword [esp + 0x14]
imul eax, edi
mov dword [esp + 0x24], eax
mov eax, edi
neg eax
add eax, eax
lea ebp, [esi + 1]
mov dword [esp + 0x3c], eax
imul ebp, edi
test byte [ebx + 0xc], 0x30
jne 0x40c68a
cmp edi, 0x300
mov eax, edi
jb 0x40c3e8
mov eax, 0x300
push ebx
push eax
lea edx, [esp + 0xa7c]
push 1
push edx
call fcn.004d58aa
add esp, 0x10
cmp edi, 0x300
mov eax, edi
jb 0x40c40b
mov eax, 0x300
push ebx
push eax
lea eax, [esp + 0xd7c]
push 1
push eax
call fcn.004d58aa
mov eax, edi
add esp, 0x10
cdq
sub eax, edx
mov esi, eax
sar esi, 1
cmp esi, 0x180
mov eax, esi
jb 0x40c437
mov eax, 0x180
push ebx
push eax
lea ecx, [esp + 0x5f0]
push 1
push ecx
call fcn.004d58aa
add esp, 0x10
cmp esi, 0x180
jb 0x40c458
mov esi, 0x180
push ebx
push esi
lea edx, [esp + 0x268]
push 1
push edx
call fcn.004d58aa
add esp, 0x10
xor esi, esi
cmp edi, 0x300
mov eax, edi
jb 0x40c47d
mov eax, 0x300
cmp esi, eax
jge 0x40c568
xor eax, eax
mov al, byte [esp + esi + 0xa74]
mov ecx, eax
shl ecx, 8
sub ecx, eax
mov eax, 0x2d4279a3
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, esi
mov ecx, edx
cdq
sub eax, edx
xor edx, edx
sar eax, 1
mov dl, byte [esp + eax + 0x5e8]
lea edi, [ecx + edx*2 - 0x13e]
xor edx, edx
mov dl, byte [esp + eax + 0x260]
mov dword [esp + 0x10], edi
lea ebx, [ecx + edx*2 - 0x112]
lea ecx, [ecx + ecx*4]
add ecx, ecx
lea eax, [ebx + ebx*2]
sub ecx, eax
mov eax, 0x2aaaaaab
sub ecx, edi
imul ecx
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
test ebx, ebx
jge 0x40c4f5
xor ebx, ebx
jmp 0x40c502
cmp ebx, 0xff
jle 0x40c502
mov ebx, 0xff
test edx, edx
jge 0x40c50a
xor edx, edx
jmp 0x40c517
cmp edx, 0xff
jle 0x40c517
mov edx, 0xff
mov eax, dword [esp + 0x10]
test eax, eax
jge 0x40c529
mov dword [esp + 0x10], 0
jmp 0x40c538
cmp eax, 0xff
jle 0x40c538
mov dword [esp + 0x10], 0xff
mov ecx, dword [esp + 0x20]
lea eax, [esi + ebp]
mov edi, dword [esp + 0x1c]
mov dword [esp + 0x28], ebx
mov bl, byte [esp + 0x10]
lea eax, [eax + eax*2]
inc esi
mov byte [eax + ecx + 0x28], bl
mov ebx, dword [esp + 0x28]
mov byte [eax + ecx + 0x2a], bl
mov ebx, dword [esp + 0x14]
mov byte [eax + ecx + 0x29], dl
jmp 0x40c46e
xor esi, esi
cmp edi, 0x300
mov eax, edi
jb 0x40c579
mov eax, 0x300
cmp esi, eax
jge 0x40c667
xor eax, eax
mov al, byte [esp + esi + 0xd74]
mov ecx, eax
shl ecx, 8
sub ecx, eax
mov eax, 0x2d4279a3
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, esi
mov ecx, edx
cdq
sub eax, edx
xor edx, edx
sar eax, 1
mov dl, byte [esp + eax + 0x5e8]
lea edi, [ecx + edx*2 - 0x13e]
xor edx, edx
mov dl, byte [esp + eax + 0x260]
mov dword [esp + 0x10], edi
lea ebx, [ecx + edx*2 - 0x112]
lea ecx, [ecx + ecx*4]
add ecx, ecx
lea eax, [ebx + ebx*2]
sub ecx, eax
mov eax, 0x2aaaaaab
sub ecx, edi
imul ecx
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
test ebx, ebx
jge 0x40c5f1
xor ebx, ebx
jmp 0x40c5fe
cmp ebx, 0xff
jle 0x40c5fe
mov ebx, 0xff
test edx, edx
jge 0x40c606
xor edx, edx
jmp 0x40c613
cmp edx, 0xff
jle 0x40c613
mov edx, 0xff
mov eax, dword [esp + 0x10]
test eax, eax
jge 0x40c625
mov dword [esp + 0x10], 0
jmp 0x40c634
cmp eax, 0xff
jle 0x40c634
mov dword [esp + 0x10], 0xff
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
add eax, esi
mov edi, dword [esp + 0x1c]
mov dword [esp + 0x28], ebx
mov bl, byte [esp + 0x10]
lea eax, [eax + eax*2]
inc esi
mov byte [eax + ecx + 0x28], bl
mov ebx, dword [esp + 0x28]
mov byte [eax + ecx + 0x2a], bl
mov ebx, dword [esp + 0x14]
mov byte [eax + ecx + 0x29], dl
jmp 0x40c56a
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x24]
sub eax, 2
add ebp, ecx
add edx, ecx
test eax, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x24], edx
jge 0x40c3cf
mov ebp, dword [esp + 0x30]
mov edi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
call edi
mov edx, dword [esp + 0x14]
push edx
call fcn.004d5e20
mov al, byte [esp + 0x1f]
add esp, 4
cmp al, 3
jne 0x40c6b4
push ebp
call fcn.0041e6f0
jmp 0x40c6be
cmp al, 1
jne 0x40c6da
push ebp
call fcn.0041e910
add esp, 4
mov esi, eax
push ebp
call edi
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1064
ret
cmp al, 2
jne 0x40c70a
push ebp
call fcn.0041e910
add esp, 4
mov esi, eax
push ebp
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalFree]
push ebp
call ebx
push esi
call fcn.0041e910
add esp, 4
mov ebp, eax
test esi, esi
je 0x40c70a
push esi
call edi
push esi
call ebx
pop edi
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x1064
ret
mov eax, dword [esp + 0x14]
push eax
call fcn.004d5e20
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1064
ret