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

Disassembly:
sub esp, 0x20
push ebx
xor ebx, ebx
cmp dword [esi + 4], ebx
mov dword [esp + 0x1c], ebx
jle 0x40dbd9
push ebp
mov dword [esp + 0x24], ebx
push edi
lea esp, [esp]
mov eax, dword [esi + 0x20]
mov ecx, dword [eax + ebx*4]
mov eax, dword [ecx]
sub eax, dword [esi + 0x40]
mov byte [esp + 0xf], 0
mov edx, eax
shl edx, 4
sub edx, eax
mov eax, dword [esp + 0x30]
lea edi, [eax + edx*4]
mov eax, dword [ecx + 4]
sub eax, dword [esi + 0x44]
mov edx, dword [esp + 0x34]
mov ecx, eax
shl ecx, 4
sub ecx, eax
lea ebp, [edx + ecx*4]
mov ecx, dword [0x4b5b38]
xor eax, eax
add ecx, 8
lea ecx, [ecx]
cmp ebx, dword [ecx]
jne 0x40d9a0
mov edx, dword [0x4b5b34]
cmp byte [edx + eax], 0
je 0x40d9ad
add eax, 1
add ecx, 0xc
cmp eax, 8
jl 0x40d990
jmp 0x40d9b2
mov byte [esp + 0xf], 1
mov eax, dword [0x4b5b24]
mov ecx, dword [eax + 0x2124]
mov edx, dword [esp + 0x28]
cmp byte [ecx + edx + 0x284], 0
jne 0x40d9e0
mov eax, dword [esi + 0x20]
mov eax, dword [eax + ebx*4]
mov ecx, dword [esi + 0x30]
cmp ecx, dword [eax]
jne 0x40da1a
mov edx, dword [esi + 0x34]
cmp edx, dword [eax + 4]
jne 0x40da1a
mov eax, dword [esi + 0x78]
cmp eax, 0xff
mov byte [esp + 0x12], 0x7b
mov byte [esp + 0x11], 0x57
mov byte [esp + 0x10], 0xd
mov byte [esp + 0x13], al
jle 0x40da02
mov byte [esp + 0x13], 0xff
mov eax, dword [esp + 0x10]
mov ecx, dword [esi + 0x54]
mov edx, dword [esi + 0x50]
push eax
add ecx, ebp
push ecx
add edx, edi
push edx
push ebx
push esi
call fcn.0040dc80
mov eax, dword [esi + 0x20]
mov eax, dword [eax + ebx*4]
mov ecx, dword [esi + 0x30]
cmp ecx, dword [eax]
jne 0x40db10
mov edx, dword [esi + 0x34]
cmp edx, dword [eax + 4]
jne 0x40db10
mov eax, dword [0x4b5b1c]
cmp dword [eax + 0x2bc], 0xe
je 0x40db47
mov ecx, dword [0x4b5b2c]
mov ecx, dword [ecx + 8]
mov ebx, dword [esi + 0x10]
mov eax, 0x66666667
imul ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
lea ecx, [eax + eax*2]
movsx eax, word [ebx]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
jns 0x40da77
xor ecx, ecx
mov edx, dword [0x4b5b20]
mov ebx, dword [edx + 0xd4]
mov eax, dword [0x4b5b2c]
add ebx, dword [eax + 0xc]
mov eax, 0xdd67c8a7
imul ebx
add edx, ebx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
add eax, eax
add eax, eax
mov ebx, eax
mov eax, dword [esi + 0x10]
movsx eax, word [eax + 2]
cdq
sub eax, edx
sar eax, 1
sub ebx, eax
jns 0x40dab6
xor ebx, ebx
mov eax, dword [esi + 0x10]
mov edx, dword [esi + 0x54]
push 0
push eax
mov eax, dword [esi + 0x50]
add edx, ebx
add edx, ebp
add eax, ecx
push edx
add eax, edi
push eax
call fcn.0043ef90
mov ecx, dword [esi + 0x54]
mov edx, dword [esi + 0x50]
lea eax, [ecx + ebp]
lea ecx, [edx + edi]
push 0
mov byte [esp + 0x2e], 0
mov byte [esp + 0x2d], 0x6c
mov byte [esp + 0x2c], 0xff
mov byte [esp + 0x2f], 0
mov edx, dword [esp + 0x2c]
push edx
lea edx, [eax + 0x3c]
push edx
lea edx, [ecx + 0x3c]
push edx
push eax
push ecx
call fcn.0043e9f0
mov ebx, dword [esp + 0x4c]
add esp, 0x28
jmp 0x40db47
mov eax, dword [esi + 0x54]
mov ecx, dword [esi + 0x50]
push 0
mov byte [esp + 0x22], 0xa8
mov byte [esp + 0x21], 0x8c
mov byte [esp + 0x20], 0x1d
mov byte [esp + 0x23], 0
mov edx, dword [esp + 0x20]
push edx
add eax, ebp
lea edx, [eax + 0x3c]
push edx
add ecx, edi
lea edx, [ecx + 0x3c]
push edx
push eax
push ecx
call fcn.0043e9f0
add esp, 0x18
cmp byte [esp + 0xf], 0
je 0x40dbbf
mov eax, dword [esi + 0x78]
cmp eax, 0xff
mov byte [esp + 0x16], 0
mov byte [esp + 0x15], 0
mov byte [esp + 0x14], 0
mov byte [esp + 0x17], al
jle 0x40db70
mov byte [esp + 0x17], 0xff
mov eax, dword [esi + 0x18]
movsx ecx, word [eax + 2]
movsx edx, word [eax]
mov ebx, dword [esp + 0x14]
push 0
push ebx
push ecx
push edx
push 0
push 0
push eax
mov eax, dword [esi + 0x54]
push ecx
push edx
mov edx, dword [esi + 0x50]
lea ecx, [eax + ebp + 4]
push ecx
lea eax, [edx + edi + 4]
mov byte [esp + 0x49], 2
mov byte [esp + 0x48], 3
mov byte [esp + 0x4a], 1
mov byte [esp + 0x4b], 0x1e
mov ecx, dword [esp + 0x48]
push eax
push ecx
call fcn.0043f540
mov ebx, dword [esp + 0x54]
add esp, 0x30
add dword [esp + 0x28], 0x288
add ebx, 1
cmp ebx, dword [esi + 4]
mov dword [esp + 0x24], ebx
jl 0x40d950
pop edi
pop ebp
pop ebx
add esp, 0x20
ret 8