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

Disassembly:
sub esp, 0x8dc
push ebx
mov ebx, dword [esp + 0x8f4]
push ebp
push str..BMP
lea eax, [esp + 0x4e8]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA_1]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA_1]
lea ecx, [esp + 0x4e4]
push 0x424c1c
push ecx
call fcn.00413c38
mov ebp, eax
add esp, 8
test ebp, ebp
mov dword [esp + 0x18], ebp
jne 0x403c0d
lea edx, [esp + 0x4e4]
lea eax, [esp + 0xe4]
push edx
push str.SurfaceToBMP_cant_create_file___s__n
push eax
call fcn.00412b72
mov eax, dword [0x443bf8]
add esp, 0xc
test eax, eax
je 0x4041d7
lea ecx, [esp + 0xe4]
push eax
push ecx
call fcn.00413bb9
add esp, 8
pop ebp
pop ebx
add esp, 0x8dc
ret
push esi
mov esi, dword [esp + 0x8ec]
push edi
mov ecx, 0x1f
mov edx, dword [esi]
xor eax, eax
lea edi, [esp + 0x70]
push eax
rep stosd dword es:[edi], eax
lea eax, [esp + 0x74]
push 0x11
push eax
push 0
push esi
mov dword [esp + 0x84], 0x7c
mov dword [esp + 0x88], 0x180e
call dword [edx + 0x64]
test eax, eax
jl 0x4041cc
mov ebp, dword [esp + 0x8f4]
cmp ebp, 0xffffffff
jne 0x403c63
mov ebp, dword [esp + 0x7c]
jmp 0x403c6d
mov eax, dword [esp + 0x7c]
cmp ebp, eax
jb 0x403c74
mov ebp, eax
mov dword [esp + 0x8f4], ebp
mov eax, dword [esp + 0x8f8]
mov ecx, dword [esp + 0x78]
cmp eax, 0xffffffff
je 0x403c88
cmp eax, ecx
jb 0x403c8f
mov dword [esp + 0x8f8], ecx
mov eax, dword [esp + 0xc4]
cmp eax, 8
jne 0x403e46
mov dword [esp + 0x1c], eax
xor eax, eax
mov dword [esp + 0x14], eax
mov edi, 0x100
lea esi, [ebp + 3]
mov ecx, dword [0x443bf8]
and esi, 0xfffffffc
test ecx, ecx
mov dword [esp + 0x2c], esi
je 0x403cfd
mov ecx, dword [esp + 0x8fc]
mov edx, dword [eax*4 + 0x424b24]
push ecx
push ecx
push edx
push ebx
lea eax, [esp + 0xfc]
push str.___s____Suface_Format____s____PalBank__3d__0x_08X__n
push eax
call fcn.00412b72
mov ecx, dword [0x443bf8]
lea edx, [esp + 0x104]
push ecx
push edx
call fcn.00413bb9
add esp, 0x20
push esi
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc_1]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x28], ebx
je 0x4041b6
mov ecx, dword [esp + 0x8f8]
mov edx, esi
imul edx, ecx
lea eax, [edi*4 + 0x36]
mov dword [esp + 0x50], ecx
mov cx, word [esp + 0x1c]
add edx, eax
mov dword [esp + 0x42], eax
mov dword [esp + 0x3a], edx
mov edx, dword [esp + 0x20]
xor eax, eax
mov word [esp + 0x3e], ax
mov word [esp + 0x40], ax
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], eax
mov dword [esp + 0x6c], eax
push edx
mov word [esp + 0x5a], cx
push 1
lea eax, [esp + 0x40]
mov ecx, 0xb12
push 0xe
push eax
mov word [esp + 0x48], 0x4d42
mov dword [esp + 0x58], 0x28
mov dword [esp + 0x5c], ebp
mov word [esp + 0x64], 1
mov dword [esp + 0x70], ecx
mov dword [esp + 0x74], ecx
mov dword [esp + 0x78], edi
call fcn.00413a80
mov ecx, dword [esp + 0x30]
lea edx, [esp + 0x58]
push ecx
push 1
push 0x28
push edx
call fcn.00413a80
mov eax, dword [esp + 0x3c]
add esp, 0x20
cmp eax, 8
jne 0x403df1
xor eax, eax
test edi, edi
jbe 0x403dd5
lea ecx, [esp + 0xed]
mov byte [ecx + 1], al
mov byte [ecx], al
mov byte [ecx - 1], al
mov byte [ecx + 2], 0
inc eax
add ecx, 4
cmp eax, edi
jb 0x403dc1
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0xec]
push eax
push 1
push 0x400
push ecx
call fcn.00413a80
add esp, 0x10
mov edx, dword [esp + 0x94]
mov ecx, esi
mov dword [esp + 0x24], edx
mov edx, dword [esp + 0x80]
xor eax, eax
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x8f8]
dec eax
test eax, eax
jl 0x4041af
mov esi, eax
mov ecx, edx
imul esi, edx
neg ecx
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x24]
add esi, ecx
inc eax
mov dword [esp + 0x1c], esi
mov dword [esp + 0x24], eax
jmp 0x403f69
cmp eax, 0x10
mov dword [esp + 0x1c], 0x18
jne 0x403f20
mov edx, dword [esp + 0xd0]
push edx
call fcn.00404240
mov esi, eax
mov eax, dword [esp + 0xd0]
push eax
call fcn.00404240
mov ecx, dword [esp + 0xd0]
mov edi, eax
push ecx
call fcn.00404240
mov cl, byte [esp + 0xc8]
add esp, 0xc
test cl, 1
je 0x403ea2
mov ecx, dword [esp + 0xc4]
sub ecx, eax
sub ecx, edi
sub ecx, esi
test ecx, ecx
jne 0x403ed8
cmp esi, 5
jne 0x403ec4
cmp edi, 6
jne 0x403ec4
cmp eax, esi
jne 0x403ec4
mov eax, 3
xor edi, edi
mov dword [esp + 0x14], eax
lea esi, [ebp + ebp*2 + 3]
jmp 0x403cb1
mov eax, 4
xor edi, edi
mov dword [esp + 0x14], eax
lea esi, [ebp + ebp*2 + 3]
jmp 0x403cb1
cmp esi, 5
jne 0x403efb
cmp edi, esi
jne 0x403ec4
cmp eax, esi
jne 0x403ec4
cmp ecx, 1
jne 0x403ec4
mov eax, ecx
xor edi, edi
mov dword [esp + 0x14], eax
lea esi, [ebp + ebp*2 + 3]
jmp 0x403cb1
cmp esi, 4
jne 0x403ec4
cmp edi, esi
jne 0x403ec4
cmp eax, esi
jne 0x403ec4
cmp ecx, esi
jne 0x403ec4
mov eax, 2
xor edi, edi
mov dword [esp + 0x14], eax
lea esi, [ebp + ebp*2 + 3]
jmp 0x403cb1
cmp eax, 0x18
jne 0x403f39
mov eax, 5
xor edi, edi
mov dword [esp + 0x14], eax
lea esi, [ebp + ebp*2 + 3]
jmp 0x403cb1
cmp eax, 0x20
jne 0x4041e0
mov eax, dword [esp + 0xbc]
lea esi, [ebp + ebp*2 + 3]
and eax, 0xff
and eax, 1
or al, 6
xor edi, edi
mov dword [esp + 0x14], eax
jmp 0x403cb1
mov ebp, dword [esp + 0x8f4]
mov eax, dword [esp + 0x14]
cmp eax, 7
ja case.default.0x403f78
mov ecx, eax
jmp dword [ecx*4 + 0x40421c]
mov ecx, ebp
mov edi, ebx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp case.default.0x403f78
mov edi, esi
mov esi, ebx
test ebp, ebp
jle case.default.0x403f78
mov al, byte [edi]
and al, 0xf
mov dl, al
shl dl, 4
or dl, al
mov ax, word [edi]
mov cl, al
shr cl, 4
and cl, 0xf
mov bl, cl
shl bl, 4
or bl, cl
xor ecx, ecx
mov cl, ah
mov byte [esp + 0x13], bl
and cl, 0xf
mov bl, cl
shr eax, 0xc
shl bl, 4
and al, 0xf
or bl, cl
mov cl, al
shl cl, 4
or cl, al
jne 0x403feb
mov al, byte [esp + 0x13]
not dl
not al
not bl
jmp 0x403fef
mov al, byte [esp + 0x13]
mov byte [esi], dl
inc esi
add edi, 2
mov byte [esi], al
inc esi
mov byte [esi], bl
inc esi
dec ebp
jne 0x403fa2
jmp case.default.0x403f78
mov eax, dword [esp + 0x8f4]
mov ebp, dword [esp + 0x1c]
mov edi, dword [esp + 0x28]
test eax, eax
jle case.default.0x403f78
mov edx, eax
mov dword [esp + 0x30], edx
mov al, byte [ebp]
mov si, word [ebp]
and al, 0x1f
mov cl, al
shr cl, 2
shl al, 3
or cl, al
mov eax, esi
shr eax, 5
and al, 0x1f
mov dl, al
shr dl, 2
shl al, 3
or dl, al
mov eax, esi
shr eax, 0xa
and al, 0x1f
mov bl, al
shr bl, 2
shl al, 3
or bl, al
test esi, 0x8000
jne 0x404063
not cl
not dl
not bl
mov byte [edi], cl
mov eax, dword [esp + 0x30]
inc edi
add ebp, 2
mov byte [edi], dl
inc edi
mov byte [edi], bl
inc edi
dec eax
mov dword [esp + 0x30], eax
jne 0x404020
jmp case.default.0x403f78
test ebp, ebp
mov ecx, ebx
jle case.default.0x403f78
mov al, byte [esi]
add esi, 2
and al, 0x1f
mov dl, al
shr dl, 2
shl al, 3
or dl, al
mov byte [ecx], dl
mov ax, word [esi - 2]
shr eax, 5
and al, 0x3f
inc ecx
mov dl, al
shr dl, 4
shl al, 2
or dl, al
mov byte [ecx], dl
mov ax, word [esi - 2]
shr eax, 0xb
and al, 0x1f
inc ecx
mov dl, al
shr dl, 2
shl al, 3
or dl, al
mov byte [ecx], dl
inc ecx
dec ebp
jne 0x404089
jmp case.default.0x403f78
test ebp, ebp
mov ecx, ebx
jle case.default.0x403f78
mov al, byte [esi]
mov di, word [esi]
and al, 0x1f
add esi, 2
mov dl, al
shr dl, 2
shl al, 3
or dl, al
mov eax, edi
shr eax, 5
and al, 0x1f
mov byte [ecx], dl
mov bl, al
shr bl, 2
shl al, 3
or bl, al
mov eax, edi
shr eax, 0xa
and al, 0x1f
inc ecx
mov dl, al
mov byte [ecx], bl
inc ecx
shr dl, 2
shl al, 3
or dl, al
mov byte [ecx], dl
inc ecx
dec ebp
jne 0x4040db
jmp case.default.0x403f78
test ebp, ebp
mov eax, esi
mov ecx, ebx
jle case.default.0x403f78
mov esi, dword [esp + 0x14]
mov dl, byte [eax]
mov bl, byte [eax + 1]
inc eax
mov byte [esp + 0x13], bl
inc eax
mov bl, byte [eax]
inc eax
cmp esi, 5
mov byte [esp + 0x1b], bl
je 0x404169
cmp esi, 6
jne 0x40414a
inc eax
jmp 0x404169
mov bl, byte [eax]
inc eax
test bl, bl
jne 0x404165
mov bl, byte [esp + 0x13]
not bl
mov byte [esp + 0x13], bl
mov bl, byte [esp + 0x1b]
not dl
not bl
jmp 0x404169
mov bl, byte [esp + 0x1b]
mov byte [ecx], dl
mov dl, byte [esp + 0x13]
inc ecx
mov byte [ecx], dl
inc ecx
mov byte [ecx], bl
inc ecx
dec ebp
jne 0x40412b
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x2c]
mov ebx, dword [esp + 0x28]
push eax
push 1
push ecx
push ebx
call fcn.00413a80
mov esi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x34]
add esp, 0x10
add esi, ecx
dec eax
mov dword [esp + 0x1c], esi
mov dword [esp + 0x24], eax
jne 0x403f62
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree_1]
mov esi, dword [esp + 0x8f0]
mov edx, dword [esi]
push 0
push esi
call dword [edx + 0x80]
mov ebp, dword [esp + 0x20]
push ebp
call fcn.00413a03
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8dc
ret
lea edx, [esp + 0x4ec]
lea eax, [esp + 0xec]
push edx
push str.SurfaceToBMP_Surface_format_unknown___s__n
push eax
call fcn.00412b72
mov eax, dword [0x443bf8]
add esp, 0xc
test eax, eax
je 0x4041bd
lea ecx, [esp + 0xec]
push eax
push ecx
call fcn.00413bb9
add esp, 8
jmp 0x4041bd